Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <Addon.h>
Public Member Functions | |
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 CAddonType * | Type (AddonType type) const |
The get for given addon type information and extension data. | |
std::string | ID () const override |
std::string | Name () const override |
bool | IsInUse () 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 InfoMap & | ExtraInfo () 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< AddonInstanceId > | GetKnownInstanceIds () 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 | HasSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override |
Check whether this add-on can be configured by the user. | |
bool | HasUserSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override |
Check whether the user has configured this add-on or not. | |
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< CAddonSettings > | GetSettings (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 | OnPreInstall () override |
void | OnPostInstall (bool update, bool modal) override |
void | OnPreUnInstall () override |
void | OnPostUnInstall () override |
Public Member Functions inherited from ADDON::IAddon | |
virtual | ~IAddon ()=default |
Protected Member Functions | |
virtual bool | SettingsInitialized (AddonInstanceId id=ADDON_SETTINGS_ID) const |
Whether or not the settings have been initialized. | |
virtual bool | SettingsLoaded (AddonInstanceId id=ADDON_SETTINGS_ID) const |
Whether or not the settings have been loaded. | |
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. | |
virtual bool | SettingsFromXML (const CXBMCTinyXML &doc, bool loadDefaults, AddonInstanceId id=ADDON_SETTINGS_ID) |
Parse settings from an XML document. | |
virtual bool | SettingsToXML (CXBMCTinyXML &doc, AddonInstanceId id=ADDON_SETTINGS_ID) const |
Write settings into an XML document. | |
Protected Attributes | |
const AddonInfoPtr | m_addonInfo |
|
explicit |
|
overridedefault |
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Check whether this add-on can be configured by the user.
Implements ADDON::IAddon.
Reimplemented in KODI::GAME::CController.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Delete selected instance settings from storage.
The related instance-settings-[0-9...].xml file will be deleted by this method.
[in] | instance | Instance identifier to use. |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
get the required version of a dependency.
dependencyID | the addon ID of the dependency. |
Implements ADDON::IAddon.
|
overridevirtual |
Gives active, independently working instance identifiers for this add-on.
This function is supported if add-on type has defined AddonInstanceUse::BY_SETTINGS and the associated settings are available.
Settings Handling
Implements ADDON::IAddon.
|
inlineoverridevirtual |
retrieve the running instance of an add-on if it persists while running.
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll, and KODI::GAME::CGameClient.
|
overridevirtual |
Retrieve a particular settings value.
If a previously configured user setting is available, we return it's value, else we return the default (if available).
[in] | key | the id of the setting to retrieve |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Retrieve a particular settings value as boolean.
If a previously configured user setting is available, we return it's value, else we return the default (if available).
[in] | key | the id of the setting to retrieve |
[out] | value | the current value of the setting, or the default if the setting has yet to be configured |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Retrieve a particular settings value as integer.
If a previously configured user setting is available, we return it's value, else we return the default (if available)
[in] | key | the id of the setting to retrieve |
[out] | value | the current value of the setting, or the default if the setting has yet to be configured |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Retrieve a particular settings value as number.
If a previously configured user setting is available, we return it's value, else we return the default (if available)
[in] | key | the id of the setting to retrieve |
[out] | value | the current value of the setting, or the default if the setting has yet to be configured |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Retrieve a particular settings value as string.
If a previously configured user setting is available, we return it's value, else we return the default (if available)
[in] | key | the id of the setting to retrieve |
[out] | value | the current value of the setting, or the default if the setting has yet to be configured |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
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.
[in] | type | Type identifier to be checked |
Implements ADDON::IAddon.
|
overridevirtual |
Check whether this add-on can be configured by the user.
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
Reimplemented in ADDON::CSkinInfo.
|
protectedvirtual |
Whether there are settings to be saved.
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
To check complete addon (not only this) contains a type.
[in] | type | The to checked type identifier |
Implements ADDON::IAddon.
Reimplemented in ADDON::CPluginSource.
|
overridevirtual |
Check whether the user has configured this add-on or not.
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
Reimplemented in ADDON::CSkinInfo.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Return the used instance path type of the add-on type.
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
inlineoverridevirtual |
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll, ADDON::CLanguageResource, ADDON::CScraper, ADDON::CSkinInfo, and ADDON::CUISoundsResource.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll, and KODI::GAME::CGameClient.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
protected |
Load the default settings and override these with any previously configured user settings.
[in] | bForce | force the load of settings even if they are already loaded (reload) |
[in] | loadUserSettings | whether or not to load user settings |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
|
protectedvirtual |
Load the user settings.
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
|
overridevirtual |
To get the main type of this addon.
This is the first type defined in addon.xml and can be different to the on Type() defined type.
Implements ADDON::IAddon.
|
overridevirtual |
return whether or not this addon satisfies the given version requirements
version | the version to meet. |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll, ADDON::CFontResource, ADDON::CLanguageResource, ADDON::CSkinInfo, and ADDON::CUISoundsResource.
|
inlineoverridevirtual |
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll.
|
inlineoverridevirtual |
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll, and ADDON::CSkinInfo.
|
inlineoverridevirtual |
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll, and ADDON::CImageResource.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Save any user configured settings.
[in] | instance | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
Reimplemented in ADDON::CAddonDll.
|
overridevirtual |
Implements ADDON::IAddon.
|
protectedvirtual |
Parse settings from an XML document.
[in] | doc | XML document to parse for settings |
[in] | loadDefaults | if true, the default attribute is used and settings are reset prior to parsing, else the value attribute is used. |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Reimplemented in ADDON::CSkinInfo.
|
protectedvirtual |
Whether or not the settings have been initialized.
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
|
protectedvirtual |
Whether or not the settings have been loaded.
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Reimplemented in ADDON::CSkinInfo.
|
protectedvirtual |
Write settings into an XML document.
[out] | doc | XML document to receive the settings |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Reimplemented in ADDON::CSkinInfo.
|
overridevirtual |
Implements ADDON::IAddon.
|
overridevirtual |
Check whether the add-on supports individual settings per add-on instance.
This function is supported if add-on type has defined AddonInstanceUse::BY_SETTINGS
Implements ADDON::IAddon.
|
overridevirtual |
Check add-on for support from independent work instances.
Implements ADDON::IAddon.
|
inlineoverridevirtual |
To get the on this CAddon class processed addon type.
Implements ADDON::IAddon.
const CAddonType * ADDON::CAddon::Type | ( | AddonType | type | ) | const |
The get for given addon type information and extension data.
[in] | type | The wanted type data |
Example:
|
overridevirtual |
Update a user-configured setting with a new value.
[in] | key | the id of the setting to update |
[in] | value | the value that the setting should take |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Update a user-configured setting with a new boolean value.
[in] | key | the id of the setting to update |
[in] | value | the value that the setting should take |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Update a user-configured setting with a new integer value.
[in] | key | the id of the setting to update |
[in] | value | the value that the setting should take |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Update a user-configured setting with a new number value.
[in] | key | the id of the setting to update |
[in] | value | the value that the setting should take |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Update a user-configured setting with a new string value.
[in] | key | the id of the setting to update |
[in] | value | the value that the setting should take |
[in] | id | Instance identifier to use, use ADDON_SETTINGS_ID to denote global add-on settings from settings.xml. |
Implements ADDON::IAddon.
|
overridevirtual |
Implements ADDON::IAddon.
|
protected |