API Documentation
Loading...
Searching...
No Matches
ApplicationOption< t_type > Class Template Reference

The default object to store data of any type that should persist through sessions of the application. More...

#include <ApplicationOptions.h>

Inheritance diagram for ApplicationOption< t_type >:
[legend]
Collaboration diagram for ApplicationOption< t_type >:
[legend]

Public Member Functions

 ApplicationOption (const TranslatedString &group, const TranslatedString &label, const t_type &value, ApplicationOptions &options=ApplicationOptions::UserOptions())
 
 ApplicationOption (const TranslatedString &label, const t_type &value, ApplicationOptions &options=ApplicationOptions::UserOptions())
 
t_type get () const
 
Resource< t_type > & getResource ()
 
void set (const t_type &value, bool make_default=false)
 
void setDefaultValue (const t_type &value)
 
void addListener (ResourceListener *listener, bool silent_add=false)
 
virtual String toString () const override
 
virtual void fromString (const String &value) override
 
virtual bool isDefault () const override
 
virtual void setToDefaultValue () override
 
virtual INIOptioniniOption () override
 
const TranslatedStringlabel () const
 
const TranslatedStringgroup () const
 
- Public Member Functions inherited from ApplicationOptionBase
virtual ~ApplicationOptionBase ()
 

Protected Attributes

const TranslatedString m_group
 
const TranslatedString m_label
 
Resource< t_type > m_value
 
ApplicationOptionsm_options
 
t_type m_default_value
 

Detailed Description

template<class t_type>
class NDEVR::ApplicationOption< t_type >

The default object to store data of any type that should persist through sessions of the application.


Class: ApplicationOption

Stores data of any type that can easily be saved or retrieved at runtime. Option belongs to a

specific group for easy sorting and can be used to automatically generate widgets.

Constructor & Destructor Documentation

◆ ApplicationOption() [1/2]

template<class t_type >
ApplicationOption ( const TranslatedString & group,
const TranslatedString & label,
const t_type & value,
ApplicationOptions & options = ApplicationOptions::UserOptions() )
inline

◆ ApplicationOption() [2/2]

template<class t_type >
ApplicationOption ( const TranslatedString & label,
const t_type & value,
ApplicationOptions & options = ApplicationOptions::UserOptions() )
inline

Member Function Documentation

◆ addListener()

template<class t_type >
void addListener ( ResourceListener * listener,
bool silent_add = false )
inline

◆ fromString()

template<class t_type >
virtual void fromString ( const String & value)
inlineoverridevirtual

Implements ApplicationOptionBase.

◆ get()

template<class t_type >
t_type get ( ) const
inline

◆ getResource()

template<class t_type >
Resource< t_type > & getResource ( )
inline

◆ group()

template<class t_type >
const TranslatedString & group ( ) const
inline

◆ iniOption()

template<class t_type >
virtual INIOption * iniOption ( )
inlineoverridevirtual

Implements ApplicationOptionBase.

◆ isDefault()

template<class t_type >
virtual bool isDefault ( ) const
inlineoverridevirtual

Implements ApplicationOptionBase.

◆ label()

template<class t_type >
const TranslatedString & label ( ) const
inline

◆ set()

template<class t_type >
void set ( const t_type & value,
bool make_default = false )
inline

◆ setDefaultValue()

template<class t_type >
void setDefaultValue ( const t_type & value)
inline

◆ setToDefaultValue()

template<class t_type >
virtual void setToDefaultValue ( )
inlineoverridevirtual

Implements ApplicationOptionBase.

◆ toString()

template<class t_type >
virtual String toString ( ) const
inlineoverridevirtual

Implements ApplicationOptionBase.

Member Data Documentation

◆ m_default_value

template<class t_type >
t_type m_default_value
protected

◆ m_group

template<class t_type >
const TranslatedString m_group
protected

◆ m_label

template<class t_type >
const TranslatedString m_label
protected

◆ m_options

template<class t_type >
ApplicationOptions& m_options
protected

◆ m_value

template<class t_type >
Resource<t_type> m_value
protected

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