16class CommandController;
17class GlobalCommandController;
43 assert(prefix.starts_with(
"::"));
148 restoreValue = newRestoreValue;
161 checkFunc = std::move(checkFunc_);
170 void tabCompletion(std::vector<std::string>& tokens)
const override;
194 std::function<void(
TclObject&)> checkFunc;
198 std::optional<TclObject> dontSaveValue;
virtual void setValue(const TclObject &value)=0
Change the value of this setting to the given value.
virtual std::optional< TclObject > getOptionalValue() const =0
Like getValue(), but in case of error returns an empty optional instead of throwing an exception.
virtual void additionalInfo(TclObject &result) const =0
Helper method for info().
BaseSetting(std::string_view name)
void info(TclObject &result) const
For SettingInfo.
virtual void setValueDirect(const TclObject &value)=0
Similar to setValue(), but doesn't trigger Tcl traces.
virtual void setDontSaveValue(const TclObject &dontSaveValue)=0
This value will never end up in the settings.xml file.
virtual const TclObject & getValue() const =0
Get current value as a TclObject.
virtual bool needLoadSave() const =0
Does this setting need to be loaded or saved (settings.xml).
virtual std::string_view getTypeString() const =0
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
virtual TclObject getDefaultValue() const =0
Get the default value of this setting.
void setPrefix(std::string_view prefix)
Set a machine specific prefix.
const TclObject & getFullNameObj() const
Get the name of this setting.
virtual void tabCompletion(std::vector< std::string > &tokens) const =0
Complete a partly typed value.
virtual TclObject getRestoreValue() const =0
Get the value that will be set after a Tcl 'unset' command.
virtual bool needTransfer() const =0
Does this setting need to be transfered on reverse.
virtual std::string_view getDescription() const =0
pure virtual methods ///
std::string_view getBaseName() const
std::string_view getFullName() const
const TclObject & getBaseNameObj() const
void setChecker(std::function< void(TclObject &)> checkFunc_)
Set value-check-callback.
std::string_view getDescription() const final
pure virtual methods ///
std::optional< TclObject > getOptionalValue() const final
Like getValue(), but in case of error returns an empty optional instead of throwing an exception.
void tabCompletion(std::vector< std::string > &tokens) const override
Complete a partly typed value.
void setRestoreValue(const TclObject &newRestoreValue)
Set restore value.
bool needLoadSave() const final
Does this setting need to be loaded or saved (settings.xml).
Setting & operator=(const Setting &)=delete
void setDontSaveValue(const TclObject &dontSaveValue) final
This value will never end up in the settings.xml file.
CommandController & getCommandController() const
bool needTransfer() const final
Does this setting need to be transfered on reverse.
Interpreter & getInterpreter() const
TclObject getRestoreValue() const final
Get the value that will be set after a Tcl 'unset' command.
TclObject getDefaultValue() const final
Get the default value of this setting.
const TclObject & getValue() const final
Gets the current value of this setting as a TclObject.
void setValue(const TclObject &newValue) final
Change the value of this setting to the given value.
void notifyPropertyChange() const
void additionalInfo(TclObject &result) const override
Helper method for info().
Setting(const Setting &)=delete
void setValueDirect(const TclObject &newValue) final
Similar to setValue(), but doesn't trigger Tcl traces.
Generic Gang-of-Four Subject class of the Observer pattern, templatized edition.
zstring_view getString() const
This file implemented 3 utility functions:
TemporaryString tmpStrCat(Ts &&... ts)