kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass > Class Template Reference

TextConceptImplementation is an abstract class for implementing text concept. More...

#include <kanzi/ui/node/concept/text_block.hpp>

Inheritance diagram for kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >:
kanzi::TextBlockConcept

Public Member Functions

float getFontSize () const
 Gets the value of the FontSizeProperty. More...
 
void setFontSize (float value)
 Sets the value of the FontSizeProperty. More...
 
MaterialSharedPtr getFontMaterial () const
 Gets the value of the FontMaterialProperty. More...
 
void setFontMaterial (MaterialSharedPtr value)
 Sets the value of the FontMaterialProperty. More...
 
ColorRGBA getFontColor () const
 Gets the value of the FontColorProperty. More...
 
void setFontColor (ColorRGBA value)
 Sets the value of the FontColorProperty. More...
 
TextHorizontalAlignment getTextHorizontalAlignment () const
 Gets the value of the TextHorizontalAlignmentProperty. More...
 
void setTextHorizontalAlignment (TextHorizontalAlignment value)
 Sets the value of the TextHorizontalAlignmentProperty. More...
 
TextVerticalAlignment getTextVerticalAlignment () const
 Gets the value of the TextVerticalAlignmentProperty. More...
 
void setTextVerticalAlignment (TextVerticalAlignment value)
 Sets the value of the TextVerticalAlignmentProperty. More...
 
float getLineSpacing () const
 Gets the value of the LineSpacingProperty. More...
 
void setLineSpacing (float value)
 Sets the value of the LineSpacingProperty. More...
 
float getCharacterSpacing () const
 Gets the value of the CharacterSpacingProperty. More...
 
void setCharacterSpacing (float value)
 Sets the value of the CharacterSpacingProperty. More...
 
float getFixedCharacterWidth () const
 Gets the value of the FixedCharacterWidthProperty. More...
 
void setFixedCharacterWidth (float value)
 Sets the value of the FixedCharacterWidthProperty. More...
 
string getOverflow () const
 Gets the value of the OverflowProperty. More...
 
void setOverflow (string_view value)
 Sets the value of the OverflowProperty. More...
 
string getText () const
 Gets the value of TextProperty. More...
 
void setText (string value)
 Sets the value of TextProperty. More...
 
bool isWordWrap () const
 Gets the value of WordWrapProperty. More...
 
void setWordWrap (bool value)
 Sets the value of WordWrapProperty. More...
 
bool isConstrainContentHeight () const
 Gets the value of ConstrainContentHeightProperty. More...
 
void setConstrainContentHeight (bool value)
 Sets the value of ConstrainContentHeightProperty. More...
 
Vector2 getHorizontalPadding () const
 Gets the value of HorizontalPaddingProperty. More...
 
void setHorizontalPadding (Vector2 value)
 Sets the value of HorizontalPaddingProperty. More...
 
Vector2 getVerticalPadding () const
 Gets the value of VerticalPaddingProperty. More...
 
void setVerticalPadding (Vector2 value)
 Sets the value of VerticalPaddingProperty. More...
 
KzcRectangle getTextBounds () const
 Get bounding rectangle for the text. More...
 

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...
 
virtual void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) KZ_OVERRIDE
 Node::onPropertyChanged implementation. More...
 

Protected Attributes

MaterialSharedPtr m_cachedFontMaterial
 Font material resource reference. More...
 
FontSharedPtr m_cachedFont
 Font resource reference. More...
 
TextFormatSharedPtr m_textFormat
 The text layout for the glyphs that this node displays. More...
 
ClassPropertyDefaultValue< ResourceSharedPtrm_classValueFontMaterialProperty
 Default value for font material property. More...
 
ClassPropertyDefaultValue< ResourceSharedPtrm_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< ColorRGBAFontColorProperty
 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< ResourceSharedPtrFontMaterialProperty
 Use the Font Material property to set the material whose shader is used to render the text. More...
 
