Kodi Docs 20.0
Kodi is an open source media player and entertainment hub.
kodi Namespace Reference

Namespaces

namespace  addon
 
namespace  audioengine
 
namespace  gui
 
namespace  network
 
namespace  platform
 
namespace  tools
 
namespace  vfs
 

Classes

class  CSettingValue
 

Typedefs

using HardwareContext = ADDON_HARDWARE_CONTEXT
 

Functions

std::string ATTR_DLL_LOCAL GetKodiTypeVersion (int type)
 To get used version inside Kodi itself about asked type. More...
 
std::string ATTR_DLL_LOCAL GetAddonPath (const std::string &append="")
 To get the addon system installation folder. More...
 
std::string ATTR_DLL_LOCAL GetBaseUserPath (const std::string &append="")
 To get the user-related folder of the addon. More...
 
std::string ATTR_DLL_LOCAL GetLibPath ()
 This function gives OS associated executable binary path of the addon. More...
 
void ATTR_DLL_LOCAL Log (const AddonLog loglevel, const char *format,...)
 Add a message to Kodi's log. More...
 
bool ATTR_DLL_LOCAL IsSettingUsingDefault (const std::string &settingName)
 Check the given setting name is set to default value. More...
 
bool ATTR_DLL_LOCAL CheckSettingString (const std::string &settingName, std::string &settingValue)
 Check and get a string setting value. More...
 
std::string ATTR_DLL_LOCAL GetSettingString (const std::string &settingName, const std::string &defaultValue="")
 Get string setting value. More...
 
void ATTR_DLL_LOCAL SetSettingString (const std::string &settingName, const std::string &settingValue)
 Set string setting of addon. More...
 
bool ATTR_DLL_LOCAL CheckSettingInt (const std::string &settingName, int &settingValue)
 Check and get a integer setting value. More...
 
int ATTR_DLL_LOCAL GetSettingInt (const std::string &settingName, int defaultValue=0)
 Get integer setting value. More...
 
void ATTR_DLL_LOCAL SetSettingInt (const std::string &settingName, int settingValue)
 Set integer setting of addon. More...
 
bool ATTR_DLL_LOCAL CheckSettingBoolean (const std::string &settingName, bool &settingValue)
 Check and get a boolean setting value. More...
 
bool ATTR_DLL_LOCAL GetSettingBoolean (const std::string &settingName, bool defaultValue=false)
 Get boolean setting value. More...
 
void ATTR_DLL_LOCAL SetSettingBoolean (const std::string &settingName, bool settingValue)
 Set boolean setting of addon. More...
 
bool ATTR_DLL_LOCAL CheckSettingFloat (const std::string &settingName, float &settingValue)
 Check and get a floating point setting value. More...
 
float ATTR_DLL_LOCAL GetSettingFloat (const std::string &settingName, float defaultValue=0.0f)
 Get floating point setting value. More...
 
void ATTR_DLL_LOCAL SetSettingFloat (const std::string &settingName, float settingValue)
 Set floating point setting of addon. More...
 
template<typename enumType >
bool ATTR_DLL_LOCAL CheckSettingEnum (const std::string &settingName, enumType &settingValue)
 Check and get a enum setting value. More...
 
template<typename enumType >
enumType ATTR_DLL_LOCAL GetSettingEnum (const std::string &settingName, enumType defaultValue=static_cast< enumType >(0))
 Get enum setting value. More...
 
template<typename enumType >
void ATTR_DLL_LOCAL SetSettingEnum (const std::string &settingName, enumType settingValue)
 Set enum setting of addon. More...
 
std::string ATTR_DLL_LOCAL TranslateAddonStatus (ADDON_STATUS status)
 Get to related ADDON_STATUS a human readable text. More...
 
voidGetInterface (const std::string &name, const std::string &version)
 Returns a function table to a named interface. More...
 
