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

Group of settings being part of a category. More...

#include <SettingSection.h>

Inheritance diagram for CSettingGroup:
ISetting

Public Member Functions

 CSettingGroup (const std::string &id, CSettingsManager *settingsManager=nullptr)
 Creates a new setting group with the given identifier.
 
 ~CSettingGroup () override=default
 
bool Deserialize (const TiXmlNode *node, bool update=false) override
 Deserializes the given XML node into the properties of the setting object.
 
const SettingListGetSettings () const
 Gets the full list of settings belonging to the setting group.
 
SettingList GetSettings (SettingLevel level) const
 Gets the list of settings assigned to the given setting level (or below) and that meet the requirements conditions belonging to the setting group.
 
bool ContainsVisibleSettings (const SettingLevel level) const
 
void AddSetting (const std::shared_ptr< CSetting > &setting)
 
void AddSettings (const SettingList &settings)
 
bool ReplaceSetting (const std::shared_ptr< const CSetting > &currentSetting, const std::shared_ptr< CSetting > &newSetting)
 
std::shared_ptr< const ISettingControlGetControl () const
 
std::shared_ptr< ISettingControlGetControl ()
 
void SetControl (std::shared_ptr< ISettingControl > control)
 
- 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 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.
 

Additional Inherited Members

- 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.
 
- 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.
 
- Protected Attributes inherited from ISetting
std::string m_id
 
CSettingsManagerm_settingsManager
 
- Static Protected Attributes inherited from ISetting
static constexpr int DefaultLabel = -1
 

Detailed Description

Group of settings being part of a category.

See also
CSettingCategory
CSetting

Constructor & Destructor Documentation

◆ CSettingGroup()

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

Creates a new setting group with the given identifier.

Parameters
idIdentifier of the setting group
settingsManagerReference to the settings manager

◆ ~CSettingGroup()

CSettingGroup::~CSettingGroup ( )
overridedefault

Member Function Documentation

◆ AddSetting()

void CSettingGroup::AddSetting ( const std::shared_ptr< CSetting > & setting)

◆ AddSettings()

void CSettingGroup::AddSettings ( const SettingList & settings)

◆ ContainsVisibleSettings()

bool CSettingGroup::ContainsVisibleSettings ( const SettingLevel level) const

◆ Deserialize()

bool CSettingGroup::Deserialize ( const TiXmlNode * node,
bool update = false )
overridevirtual

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 from ISetting.

◆ GetControl() [1/2]

std::shared_ptr< ISettingControl > CSettingGroup::GetControl ( )
inline

◆ GetControl() [2/2]

std::shared_ptr< const ISettingControl > CSettingGroup::GetControl ( ) const
inline

◆ GetSettings() [1/2]

const SettingList & CSettingGroup::GetSettings ( ) const
inline

Gets the full list of settings belonging to the setting group.

Returns
Full list of settings belonging to the setting group

◆ GetSettings() [2/2]

SettingList CSettingGroup::GetSettings ( SettingLevel level) const

Gets the list of settings assigned to the given setting level (or below) and that meet the requirements conditions belonging to the setting group.

Parameters
levelLevel the settings should be assigned to
Returns
List of settings belonging to the setting group

◆ ReplaceSetting()

bool CSettingGroup::ReplaceSetting ( const std::shared_ptr< const CSetting > & currentSetting,
const std::shared_ptr< CSetting > & newSetting )

◆ SetControl()

void CSettingGroup::SetControl ( std::shared_ptr< ISettingControl > control)
inline

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