Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Setting base class containing all the properties which are common to all settings independent of the setting type. More...
#include <Setting.h>
Public Member Functions | |
CSetting (const std::string &id, CSettingsManager *settingsManager=nullptr) | |
CSetting (const std::string &id, const CSetting &setting) | |
~CSetting () override=default | |
virtual std::shared_ptr< CSetting > | Clone (const std::string &id) const =0 |
void | MergeBasics (const CSetting &other) |
virtual void | MergeDetails (const CSetting &other)=0 |
bool | Deserialize (const TiXmlNode *node, bool update=false) override |
Deserializes the given XML node into the properties of the setting object. | |
virtual SettingType | GetType () const =0 |
virtual bool | FromString (const std::string &value)=0 |
virtual std::string | ToString () const =0 |
virtual bool | Equals (const std::string &value) const =0 |
virtual bool | CheckValidity (const std::string &value) const =0 |
virtual void | Reset ()=0 |
bool | IsEnabled () const |
bool | GetEnabled () const |
void | SetEnabled (bool enabled) |
bool | IsDefault () const |
const std::string & | GetParent () const |
void | SetParent (const std::string &parentSetting) |
SettingLevel | GetLevel () const |
void | SetLevel (SettingLevel level) |
std::shared_ptr< const ISettingControl > | GetControl () const |
std::shared_ptr< ISettingControl > | GetControl () |
void | SetControl (std::shared_ptr< ISettingControl > control) |
const SettingDependencies & | GetDependencies () const |
void | SetDependencies (const SettingDependencies &dependencies) |
const std::set< CSettingUpdate > & | GetUpdates () const |
void | SetCallback (ISettingCallback *callback) |
bool | IsReference () const |
const std::string & | GetReferencedId () const |
void | SetReferencedId (const std::string &referencedId) |
void | MakeReference (const std::string &referencedId="") |
bool | GetVisible () const |
bool | IsVisible () const override |
Whether the setting object is visible or hidden. | |
void | OnSettingAction (const std::shared_ptr< const CSetting > &setting) override |
The given setting has been activated. | |
Public Member Functions inherited from ISetting | |
ISetting (const std::string &id, CSettingsManager *settingsManager=nullptr) | |
Creates a new setting object with the given identifier. | |
virtual | ~ISetting ()=default |
const std::string & | GetId () const |
Gets the identifier of the setting object. | |
virtual void | SetVisible (bool visible) |
Sets the visibility state of the setting object. | |
int | GetLabel () const |
Gets the localizeable label ID of the setting group. | |
void | SetLabel (int label) |
Sets the localizeable label ID of the setting group. | |
int | GetHelp () const |
Gets the localizeable help ID of the setting group. | |
void | SetHelp (int help) |
Sets the localizeable help ID of the setting group. | |
virtual bool | MeetsRequirements () const |
Whether the setting object meets all necessary requirements. | |
virtual void | CheckRequirements () |
Checks if the setting object meets all necessary requirements. | |
virtual void | SetRequirementsMet (bool requirementsMet) |
Sets whether the setting object meets all necessary requirements. | |
Static Public Member Functions | |
static bool | DeserializeIdentification (const TiXmlNode *node, std::string &identification, bool &isReference) |
Deserializes the given XML node to retrieve a setting object's identifier and whether the setting is a reference to another setting or not. | |
Static Public Member Functions inherited from ISetting | |
static bool | DeserializeIdentification (const TiXmlNode *node, std::string &identification) |
Deserializes the given XML node to retrieve a setting object's identifier. | |
Protected Member Functions | |
bool | OnSettingChanging (const std::shared_ptr< const CSetting > &setting) override |
The value of the given setting is being changed. | |
void | OnSettingChanged (const std::shared_ptr< const CSetting > &setting) override |
The value of the given setting has changed. | |
bool | OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override |
The given setting needs to be updated. | |
void | OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName) override |
The given property of the given setting has changed. | |
void | Copy (const CSetting &setting) |
template<class TSetting > | |
std::shared_ptr< TSetting > | shared_from_base () |
Protected Member Functions inherited from ISettingCallback | |
virtual | ~ISettingCallback ()=default |
Protected Attributes | |
ISettingCallback * | m_callback = nullptr |
bool | m_enabled = true |
std::string | m_parentSetting |
SettingLevel | m_level = SettingLevel::Standard |
std::shared_ptr< ISettingControl > | m_control |
SettingDependencies | m_dependencies |
std::set< CSettingUpdate > | m_updates |
bool | m_changed = false |
CSharedSection | m_critical |
std::string | m_referencedId |
Protected Attributes inherited from ISetting | |
std::string | m_id |
CSettingsManager * | m_settingsManager |
Additional Inherited Members | |
Static Protected Member Functions inherited from ISetting | |
static bool | DeserializeIdentificationFromAttribute (const TiXmlNode *node, const std::string &attribute, std::string &identification) |
Deserializes the given XML node to retrieve a setting object's identifier from the given attribute. | |
Static Protected Attributes inherited from ISetting | |
static constexpr int | DefaultLabel = -1 |
Setting base class containing all the properties which are common to all settings independent of the setting type.
CSetting::CSetting | ( | const std::string & | id, |
CSettingsManager * | settingsManager = nullptr ) |
CSetting::CSetting | ( | const std::string & | id, |
const CSetting & | setting ) |
|
overridedefault |
|
pure virtual |
Implemented in CSettingAction, CSettingBool, CSettingDate, CSettingInt, CSettingList, CSettingNumber, CSettingString, and CSettingTime.
|
pure virtual |
Implemented in ADDON::CSettingUrlEncodedString, CSettingAction, CSettingAddon, CSettingBool, CSettingDate, CSettingInt, CSettingList, CSettingNumber, CSettingPath, CSettingString, and CSettingTime.
Deserializes the given XML node into the properties of the setting object.
If the update parameter is true, the checks for mandatory properties are skipped and values are only updated.
node | XML node containing the properties of the setting object |
update | Whether to perform checks for mandatory properties or not |
Reimplemented from ISetting.
Reimplemented in CSettingAction, CSettingAddon, CSettingBool, CSettingInt, CSettingList, CSettingNumber, CSettingPath, and CSettingString.
|
static |
Deserializes the given XML node to retrieve a setting object's identifier and whether the setting is a reference to another setting or not.
node | XML node containing a setting object's identifier |
identification | Will contain the deserialized setting object's identifier |
isReference | Whether the setting is a reference to the setting with the determined identifier |
|
pure virtual |
Implemented in CSettingAction, CSettingBool, CSettingInt, CSettingList, CSettingNumber, and CSettingString.
|
pure virtual |
Implemented in CSettingAction, CSettingBool, CSettingInt, CSettingList, CSettingNumber, and CSettingString.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
pure virtual |
|
inline |
|
inline |
|
inline |
bool CSetting::IsEnabled | ( | ) | const |
|
inline |
|
overridevirtual |
Whether the setting object is visible or hidden.
Reimplemented from ISetting.
void CSetting::MakeReference | ( | const std::string & | referencedId = "" | ) |
Implemented in CSettingAction, CSettingBool, CSettingInt, CSettingList, CSettingNumber, and CSettingString.
The given setting has been activated.
This callback is triggered whenever the given setting has been activated. This callback is only fired for CSettingAction settings.
setting | The setting which has been activated. |
Reimplemented from ISettingCallback.
|
overrideprotectedvirtual |
The value of the given setting has changed.
This callback is triggered whenever the value of a setting has been successfully changed (i.e. none of the OnSettingChanging() handlers) has reverted the change.
setting | The setting whose value has been changed |
Reimplemented from ISettingCallback.
|
overrideprotectedvirtual |
The value of the given setting is being changed.
This callback is triggered whenever the value of a setting is being changed. The given CSetting already contains the new value and the handler of the callback has the possibility to allow or revert changing the value of the setting. In case of a revert OnSettingChanging() is called again to inform all listeners that the value change has been reverted.
setting | The setting whose value is being changed (already containing the changed value) |
Reimplemented from ISettingCallback.
|
overrideprotectedvirtual |
The given property of the given setting has changed.
This callback is triggered when a property (e.g. enabled or the list of dynamic options) has changed.
setting | The setting which has a changed property |
propertyName | The string representation of the changed property |
Reimplemented from ISettingCallback.
|
overrideprotectedvirtual |
The given setting needs to be updated.
This callback is triggered when a setting needs to be updated because its value is outdated. This only happens when initially loading the value of a setting and will not be triggered afterwards.
setting | The setting which needs to be updated. |
oldSettingId | The id of the previous setting. |
oldSettingNode | The old setting node |
Reimplemented from ISettingCallback.
|
pure virtual |
Implemented in CSettingAction, CSettingBool, CSettingInt, CSettingList, CSettingNumber, and CSettingString.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
pure virtual |
Implemented in CSettingAction, CSettingBool, CSettingInt, CSettingList, CSettingNumber, and CSettingString.
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |