All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass > Class Template Reference

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

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

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

Public Member Functions

FontSharedPtr getFont () const
 Gets the font currently in use. More...
 
void setUserFont (const FontSharedPtr &font)
 Sets a font to use. More...
 
MaterialSharedPtr getFontMaterial () const
 Gets the currently used font material. More...
 
void setUserFontMaterial (const MaterialSharedPtr &material)
 Sets a font material to use. More...
 
ResourceID getFontResourceID () const
 Gets the value of the FontProperty. More...
 
void setFontResourceID (ResourceID 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...
 
ResourceID getFontMaterialResourceID () const
 Gets the value of the FontMaterialProperty. More...
 
void setFontMaterialResourceID (ResourceID 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...
 
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...
 
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)
 Position the text. More...
 

Protected Attributes

ResourceReference< Materialm_fontMaterial
 Font material resource reference. More...
 
ResourceReference< KzuFontm_font
 Font resource reference. More...
 
TextFormatSharedPtr m_textFormat
 The text layout for the glyphs that this node displays. 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< float > FontSizeProperty
 FontSize property. More...
 
static PropertyType< ResourceIDFontMaterialProperty
 FontMaterial property. More...
 
static PropertyType< ColorRGBAFontColorProperty
 FontColor property. More...
 
static PropertyType
< TextBlockConcept::TextHorizontalAlignment
TextHorizontalAlignmentProperty
 TextHorizontalAlignment property. More...
 
static PropertyType
< TextBlockConcept::TextVerticalAlignment
TextVerticalAlignmentProperty
 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...
 

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 font currently in use.

Returns
The name of the font in use.
See also
setFontResourceID(), setUserFont()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setUserFont ( const FontSharedPtr font)

Sets a font to use.

The font you set with this method overrides the font set in the FontProperty.

Parameters
fontThe name of the font to use.
See also
getFont(), FontProperty
template<typename TBaseClass , typename TDerivedClass >
MaterialSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontMaterial ( ) const

Gets the currently used font material.

Returns
The name of the font material in use.
See also
setFontMaterialResourceID(), setUserFontMaterial()
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setUserFontMaterial ( const MaterialSharedPtr material)

Sets a font material to use.

The material you set with this method overrides the material set in the FontMaterialProperty.

Parameters
materialThe name of the font material to use.
See also
FontMaterialProperty
template<typename TBaseClass , typename TDerivedClass >
ResourceID kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getFontResourceID ( ) 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 >::setFontResourceID ( ResourceID  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 >
ResourceID 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 ( ResourceID  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 KzcColorRGBA 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 >
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 >
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 
)
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.

Member Data Documentation

template<typename TBaseClass, typename TDerivedClass>
ResourceReference<Material> kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::m_fontMaterial
protected

Font material resource reference.

template<typename TBaseClass, typename TDerivedClass>
ResourceReference<KzuFont> kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::m_font
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.


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