kodi
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ISetting Class Reference

Interface defining the base of all setting objects. More...

#include <ISetting.h>

Inheritance diagram for ISetting:
Inheritance graph
[legend]
Collaboration diagram for ISetting:
Collaboration graph
[legend]

Public Member Functions

 ISetting (const std::string &id, CSettingsManager *settingsManager=nullptr)
 Creates a new setting object with the given identifier. More...
 
virtual bool Deserialize (const TiXmlNode *node, bool update=false)
 Deserializes the given XML node into the properties of the setting object. More...
 
const std::string & GetId () const
 Gets the identifier of the setting object. More...
 
virtual bool IsVisible () const
 Whether the setting object is visible or hidden. More...
 
virtual void SetVisible (bool visible)
 Sets the visibility state of the setting object. More...
 
int GetLabel () const
 Gets the localizeable label ID of the setting group. More...
 
void SetLabel (int label)
 Sets the localizeable label ID of the setting group. More...
 
int GetHelp () const
 Gets the localizeable help ID of the setting group. More...
 
void SetHelp (int help)
 Sets the localizeable help ID of the setting group. More...
 
virtual bool MeetsRequirements () const
 Whether the setting object meets all necessary requirements. More...
 
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. More...
 

Static Public Member Functions

static bool DeserializeIdentification (const TiXmlNode *node, std::string &identification)
 Deserializes the given XML node to retrieve a setting object's identifier. More...
 

Static Protected Member Functions

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. More...
 

Protected Attributes

std::string m_id
 
CSettingsManagerm_settingsManager
 

Static Protected Attributes

static constexpr int DefaultLabel = -1
 

Detailed Description

Interface defining the base of all setting objects.

Constructor & Destructor Documentation

◆ ISetting()

ISetting::ISetting ( const std::string &  id,
CSettingsManager settingsManager = nullptr 
)

Creates a new setting object with the given identifier.

Parameters
idIdentifier of the setting object
settingsManagerReference to the settings manager

Member Function Documentation

◆ Deserialize()

bool ISetting::Deserialize ( const TiXmlNode *  node,
bool  update = false 
)
virtual

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.

Parameters
nodeXML node containing the properties of the setting object
updateWhether to perform checks for mandatory properties or not
Returns
True if deserialization was successful, false otherwise

Reimplemented in CSettingAction, CSettingString, CSettingNumber, CSettingInt, CSettingBool, CSettingList, CSettingSection, CSettingCategory, CSetting, CSettingGroup, CSettingAddon, and CSettingPath.

◆ DeserializeIdentification()

bool ISetting::DeserializeIdentification ( const TiXmlNode *  node,
std::string &  identification 
)
static

Deserializes the given XML node to retrieve a setting object's identifier.

Parameters
nodeXML node containing a setting object's identifier
identificationWill contain the deserialized setting object's identifier
Returns
True if a setting object's identifier was deserialized, false otherwise

◆ DeserializeIdentificationFromAttribute()

bool ISetting::DeserializeIdentificationFromAttribute ( const TiXmlNode *  node,
const std::string &  attribute,
std::string &  identification 
)
staticprotected

Deserializes the given XML node to retrieve a setting object's identifier from the given attribute.

Parameters
nodeXML node containing a setting object's identifier
attributeAttribute which contains the setting object's identifier
identificationWill contain the deserialized setting object's identifier
Returns
True if a setting object's identifier was deserialized, false otherwise

◆ GetHelp()

int ISetting::GetHelp ( ) const
inline

Gets the localizeable help ID of the setting group.

Returns
Localizeable help ID of the setting group

◆ GetId()

const std::string& ISetting::GetId ( ) const
inline

Gets the identifier of the setting object.

Returns
Identifier of the setting object

◆ GetLabel()

int ISetting::GetLabel ( ) const
inline

Gets the localizeable label ID of the setting group.

Returns
Localizeable label ID of the setting group

◆ IsVisible()

virtual bool ISetting::IsVisible ( ) const
inlinevirtual

Whether the setting object is visible or hidden.

Returns
True if the setting object is visible, false otherwise

Reimplemented in CSetting.

◆ MeetsRequirements()

virtual bool ISetting::MeetsRequirements ( ) const
inlinevirtual

Whether the setting object meets all necessary requirements.

Returns
True if the setting object meets all necessary requirements, false otherwise

◆ SetHelp()

void ISetting::SetHelp ( int  help)
inline

Sets the localizeable help ID of the setting group.

Parameters
labelLocalizeable help ID of the setting group

◆ SetLabel()

void ISetting::SetLabel ( int  label)
inline

Sets the localizeable label ID of the setting group.

Parameters
labelLocalizeable label ID of the setting group

◆ SetRequirementsMet()

virtual void ISetting::SetRequirementsMet ( bool  requirementsMet)
inlinevirtual

Sets whether the setting object meets all necessary requirements.

Parameters
visibleWhether the setting object meets all necessary requirements or not

◆ SetVisible()

virtual void ISetting::SetVisible ( bool  visible)
inlinevirtual

Sets the visibility state of the setting object.

Parameters
visibleWhether the setting object shall be visible or not

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