주요 내용으로 건너뛰기

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

structTypedTextData
The data structure for typed texts.

Public Functions

FORCE_INLINE_FUNCTION AlignmentgetAlignment() 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 FontIdgetFontId() const
Gets the font ID associated with this TypedText.
FORCE_INLINE_FUNCTION TypedTextIdgetId() 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 TextDirectiongetTextDirection() const
Gets the text direction associated with this TypedText.
FORCE_INLINE_FUNCTION boolhasValidId() 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.
voidregisterTexts(const Texts * t)
Registers an array of texts.
voidregisterTypedTextDatabase(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

Gets the alignment associated with this TypedText.

Returns:

The alignment.

getFont

FORCE_INLINE_FUNCTION const Font * getFont()const

Gets the font associated with this TypedText.

Returns:

The font.

getFontId

FORCE_INLINE_FUNCTION FontId getFontId()const

Gets the font ID associated with this TypedText.

Returns:

The font.

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

Gets the text associated with this TypedText.

Returns:

The text.

getTextDirection

FORCE_INLINE_FUNCTION TextDirection getTextDirection()const

Gets the text direction associated with this TypedText.

Returns:

The alignment.

hasValidId

FORCE_INLINE_FUNCTION bool hasValidId()const

Has the TypedText been set to a proper value?

Returns:

Is the id valid.

TypedText

TypedText(const TypedTextIdid =TYPED_TEXT_INVALID)

Initializes a new instance of the TypedText class.

Parameters:
id(Optional) The identifier.

~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:
tThe array of texts.

registerTypedTextDatabase

static void registerTypedTextDatabase(const TypedTextData *data ,
const Font const f ,
const uint16_tn
)

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:
dataA reference to the TypedTextData storage array.
fThe fonts associated with the array.
nThe number of typed texts in the array.