openMSX
Public Member Functions | List of all members
openmsx::BooleanSetting Class Referencefinal

#include <BooleanSetting.hh>

Inheritance diagram for openmsx::BooleanSetting:
Inheritance graph
[legend]
Collaboration diagram for openmsx::BooleanSetting:
Collaboration graph
[legend]

Public Member Functions

 BooleanSetting (CommandController &commandController, std::string_view name, static_string_view description, bool initialValue, Save save=Save::YES)
 
std::string_view getTypeString () const override
 Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an appropriate setting widget.
 
void tabCompletion (std::vector< std::string > &tokens) const override
 Complete a partly typed value.
 
bool getBoolean () const noexcept
 
void setBoolean (bool b)
 
- Public Member Functions inherited from openmsx::Setting
 Setting (const Setting &)=delete
 
 Setting (Setting &&)=delete
 
Settingoperator= (const Setting &)=delete
 
Settingoperator= (Setting &&)=delete
 
virtual ~Setting ()
 
const TclObjectgetValue () const final
 Gets the current value of this setting as a TclObject.
 
std::optional< TclObjectgetOptionalValue () const final
 Like getValue(), but in case of error returns an empty optional instead of throwing an exception.
 
void setChecker (std::function< void(TclObject &)> checkFunc_)
 Set value-check-callback.
 
void setValue (const TclObject &newValue) final
 Change the value of this setting to the given value.
 
std::string_view getDescription () const final
 pure virtual methods ///
 
TclObject getDefaultValue () const final
 Get the default value of this setting.
 
void setValueDirect (const TclObject &newValue) final
 Similar to setValue(), but doesn't trigger Tcl traces.
 
void tabCompletion (std::vector< std::string > &tokens) const override
 Complete a partly typed value.
 
bool needLoadSave () const final
 Does this setting need to be loaded or saved (settings.xml).
 
void additionalInfo (TclObject &result) const override
 Helper method for info().
 
bool needTransfer () const final
 Does this setting need to be transfered on reverse.
 
CommandControllergetCommandController () const
 
InterpretergetInterpreter () const
 
- Public Member Functions inherited from openmsx::BaseSetting
const TclObjectgetFullNameObj () const
 Get the name of this setting.
 
const TclObjectgetBaseNameObj () const
 
std::string_view getFullName () const
 
std::string_view getBaseName () const
 
void setPrefix (std::string_view prefix)
 Set a machine specific prefix.
 
void info (TclObject &result) const
 For SettingInfo.
 
- Public Member Functions inherited from openmsx::Subject< Setting >
 Subject (const Subject &)=delete
 
 Subject (Subject &&)=delete
 
Subjectoperator= (const Subject &)=delete
 
Subjectoperator= (Subject &&)=delete
 
void attach (Observer< Setting > &observer)
 
void detach (Observer< Setting > &observer)
 
bool anyObservers () const
 

Additional Inherited Members

- Public Types inherited from openmsx::Setting
enum class  Save { YES , NO , NO_AND_DONT_TRANSFER }
 
- Protected Member Functions inherited from openmsx::Setting
 Setting (CommandController &commandController, std::string_view name, static_string_view description, const TclObject &initialValue, Save save=Save::YES)
 
void init ()
 
void notifyPropertyChange () const
 
- Protected Member Functions inherited from openmsx::BaseSetting
 BaseSetting (std::string_view name)
 
 BaseSetting (TclObject name)
 
 ~BaseSetting ()=default
 
- Protected Member Functions inherited from openmsx::Subject< Setting >
 Subject ()=default
 
 ~Subject ()
 
void notify () const
 

Detailed Description

Definition at line 8 of file BooleanSetting.hh.

Constructor & Destructor Documentation

◆ BooleanSetting()

openmsx::BooleanSetting::BooleanSetting ( CommandController commandController,
std::string_view  name,
static_string_view  description,
bool  initialValue,
Save  save = Save::YES 
)

Member Function Documentation

◆ getBoolean()

bool openmsx::BooleanSetting::getBoolean ( ) const
inlinenoexcept

◆ getTypeString()

std::string_view openmsx::BooleanSetting::getTypeString ( ) const
overridevirtual

Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an appropriate setting widget.

Implements openmsx::BaseSetting.

Definition at line 22 of file BooleanSetting.cc.

◆ setBoolean()

void openmsx::BooleanSetting::setBoolean ( bool  b)
inline

◆ tabCompletion()

void openmsx::BooleanSetting::tabCompletion ( std::vector< std::string > &  tokens) const
overridevirtual

Complete a partly typed value.

Default implementation does not complete anything, subclasses can override this to complete according to their specific value type.

Implements openmsx::BaseSetting.

Definition at line 27 of file BooleanSetting.cc.

References openmsx::Completer::completeString().


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