SPH
Public Member Functions | Public Attributes | List of all members
GuiSettings Class Reference

#include <Settings.h>

Inheritance diagram for GuiSettings:
Settings< GuiSettingsId >

Public Member Functions

template<typename TValue >
INLINE TValue get (const GuiSettingsId id) const
 
template<typename TValue >
INLINE GuiSettingsset (const GuiSettingsId id, const TValue &value)
 
template<>
INLINE Pixel get (const GuiSettingsId id) const
 
template<>
INLINE Rgba get (const GuiSettingsId id) const
 
template<>
INLINE GuiSettingsset (const GuiSettingsId id, const Rgba &color)
 
- Public Member Functions inherited from Settings< GuiSettingsId >
 Settings ()
 Initialize settings by settings all value to their defaults. More...
 
 Settings (EmptySettingsTag)
 Initialize empty settings object. More...
 
 Settings (const Settings &other)
 
 Settings (Settings &&other)
 
Settingsoperator= (std::initializer_list< Entry > list)
 Assigns a list of settings into the object, erasing all previous entries. More...
 
Settingsoperator= (const Settings &other)
 
Settingsoperator= (Settings &&other)
 
Settingsset (const GuiSettingsId idx, TValue &&value, std::enable_if_t<!std::is_enum< std::decay_t< TValue >>::value, int >=0)
 Saves a value into the settings. More...
 
Settingsset (const GuiSettingsId idx, TValue &&value, std::enable_if_t< std::is_enum< std::decay_t< TValue >>::value, int >=0)
 Saves a value into the settings. More...
 
Settingsset (const GuiSettingsId idx, const Flags< TValue > flags)
 Saves flags into the settings. More...
 
Settingsset (const GuiSettingsId idx, EmptyFlags)
 Clear flags of given parameter in settings. More...
 
Settingsset (const GuiSettingsId idx, const EnumWrapper ew)
 Special setter for value of type EnumWrapper. More...
 
void addEntries (const Settings &settings)
 Adds entries from different Settings object into this one, overriding current entries. More...
 
void unset (const GuiSettingsId idx)
 Removes given parameter from settings. More...
 
TValue get (const GuiSettingsId idx, std::enable_if_t<!std::is_enum< std::decay_t< TValue >>::value, int >=0) const
 Returns a value of given type from the settings. More...
 
TValue get (const GuiSettingsId idx, std::enable_if_t< std::is_enum< std::decay_t< TValue >>::value, int >=0) const
 Returns a value of given type from the settings. More...
 
Flags< TValue > getFlags (const GuiSettingsId idx) const
 Returns Flags from underlying value stored in settings. More...
 
bool has (const GuiSettingsId idx) const
 Checks if the given entry is stored in the settings. More...
 
bool hasType (const GuiSettingsId idx) const
 Checks if the given entry has specified type. More...
 
Outcome saveToFile (const Path &path) const
 Saves all values stored in settings into file. More...
 
Outcome loadFromFile (const Path &path)
 Loads the settings from file. More...
 
bool tryLoadFileOrSaveCurrent (const Path &path, const Settings &overrides=EMPTY_SETTINGS)
 If the specified file exists, loads the settings from it, otherwise creates the file and saves the current values. More...
 
SettingsIterator< GuiSettingsIdbegin () const
 Iterator to the first entry of the settings storage. More...
 
SettingsIterator< GuiSettingsIdend () const
 Iterator to the one-past-end entry the settings storage. More...
 
Size size () const
 Returns the number of entries in the settings. More...
 

Public Attributes

Function< void(GuiSettingsId id)> accessor
 

Additional Inherited Members

- Static Public Member Functions inherited from Settings< GuiSettingsId >
static Optional< std::string > getEntryName (const GuiSettingsId idx)
 Returns the human-readable name of the entry with given index. More...
 
static Optional< int > getEntryType (const GuiSettingsId idx)
 Returns the type of the entry with given index. More...
 
static std::string typeToString (const int type)
 Returns the string name for given type index. More...
 
static Optional< std::string > getEntryDesc (const GuiSettingsId idx)
 Returns a description of the entry with given index. More...
 
static Optional< GuiSettingsIdgetEntryId (const std::string &name)
 Returns an ID for given entry name. More...
 
static const SettingsgetDefaults ()
 \brief Returns a reference to object containing default values of all settings. More...
 

Detailed Description

Definition at line 238 of file Settings.h.

Member Function Documentation

◆ get() [1/3]

template<typename TValue >
INLINE TValue GuiSettings::get ( const GuiSettingsId  id) const
inline

Definition at line 245 of file Settings.h.

◆ get() [2/3]

template<>
INLINE Pixel GuiSettings::get ( const GuiSettingsId  id) const

Definition at line 261 of file Settings.h.

◆ get() [3/3]

template<>
INLINE Rgba GuiSettings::get ( const GuiSettingsId  id) const

Definition at line 267 of file Settings.h.

◆ set() [1/2]

template<>
INLINE GuiSettings& GuiSettings::set ( const GuiSettingsId  id,
const Rgba color 
)

Definition at line 273 of file Settings.h.

◆ set() [2/2]

template<typename TValue >
INLINE GuiSettings& GuiSettings::set ( const GuiSettingsId  id,
const TValue &  value 
)
inline

Definition at line 250 of file Settings.h.

Member Data Documentation

◆ accessor

Function<void(GuiSettingsId id)> GuiSettings::accessor

Definition at line 242 of file Settings.h.


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