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

FontSharedPtr getFont () const
 Gets the value of the FontProperty. More...
 
void setFont (FontSharedPtr value)
 Sets the value of the FontProperty. More...
 
float getFontSize () const
 Gets the value of the FontSizeProperty. More...
 
void setFontSize (float value)
 Sets the value of the FontSizeProperty. More...
 
MaterialSharedPtr getFontMaterialResourceID () const
 Gets the value of the FontMaterialProperty. More...
 
void setFontMaterialResourceID (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
 FontColor property. More...
 
static PropertyType< float > FontSizeProperty
 FontSize property. More...
 
static PropertyType< ResourceSharedPtrFontMaterialProperty
 FontMaterial property. More...
 
static PropertyType< TextBlockConcept::TextHorizontalAlignmentTextHorizontalAlignmentProperty
 TextHorizontalAlignment property. More...
 
static PropertyType< TextBlockConcept::TextVerticalAlignmentTextVerticalAlignmentProperty
 TextVerticalAlignment property. More...
 
static PropertyType< float > LineSpacingProperty
 LineSpacing property. More...
 
static PropertyType< float > CharacterSpacingProperty
 CharacterSpacing property. More...
 
static PropertyType< string > OverflowProperty
 Overflow property. More...
 
static PropertyType< string > TextProperty
 Text property. More...
 
static PropertyType< bool > WordWrapProperty
 WordWrap property. More...
 
static PropertyType< bool > ConstrainContentHeightProperty
 ConstrainContentHeight property. More...
 
static PropertyType< float > FixedCharacterWidthProperty
 FixedCharacterWidth property. More...
 
static PropertyType< Vector2HorizontalPaddingProperty
 HorizontalPadding property. More...
 
static PropertyType< Vector2VerticalPaddingProperty
 VerticalPadding property. 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 >
FontSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFont ( ) const

Gets the value of the FontProperty.

Returns
The resource ID of the font set in the FontProperty property.
See also
setFontResourceID()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setFont ( FontSharedPtr  value)

Sets the value of the FontProperty.

Parameters
valueThe resource ID of the font to use.
See also
getFontResourceID()
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 >::getFontMaterialResourceID ( ) const

Gets the value of the FontMaterialProperty.

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

Sets the value of the FontMaterialProperty.

Parameters
valueThe resource ID of the 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: