Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Text.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MIMICS_TEXT_HPP_
2#define IV_SRC_MIMICS_TEXT_HPP_
3
6
7namespace iv::mimics
8{
9
11{
12public:
13 Text() = delete;
14 ~Text() override = default;
15
16 bool load(const iv::file::xml::node &nodeControlMimic) override;
17 bool save(iv::file::xml::node &nodeControlMimic) const override;
18
19 //Controller
20 void executeCommand(const std::string &strAction) const override;
21
23
24 // View
25 void drawSpecific(IGraphics *graphics, std::optional<iv::types::color> colorWorkingState,
26 std::optional<iv::types::color> colorControlState, iv::eLanguage drawingLanguage) override;
27
28 // UI
30
31 // iv::types::height m_textHeight;
33
35
40
41protected:
43 Text(const Text &other);
44
46
47 [[nodiscard]] virtual std::string prvGetText(iv::eLanguage activeLanguage) const = 0;
48 [[nodiscard]] virtual std::set<std::string> prvGetTexts() const = 0;
49
50 // Draw
51 [[nodiscard]] iv::math::geometry::Point2d prvPosInitialLine(double xOrg, double yOrg, double lengthLine,
52 double lengthText) const;
53
54 std::unique_ptr<CDrawText> m_drawText {nullptr};
55 std::unique_ptr<CRectangleGraphics> m_rectangleOpt {nullptr};
56
57 struct Keys
58 {
59 static constexpr std::string_view anchorPoint {"AnchorPoint"};
60 static constexpr std::string_view textColor {"Color"};
61 static constexpr std::string_view hasBackground {"HasBackground"};
62 static constexpr std::string_view backgroundColor {"BackgroundColor"};
63 static constexpr std::string_view hasUnderline {"HasUnderline"};
64 static constexpr std::string_view underlineColor {"UnderlineColor"};
65 static constexpr std::string_view lengthLine {"UnderlineLength"};
66 static constexpr std::string_view lineWidth {"UnderlineWidth"};
67 };
69 {
70 static constexpr std::string string {};
73 static constexpr bool hasUnderline {false};
75 static constexpr iv::types::length lengthLine {50};
76 static constexpr iv::types::width lineWidth {3};
77 };
78 struct Sections
79 {
80 static constexpr std::string_view textAttributes {"TextAttributes"};
81 };
82};
83
84}// namespace iv::mimics
85
86#endif//IV_SRC_MIMICS_TEXT_HPP_
Definition AbstractComponentGUI.hpp:30
Definition IGraphics.hpp:20
Definition xmlFile.hpp:15
Definition AbstractMimicElement.hpp:21
Definition Text.hpp:11
virtual std::string prvGetText(iv::eLanguage activeLanguage) const =0
std::unique_ptr< CDrawText > m_drawText
Definition Text.hpp:54
bool m_hasUnderline
Definition Text.hpp:36
iv::mimics::elements::eTextAnchorPoint m_anchorPoint
Definition Text.hpp:34
iv::math::geometry::Point2d getCenter() const
Definition Text.cpp:83
iv::types::color m_underlineColor
Definition Text.hpp:37
AbstractComponentGUI * prvPanelEditUnderline()
Definition Text.cpp:243
void drawSpecific(IGraphics *graphics, std::optional< iv::types::color > colorWorkingState, std::optional< iv::types::color > colorControlState, iv::eLanguage drawingLanguage) override
Draws the specific abstract element shape.
Definition Text.cpp:104
iv::types::color m_textColor
Definition Text.hpp:32
AbstractComponentGUI * panelEditControl() override
UI methods ///.
Definition Text.cpp:225
bool load(const iv::file::xml::node &nodeControlMimic) override
Definition Text.cpp:41
iv::types::length m_underlineLength
Definition Text.hpp:38
bool save(iv::file::xml::node &nodeControlMimic) const override
Definition Text.cpp:62
std::unique_ptr< CRectangleGraphics > m_rectangleOpt
Definition Text.hpp:55
iv::types::width m_underlineWidth
Definition Text.hpp:39
void executeCommand(const std::string &strAction) const override
Run actions ///.
Definition Text.cpp:79
iv::math::geometry::Point2d prvPosInitialLine(double xOrg, double yOrg, double lengthLine, double lengthText) const
Definition Text.cpp:286
virtual std::set< std::string > prvGetTexts() const =0
~Text() override=default
constexpr iv::types::color White
Definition color.hpp:222
constexpr iv::types::color Red
Definition color.hpp:179
eTextAnchorPoint
Definition enums.hpp:106
Definition GeneratorPmsBuilders.cpp:9
eMimicElementType
Definition enums.hpp:8
double length
Definition types.hpp:15
double width
Definition types.hpp:23
uint32_t color
Definition types.hpp:12
eLanguage
Definition enums.hpp:37
Definition structs.hpp:16
Definition Text.hpp:69
static constexpr iv::types::length lengthLine
Definition Text.hpp:75
static constexpr iv::types::color underlineColor
Definition Text.hpp:74
static constexpr iv::types::color textColor
Definition Text.hpp:72
static constexpr iv::types::width lineWidth
Definition Text.hpp:76
static constexpr bool hasUnderline
Definition Text.hpp:73
static constexpr auto anchorPoint
Definition Text.hpp:71
Definition Text.hpp:58
static constexpr std::string_view underlineColor
Definition Text.hpp:64
static constexpr std::string_view lineWidth
Definition Text.hpp:66
static constexpr std::string_view hasUnderline
Definition Text.hpp:63
static constexpr std::string_view textColor
Definition Text.hpp:60
static constexpr std::string_view lengthLine
Definition Text.hpp:65
static constexpr std::string_view backgroundColor
Definition Text.hpp:62
static constexpr std::string_view hasBackground
Definition Text.hpp:61
static constexpr std::string_view anchorPoint
Definition Text.hpp:59
Definition Text.hpp:79
static constexpr std::string_view textAttributes
Definition Text.hpp:80