static PropertyType< TextBlockConcept::TextHorizontalAlignmentTextHorizontalAlignmentProperty
 Use the Text Horizontal Alignment property to set the horizontal alignment of the text. More...
 
static PropertyType< TextBlockConcept::TextVerticalAlignmentTextVerticalAlignmentProperty
 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< Vector2HorizontalPaddingProperty
 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< Vector2VerticalPaddingProperty
 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...
 

Detailed Description

template<typename TBaseClass, typename TDerivedClass>
class kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >

TextConceptImplementation is an abstract class for implementing text concept.

Constructor & Destructor Documentation

template<typename TBaseClass , typename TDerivedClass >
kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::TextBlockConceptImpl ( Domain domain,
string_view  name 
)
explicitprotected

Constructor.

Parameters
domainThe UI domain the new node belongs to.
nameThe name of the node.

Member Function Documentation

template<typename TBaseClass , typename TDerivedClass >
PropertyTypeEditorInfoSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::makeEditorInfo ( )
static
template<typename TBaseClass , typename TDerivedClass >
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontSize ( ) const

Gets the value of the FontSizeProperty.

Returns
The size of the font in device independent pixels.
See also
setFontSize()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFontSize ( float  value)

Sets the value of the FontSizeProperty.

Parameters
valueThe size of the font in device independent pixels.
See also
getFontSize()
template<typename TBaseClass , typename TDerivedClass >
MaterialSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontMaterial ( ) const

Gets the value of the FontMaterialProperty.

Returns
The font material currently in use.
See also
setFontMaterial()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFontMaterial ( MaterialSharedPtr  value)

Sets the value of the FontMaterialProperty.

Parameters
valueThe font material.
See also
getFontMaterialResourceID()
template<typename TBaseClass , typename TDerivedClass >
ColorRGBA kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontColor ( ) const

Gets the value of the FontColorProperty.

Returns
The color value of the default font material, or the color value of materials with fragment shader that uses the FontColor uniform. Returns the value in range [0,1].
See also
setFontColor()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFontColor ( ColorRGBA  value)

Sets the value of the FontColorProperty.

Parameters
valueThe ColorRGBA color value of the font material with fragment shader that uses the FontColor uniform.
See also
getFontColor()
template<typename TBaseClass , typename TDerivedClass >
TextBlockConcept::TextHorizontalAlignment kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextHorizontalAlignment ( ) const

Gets the value of the TextHorizontalAlignmentProperty.

Returns
The horizontal alignment of the object.
See also
setTextHorizontalAlignment()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setTextHorizontalAlignment ( TextBlockConcept::TextHorizontalAlignment  value)

Sets the value of the TextHorizontalAlignmentProperty.

Parameters
valueOne of the TextHorizontalAlignment enumerator values.
See also
getTextHorizontalAlignment()
template<typename TBaseClass , typename TDerivedClass >
TextBlockConcept::TextVerticalAlignment kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextVerticalAlignment ( ) const

Gets the value of the TextVerticalAlignmentProperty.

Returns
The vertical alignment of the object.
See also
setTextVerticalAlignment()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setTextVerticalAlignment ( TextBlockConcept::TextVerticalAlignment  value)

Sets the value of the TextVerticalAlignmentProperty.

Parameters
valueOne of the TextVerticalAlignment enumerator values.
See also
getTextVerticalAlignment()
template<typename TBaseClass , typename TDerivedClass >
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getLineSpacing ( ) const

Gets the value of the LineSpacingProperty.

Returns
The line spacing in multiples of the normal line height of the selected font.
See also
setLineSpacing()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setLineSpacing ( float  value)

Sets the value of the LineSpacingProperty.

Parameters
valueThe line spacing in multiples of the normal line height of the selected font.
See also
getLineSpacing()
template<typename TBaseClass , typename TDerivedClass >
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getCharacterSpacing ( ) const

Gets the value of the CharacterSpacingProperty.

