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

#include <Skin.h>

Inheritance diagram for ADDON::CSkinInfo:
ADDON::CAddon ADDON::IAddon

Classes

class  CStartupWindow
 

Public Member Functions

 CSkinInfo (const AddonInfoPtr &addonInfo)
 
 CSkinInfo (const AddonInfoPtr &addonInfo, const RESOLUTION_INFO &resolution)
 
 CSkinInfo (const AddonInfoPtr &addonInfo, const RESOLUTION_INFO &resolution, const std::vector< RESOLUTION_INFO > &resolutions, float effectsSlowDown, bool debugging)
 
 ~CSkinInfo () override
 
void Start ()
 Load resolution information from directories in Path().
 
bool HasSkinFile (const std::string &strFile) const
 
std::string GetSkinPath (const std::string &file, RESOLUTION_INFO *res=nullptr, const std::string &baseDir="") const
 Get the full path to the specified file in the skin We search for XML files in the skin folder that best matches the current resolution.
 
bool IsDebugging () const
 Return whether skin debugging is enabled.
 
int GetFirstWindow () const
 Get the id of the first window to load The first window is generally Startup.xml unless it doesn't exist or if the skinner has specified which start windows they support and the user is going to somewhere other than the home screen.
 
int GetStartWindow () const
 Get the id of the window the user wants to start in after any skin animation.
 
void ResolveIncludes (TiXmlElement *node, std::map< INFO::InfoPtr, bool > *xmlIncludeConditions=nullptr)
 
float GetEffectsSlowdown () const
 
const std::vector< CStartupWindow > & GetStartupWindows () const
 
void GetSkinPaths (std::vector< std::string > &paths) const
 Retrieve the skin paths to search for skin XML files.
 
bool IsInUse () const override
 
const std::string & GetCurrentAspect () const
 
void LoadIncludes ()
 
void LoadTimers ()
 Load the defined skin timers.
 
void ProcessTimers ()
 Starts evaluating timers.
 
void Unload ()
 Called when unloading a skin, allows to cleanup specific skin resources.
 
void ToggleDebug ()
 
const INFO::CSkinVariableStringCreateSkinVariable (const std::string &name, int context)
 
bool HasSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 Don't handle skin settings like normal addon settings.
 
bool HasUserSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 Check whether the user has configured this add-on or not.
 
int TranslateString (const std::string &setting)
 
const std::string & GetString (int setting) const
 
void SetString (int setting, const std::string &label)
 
int TranslateBool (const std::string &setting)
 
bool GetBool (int setting) const
 
void SetBool (int setting, bool set)
 
int GetInt (int setting) const
 Get the skin setting value as an integer value.
 
std::set< CSkinSettingPtrGetSkinSettings () const
 
CSkinSettingPtr GetSkinSetting (const std::string &settingId)
 
std::shared_ptr< const CSkinSettingGetSkinSetting (const std::string &settingId) const
 
void Reset (const std::string &setting)
 
void Reset ()
 
void OnPreInstall () override
 
void OnPostInstall (bool update, bool modal) override
 
bool TimerIsRunning (const std::string &timer) const
 Checks if the timer with name timer is running.
 
float GetTimerElapsedSeconds (const std::string &timer) const
 Get the elapsed seconds since the timer with name timer was started.
 
void TimerStart (const std::string &timer) const
 Starts/Enables a given skin timer.
 
void TimerStop (const std::string &timer) const
 Stops/Disables a given skin timer.
 
- Public Member Functions inherited from ADDON::CAddon
 CAddon (const AddonInfoPtr &addonInfo, AddonType addonType)
 
 ~CAddon () override=default
 
AddonType MainType () const override
 To get the main type of this addon.
 
AddonType Type () const override
 To get the on this CAddon class processed addon type.
 
bool HasType (AddonType type) const override
 To check complete addon (not only this) contains a type.
 
bool HasMainType (AddonType type) const override
 To check complete addon (not only this) has a specific type defined in its first extension point including the provided subcontent e.g. video or audio.
 
const CAddonTypeType (AddonType type) const
 The get for given addon type information and extension data.
 
std::string ID () const override
 
std::string Name () const override
 
bool IsBinary () const override
 
CAddonVersion Version () const override
 
CAddonVersion MinVersion () const override
 
