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

#include "MenuButtonCfg.h"

Inheritance diagram for ot::MenuButtonCfg:
ot::MenuClickableEntryCfg ot::MenuEntryCfg ot::Serializable

Public Types

enum  ButtonAction { NotifyOwner , Clear }
 
- Public Types inherited from ot::MenuEntryCfg
enum  EntryType { Menu , Button , Separator }
 

Public Member Functions

 MenuButtonCfg ()
 
 MenuButtonCfg (const std::string &_name, const std::string &_text, const std::string &_iconPath=std::string(), ButtonAction _action=ButtonAction::NotifyOwner)
 
 MenuButtonCfg (const MenuButtonCfg &_other)
 
 MenuButtonCfg (const ot::ConstJsonObject &_object)
 
virtual ~MenuButtonCfg ()
 
MenuButtonCfgoperator= (const MenuButtonCfg &)=delete
 
virtual MenuEntryCfgcreateCopy (void) const override
 
virtual EntryType getMenuEntryType (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 setButtonAction (ButtonAction _action)
 
ButtonAction getButtonAction (void) const
 
- Public Member Functions inherited from ot::MenuClickableEntryCfg
 MenuClickableEntryCfg ()
 
 MenuClickableEntryCfg (const std::string &_name, const std::string &_text, const std::string &_iconPath=std::string())
 
 MenuClickableEntryCfg (const MenuClickableEntryCfg &_other)
 
virtual ~MenuClickableEntryCfg ()
 
MenuClickableEntryCfgoperator= (const MenuClickableEntryCfg &_other)
 
void setName (const std::string &_name)
 
const std::string & getName (void) const
 
void setText (const std::string &_text)
 
const std::string & getText (void) const
 
void setIconPath (const std::string &_iconPath)
 
const std::string & getIconPath (void) const
 
void setToolTip (const std::string &_toolTip)
 
const std::string & getToolTip (void) const
 
- Public Member Functions inherited from ot::MenuEntryCfg
 MenuEntryCfg ()
 
 MenuEntryCfg (const MenuEntryCfg &_other)
 
virtual ~MenuEntryCfg ()
 
MenuEntryCfgoperator= (const MenuEntryCfg &_other)
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Static Public Member Functions

static std::string toString (ButtonAction _action)
 
static ButtonAction stringToButtonAction (const std::string &_action)
 
- Static Public Member Functions inherited from ot::MenuEntryCfg
static std::string toString (EntryType _type)
 
static EntryType stringToEntryType (const std::string &_type)
 
static const std::string & entryTypeJsonKey (void)
 

Member Enumeration Documentation

◆ ButtonAction

Enumerator
NotifyOwner 
Clear 

Constructor & Destructor Documentation

◆ MenuButtonCfg() [1/4]

ot::MenuButtonCfg::MenuButtonCfg ( )

◆ MenuButtonCfg() [2/4]

ot::MenuButtonCfg::MenuButtonCfg ( const std::string & _name,
const std::string & _text,
const std::string & _iconPath = std::string(),
ButtonAction _action = ButtonAction::NotifyOwner )

◆ MenuButtonCfg() [3/4]

ot::MenuButtonCfg::MenuButtonCfg ( const MenuButtonCfg & _other)

◆ MenuButtonCfg() [4/4]

ot::MenuButtonCfg::MenuButtonCfg ( const ot::ConstJsonObject & _object)

◆ ~MenuButtonCfg()

ot::MenuButtonCfg::~MenuButtonCfg ( )
virtual

Member Function Documentation

◆ addToJsonObject()

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

◆ createCopy()

ot::MenuEntryCfg * ot::MenuButtonCfg::createCopy ( void ) const
overridevirtual

Implements ot::MenuEntryCfg.

◆ getButtonAction()

ButtonAction ot::MenuButtonCfg::getButtonAction ( void ) const
inline

◆ getMenuEntryType()

virtual EntryType ot::MenuButtonCfg::getMenuEntryType ( void ) const
inlineoverridevirtual

Implements ot::MenuEntryCfg.

◆ operator=()

MenuButtonCfg & ot::MenuButtonCfg::operator= ( const MenuButtonCfg & )
delete

◆ setButtonAction()

void ot::MenuButtonCfg::setButtonAction ( ButtonAction _action)
inline

◆ setFromJsonObject()

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

◆ stringToButtonAction()

ot::MenuButtonCfg::ButtonAction ot::MenuButtonCfg::stringToButtonAction ( const std::string & _action)
static

◆ toString()

std::string ot::MenuButtonCfg::toString ( ButtonAction _action)
static

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