Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CCell.hpp
Go to the documentation of this file.
1#ifndef LIBS_DOCUMENTS_CCELL_HPP_
2#define LIBS_DOCUMENTS_CCELL_HPP_
3
6#include "third_party/magic_enum/magic_enum.hpp"
7
8#include <string>
9
10class IManagerPrinter;
11
12class CCell
13{
14public:
15 static CCell *createCellChar(uint8_t number);
16 static CCell *createCellImage(const std::string &nameImage, uint64_t sizeXmm, uint64_t sizeYmm);
17 static CCell *createCellIndicator(bool isOk);
18 static CCell *createCellLong(int64_t number);
19 static CCell *createCellNumber(double number, double precision);
20 static CCell *createCellNumberWithDecimals(double number, uint64_t numDecimals);
21 static CCell *createCellText(const std::string &text);
22 template<typename T>
23 static CCell *createCellEnum(const T enumValue)
24 requires(std::is_enum_v<T>)
25 {
26 return createCellText(magic_enum::enum_name(enumValue).data());
27 }
28
29 CCell();
30 CCell(const CCell &cell);
31 CCell(CCell &&cell) = delete;
32 ~CCell();
33
34 CCell &operator=(const CCell &other) = delete;
35 CCell &operator=(CCell &&other) = delete;
36
37 void hideAllLines();
38 void hideBottomLine();
40 void hideLeftLine();
41 void hideRightLine();
42 void hideTopLine();
43 void hideVerticalLines();
44 void processCell(IManagerPrinter *manager, double widthCell, double heightCell) const;
45 void showOnlyBottomLine();
46
47 [[nodiscard]] uint64_t getFontHeight() const;
48 double getHeight(IManagerPrinter *manager) const;
49 double getWidth(IManagerPrinter *manager) const;
50
51 void setAlignment(iv::eFontAlignment alignment);
52 void setColorBackground(iv::types::color colorBackground);
53 void setColorForeground(iv::types::color colorForeground);
54 void setColorLines(iv::types::color colorLines);
55 void setFont(const std::string &nameFont);
56 void setMarginCell(uint64_t marginTop, uint64_t marginBottom, uint64_t marginRight, uint64_t marginLeft);
57 void setSlant(iv::eFontSlant slant);
58 void setStyleCellHeader();
59 void setStyleCellError();
60 void setText(const std::string &text);
61 void setTextHeight(uint64_t sizeDP);
62 void setWeight(iv::eFontWeight weight);
63
64 [[nodiscard]] bool isEmpty() const;
65
66private:
67 std::string m_textOpt;
68 std::string m_nameImageOpt;
69
70 uint64_t m_sizeXImage;
71 uint64_t m_sizeYImage;
72
77
79 uint32_t m_colorLines;
80
82};
83
84#endif /* LIBS_DOCUMENTS_CCELL_HPP_ */
Definition CCell.hpp:13
void hideVerticalLines()
Definition CCell.cpp:313
static CCell * createCellImage(const std::string &nameImage, uint64_t sizeXmm, uint64_t sizeYmm)
Definition CCell.cpp:75
void setStyleCellHeader()
Definition CCell.cpp:454
void processCell(IManagerPrinter *manager, double widthCell, double heightCell) const
Definition CCell.cpp:323
std::string m_nameImageOpt
Definition CCell.hpp:68
static CCell * createCellEnum(const T enumValue)
Definition CCell.hpp:23
double getHeight(IManagerPrinter *manager) const
Definition CCell.cpp:351
static CCell * createCellText(const std::string &text)
Definition CCell.cpp:201
static CCell * createCellIndicator(bool isOk)
Definition CCell.cpp:100
bool m_isLineLeft
Definition CCell.hpp:76
~CCell()
Definition CCell.cpp:245
bool isEmpty() const
Definition CCell.cpp:492
void hideBottomLine()
Definition CCell.cpp:263
void setStyleCellError()
Definition CCell.cpp:463
uint32_t m_colorLines
Definition CCell.hpp:79
CStyleParagraph * m_styleParagraph
Definition CCell.hpp:81
static CCell * createCellLong(int64_t number)
Definition CCell.cpp:125
uint32_t m_colorBackGround
Definition CCell.hpp:78
void setColorLines(iv::types::color colorLines)
Definition CCell.cpp:425
double getWidth(IManagerPrinter *manager) const
Definition CCell.cpp:377
void setText(const std::string &text)
Definition CCell.cpp:471
void hideLeftLine()
Definition CCell.cpp:283
CCell(CCell &&cell)=delete
CCell & operator=(const CCell &other)=delete
void setFont(const std::string &nameFont)
Definition CCell.cpp:432
void setSlant(iv::eFontSlant slant)
Definition CCell.cpp:447
void hideAllLines()
Definition CCell.cpp:253
void setMarginCell(uint64_t marginTop, uint64_t marginBottom, uint64_t marginRight, uint64_t marginLeft)
Definition CCell.cpp:440
void hideRightLine()
Definition CCell.cpp:293
void setColorBackground(iv::types::color colorBackground)
Definition CCell.cpp:410
static CCell * createCellNumberWithDecimals(double number, uint64_t numDecimals)
Definition CCell.cpp:175
uint64_t m_sizeXImage
Definition CCell.hpp:70
bool m_isLineRight
Definition CCell.hpp:75
void setAlignment(iv::eFontAlignment alignment)
Definition CCell.cpp:403
void showOnlyBottomLine()
Definition CCell.cpp:334
uint64_t m_sizeYImage
Definition CCell.hpp:71
void setTextHeight(uint64_t sizeDP)
Definition CCell.cpp:478
uint64_t getFontHeight() const
Definition CCell.cpp:344
CCell()
Definition CCell.cpp:29
bool m_isLineTop
Definition CCell.hpp:73
CCell & operator=(CCell &&other)=delete
void setWeight(iv::eFontWeight weight)
Definition CCell.cpp:485
static CCell * createCellChar(uint8_t number)
Definition CCell.cpp:50
void hideHorizontalLines()
Definition CCell.cpp:273
void hideTopLine()
Definition CCell.cpp:303
bool m_isLineBottom
Definition CCell.hpp:74
void setColorForeground(iv::types::color colorForeground)
Definition CCell.cpp:417
static CCell * createCellNumber(double number, double precision)
Definition CCell.cpp:150
std::string m_textOpt
Definition CCell.hpp:67
Definition CStyleParagraph.hpp:10
Definition IManagerPrinter.hpp:19
uint32_t color
Definition types.hpp:12
eFontWeight
Definition enums.hpp:87
eFontAlignment
Definition enums.hpp:72
eFontSlant
Definition enums.hpp:80