std::string Summary () const override
 
std::string Description () const override
 
std::string Path () const override
 
std::string Profile () const override
 
std::string LibPath () const override
 
std::string Author () const override
 
std::string ChangeLog () const override
 
std::string Icon () const override
 
ArtMap Art () const override
 
std::vector< std::string > Screenshots () const override
 
std::string Disclaimer () const override
 
AddonLifecycleState LifecycleState () const override
 
std::string LifecycleStateDescription () const override
 
CDateTime InstallDate () const override
 
CDateTime LastUpdated () const override
 
CDateTime LastUsed () const override
 
std::string Origin () const override
 
std::string OriginName () const override
 
uint64_t PackageSize () const override
 
const InfoMapExtraInfo () const override
 
const std::vector< DependencyInfo > & GetDependencies () const override
 
std::string FanArt () const override
 
bool SupportsMultipleInstances () const override
 Check add-on for support from independent work instances.
 
AddonInstanceSupport InstanceUseType () const override
 Return the used instance path type of the add-on type.
 
std::vector< AddonInstanceIdGetKnownInstanceIds () const override
 Gives active, independently working instance identifiers for this add-on.
 
bool SupportsInstanceSettings () const override
 Check whether the add-on supports individual settings per add-on instance.
 
bool DeleteInstanceSettings (AddonInstanceId instance) override
 Delete selected instance settings from storage.
 
bool CanHaveAddonOrInstanceSettings () override
 Check whether this add-on can be configured by the user.
 
bool SaveSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 Save any user configured settings.
 
