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

#include "CheckBoxCfg.h"

Inheritance diagram for ot::CheckBoxCfg:
ot::WidgetBaseCfg ot::Serializable

Public Types

enum  CheckBoxState { Unchecked , PartiallyChecked , Checked }
 

Public Member Functions

 CheckBoxCfg ()
 
 CheckBoxCfg (const std::string &_name, const std::string &_text, CheckBoxState _checkedState=CheckBoxState::Checked)
 
 CheckBoxCfg (const CheckBoxCfg &)=default
 
 CheckBoxCfg (CheckBoxCfg &&)=default
 
virtual ~CheckBoxCfg ()
 
CheckBoxCfgoperator= (const CheckBoxCfg &)=default
 
CheckBoxCfgoperator= (CheckBoxCfg &&)=default
 
virtual std::string getWidgetBaseTypeString (void) const override
 
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 setText (const std::string &_text)
 
const std::string & getText (void) const
 
void setChecked (bool _checked)
 
void setCheckedState (CheckBoxState _state)
 
bool getChecked (void) const
 
CheckBoxState getCheckedState (void) const
 
- Public Member Functions inherited from ot::WidgetBaseCfg
 WidgetBaseCfg ()
 
 WidgetBaseCfg (const std::string &_name)
 
 WidgetBaseCfg (const WidgetBaseCfg &)=default
 
 WidgetBaseCfg (WidgetBaseCfg &&)=default
 
virtual ~WidgetBaseCfg ()
 
WidgetBaseCfgoperator= (const WidgetBaseCfg &)=default
 
WidgetBaseCfgoperator= (WidgetBaseCfg &&)=default
 
void setName (const std::string &_name)
 
const std::string & getName (void) const
 
void setToolTip (const std::string &_toolTip)
 
const std::string & getToolTip (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Static Public Member Functions

static std::string toString (CheckBoxState _state)
 
static CheckBoxState stringToCheckBoxState (const std::string &_state)
 
static std::string getCheckBoxCfgTypeString (void)
 
- Static Public Member Functions inherited from ot::WidgetBaseCfg
static std::string typeStringJsonKey (void)
 

Member Enumeration Documentation

◆ CheckBoxState

Enumerator
Unchecked 
PartiallyChecked 
Checked 

Constructor & Destructor Documentation

◆ CheckBoxCfg() [1/4]

ot::CheckBoxCfg::CheckBoxCfg ( )

◆ CheckBoxCfg() [2/4]

ot::CheckBoxCfg::CheckBoxCfg ( const std::string & _name,
const std::string & _text,
CheckBoxState _checkedState = CheckBoxState::Checked )

◆ CheckBoxCfg() [3/4]

ot::CheckBoxCfg::CheckBoxCfg ( const CheckBoxCfg & )
default

◆ CheckBoxCfg() [4/4]

ot::CheckBoxCfg::CheckBoxCfg ( CheckBoxCfg && )
default

◆ ~CheckBoxCfg()

ot::CheckBoxCfg::~CheckBoxCfg ( )
virtual

Member Function Documentation

◆ addToJsonObject()

void ot::CheckBoxCfg::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.

Reimplemented from ot::WidgetBaseCfg.

◆ getCheckBoxCfgTypeString()

static std::string ot::CheckBoxCfg::getCheckBoxCfgTypeString ( void )
inlinestatic

◆ getChecked()

bool ot::CheckBoxCfg::getChecked ( void ) const
inline

◆ getCheckedState()

CheckBoxState ot::CheckBoxCfg::getCheckedState ( void ) const
inline

◆ getText()

const std::string & ot::CheckBoxCfg::getText ( void ) const
inline

◆ getWidgetBaseTypeString()

virtual std::string ot::CheckBoxCfg::getWidgetBaseTypeString ( void ) const
inlineoverridevirtual

Implements ot::WidgetBaseCfg.

◆ operator=() [1/2]

CheckBoxCfg & ot::CheckBoxCfg::operator= ( CheckBoxCfg && )
default

◆ operator=() [2/2]

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

◆ setChecked()

void ot::CheckBoxCfg::setChecked ( bool _checked)
inline

◆ setCheckedState()

void ot::CheckBoxCfg::setCheckedState ( CheckBoxState _state)
inline

◆ setFromJsonObject()

void ot::CheckBoxCfg::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).

Reimplemented from ot::WidgetBaseCfg.

◆ setText()

void ot::CheckBoxCfg::setText ( const std::string & _text)
inline

◆ stringToCheckBoxState()

ot::CheckBoxCfg::CheckBoxState ot::CheckBoxCfg::stringToCheckBoxState ( const std::string & _state)
static

◆ toString()

std::string ot::CheckBoxCfg::toString ( CheckBoxState _state)
static

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