OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::StyledTextStyle Class Reference

#include "StyledTextStyle.h"

Inheritance diagram for ot::StyledTextStyle:
ot::Serializable

Public Types

enum class  TextSize { Regular , Header1 , Header2 , Header3 }
 

Public Member Functions

 StyledTextStyle ()
 
 StyledTextStyle (const ConstJsonObject &_jsonObject)
 
 StyledTextStyle (const StyledTextStyle &)=default
 
virtual ~StyledTextStyle ()=default
 
StyledTextStyleoperator= (const StyledTextStyle &)=default
 
bool operator== (const StyledTextStyle &_other) const
 
bool operator!= (const StyledTextStyle &_other) const
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ot::ConstJsonObject &_object) override
 Set the object contents from the provided JSON object.
 
void setColorReference (StyledText::ColorReference _colorReference)
 
StyledText::ColorReference getColorReference (void) const
 
void setBold (bool _isBold)
 
bool getBold (void) const
 
void setItalic (bool _isItalic)
 
bool getItalic (void) const
 
void setUnderline (bool _isUnderline)
 
bool getUnderline (void) const
 
void setLineTrough (bool _isLineTrough)
 
bool getLineTrough (void) const
 
void setTextSize (TextSize _size)
 
TextSize getTextSize (void) const
 
bool hasStyleSet (void) const
 Returns true if any style changes are set. If any style is set the generated text requires styling otherwise the default text editor style will be used.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Static Public Member Functions

static std::string toString (TextSize _size)
 
static TextSize stringToTextSize (const std::string &_size)
 

Member Enumeration Documentation

◆ TextSize

enum class ot::StyledTextStyle::TextSize
strong
Enumerator
Regular 
Header1 
Header2 
Header3 

Constructor & Destructor Documentation

◆ StyledTextStyle() [1/3]

ot::StyledTextStyle::StyledTextStyle ( )

◆ StyledTextStyle() [2/3]

ot::StyledTextStyle::StyledTextStyle ( const ConstJsonObject & _jsonObject)

◆ StyledTextStyle() [3/3]

ot::StyledTextStyle::StyledTextStyle ( const StyledTextStyle & )
default

◆ ~StyledTextStyle()

virtual ot::StyledTextStyle::~StyledTextStyle ( )
virtualdefault

Member Function Documentation

◆ addToJsonObject()

void ot::StyledTextStyle::addToJsonObject ( ot::JsonValue & _object,
ot::JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference to write the data to.
_allocatorAllocator.

Implements ot::Serializable.

◆ getBold()

bool ot::StyledTextStyle::getBold ( void ) const
inline

◆ getColorReference()

StyledText::ColorReference ot::StyledTextStyle::getColorReference ( void ) const
inline

◆ getItalic()

bool ot::StyledTextStyle::getItalic ( void ) const
inline

◆ getLineTrough()

bool ot::StyledTextStyle::getLineTrough ( void ) const
inline

◆ getTextSize()

TextSize ot::StyledTextStyle::getTextSize ( void ) const
inline

◆ getUnderline()

bool ot::StyledTextStyle::getUnderline ( void ) const
inline

◆ hasStyleSet()

bool ot::StyledTextStyle::hasStyleSet ( void ) const
inline

Returns true if any style changes are set. If any style is set the generated text requires styling otherwise the default text editor style will be used.

◆ operator!=()

bool ot::StyledTextStyle::operator!= ( const StyledTextStyle & _other) const

◆ operator=()

StyledTextStyle & ot::StyledTextStyle::operator= ( const StyledTextStyle & )
default

◆ operator==()

bool ot::StyledTextStyle::operator== ( const StyledTextStyle & _other) const

◆ setBold()

void ot::StyledTextStyle::setBold ( bool _isBold)
inline

◆ setColorReference()

void ot::StyledTextStyle::setColorReference ( StyledText::ColorReference _colorReference)
inline

◆ setFromJsonObject()

void ot::StyledTextStyle::setFromJsonObject ( const ot::ConstJsonObject & _object)
overridevirtual

Set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information.
Exceptions
Maythrow an exception if the provided object is not valid (members missing or invalid types).

Implements ot::Serializable.

◆ setItalic()

void ot::StyledTextStyle::setItalic ( bool _isItalic)
inline

◆ setLineTrough()

void ot::StyledTextStyle::setLineTrough ( bool _isLineTrough)
inline

◆ setTextSize()

void ot::StyledTextStyle::setTextSize ( TextSize _size)
inline

◆ setUnderline()

void ot::StyledTextStyle::setUnderline ( bool _isUnderline)
inline

◆ stringToTextSize()

ot::StyledTextStyle::TextSize ot::StyledTextStyle::stringToTextSize ( const std::string & _size)
static

◆ toString()

std::string ot::StyledTextStyle::toString ( TextSize _size)
static

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