TypedText
touchgfx/TypedText.hpp
TypedText represents text (for characters) and typography (for font and alignment). TypedText provides methods for adjusting the text, font and alignment.
See: TextArea
Public Classes
| struct | TypedTextData |
| The data structure for typed texts. | |
Public Functions
| FORCE_INLINE_FUNCTION Alignment | getAlignment() const |
| Gets the alignment associated with this TypedText. | |
| FORCE_INLINE_FUNCTION const Font * | getFont() const |
| Gets the font associated with this TypedText. | |
| FORCE_INLINE_FUNCTION FontId | getFontId() const |
| Gets the font ID associated with this TypedText. | |
| FORCE_INLINE_FUNCTION TypedTextId | getId() const |
| Gets the id of the typed text. | |
| FORCE_INLINE_FUNCTION const Unicode::UnicodeChar * | getText() const |
| Gets the text associated with this TypedText. | |
| FORCE_INLINE_FUNCTION TextDirection | getTextDirection() const |
| Gets the text direction associated with this TypedText. | |
| FORCE_INLINE_FUNCTION bool | hasValidId() const |
| Has the TypedText been set to a proper value? | |
| TypedText(const TypedTextId id =TYPED_TEXT_INVALID) | |
| Initializes a new instance of the TypedText class. | |
| virtual | ~TypedText() |
| Finalizes an instance of the TypedText class. | |
| void | registerTexts(const Texts * t) |
| Registers an array of texts. | |
| void | registerTypedTextDatabase(const TypedTextData data, const Font const * f, const uint16_t n) |
| Registers an array of typed texts. | |
Public Functions Documentation
getAlignment
| FORCE_INLINE_FUNCTION Alignment getAlignment | ( | ) | const |
getFont
| FORCE_INLINE_FUNCTION const Font * getFont | ( | ) | const |
getFontId
| FORCE_INLINE_FUNCTION FontId getFontId | ( | ) | const |
getId
| FORCE_INLINE_FUNCTION TypedTextId getId | ( | ) | const |
Gets the id of the typed text.
Returns:
The id.
getText
| FORCE_INLINE_FUNCTION const Unicode::UnicodeChar * getText | ( | ) | const |
getTextDirection
| FORCE_INLINE_FUNCTION TextDirection getTextDirection | ( | ) | const |
hasValidId
| FORCE_INLINE_FUNCTION bool hasValidId | ( | ) | const |
TypedText
| TypedText | ( | const TypedTextId | id =TYPED_TEXT_INVALID | ) | |
~TypedText
| virtual ~TypedText | ( | ) |
Finalizes an instance of the TypedText class.
registerTexts
| static void registerTexts | ( | const Texts * | t | ) | |
Registers an array of texts.
This function is called automatically from touchgfx_generic_init(). Should not be called under normal circumstances.
Parameters:
| t | The array of texts. |
registerTypedTextDatabase
| static void registerTypedTextDatabase | ( | const TypedTextData * | data , | ||
| const Font const | f , | ||||
| const uint16_t | n | ||||
| ) |
Registers an array of typed texts.
All typed text instances are bound to this database. This function is called automatically when setting a new language. Use Texts::setLanguage() instead of calling this function directly.
Parameters:
| data | A reference to the TypedTextData storage array. |
| f | The fonts associated with the array. |
| n | The number of typed texts in the array. |