void UpdateSetting (const std::string &key, const std::string &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new value.
 
bool UpdateSettingBool (const std::string &key, bool value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new boolean value.
 
bool UpdateSettingInt (const std::string &key, int value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new integer value.
 
bool UpdateSettingNumber (const std::string &key, double value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new number value.
 
bool UpdateSettingString (const std::string &key, const std::string &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new string value.
 
std::string GetSetting (const std::string &key, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value.
 
bool GetSettingBool (const std::string &key, bool &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as boolean.
 
bool GetSettingInt (const std::string &key, int &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as integer.
 
bool GetSettingNumber (const std::string &key, double &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as number.
 
bool GetSettingString (const std::string &key, std::string &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as string.
 
std::shared_ptr< CAddonSettingsGetSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 
CAddonVersion GetDependencyVersion (const std::string &dependencyID) const override
 get the required version of a dependency.
 
bool MeetsVersion (const CAddonVersion &versionMin, const CAddonVersion &version) const override
 return whether or not this addon satisfies the given version requirements
 
bool ReloadSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 
void ResetSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 
AddonPtr GetRunningInstance () const override
 retrieve the running instance of an add-on if it persists while running.
 
void OnPreUnInstall () override
 
void OnPostUnInstall () override
 
- Public Member Functions inherited from ADDON::IAddon
virtual ~IAddon ()=default
 

Static Public Member Functions

static bool TranslateResolution (const std::string &name, RESOLUTION_INFO &res)
 Translate a resolution string.
 
static void SettingOptionsSkinColorsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string &current, void *data)
 
static void SettingOptionsSkinFontsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string &current, void *data)
 
static void SettingOptionsSkinThemesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string &current, void *data)
 
static void SettingOptionsStartupWindowsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int &current, void *data)
 
static std::set< CSkinSettingPtrParseSettings (const TiXmlElement *rootElement)
 

Protected Member Functions

bool LoadStartupWindows (const AddonInfoPtr &addonInfo)
 
bool SettingsLoaded (AddonInstanceId id=ADDON_SETTINGS_ID) const override
 Whether or not the settings have been loaded.
 
bool SettingsFromXML (const CXBMCTinyXML &doc, bool loadDefaults, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Parse settings from an XML document.
 
bool SettingsToXML (CXBMCTinyXML &doc, AddonInstanceId id=ADDON_SETTINGS_ID) const override
 Write settings into an XML document.
 
- Protected Member Functions inherited from ADDON::CAddon
virtual bool SettingsInitialized (AddonInstanceId id=ADDON_SETTINGS_ID) const
 Whether or not the settings have been initialized.
 
bool LoadSettings (bool bForce, bool loadUserSettings, AddonInstanceId id=ADDON_SETTINGS_ID)
 Load the default settings and override these with any previously configured user settings.
 
virtual bool LoadUserSettings (AddonInstanceId id=ADDON_SETTINGS_ID)
 Load the user settings.
 
virtual bool HasSettingsToSave (AddonInstanceId id=ADDON_SETTINGS_ID) const
 Whether there are settings to be saved.
 

Static Protected Member Functions

static CSkinSettingPtr ParseSetting (const TiXmlElement *element)
 

Protected Attributes

RESOLUTION_INFO m_defaultRes
 
std::vector< RESOLUTION_INFOm_resolutions
 
float m_effectsSlowDown
 
CGUIIncludes m_includes
 
std::string m_currentAspect
 
std::vector< CStartupWindowm_startupWindows
 
bool m_debugging
 
std::unique_ptr< CSkinTimerManagerm_skinTimerManager
 
- Protected Attributes inherited from ADDON::CAddon
const AddonInfoPtr m_addonInfo
 

Constructor & Destructor Documentation

◆ CSkinInfo() [1/3]

ADDON::CSkinInfo::CSkinInfo ( const AddonInfoPtr & addonInfo)
explicit

◆ CSkinInfo() [2/3]

ADDON::CSkinInfo::CSkinInfo ( const AddonInfoPtr & addonInfo,
const RESOLUTION_INFO & resolution )
explicit

◆ CSkinInfo() [3/3]

ADDON::CSkinInfo::CSkinInfo ( const AddonInfoPtr & addonInfo,
const RESOLUTION_INFO & resolution,
const std::vector< RESOLUTION_INFO > & resolutions,
float effectsSlowDown,
bool debugging )

◆ ~CSkinInfo()

ADDON::CSkinInfo::~CSkinInfo ( )
overridedefault

Member Function Documentation

◆ CreateSkinVariable()

const INFO::CSkinVariableString * ADDON::CSkinInfo::CreateSkinVariable ( const std::string & name,
int context )

◆ GetBool()

bool ADDON::CSkinInfo::GetBool ( int setting) const

◆ GetCurrentAspect()

const std::string & ADDON::CSkinInfo::GetCurrentAspect ( ) const
inline

◆ GetEffectsSlowdown()

float ADDON::CSkinInfo::GetEffectsSlowdown ( ) const
inline

◆ GetFirstWindow()

int ADDON::CSkinInfo::GetFirstWindow ( ) const

Get the id of the first window to load The first window is generally Startup.xml unless it doesn't exist or if the skinner has specified which start windows they support and the user is going to somewhere other than the home screen.

Returns
id of the first window to load

◆ GetInt()

int ADDON::CSkinInfo::GetInt ( int setting) const

Get the skin setting value as an integer value.

Parameters
setting- the setting id
Returns
the setting value as an integer, -1 if no conversion is possible

◆ GetSkinPath()

std::string ADDON::CSkinInfo::GetSkinPath ( const std::string & file,
RESOLUTION_INFO * res = nullptr,
const std::string & baseDir = "" ) const

Get the full path to the specified file in the skin We search for XML files in the skin folder that best matches the current resolution.

Parameters
fileXML file to look for
res[out] If non-NULL, the resolution that the returned XML file is in is returned. Defaults to NULL.
baseDir[in] If non-empty, the given directory is searched instead of the skin's directory. Defaults to empty.
Returns
path to the XML file

◆ GetSkinPaths()

void ADDON::CSkinInfo::GetSkinPaths ( std::vector< std::string > & paths) const

Retrieve the skin paths to search for skin XML files.

Parameters
paths[out] vector of paths to search, in order.

◆ GetSkinSetting() [1/2]

CSkinSettingPtr ADDON::CSkinInfo::GetSkinSetting ( const std::string & settingId)

◆ GetSkinSetting() [2/2]

std::shared_ptr< const CSkinSetting > ADDON::CSkinInfo::GetSkinSetting ( const std::string & settingId) const

◆ GetSkinSettings()

std::set< CSkinSettingPtr > ADDON::CSkinInfo::GetSkinSettings ( ) const

◆ GetStartupWindows()

const std::vector< CStartupWindow > & ADDON::CSkinInfo::GetStartupWindows ( ) const
inline

◆ GetStartWindow()

int ADDON::CSkinInfo::GetStartWindow ( ) const

Get the id of the window the user wants to start in after any skin animation.

Returns
id of the start window

◆ GetString()

const std::string & ADDON::CSkinInfo::GetString ( int setting) const

◆ GetTimerElapsedSeconds()

float ADDON::CSkinInfo::GetTimerElapsedSeconds ( const std::string & timer) const

Get the elapsed seconds since the timer with name timer was started.

Parameters
timerthe name of the skin timer
Returns
the elapsed time in seconds the given timer is running (0 if not running or if it does not exist)

◆ HasSettings()

bool ADDON::CSkinInfo::HasSettings ( AddonInstanceId id = ADDON_SETTINGS_ID)
inlineoverridevirtual

Don't handle skin settings like normal addon settings.

Reimplemented from ADDON::CAddon.

◆ HasSkinFile()

bool ADDON::CSkinInfo::HasSkinFile ( const std::string & strFile) const

◆ HasUserSettings()

bool ADDON::CSkinInfo::HasUserSettings ( AddonInstanceId id = ADDON_SETTINGS_ID)
inlineoverridevirtual

Check whether the user has configured this add-on or not.

Parameters
[in]idInstance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml.
Returns
true if previously saved settings are found, false otherwise
See also
LoadSettings, LoadUserSettings, SaveSettings, HasSettings, GetSetting, UpdateSetting

Reimplemented from ADDON::CAddon.

◆ IsDebugging()

bool ADDON::CSkinInfo::IsDebugging ( ) const
inline

Return whether skin debugging is enabled.

Returns
true if skin debugging (set via <debugging>true</debugging> in addon.xml) is enabled.

◆ IsInUse()

bool ADDON::CSkinInfo::IsInUse ( ) const
overridevirtual

Reimplemented from ADDON::CAddon.

◆ LoadIncludes()

void ADDON::CSkinInfo::LoadIncludes ( )

◆ LoadStartupWindows()

bool ADDON::CSkinInfo::LoadStartupWindows ( const AddonInfoPtr & addonInfo)
protected

◆ LoadTimers()

void ADDON::CSkinInfo::LoadTimers ( )

Load the defined skin timers.

Skin timers are defined in Timers.xml

See also
Skin_Timers

◆ OnPostInstall()

void ADDON::CSkinInfo::OnPostInstall ( bool update,
bool modal )
overridevirtual

Reimplemented from ADDON::CAddon.

◆ OnPreInstall()

void ADDON::CSkinInfo::OnPreInstall ( )
overridevirtual

Reimplemented from ADDON::CAddon.

◆ ParseSetting()

CSkinSettingPtr ADDON::CSkinInfo::ParseSetting ( const TiXmlElement * element)
staticprotected

◆ ParseSettings()

std::set< CSkinSettingPtr > ADDON::CSkinInfo::ParseSettings ( const TiXmlElement * rootElement)
static

◆ ProcessTimers()

void ADDON::CSkinInfo::ProcessTimers ( )

Starts evaluating timers.

◆ Reset() [1/2]

void ADDON::CSkinInfo::Reset ( )

◆ Reset() [2/2]

void ADDON::CSkinInfo::Reset ( const std::string & setting)

◆ ResolveIncludes()

void ADDON::CSkinInfo::ResolveIncludes ( TiXmlElement * node,
std::map< INFO::InfoPtr, bool > * xmlIncludeConditions = nullptr )

◆ SetBool()

void ADDON::CSkinInfo::SetBool ( int setting,
bool set )

◆ SetString()

void ADDON::CSkinInfo::SetString ( int setting,
const std::string & label )

◆ SettingOptionsSkinColorsFiller()

void ADDON::CSkinInfo::SettingOptionsSkinColorsFiller ( const std::shared_ptr< const CSetting > & setting,
std::vector< StringSettingOption > & list,
std::string & current,
void * data )
static

◆ SettingOptionsSkinFontsFiller()

void ADDON::CSkinInfo::SettingOptionsSkinFontsFiller ( const std::shared_ptr< const CSetting > & setting,
std::vector< StringSettingOption > & list,
std::string & current,
void * data )
static

◆ SettingOptionsSkinThemesFiller()

void ADDON::CSkinInfo::SettingOptionsSkinThemesFiller ( const std::shared_ptr< const CSetting > & setting,
std::vector< StringSettingOption > & list,
std::string & current,
void * data )
static

◆ SettingOptionsStartupWindowsFiller()

void ADDON::CSkinInfo::SettingOptionsStartupWindowsFiller ( const std::shared_ptr< const CSetting > & setting,
std::vector< IntegerSettingOption > & list,
int & current,
void * data )
static

◆ SettingsFromXML()

bool ADDON::CSkinInfo::SettingsFromXML ( const CXBMCTinyXML & doc,
bool loadDefaults,
AddonInstanceId id = ADDON_SETTINGS_ID )
overrideprotectedvirtual

Parse settings from an XML document.

Parameters
[in]docXML document to parse for settings
[in]loadDefaultsif true, the default attribute is used and settings are reset prior to parsing, else the value attribute is used.
[in]idInstance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml.
Returns
true if settings are loaded, false otherwise
See also
SettingsToXML

Reimplemented from ADDON::CAddon.

◆ SettingsLoaded()

bool ADDON::CSkinInfo::SettingsLoaded ( AddonInstanceId id = ADDON_SETTINGS_ID) const
overrideprotectedvirtual

Whether or not the settings have been loaded.

Parameters
[in]idInstance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml.
Returns
true if settings are loaded correct

Reimplemented from ADDON::CAddon.

◆ SettingsToXML()

bool ADDON::CSkinInfo::SettingsToXML ( CXBMCTinyXML & doc,
AddonInstanceId id = ADDON_SETTINGS_ID ) const
overrideprotectedvirtual

Write settings into an XML document.

Parameters
[out]docXML document to receive the settings
[in]idInstance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml.
Returns
true if settings are saved, false otherwise
See also
SettingsFromXML

Reimplemented from ADDON::CAddon.

◆ Start()

void ADDON::CSkinInfo::Start ( )

Load resolution information from directories in Path().

◆ TimerIsRunning()

bool ADDON::CSkinInfo::TimerIsRunning ( const std::string & timer) const

Checks if the timer with name timer is running.

Parameters
timerthe name of the skin timer
Returns
true if the given timer exists and is running, false otherwise

◆ TimerStart()

void ADDON::CSkinInfo::TimerStart ( const std::string & timer) const

Starts/Enables a given skin timer.

Parameters
timerthe name of the skin timer

◆ TimerStop()

void ADDON::CSkinInfo::TimerStop ( const std::string & timer) const

Stops/Disables a given skin timer.

Parameters
timerthe name of the skin timer

◆ ToggleDebug()

void ADDON::CSkinInfo::ToggleDebug ( )

◆ TranslateBool()

int ADDON::CSkinInfo::TranslateBool ( const std::string & setting)

◆ TranslateResolution()

bool ADDON::CSkinInfo::TranslateResolution ( const std::string & name,
RESOLUTION_INFO & res )
static

Translate a resolution string.

Parameters
namethe string to translate
res[out] the resolution structure if name is valid
Returns
true if the resolution is valid, false otherwise

◆ TranslateString()

int ADDON::CSkinInfo::TranslateString ( const std::string & setting)

◆ Unload()

void ADDON::CSkinInfo::Unload ( )

Called when unloading a skin, allows to cleanup specific skin resources.

Member Data Documentation

◆ m_currentAspect

std::string ADDON::CSkinInfo::m_currentAspect
protected

◆ m_debugging

bool ADDON::CSkinInfo::m_debugging
protected

◆ m_defaultRes

RESOLUTION_INFO ADDON::CSkinInfo::m_defaultRes
protected

◆ m_effectsSlowDown

float ADDON::CSkinInfo::m_effectsSlowDown
protected

◆ m_includes

CGUIIncludes ADDON::CSkinInfo::m_includes
protected

◆ m_resolutions

std::vector<RESOLUTION_INFO> ADDON::CSkinInfo::m_resolutions
protected

◆ m_skinTimerManager

std::unique_ptr<CSkinTimerManager> ADDON::CSkinInfo::m_skinTimerManager
protected

Manager/Owner of skin timers

◆ m_startupWindows

std::vector<CStartupWindow> ADDON::CSkinInfo::m_startupWindows
protected

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