Kodi Docs 20.0
Kodi is an open source media player and entertainment hub.
kodi-dev-kit/include/kodi/AddonBase.h File Reference
#include "c-api/addon_base.h"
#include "versions.h"
#include <assert.h>
#include <stdarg.h>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
#include "tools/StringUtils.h"

Classes

class  kodi::CSettingValue
 
struct  kodi::addon::CPrivateBase
 Internal used structure to have stored C API data above and available for everything below. More...
 
class  kodi::addon::IAddonInstance
 
class  kodi::addon::CStructHdl< CPP_CLASS, C_STRUCT >
 
class  kodi::addon::CAddonBase
 

Namespaces

namespace  kodi
 
namespace  kodi::gui
 
namespace  kodi::addon
 

Macros

#define ADDONCREATOR(AddonClass)
 

Typedefs

using kodi::HardwareContext = ADDON_HARDWARE_CONTEXT
 

Functions

std::string ATTR_DLL_LOCAL kodi::GetKodiTypeVersion (int type)
 To get used version inside Kodi itself about asked type. More...
 
std::string ATTR_DLL_LOCAL kodi::GetAddonPath (const std::string &append="")
 To get the addon system installation folder. More...
 
std::string ATTR_DLL_LOCAL kodi::GetBaseUserPath (const std::string &append="")
 To get the user-related folder of the addon. More...
 
std::string ATTR_DLL_LOCAL kodi::GetLibPath ()
 This function gives OS associated executable binary path of the addon. More...
 
void ATTR_DLL_LOCAL kodi::Log (const AddonLog loglevel, const char *format,...)
 Add a message to Kodi's log. More...
 
bool ATTR_DLL_LOCAL kodi::IsSettingUsingDefault (const std::string &settingName)
 Check the given setting name is set to default value. More...
 
bool ATTR_DLL_LOCAL kodi::CheckSettingString (const std::string &settingName, std::string &settingValue)
 Check and get a string setting value. More...
 
std::string ATTR_DLL_LOCAL kodi::GetSettingString (const std::string &settingName, const std::string &defaultValue="")
 Get string setting value. More...
 
void ATTR_DLL_LOCAL kodi::SetSettingString (const std::string &settingName, const std::string &settingValue)
 Set string setting of addon. More...
 
bool ATTR_DLL_LOCAL kodi::CheckSettingInt (const std::string &settingName, int &settingValue)
 Check and get a integer setting value. More...
 
int ATTR_DLL_LOCAL kodi::GetSettingInt (const std::string &settingName, int defaultValue=0)
 Get integer setting value. More...
 
void ATTR_DLL_LOCAL kodi::SetSettingInt (const std::string &settingName, int settingValue)
 Set integer setting of addon. More...
 
bool ATTR_DLL_LOCAL kodi::CheckSettingBoolean (const std::string &settingName, bool &settingValue)
 Check and get a boolean setting value. More...
 
bool ATTR_DLL_LOCAL kodi::GetSettingBoolean (const std::string &settingName, bool defaultValue=false)
 Get boolean setting value. More...
 
void ATTR_DLL_LOCAL kodi::SetSettingBoolean (const std::string &settingName, bool settingValue)
 Set boolean setting of addon. More...
 
bool ATTR_DLL_LOCAL kodi::CheckSettingFloat (const std::string &settingName, float &settingValue)
 Check and get a floating point setting value. More...
 
float ATTR_DLL_LOCAL kodi::GetSettingFloat (const std::string &settingName, float defaultValue=0.0f)
 Get floating point setting value. More...
 
void ATTR_DLL_LOCAL kodi::SetSettingFloat (const std::string &settingName, float settingValue)
 Set floating point setting of addon. More...
 
template<typename enumType >
bool ATTR_DLL_LOCAL kodi::CheckSettingEnum (const std::string &settingName, enumType &settingValue)
 Check and get a enum setting value. More...
 
template<typename enumType >
enumType ATTR_DLL_LOCAL kodi::GetSettingEnum (const std::string &settingName, enumType defaultValue=static_cast< enumType >(0))
 Get enum setting value. More...
 
template<typename enumType >
void ATTR_DLL_LOCAL kodi::SetSettingEnum (const std::string &settingName, enumType settingValue)
 Set enum setting of addon. More...
 
std::string ATTR_DLL_LOCAL kodi::TranslateAddonStatus (ADDON_STATUS status)
 Get to related ADDON_STATUS a human readable text. More...
 
voidkodi::GetInterface (const std::string &name, const std::string &version)
 Returns a function table to a named interface. More...
 

Macro Definition Documentation

◆ ADDONCREATOR

#define ADDONCREATOR (   AddonClass)
Value:
extern "C" ATTR_DLL_EXPORT ADDON_STATUS ADDON_Create( \
KODI_HANDLE addonInterface, const char* /*globalApiVersion*/, void* /*unused*/) \
{ \
return static_cast<kodi::addon::CAddonBase*>( \
->Create(); \
} \
extern "C" ATTR_DLL_EXPORT const char* ADDON_GetTypeVersion(int type) \
{ \
} \
extern "C" ATTR_DLL_EXPORT const char* ADDON_GetTypeMinVersion(int type) \
{ \
} \
AddonGlobalInterface* kodi::addon::CPrivateBase::m_interface = nullptr;
#define ATTR_DLL_EXPORT
Definition: addon_base.h:80
void * KODI_HANDLE
Standard undefined pointer handle.
Definition: addon_base.h:199
Definition: kodi-dev-kit/include/kodi/AddonBase.h:332
ADDON_STATUS
Definition: addon_base.h:134
const char * GetTypeVersion(int type)
Definition: versions.h:266
const char * GetTypeMinVersion(int type)
Definition: versions.h:358
Main structure passed from kodi to addon with basic information needed to create add-on.
Definition: addon_base.h:281
KODI_HANDLE addonBase
Definition: addon_base.h:295
static AddonGlobalInterface * m_interface
Definition: kodi-dev-kit/include/kodi/AddonBase.h:182