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

#include "MessageDialogCfg.h"

Inheritance diagram for ot::MessageDialogCfg:
ot::DialogCfg ot::Serializable

Public Types

enum  BasicButton {
  NoButtons = 0 << 0 , Ok = 1 << 0 , Save = 1 << 1 , SaveAll = 1 << 2 ,
  Open = 1 << 3 , Yes = 1 << 4 , YesToAll = 1 << 5 , No = 1 << 6 ,
  NoToAll = 1 << 7 , Abort = 1 << 8 , Retry = 1 << 9 , Ignore = 1 << 10 ,
  Close = 1 << 11 , Cancel = 1 << 12 , Discard = 1 << 13 , Help = 1 << 14 ,
  Apply = 1 << 15 , Reset = 1 << 16 , RestoreDefaults = 1 << 17
}
 
enum  BasicIcon {
  NoIcon , Information , Question , Warning ,
  Critical
}
 
typedef Flags< BasicButtonBasicButtons
 
- Public Types inherited from ot::DialogCfg
enum  DialogFlag { NoFlags = 0x00 , CancelOnNoChange = 0x01 , MoveGrabAnywhere = 0x02 , RecenterOnF11 = 0x04 }
 
typedef Flags< DialogFlagDialogFlags
 

Public Member Functions

 MessageDialogCfg ()
 
virtual ~MessageDialogCfg ()
 
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
 Will set the object contents from the provided JSON object.
 
void setText (const std::string &_text)
 
const std::string & getText (void) const
 
void setButton (BasicButton _button, bool _active=true)
 
void setButtons (BasicButtons _buttons)
 
const BasicButtonsgetButtons (void) const
 
void setIcon (BasicIcon _icon)
 
BasicIcon getIcon (void) const
 
- Public Member Functions inherited from ot::DialogCfg
 DialogCfg (DialogFlags _flags=DialogFlags(NoFlags))
 
 DialogCfg (const std::string &_title, DialogFlags _flags=DialogFlags(NoFlags))
 
 DialogCfg (const DialogCfg &_other)
 
virtual ~DialogCfg ()
 
DialogCfgoperator= (const DialogCfg &_other)
 
void setName (const std::string &_name)
 
const std::string & getName (void) const
 
void setTitle (const std::string &_title)
 
const std::string & getTitle (void) const
 
void setFlag (DialogFlag _flag, bool _active=true)
 
void setFlags (DialogFlags _flags)
 
DialogFlags getFlags (void) const
 
void setMinSize (int _width, int _height)
 
void setMinSize (const ot::Size2D &_size)
 
const ot::Size2DgetMinSize (void) const
 
void setMaxSize (int _width, int _height)
 
void setMaxSize (const ot::Size2D &_size)
 
const ot::Size2DgetMaxSize (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Static Public Member Functions

static std::string toString (BasicButton _button)
 
static BasicButton stringToButton (const std::string &_button)
 
static std::list< std::string > toStringList (const BasicButtons &_buttons)
 
static BasicButtons stringListToButtons (const std::list< std::string > &_buttons)
 
static std::string iconToString (BasicIcon _icon)
 
static BasicIcon stringToIcon (const std::string &_icon)
 
- Static Public Member Functions inherited from ot::DialogCfg
static std::string toString (DialogFlag _flag)
 
static DialogFlag stringToFlag (const std::string &_flag)
 
static std::list< std::string > toStringList (DialogFlags _flags)
 
static DialogFlags stringListToFlags (const std::list< std::string > &_flags)
 

Member Typedef Documentation

◆ BasicButtons

Member Enumeration Documentation

◆ BasicButton

Enumerator
NoButtons 
Ok 
Save 
SaveAll 
Open 
Yes 
YesToAll 
No 
NoToAll 
Abort 
Retry 
Ignore 
Close 
Cancel 
Discard 
Help 
Apply 
Reset 
RestoreDefaults 

◆ BasicIcon

Enumerator
NoIcon 
Information 
Question 
Warning 
Critical 

Constructor & Destructor Documentation

◆ MessageDialogCfg()

ot::MessageDialogCfg::MessageDialogCfg ( )

◆ ~MessageDialogCfg()

ot::MessageDialogCfg::~MessageDialogCfg ( )
virtual

Member Function Documentation

◆ addToJsonObject()

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

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference
_allocatorAllocator

Reimplemented from ot::DialogCfg.

◆ getButtons()

const BasicButtons & ot::MessageDialogCfg::getButtons ( void ) const
inline

◆ getIcon()

BasicIcon ot::MessageDialogCfg::getIcon ( void ) const
inline

◆ getText()

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

◆ iconToString()

std::string ot::MessageDialogCfg::iconToString ( BasicIcon _icon)
static

◆ setButton()

void ot::MessageDialogCfg::setButton ( BasicButton _button,
bool _active = true )
inline

◆ setButtons()

void ot::MessageDialogCfg::setButtons ( BasicButtons _buttons)
inline

◆ setFromJsonObject()

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

Will set the object contents from the provided JSON object.

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

Reimplemented from ot::DialogCfg.

◆ setIcon()

void ot::MessageDialogCfg::setIcon ( BasicIcon _icon)
inline

◆ setText()

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

◆ stringListToButtons()

ot::MessageDialogCfg::BasicButtons ot::MessageDialogCfg::stringListToButtons ( const std::list< std::string > & _buttons)
static

◆ stringToButton()

ot::MessageDialogCfg::BasicButton ot::MessageDialogCfg::stringToButton ( const std::string & _button)
static

◆ stringToIcon()

ot::MessageDialogCfg::BasicIcon ot::MessageDialogCfg::stringToIcon ( const std::string & _icon)
static

◆ toString()

std::string ot::MessageDialogCfg::toString ( BasicButton _button)
static

◆ toStringList()

std::list< std::string > ot::MessageDialogCfg::toStringList ( const BasicButtons & _buttons)
static

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