Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CDrawText.hpp
Go to the documentation of this file.
1#ifndef LIBS_SHAPES_CDRAWTEXT_HPP_
2#define LIBS_SHAPES_CDRAWTEXT_HPP_
3
4#include "core/defines.hpp"
6
7#include <cstdint>
8#include <string>
9
11{
12public:
13 CDrawText() = delete;
14 explicit CDrawText(std::string_view text, iv::types::coord x = 0, iv::types::coord y = 0, unsigned char justify = 1,
15 double heightFont = 14);
16 CDrawText(const CDrawText &drawText);
17 explicit CDrawText(const CDrawText *drawText);
18 ~CDrawText();
19
20 bool operator==(const CDrawText &b) const;
21 bool operator!=(const CDrawText &b) const;
22
23 void draw(IGraphics *graphics);
24 void removeObjectDraw(IGraphics *graphics);
25
26 void getSizeText(IGraphics *graphics, iv::types::width *widthText, iv::types::height *heightText) const;
27 void getCoordTextAndSize(IGraphics *graphics, unsigned char justify, iv::types::coord *xCornerLeftDown,
28 iv::types::coord *yCornerLeftDown, iv::types::width *widthText,
29 iv::types::height *heightText) const;
30 void getPosition(iv::types::coord *xPos, iv::types::coord *yPos) const;
31
32 void setText(std::string_view text);
33 void setHeight(double heightFont);
34 void setWeight(iv::ui::eTextWeight textWeight);
35 void setStyle(iv::ui::eTextStyle textStyle);
36 void setPosition(iv::types::coord x, iv::types::coord y, uint8_t justify);
38 bool isEmpty();
39 bool isText(std::string_view text);
40
41private:
42 std::string m_text;
43 unsigned char m_justify;
44
46
47 // Text block properties
53 uint32_t m_idBlock;
54};
55
56#endif /* LIBS_SHAPES_CDRAWTEXT_HPP_ */
Definition CDrawText.hpp:11
std::string m_text
Definition CDrawText.hpp:42
bool isText(std::string_view text)
Definition CDrawText.cpp:285
bool operator==(const CDrawText &b) const
Definition CDrawText.cpp:78
iv::types::coord m_dyCornerLeftDown
Definition CDrawText.hpp:52
void translate(iv::types::coord x, iv::types::coord y)
Definition CDrawText.cpp:94
~CDrawText()
Definition CDrawText.cpp:64
CDrawText()=delete
void setHeight(double heightFont)
Definition CDrawText.cpp:233
iv::ui::TextModifier m_textModifier
Definition CDrawText.hpp:45
iv::types::width m_widthText
Definition CDrawText.hpp:49
void getSizeText(IGraphics *graphics, iv::types::width *widthText, iv::types::height *heightText) const
Definition CDrawText.cpp:164
void setStyle(iv::ui::eTextStyle textStyle)
Definition CDrawText.cpp:251
void setWeight(iv::ui::eTextWeight textWeight)
Definition CDrawText.cpp:242
bool operator!=(const CDrawText &b) const
Definition CDrawText.cpp:86
void getPosition(iv::types::coord *xPos, iv::types::coord *yPos) const
Definition CDrawText.cpp:215
uint32_t m_idBlock
Definition CDrawText.hpp:53
iv::types::height m_heightText
Definition CDrawText.hpp:50
void setText(std::string_view text)
Definition CDrawText.cpp:224
void removeObjectDraw(IGraphics *graphics)
Definition CDrawText.cpp:156
void getCoordTextAndSize(IGraphics *graphics, unsigned char justify, iv::types::coord *xCornerLeftDown, iv::types::coord *yCornerLeftDown, iv::types::width *widthText, iv::types::height *heightText) const
Definition CDrawText.cpp:184
bool m_hasToRemove
Definition CDrawText.hpp:48
void setPosition(iv::types::coord x, iv::types::coord y, uint8_t justify)
Definition CDrawText.cpp:260
void draw(IGraphics *graphics)
Definition CDrawText.cpp:115
unsigned char m_justify
Definition CDrawText.hpp:43
bool isEmpty()
Definition CDrawText.cpp:280
iv::types::coord m_dxCornerLeftDown
Definition CDrawText.hpp:51
Definition IGraphics.hpp:20
double height
Definition types.hpp:14
double width
Definition types.hpp:23
double coord
Definition types.hpp:13
eTextStyle
Definition enums.hpp:27
eTextWeight
Definition enums.hpp:21
Definition modifiers.hpp:15