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

#include "DialogCfg.h"

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

Public Types

enum  DialogFlag { NoFlags = 0x00 , CancelOnNoChange = 0x01 , MoveGrabAnywhere = 0x02 , RecenterOnF11 = 0x04 }
 
typedef Flags< DialogFlagDialogFlags
 

Public Member Functions

 DialogCfg (DialogFlags _flags=DialogFlags(NoFlags))
 
 DialogCfg (const std::string &_title, DialogFlags _flags=DialogFlags(NoFlags))
 
 DialogCfg (const DialogCfg &_other)
 
virtual ~DialogCfg ()
 
DialogCfgoperator= (const DialogCfg &_other)
 
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 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 (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

◆ DialogFlags

Member Enumeration Documentation

◆ DialogFlag

Enumerator
NoFlags 
CancelOnNoChange 

No dialog flags.

MoveGrabAnywhere 

If set the UI will silently close the dialog when pressing confim button and the initial data did not change.

RecenterOnF11 

If set the dialog may be moved around by holding the left mouse button anywhere in the dialog and move.

Constructor & Destructor Documentation

◆ DialogCfg() [1/3]

ot::DialogCfg::DialogCfg ( DialogFlags _flags = DialogFlags(NoFlags))

◆ DialogCfg() [2/3]

ot::DialogCfg::DialogCfg ( const std::string & _title,
DialogFlags _flags = DialogFlags(NoFlags) )

◆ DialogCfg() [3/3]

ot::DialogCfg::DialogCfg ( const DialogCfg & _other)

◆ ~DialogCfg()

virtual ot::DialogCfg::~DialogCfg ( )
inlinevirtual

Member Function Documentation

◆ addToJsonObject()

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

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference
_allocatorAllocator

Implements ot::Serializable.

Reimplemented in ot::MessageDialogCfg, ot::OnePropertyDialogCfg, and ot::PropertyDialogCfg.

◆ getFlags()

DialogFlags ot::DialogCfg::getFlags ( void ) const
inline

◆ getMaxSize()

const ot::Size2D & ot::DialogCfg::getMaxSize ( void ) const
inline

◆ getMinSize()

const ot::Size2D & ot::DialogCfg::getMinSize ( void ) const
inline

◆ getName()

const std::string & ot::DialogCfg::getName ( void ) const
inline

◆ getTitle()

const std::string & ot::DialogCfg::getTitle ( void ) const
inline

◆ operator=()

ot::DialogCfg & ot::DialogCfg::operator= ( const DialogCfg & _other)

◆ setFlag()

void ot::DialogCfg::setFlag ( DialogFlag _flag,
bool _active = true )
inline

◆ setFlags()

void ot::DialogCfg::setFlags ( DialogFlags _flags)
inline

◆ setFromJsonObject()

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

Implements ot::Serializable.

Reimplemented in ot::MessageDialogCfg, ot::OnePropertyDialogCfg, and ot::PropertyDialogCfg.

◆ setMaxSize() [1/2]

void ot::DialogCfg::setMaxSize ( const ot::Size2D & _size)
inline

◆ setMaxSize() [2/2]

void ot::DialogCfg::setMaxSize ( int _width,
int _height )
inline

◆ setMinSize() [1/2]

void ot::DialogCfg::setMinSize ( const ot::Size2D & _size)
inline

◆ setMinSize() [2/2]

void ot::DialogCfg::setMinSize ( int _width,
int _height )
inline

◆ setName()

void ot::DialogCfg::setName ( const std::string & _name)
inline

◆ setTitle()

void ot::DialogCfg::setTitle ( const std::string & _title)
inline

◆ stringListToFlags()

ot::DialogCfg::DialogFlags ot::DialogCfg::stringListToFlags ( const std::list< std::string > & _flags)
static

◆ stringToFlag()

ot::DialogCfg::DialogFlag ot::DialogCfg::stringToFlag ( const std::string & _flag)
static

◆ toString()

std::string ot::DialogCfg::toString ( DialogFlag _flag)
static

◆ toStringList()

std::list< std::string > ot::DialogCfg::toStringList ( DialogFlags _flags)
static

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