Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CSettingList Class Reference

List setting implementation. More...

#include <Setting.h>

Inheritance diagram for CSettingList:
CSetting ISetting ISettingCallback

Public Member Functions

 CSettingList (const std::string &id, std::shared_ptr< CSetting > settingDefinition, CSettingsManager *settingsManager=nullptr)
 
 CSettingList (const std::string &id, std::shared_ptr< CSetting > settingDefinition, int label, CSettingsManager *settingsManager=nullptr)
 
 CSettingList (const std::string &id, const CSettingList &setting)
 
 ~CSettingList () override=default
 
std::shared_ptr< CSettingClone (const std::string &id) const override
 
bool Deserialize (const TiXmlNode *node, bool update=false) override
 Deserializes the given XML node into the properties of the setting object. More...
 
SettingType GetType () const override
 
bool FromString (const std::string &value) override
 
std::string ToString () const override
 
bool Equals (const std::string &value) const override
 
bool CheckValidity (const std::string &value) const override
 
void Reset () override
 
SettingType GetElementType () const
 
std::shared_ptr< CSettingGetDefinition ()
 
std::shared_ptr< const CSettingGetDefinition () const
 
void SetDefinition (std::shared_ptr< CSetting > definition)
 
const std::string & GetDelimiter () const
 
void SetDelimiter (const std::string &delimiter)
 
int GetMinimumItems () const
 
void SetMinimumItems (int minimumItems)
 
int GetMaximumItems () const
 
void SetMaximumItems (int maximumItems)
 
bool FromString (const std::vector< std::string > &value)
 
const SettingListGetValue () const
 
bool SetValue (const SettingList &values)
 
const SettingListGetDefault () const
 
void SetDefault (const SettingList &values)
 
bool FindIntInList (int value) const
 
- Public Member Functions inherited from CSetting
 CSetting (const std::string &id, CSettingsManager *settingsManager=nullptr)
 
 CSetting (const std::string &id, const CSetting &setting)
 
 ~CSetting () override=default
 
bool IsEnabled () 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 ISettingControlGetControl () const
 
std::shared_ptr< ISettingControlGetControl ()
 
void SetControl (std::shared_ptr< ISettingControl > control)
 
const SettingDependenciesGetDependencies () const
 
void SetDependencies (const SettingDependencies &dependencies)
 
const std::set< CSettingUpdate > & GetUpdates () const
 
void SetCallback (ISettingCallback *callback)
 
bool IsVisible () const override
 Whether the setting object is visible or hidden. More...
 
void OnSettingAction (std::shared_ptr< const CSetting > setting) override
 The given setting has been activated. More...
 
- Public Member Functions inherited from ISetting
 ISetting (const std::string &id, CSettingsManager *settingsManager=nullptr)
 Creates a new setting object with the given identifier. More...
 
virtual ~ISetting ()=default
 
const std::string & GetId () const
 Gets the identifier of the setting object. 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. More...
 
virtual void SetRequirementsMet (bool requirementsMet)
 Sets whether the setting object meets all necessary requirements. More...
 

Protected Member Functions

void copy (const CSettingList &setting)
 
bool fromString (const std::string &strValue, SettingList &values) const
 
bool fromValues (const std::vector< std::string > &strValues, SettingList &values) const
 
std::string toString (const SettingList &values) const
 
- Protected Member Functions inherited from CSetting
bool OnSettingChanging (std::shared_ptr< const CSetting > setting) override
 The value of the given setting is being changed. More...
 
void OnSettingChanged (std::shared_ptr< const CSetting > setting) override
 The value of the given setting has changed. More...
 
