openMSX
|
#include <KeyCodeSetting.hh>
Public Member Functions | |
KeyCodeSetting (CommandController &commandController, std::string_view name, static_string_view description, Keys::KeyCode initialValue) | |
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. More... | |
Keys::KeyCode | getKey () const noexcept |
![]() | |
Setting (const Setting &)=delete | |
Setting & | operator= (const Setting &)=delete |
virtual | ~Setting () |
const TclObject & | getValue () const final |
Gets the current value of this setting as a TclObject. More... | |
std::optional< TclObject > | getOptionalValue () const final |
Like getValue(), but in case of error returns an empty optional instead of throwing an exception. More... | |
void | setRestoreValue (const TclObject &newRestoreValue) |
Set restore value. More... | |
void | setChecker (std::function< void(TclObject &)> checkFunc_) |
Set value-check-callback. More... | |
void | setValue (const TclObject &newValue) final |
Change the value of this setting to the given value. More... | |
std::string_view | getDescription () const final |
pure virtual methods /// More... | |
TclObject | getDefaultValue () const final |
Get the default value of this setting. More... | |
TclObject | getRestoreValue () const final |
Get the value that will be set after a Tcl 'unset' command. More... | |
void | setValueDirect (const TclObject &newValue) final |
Similar to setValue(), but doesn't trigger Tcl traces. More... | |
void | tabCompletion (std::vector< std::string > &tokens) const override |
Complete a partly typed value. More... | |
bool | needLoadSave () const final |
Does this setting need to be loaded or saved (settings.xml). More... | |
void | additionalInfo (TclObject &result) const override |
Helper method for info(). More... | |
bool | needTransfer () const final |
Does this setting need to be transfered on reverse. More... | |
void | setDontSaveValue (const TclObject &dontSaveValue) final |
This value will never end up in the settings.xml file. More... | |
CommandController & | getCommandController () const |
Interpreter & | getInterpreter () const |
![]() | |
const TclObject & | getFullNameObj () const |
Get the name of this setting. More... | |
const TclObject & | getBaseNameObj () const |
std::string_view | getFullName () const |
std::string_view | getBaseName () const |
void | setPrefix (std::string_view prefix) |
Set a machine specific prefix. More... | |
void | info (TclObject &result) const |
For SettingInfo. More... | |
![]() | |
void | attach (Observer< Setting > &observer) |
void | detach (Observer< Setting > &observer) |
bool | anyObservers () const |
Additional Inherited Members | |
![]() | |
enum | SaveSetting { SAVE , DONT_SAVE , DONT_TRANSFER } |
![]() | |
Setting (CommandController &commandController, std::string_view name, static_string_view description, const TclObject &initialValue, SaveSetting save=SAVE) | |
void | init () |
void | notifyPropertyChange () const |
![]() | |
BaseSetting (std::string_view name) | |
BaseSetting (TclObject name) | |
~BaseSetting ()=default | |
![]() | |
Subject ()=default | |
~Subject () | |
void | notify () const |
Definition at line 9 of file KeyCodeSetting.hh.
openmsx::KeyCodeSetting::KeyCodeSetting | ( | CommandController & | commandController, |
std::string_view | name, | ||
static_string_view | description, | ||
Keys::KeyCode | initialValue | ||
) |
Definition at line 6 of file KeyCodeSetting.cc.
References openmsx::Keys::getCode(), openmsx::TclObject::getString(), openmsx::Setting::init(), openmsx::Keys::K_NONE, and openmsx::Setting::setChecker().
|
noexcept |
Definition at line 26 of file KeyCodeSetting.cc.
References openmsx::Keys::getCode(), and openmsx::Setting::getValue().
|
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 21 of file KeyCodeSetting.cc.