Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
ISetting Class Reference

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

#include <ISetting.h>

Inheritance diagram for ISetting:
CSetting CSettingCategory CSettingGroup CSettingSection CTraitedSetting< bool, SettingType::Boolean > CTraitedSetting< int, SettingType::Integer > CTraitedSetting< double, SettingType::Number > CTraitedSetting< std::string, SettingType::String > CSettingAction CSettingList CTraitedSetting< TValue, TSettingType > CSettingBool CSettingInt CSettingNumber CSettingString ADDON::CSettingUrlEncodedString CSettingAddon CSettingDate CSettingPath CSettingTime

Public Member Functions

 ISetting (const std::string &id, CSettingsManager *settingsManager=nullptr)
 Creates a new setting object with the given identifier.
 
virtual ~ISetting ()=default
 
virtual bool Deserialize (const TiXmlNode *node, bool update=false)
 Deserializes the given XML node into the properties of the setting object.
 
const std::string & GetId () const
 Gets the identifier of the setting object.
 
virtual bool IsVisible () const
 Whether the setting object is visible or hidden.
 
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)
 Deserializes the given XML node to retrieve a setting object's identifier.
 

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.
 

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

◆ ~ISetting()

virtual ISetting::~ISetting ( )
virtualdefault

Member Function Documentation

◆ CheckRequirements()

void ISetting::CheckRequirements ( )
virtual

Checks if the setting object meets all necessary requirements.

◆ 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 CSetting, CSettingList, CSettingBool, CSettingInt, CSettingNumber, CSettingString, CSettingAction, CSettingGroup, CSettingCategory, CSettingSection, 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

Member Data Documentation

◆ DefaultLabel

constexpr int ISetting::DefaultLabel = -1
staticconstexprprotected

◆ m_id

std::string ISetting::m_id
protected

◆ m_settingsManager

CSettingsManager* ISetting::m_settingsManager
protected

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