bool OnSettingUpdate (std::shared_ptr< CSetting > setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override
 The given setting needs to be updated. More...
 
void OnSettingPropertyChanged (std::shared_ptr< const CSetting > setting, const char *propertyName) override
 The given property of the given setting has changed. More...
 
void Copy (const CSetting &setting)
 
template<class TSetting >
std::shared_ptr< TSetting > shared_from_base ()
 
- Protected Member Functions inherited from ISettingCallback
virtual ~ISettingCallback ()=default
 

Static Protected Member Functions

static void copy (const SettingList &srcValues, SettingList &dstValues)
 

Protected Attributes

SettingList m_values
 
SettingList m_defaults
 
std::shared_ptr< CSettingm_definition
 
std::string m_delimiter = "|"
 
int m_minimumItems = 0
 
int m_maximumItems = -1
 
- Protected Attributes inherited from CSetting
ISettingCallbackm_callback = nullptr
 
bool m_enabled = true
 
std::string m_parentSetting
 
SettingLevel m_level = SettingLevel::Standard
 
std::shared_ptr< ISettingControlm_control
 
SettingDependencies m_dependencies
 
std::set< CSettingUpdatem_updates
 
bool m_changed = false
 
CSharedSection m_critical
 
- Protected Attributes inherited from ISetting
std::string m_id
 
CSettingsManagerm_settingsManager
 

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

Detailed Description

List setting implementation.

See also
CSetting

Constructor & Destructor Documentation

◆ CSettingList() [1/3]

CSettingList::CSettingList ( const std::string &  id,
std::shared_ptr< CSetting settingDefinition,
CSettingsManager settingsManager = nullptr 
)

◆ CSettingList() [2/3]

CSettingList::CSettingList ( const std::string &  id,
std::shared_ptr< CSetting settingDefinition,
int  label,
CSettingsManager settingsManager = nullptr 
)

◆ CSettingList() [3/3]

CSettingList::CSettingList ( const std::string &  id,
const CSettingList setting 
)

◆ ~CSettingList()

CSettingList::~CSettingList ( )
overridedefault

Member Function Documentation

◆ CheckValidity()

bool CSettingList::CheckValidity ( const std::string &  value) const
overridevirtual

Implements CSetting.

◆ Clone()

SettingPtr CSettingList::Clone ( const std::string &  id) const
overridevirtual

Implements CSetting.

◆ copy() [1/2]

void CSettingList::copy ( const CSettingList setting)
protected

◆ copy() [2/2]

void CSettingList::copy ( const SettingList srcValues,
SettingList dstValues 
)
staticprotected

◆ Deserialize()

bool CSettingList::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 CSetting.

◆ Equals()

bool CSettingList::Equals ( const std::string &  value) const
overridevirtual

Implements CSetting.

◆ FindIntInList()

bool CSettingList::FindIntInList ( int  value) const

◆ fromString()

bool CSettingList::fromString ( const std::string &  strValue,
SettingList values 
) const
protected

◆ FromString() [1/2]

bool CSettingList::FromString ( const std::string &  value)
overridevirtual

Implements CSetting.

◆ FromString() [2/2]

bool CSettingList::FromString ( const std::vector< std::string > &  value)

◆ fromValues()

bool CSettingList::fromValues ( const std::vector< std::string > &  strValues,
SettingList values 
) const
protected

◆ GetDefault()

const SettingList & CSettingList::GetDefault ( ) const
inline

◆ GetDefinition() [1/2]

std::shared_ptr< CSetting > CSettingList::GetDefinition ( )
inline

◆ GetDefinition() [2/2]

std::shared_ptr< const CSetting > CSettingList::GetDefinition ( ) const
inline

◆ GetDelimiter()

const std::string & CSettingList::GetDelimiter ( ) const
inline

◆ GetElementType()

SettingType CSettingList::GetElementType ( ) const

◆ GetMaximumItems()

int CSettingList::GetMaximumItems ( ) const
inline

◆ GetMinimumItems()

int CSettingList::GetMinimumItems ( ) const
inline

◆ GetType()

SettingType CSettingList::GetType ( ) const
inlineoverridevirtual

Implements CSetting.

◆ GetValue()

const SettingList & CSettingList::GetValue ( ) const
inline

◆ Reset()

void CSettingList::Reset ( void  )
overridevirtual

Implements CSetting.

◆ SetDefault()

void CSettingList::SetDefault ( const SettingList values)

◆ SetDefinition()

void CSettingList::SetDefinition ( std::shared_ptr< CSetting definition)
inline

◆ SetDelimiter()

void CSettingList::SetDelimiter ( const std::string &  delimiter)
inline

◆ SetMaximumItems()

void CSettingList::SetMaximumItems ( int  maximumItems)
inline

◆ SetMinimumItems()

void CSettingList::SetMinimumItems ( int  minimumItems)
inline

◆ SetValue()

bool CSettingList::SetValue ( const SettingList values)

◆ ToString()

std::string CSettingList::ToString ( ) const
overridevirtual

Implements CSetting.

◆ toString()

std::string CSettingList::toString ( const SettingList values) const
protected

Member Data Documentation

◆ m_defaults

SettingList CSettingList::m_defaults
protected

◆ m_definition

std::shared_ptr<CSetting> CSettingList::m_definition
protected

◆ m_delimiter

std::string CSettingList::m_delimiter = "|"
protected

◆ m_maximumItems

int CSettingList::m_maximumItems = -1
protected

◆ m_minimumItems

int CSettingList::m_minimumItems = 0
protected

◆ m_values

SettingList CSettingList::m_values
protected

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