Returns
The character spacing in device independent pixels.
See also
setCharacterSpacing()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setCharacterSpacing ( float  value)

Sets the value of the CharacterSpacingProperty.

Parameters
valueThe character spacing in device independent pixels.
See also
getCharacterSpacing()
template<typename TBaseClass , typename TDerivedClass >
float kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFixedCharacterWidth ( ) const

Gets the value of the FixedCharacterWidthProperty.

Returns
The fixed character width in device independent pixels.
See also
setFixedCharacterWidth()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFixedCharacterWidth ( float  value)

Sets the value of the FixedCharacterWidthProperty.

Parameters
valueThe fixed character width in device independent pixels.
See also
getFixedCharacterWidth()
template<typename TBaseClass , typename TDerivedClass >
string kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getOverflow ( ) const

Gets the value of the OverflowProperty.

Returns
The characters that represent the clipped text when the text string is too long to fit in the node.
See also
setOverflow()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setOverflow ( string_view  value)

Sets the value of the OverflowProperty.

Parameters
valueThe characters that represent the clipped text when the text string is too long to fit in the node.
See also
getOverflow()
template<typename TBaseClass , typename TDerivedClass >
string kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getText ( ) const

Gets the value of TextProperty.

See also
setText()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setText ( string  value)

Sets the value of TextProperty.

See also
getText()
template<typename TBaseClass , typename TDerivedClass >
bool kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::isWordWrap ( ) const

Gets the value of WordWrapProperty.

See also
setWordWrap()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setWordWrap ( bool  value)

Sets the value of WordWrapProperty.

See also
isWordWrap()
template<typename TBaseClass , typename TDerivedClass >
bool kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::isConstrainContentHeight ( ) const
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setConstrainContentHeight ( bool  value)
template<typename TBaseClass , typename TDerivedClass >
Vector2 kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getHorizontalPadding ( ) const
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setHorizontalPadding ( Vector2  value)
template<typename TBaseClass , typename TDerivedClass >
Vector2 kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getVerticalPadding ( ) const

Gets the value of VerticalPaddingProperty.

See also
setVerticalPadding()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setVerticalPadding ( Vector2  value)

Sets the value of VerticalPaddingProperty.

See also
getVerticalPadding()
template<typename TBaseClass , typename TDerivedClass >
KzcRectangle kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextBounds ( ) const

Get bounding rectangle for the text.

Returns
Rectangle.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::prepareTextFormat ( float  textFormatWidth,
float  textFormatHeight,
bool  constrainToActualSize 
)
protected

Position the text.

Parameters
textFormatWidthThe width of the area available for the glyphs in font units. Set to infinity for an unbound area.
textFormatHeightThe height of the area available for the glyphs in font units. Set to infinity for an unbound area.
constrainToActualSizeFlag indicating whether text format should be constrained to actual size provided by layout. Set to false to use unconstrained layout.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::onNodePropertyChanged ( AbstractPropertyType  propertyType,
PropertyNotificationReason  reason 
)
protectedvirtual

Node::onPropertyChanged implementation.

Reimplemented in kanzi::TextBlock3D, and kanzi::TextBlock2D.

Member Data Documentation

template<typename TBaseClass, typename TDerivedClass>
MaterialSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::m_cachedFontMaterial
protected

Font material resource reference.

template<typename TBaseClass, typename TDerivedClass>
FontSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::m_cachedFont
protected

Font resource reference.

template<typename TBaseClass, typename TDerivedClass>
TextFormatSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::m_textFormat
protected

The text layout for the glyphs that this node displays.

template<typename TBaseClass, typename TDerivedClass>
ClassPropertyDefaultValue<ResourceSharedPtr> kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::m_classValueFontMaterialProperty
protected

Default value for font material property.

template<typename TBaseClass, typename TDerivedClass>
ClassPropertyDefaultValue<ResourceSharedPtr> kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::m_classValueFontProperty
protected

Default value for font property.


The documentation for this class was generated from the following files: