openMSX
Public Member Functions | Protected Member Functions | List of all members
openmsx::BaseSetting Class Referenceabstract

#include <Setting.hh>

Inheritance diagram for openmsx::BaseSetting:
Inheritance graph
[legend]

Public Member Functions

const TclObjectgetFullNameObj () const
 Get the name of this setting. More...
 
const TclObjectgetBaseNameObj () const
 
string_view getFullName () const
 
string_view getBaseName () const
 
void setPrefix (string_view prefix)
 Set a machine specific prefix. More...
 
void info (TclObject &result) const
 For SettingInfo. More...
 
virtual string_view getDescription () const =0
 pure virtual methods /// More...
 
virtual string_view getTypeString () const =0
 Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an appropriate setting widget. More...
 
virtual void additionalInfo (TclObject &result) const =0
 Helper method for info(). More...
 
virtual void tabCompletion (std::vector< std::string > &tokens) const =0
 Complete a partly typed value. More...
 
virtual const TclObjectgetValue () const =0
 Get current value as a TclObject. More...
 
virtual TclObject getDefaultValue () const =0
 Get the default value of this setting. More...
 
virtual TclObject getRestoreValue () const =0
 Get the value that will be set after a Tcl 'unset' command. More...
 
virtual void setValue (const TclObject &value)=0
 Change the value of this setting to the given value. More...
 
virtual void setValueDirect (const TclObject &value)=0
 Similar to setValue(), but doesn't trigger Tcl traces. More...
 
virtual bool needLoadSave () const =0
 Does this setting need to be loaded or saved (settings.xml). More...
 
virtual bool needTransfer () const =0
 Does this setting need to be transfered on reverse. More...
 
virtual void setDontSaveValue (const TclObject &dontSaveValue)=0
 This value will never end up in the settings.xml file. More...
 

Protected Member Functions

 BaseSetting (string_view name)
 
 BaseSetting (const TclObject &name)
 
 ~BaseSetting ()=default
 

Detailed Description

Definition at line 17 of file Setting.hh.

Constructor & Destructor Documentation

◆ BaseSetting() [1/2]

openmsx::BaseSetting::BaseSetting ( string_view  name)
explicitprotected

Definition at line 18 of file Setting.cc.

◆ BaseSetting() [2/2]

openmsx::BaseSetting::BaseSetting ( const TclObject name)
explicitprotected

Definition at line 24 of file Setting.cc.

◆ ~BaseSetting()

openmsx::BaseSetting::~BaseSetting ( )
protecteddefault

Member Function Documentation

◆ additionalInfo()

virtual void openmsx::BaseSetting::additionalInfo ( TclObject result) const
pure virtual

◆ getBaseName()

string_view openmsx::BaseSetting::getBaseName ( ) const
inline

◆ getBaseNameObj()

const TclObject& openmsx::BaseSetting::getBaseNameObj ( ) const
inline

◆ getDefaultValue()

virtual TclObject openmsx::BaseSetting::getDefaultValue ( ) const
pure virtual

Get the default value of this setting.

This is the initial value of the setting. Default values don't get saved in 'settings.xml'.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by info(), and setPrefix().

◆ getDescription()

virtual string_view openmsx::BaseSetting::getDescription ( ) const
pure virtual

pure virtual methods ///

Get a description of this setting that can be presented to the user.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by openmsx::Setting::setChecker(), and setPrefix().

◆ getFullName()

string_view openmsx::BaseSetting::getFullName ( ) const
inline

◆ getFullNameObj()

const TclObject& openmsx::BaseSetting::getFullNameObj ( ) const
inline

Get the name of this setting.

For global settings 'fullName' and 'baseName' are the same. For machine specific settings 'fullName' is the fully qualified name, and 'baseName' is the name without machine-prefix. For example: fullName = "::machine1::PSG_volume" baseName = "PSG_volume"

Definition at line 32 of file Setting.hh.

Referenced by openmsx::SettingsManager::registerSetting(), openmsx::Interpreter::registerSetting(), openmsx::Setting::setValue(), and openmsx::SettingsManager::unregisterSetting().

◆ getRestoreValue()

virtual TclObject openmsx::BaseSetting::getRestoreValue ( ) const
pure virtual

Get the value that will be set after a Tcl 'unset' command.

Usually this is the same as the default value. Though one exception is 'renderer', see comments in RendererFactory.cc.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by setPrefix().

◆ getTypeString()

virtual string_view openmsx::BaseSetting::getTypeString ( ) const
pure virtual

◆ getValue()

virtual const TclObject& openmsx::BaseSetting::getValue ( ) const
pure virtual

Get current value as a TclObject.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by setPrefix(), and openmsx::Interpreter::unsetVariable().

◆ info()

void openmsx::BaseSetting::info ( TclObject result) const

◆ needLoadSave()

virtual bool openmsx::BaseSetting::needLoadSave ( ) const
pure virtual

Does this setting need to be loaded or saved (settings.xml).

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by openmsx::Setting::getRestoreValue(), and setPrefix().

◆ needTransfer()

virtual bool openmsx::BaseSetting::needTransfer ( ) const
pure virtual

Does this setting need to be transfered on reverse.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by openmsx::Setting::getRestoreValue(), and setPrefix().

◆ setDontSaveValue()

virtual void openmsx::BaseSetting::setDontSaveValue ( const TclObject dontSaveValue)
pure virtual

This value will never end up in the settings.xml file.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by openmsx::Setting::getRestoreValue(), and setPrefix().

◆ setPrefix()

void openmsx::BaseSetting::setPrefix ( string_view  prefix)
inline

◆ setValue()

virtual void openmsx::BaseSetting::setValue ( const TclObject value)
pure virtual

Change the value of this setting to the given value.

This method will trigger Tcl traces. This value still passes via the 'checker-callback' (see below), so the value may be adjusted. Or in case of an invalid value this method may throw.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by openmsx::Setting::setChecker(), and setPrefix().

◆ setValueDirect()

virtual void openmsx::BaseSetting::setValueDirect ( const TclObject value)
pure virtual

Similar to setValue(), but doesn't trigger Tcl traces.

Like setValue(), the given value may be adjusted or rejected. Should only be used by the Interpreter class.

Implemented in openmsx::Setting, and openmsx::ProxySetting.

Referenced by openmsx::Setting::getRestoreValue(), openmsx::Interpreter::registerSetting(), and setPrefix().

◆ tabCompletion()

virtual void openmsx::BaseSetting::tabCompletion ( std::vector< std::string > &  tokens) const
pure virtual

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