TextConceptImplementation is an abstract class for implementing text concept. More...
#include <kanzi/ui/node/concept/text_block.hpp>
Static Public Member Functions | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Static Public Member Functions inherited from kanzi::TextBlockConcept | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Protected Member Functions | |
TextBlockConceptImpl (Domain *domain, string_view name) | |
Constructor. More... | |
void | prepareTextFormat (float textFormatWidth, float textFormatHeight, bool constrainToActualSize) |
Position the text. More... | |
void | prepareTextFormat (float textFormatWidth, float textFormatHeight, bool measure, bool ceiledSizes) |
Position the text. More... | |
virtual void | onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) KZ_OVERRIDE |
Node::onPropertyChanged implementation. More... | |
virtual void | onPostPrepareTextFormatMeasure (bool completeRelayoutingExecuted) |
When in measure layouting phase, Kanzi calls this function every time it completes the prepareTextFormat function. More... | |
virtual void | onPostPrepareTextFormatArrange (bool completeRelayoutingExecuted) |
When in arrange layouting phase, Kanzi calls this function every time it completes the prepareTextFormat function. More... | |
Protected Attributes | |
FontSharedPtr | m_cachedFont |
Font resource reference. More... | |
TextFormatSharedPtr | m_textFormat |
The text layout for the glyphs that this node displays. More... | |
ClassPropertyDefaultValue< ResourceSharedPtr > | m_classValueFontMaterialProperty |
Default value for font material property. More... | |
ClassPropertyDefaultValue< ResourceSharedPtr > | m_classValueFontProperty |
Default value for font property. More... | |
Additional Inherited Members | |
Public Types inherited from kanzi::TextBlockConcept | |
enum | TextHorizontalAlignment { TextHorizontalAlignmentLeft, TextHorizontalAlignmentRight, TextHorizontalAlignmentCenter } |
Horizontal alignment options for text layout. More... | |
enum | TextVerticalAlignment { TextVerticalAlignmentTop, TextVerticalAlignmentBaseline, TextVerticalAlignmentCenter, TextVerticalAlignmentBottom } |
Vertical alignment options for text layout. More... | |
Static Public Attributes inherited from kanzi::TextBlockConcept | |
static PropertyType< ColorRGBA > | FontColorProperty |
Use the Font Color property to set the text color for the default font material and for the materials with a fragment shader that uses the FontColor uniform. More... | |
static PropertyType< float > | FontSizeProperty |
Use the Font Size property to set the size of the font in device-independent pixels. More... | |
static PropertyType< ResourceSharedPtr > | FontMaterialProperty |
Use the Font Material property to set the material whose shader is used to render the text. More... | |
static PropertyType< TextBlockConcept::TextHorizontalAlignment > | TextHorizontalAlignmentProperty |
Use the Text Horizontal Alignment property to set the horizontal alignment of the text. More... | |
static PropertyType< TextBlockConcept::TextVerticalAlignment > | TextVerticalAlignmentProperty |
Use the Text Vertical Alignment property to set the vertical alignment of the text. More... | |
static PropertyType< float > | LineSpacingProperty |
Use the Line Spacing property to set the line spacing in multiples of the normal line height of the selected font. More... | |
static PropertyType< float > | CharacterSpacingProperty |
Use the Character Spacing property to set the character spacing in device-independent pixels. More... | |
static PropertyType< string > | OverflowProperty |
Use the Overflow property to set the characters that represent the clipped text when the text string to be rendered is too long to fit in the node. More... | |
static PropertyType< string > | TextProperty |
Use the Text property to set the text content that the text block renders. More... | |
static PropertyType< bool > | WordWrapProperty |
Use the Word Wrap property to break long text lines to multiple lines to make the text fit within the boundaries of the text block. More... | |
static PropertyType< bool > | ConstrainContentHeightProperty |
Use the Constrain Content Height property to cut out the last lines that do not fit within the boundaries of the text block. More... | |
static PropertyType< float > | FixedCharacterWidthProperty |
Use the Fixed Character Width property to override the font advance widths and make each character take a fixed amount of space specified in device-independent pixels. More... | |
static PropertyType< Vector2 > | HorizontalPaddingProperty |
Use the Horizontal Padding property to set the padding spaces between the content and the left and right boundaries of the text block. More... | |
static PropertyType< Vector2 > | VerticalPaddingProperty |
Use the Vertical Padding property to set the padding spaces between the content and the top and bottom boundaries of the text block. More... | |
static PropertyType< bool > | RemoveSideBearingsProperty |
Use the Remove Side Bearings property to position the leftmost characters of left-aligned text and rightmost characters of right-aligned text exactly within the boundary of the text block. More... | |
TextConceptImplementation is an abstract class for implementing text concept.
|
explicitprotected |
Constructor.
domain | The UI domain the new node belongs to. |
name | The name of the node. |
|
static |
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontSize | ( | ) | const |
Gets the value of the FontSizeProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFontSize | ( | float | value | ) |
Sets the value of the FontSizeProperty.
value | The size of the font in device independent pixels. |
MaterialSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontMaterial | ( | ) | const |
Gets the value of the FontMaterialProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFontMaterial | ( | MaterialSharedPtr | value | ) |
Sets the value of the FontMaterialProperty.
value | The font material. |
ColorRGBA kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontColor | ( | ) | const |
Gets the value of the FontColorProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFontColor | ( | ColorRGBA | value | ) |
Sets the value of the FontColorProperty.
value | The ColorRGBA color value of the font material with fragment shader that uses the FontColor uniform. |
TextBlockConcept::TextHorizontalAlignment kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextHorizontalAlignment | ( | ) | const |
Gets the value of the TextHorizontalAlignmentProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setTextHorizontalAlignment | ( | TextBlockConcept::TextHorizontalAlignment | value | ) |
Sets the value of the TextHorizontalAlignmentProperty.
value | One of the TextHorizontalAlignment enumerator values. |
TextBlockConcept::TextVerticalAlignment kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextVerticalAlignment | ( | ) | const |
Gets the value of the TextVerticalAlignmentProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setTextVerticalAlignment | ( | TextBlockConcept::TextVerticalAlignment | value | ) |
Sets the value of the TextVerticalAlignmentProperty.
value | One of the TextVerticalAlignment enumerator values. |
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getLineSpacing | ( | ) | const |
Gets the value of the LineSpacingProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setLineSpacing | ( | float | value | ) |
Sets the value of the LineSpacingProperty.
value | The line spacing in multiples of the normal line height of the selected font. |
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getCharacterSpacing | ( | ) | const |
Gets the value of the CharacterSpacingProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setCharacterSpacing | ( | float | value | ) |
Sets the value of the CharacterSpacingProperty.
value | The character spacing in device independent pixels. |
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFixedCharacterWidth | ( | ) | const |
Gets the value of the FixedCharacterWidthProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFixedCharacterWidth | ( | float | value | ) |
Sets the value of the FixedCharacterWidthProperty.
value | The fixed character width in device independent pixels. |
string kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getOverflow | ( | ) | const |
Gets the value of the OverflowProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setOverflow | ( | string_view | value | ) |
Sets the value of the OverflowProperty.
value | The characters that represent the clipped text when the text string is too long to fit in the node. |
string kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getText | ( | ) | const |
Gets the value of TextProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setText | ( | string | value | ) |
Sets the value of TextProperty.
bool kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::isWordWrap | ( | ) | const |
Gets the value of WordWrapProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setWordWrap | ( | bool | value | ) |
Sets the value of WordWrapProperty.
bool kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::isConstrainContentHeight | ( | ) | const |
Gets the value of ConstrainContentHeightProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setConstrainContentHeight | ( | bool | value | ) |
Sets the value of ConstrainContentHeightProperty.
Vector2 kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getHorizontalPadding | ( | ) | const |
Gets the value of HorizontalPaddingProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setHorizontalPadding | ( | Vector2 | value | ) |
Sets the value of HorizontalPaddingProperty.
Vector2 kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getVerticalPadding | ( | ) | const |
Gets the value of VerticalPaddingProperty.
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setVerticalPadding | ( | Vector2 | value | ) |
Sets the value of VerticalPaddingProperty.
KzcRectangle kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextBounds | ( | ) | const |
Get bounding rectangle for the text.
|
protected |
Position the text.
textFormatWidth | The width of the area available for the glyphs in font units. Set to infinity for an unbound area. |
textFormatHeight | The height of the area available for the glyphs in font units. Set to infinity for an unbound area. |
constrainToActualSize | Flag indicating whether text format should be constrained to actual size provided by layout. Set to false to use unconstrained layout. |
|
protected |
Position the text.
textFormatWidth | The width of the area available for the glyphs in font units. Set to infinity for an unbound area. |
textFormatHeight | The height of the area available for the glyphs in font units. Set to infinity for an unbound area. |
measure | Indicates whether Kanzi executes measure or arrange phase during the layouting of the node. For the measure phase use True, for the arrange phase use False. |
ceiledSizes | Flag indicating whether the textFormatWidth and textFormatHeight have be ceiled before passing to this function. |
|
protectedvirtual |
Node::onPropertyChanged implementation.
Reimplemented in kanzi::TextBlock2D.
|
protectedvirtual |
When in measure layouting phase, Kanzi calls this function every time it completes the prepareTextFormat function.
completeRelayoutingExecuted | Indicates whether a complete relayouting of the glyphs was required during the measure phase. |
|
protectedvirtual |
When in arrange layouting phase, Kanzi calls this function every time it completes the prepareTextFormat function.
completeRelayoutingExecuted | Indicates whether a complete relayouting of the glyphs was required during the arrange phase. |
|
protected |
Font resource reference.
|
protected |
The text layout for the glyphs that this node displays.
|
protected |
Default value for font material property.
|
protected |
Default value for font property.