std::string ATTR_DLL_LOCAL GetAddonInfo (const std::string &id)
 Returns the value of an addon property as a string. More...
 
bool ATTR_DLL_LOCAL OpenSettings ()
 Opens this Add-Ons settings dialog. More...
 
std::string ATTR_DLL_LOCAL GetLocalizedString (uint32_t labelId, const std::string &defaultStr="")
 Returns an addon's localized 'unicode string'. More...
 
bool ATTR_DLL_LOCAL UnknownToUTF8 (const std::string &stringSrc, std::string &utf8StringDst, bool failOnBadChar=false)
 Translate a string with an unknown encoding to UTF8. More...
 
std::string ATTR_DLL_LOCAL GetLanguage (LangFormats format=LANG_FMT_ENGLISH_NAME, bool region=false)
 Returns the active language as a string. More...
 
void ATTR_DLL_LOCAL QueueFormattedNotification (QueueMsg type, const char *format,...)
 Writes the C string pointed by format in the GUI. If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers. More...
 
void ATTR_DLL_LOCAL QueueNotification (QueueMsg type, const std::string &header, const std::string &message, const std::string &imageFile="", unsigned int displayTime=5000, bool withSound=true, unsigned int messageTime=1000)
 Queue a notification in the GUI. More...
 
std::string ATTR_DLL_LOCAL GetMD5 (const std::string &text)
 Get the MD5 digest of the given text. More...
 
std::string ATTR_DLL_LOCAL GetTempAddonPath (const std::string &append="")
 To get a temporary path for the addon. More...
 
std::string ATTR_DLL_LOCAL GetRegion (const std::string &id)
 Returns your regions setting as a string for the specified id. More...
 
void ATTR_DLL_LOCAL GetFreeMem (long &free, long &total, bool asBytes=false)
 Returns the amount of free memory in MByte (or as bytes) as an long integer. More...
 
int ATTR_DLL_LOCAL GetGlobalIdleTime ()
 Returns the elapsed idle time in seconds as an integer. More...
 
std::string ATTR_DLL_LOCAL GetCurrentSkinId ()
 Get the currently used skin identification name from Kodi. More...
 
bool ATTR_DLL_LOCAL IsAddonAvailable (const std::string &id, std::string &version, bool &enabled)
 To check another addon is available and usable inside Kodi. More...
 
void ATTR_DLL_LOCAL KodiVersion (kodi_version_t &version)
 Get current Kodi information and versions, returned data from the following kodi_version_t version; kodi::KodiVersion(version); is e.g.: More...
 
bool ATTR_DLL_LOCAL GetKeyboardLayout (int modifierKey, std::string &layout_name, std::vector< std::vector< std::string > > &layout)
 To get keyboard layout characters. More...
 
bool ATTR_DLL_LOCAL ChangeKeyboardLayout (std::string &layout_name)
 To change keyboard layout characters. More...
 

Function Documentation

◆ IsAddonAvailable()

bool ATTR_DLL_LOCAL kodi::IsAddonAvailable ( const std::string &  id,
std::string &  version,
bool enabled 
)
inline

To check another addon is available and usable inside Kodi.

Parameters
[in]idThe wanted addon identification string to check
[out]versionVersion string of addon if installed inside Kodi
[out]enabledSet to true true* </b> if addon is enabled @return Returns <b>true* if addon is installed

Example:

#include <kodi/General.h>
bool enabled = false;
std::string version;
bool ret = kodi::IsAddonAvailable("inputstream.adaptive", version, enabled);
fprintf(stderr, "Available inputstream.adaptive version '%s' and enabled '%s'\n",
ret ? version.c_str() : "not installed", enabled ? "yes" : "no");
bool ATTR_DLL_LOCAL IsAddonAvailable(const std::string &id, std::string &version, bool &enabled)
To check another addon is available and usable inside Kodi.
Definition: kodi-dev-kit/include/kodi/General.h:618