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

Integer setting implementation. More...

#include <Setting.h>

Inheritance diagram for CSettingInt:
CTraitedSetting< int, SettingType::Integer > CSetting ISetting ISettingCallback

Public Member Functions

 CSettingInt (const std::string &id, CSettingsManager *settingsManager=nullptr)
 
 CSettingInt (const std::string &id, const CSettingInt &setting)
 
 CSettingInt (const std::string &id, int label, int value, CSettingsManager *settingsManager=nullptr)
 
 CSettingInt (const std::string &id, int label, int value, int minimum, int step, int maximum, CSettingsManager *settingsManager=nullptr)
 
 CSettingInt (const std::string &id, int label, int value, const TranslatableIntegerSettingOptions &options, CSettingsManager *settingsManager=nullptr)
 
 ~CSettingInt () override=default
 
std::shared_ptr< CSettingClone (const std::string &id) const override
 
void MergeDetails (const CSetting &other) override
 
bool Deserialize (const TiXmlNode *node, bool update=false) override
 Deserializes the given XML node into the properties of the setting object.
 
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
 
virtual bool CheckValidity (int value) const
 
void Reset () override
 
int GetValue () const
 
bool SetValue (int value)
 
int GetDefault () const
 
void SetDefault (int value)
 
int GetMinimum () const
 
void SetMinimum (int minimum)
 
int GetStep () const
 
void SetStep (int step)
 
int GetMaximum () const
 
void SetMaximum (int maximum)
 
SettingOptionsType GetOptionsType () const
 
const TranslatableIntegerSettingOptionsGetTranslatableOptions () const
 
void SetTranslatableOptions (const TranslatableIntegerSettingOptions &options)
 
const IntegerSettingOptionsGetOptions () const
 
void SetOptions (const IntegerSettingOptions &options)
 
const std::string & GetOptionsFillerName () const
 
void SetOptionsFillerName (const std::string &optionsFillerName, void *data=nullptr)
 
void SetOptionsFiller (IntegerSettingOptionsFiller optionsFiller, void *data=nullptr)
 
const IntegerSettingOptionsGetDynamicOptions () const
 
IntegerSettingOptions UpdateDynamicOptions ()
 
SettingOptionsSort GetOptionsSort () const
 
void SetOptionsSort (SettingOptionsSort optionsSort)
 
- Public Member Functions inherited from CTraitedSetting< int, SettingType::Integer >
SettingType GetType () const override
 
- 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
 
void MergeBasics (const CSetting &other)
 
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 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 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.
 

Additional Inherited Members

- Public Types inherited from CTraitedSetting< int, SettingType::Integer >
typedef int Value
 
- Static Public Member Functions inherited from CTraitedSetting< int, SettingType::Integer >
static SettingType Type ()
 
- Static Public Member Functions inherited from CSetting
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 inherited from CTraitedSetting< int, SettingType::Integer >
 CTraitedSetting (const std::string &id, CSettingsManager *settingsManager=nullptr)
 
 CTraitedSetting (const std::string &id, const CTraitedSetting &setting)
 
 ~CTraitedSetting () override=default
 
- Protected Member Functions inherited from CSetting
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
 
- 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 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
 
std::string m_referencedId
 
- Protected Attributes inherited from ISetting
std::string m_id
 
CSettingsManagerm_settingsManager
 
- Static Protected Attributes inherited from ISetting
static constexpr int DefaultLabel = -1
 

Detailed Description

Integer setting implementation.

See also
CSetting

Constructor & Destructor Documentation

◆ CSettingInt() [1/5]

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

◆ CSettingInt() [2/5]

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

◆ CSettingInt() [3/5]

CSettingInt::CSettingInt ( const std::string & id,
int label,
int value,
CSettingsManager * settingsManager = nullptr )

◆ CSettingInt() [4/5]

CSettingInt::CSettingInt ( const std::string & id,
int label,
int value,
int minimum,
int step,
int maximum,
CSettingsManager * settingsManager = nullptr )

◆ CSettingInt() [5/5]

CSettingInt::CSettingInt ( const std::string & id,
int label,
int value,
const TranslatableIntegerSettingOptions & options,
CSettingsManager * settingsManager = nullptr )

◆ ~CSettingInt()

CSettingInt::~CSettingInt ( )
overridedefault

Member Function Documentation

◆ CheckValidity() [1/2]

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

Implements CSetting.

◆ CheckValidity() [2/2]

bool CSettingInt::CheckValidity ( int value) const
virtual

◆ Clone()

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

Implements CSetting.

◆ Deserialize()

bool CSettingInt::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 CSettingInt::Equals ( const std::string & value) const
overridevirtual

Implements CSetting.

◆ FromString()

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

Implements CSetting.

◆ GetDefault()

int CSettingInt::GetDefault ( ) const
inline

◆ GetDynamicOptions()

const IntegerSettingOptions & CSettingInt::GetDynamicOptions ( ) const
inline

◆ GetMaximum()

int CSettingInt::GetMaximum ( ) const
inline

◆ GetMinimum()

int CSettingInt::GetMinimum ( ) const
inline

◆ GetOptions()

const IntegerSettingOptions & CSettingInt::GetOptions ( ) const
inline

◆ GetOptionsFillerName()

const std::string & CSettingInt::GetOptionsFillerName ( ) const
inline

◆ GetOptionsSort()

SettingOptionsSort CSettingInt::GetOptionsSort ( ) const
inline

◆ GetOptionsType()

SettingOptionsType CSettingInt::GetOptionsType ( ) const

◆ GetStep()

int CSettingInt::GetStep ( ) const
inline

◆ GetTranslatableOptions()

const TranslatableIntegerSettingOptions & CSettingInt::GetTranslatableOptions ( ) const
inline

◆ GetValue()

int CSettingInt::GetValue ( ) const
inline

◆ MergeDetails()

void CSettingInt::MergeDetails ( const CSetting & other)
overridevirtual

Implements CSetting.

◆ Reset()

void CSettingInt::Reset ( )
inlineoverridevirtual

Implements CSetting.

◆ SetDefault()

void CSettingInt::SetDefault ( int value)

◆ SetMaximum()

void CSettingInt::SetMaximum ( int maximum)
inline

◆ SetMinimum()

void CSettingInt::SetMinimum ( int minimum)
inline

◆ SetOptions()

void CSettingInt::SetOptions ( const IntegerSettingOptions & options)
inline

◆ SetOptionsFiller()

void CSettingInt::SetOptionsFiller ( IntegerSettingOptionsFiller optionsFiller,
void * data = nullptr )
inline

◆ SetOptionsFillerName()

void CSettingInt::SetOptionsFillerName ( const std::string & optionsFillerName,
void * data = nullptr )
inline

◆ SetOptionsSort()

void CSettingInt::SetOptionsSort ( SettingOptionsSort optionsSort)
inline

◆ SetStep()

void CSettingInt::SetStep ( int step)
inline

◆ SetTranslatableOptions()

void CSettingInt::SetTranslatableOptions ( const TranslatableIntegerSettingOptions & options)
inline

◆ SetValue()

bool CSettingInt::SetValue ( int value)

◆ ToString()

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

Implements CSetting.

◆ UpdateDynamicOptions()

IntegerSettingOptions CSettingInt::UpdateDynamicOptions ( )

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