General addon interface functions
Modules | |
Definitions, structures and enumerators | |
General definition values | |
1. Setting control | |
Functions to handle settings access This can be used to get and set the addon related values inside his settings.xml. | |
|
inline |
To get used version inside Kodi itself about asked type.
This thought to allow a addon a handling of newer addon versions within older Kodi until the type min version not changed.
[in] | type | The wanted type of ADDON_TYPE to ask |
|
inline |
To get the addon system installation folder.
[in] | append | [optional] Path to append to given string |
|
inline |
To get the user-related folder of the addon.
[in] | append | [optional] Path to append to given string |
|
inline |
This function gives OS associated executable binary path of the addon.
With some systems this can differ from the addon path at GetAddonPath.
As an example on Linux:
/usr/share/kodi/addons/YOUR_ADDON_ID
/usr/lib/kodi/addons/YOUR_ADDON_ID
|
inline |
Add a message to Kodi's log.
[in] | loglevel | The log level of the message. |
[in] | format | The format of the message to pass to Kodi. |
[in] | ... | Additional text to insert in format text |
Example:
|
inline |
Get to related ADDON_STATUS a human readable text.
[in] | status | Status value to get name for |
|
inline |
Returns a function table to a named interface.
Example:
|
inline |
Returns the value of an addon property as a string.
[in] | id | id of the property that the module needs to access
|
Example:
|
inline |
Opens this Add-Ons settings dialog.
Example:
|
inline |
Returns an addon's localized 'unicode string'.
[in] | labelId | string you want to localize |
[in] | defaultStr | [opt] The default message, also helps to identify the code that is used (default is empty ) |
Example:
|
inline |
Translate a string with an unknown encoding to UTF8.
[in] | stringSrc | The string to translate. |
[out] | utf8StringDst | The translated string. |
[in] | failOnBadChar | [opt] returns failed if bad character is inside (default is false ) |
Example:
|
inline |
Returns the active language as a string.
[in] | format | Used format of the returned language string
| ||||||||
[in] | region | [opt] append the region delimited by "-" of the language (setting) to the returned language string (default is false ) |
Example:
|
inline |
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.
After the format parameter, the function expects at least as many additional arguments as specified by format.
[in] | type | The message type.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | format | The format of the message to pass to display in Kodi. C string that contains the text to be written to the stream. It can optionally contain embedded format specifiers that are replaced by the values specified in subsequent additional arguments and formatted as requested.
|
The length sub-specifier modifies the length of the data type. This is a chart showing the types used to interpret the corresponding arguments with and without length specifier (if a different type is used, the proper type promotion or conversion is performed, if allowed):
length | d i | u o x X | f F e E g G a A | c | s | p | n |
---|---|---|---|---|---|---|---|
(none) | int | unsigned int | double | int | char* | void* | int* |
hh | signed char | unsigned char | signed char* | ||||
h | short int | unsigned short int | short int* | ||||
l | long int | unsigned long int | wint_t | wchar_t* | long int* | ||
ll | long long int | unsigned long long int | long long int* | ||||
j | intmax_t | uintmax_t | intmax_t* | ||||
z | size_t | size_t | size_t* | ||||
t | ptrdiff_t | ptrdiff_t | ptrdiff_t* | ||||
L | long double |
Note: that the c specifier takes an int (or wint_t) as argument, but performs the proper conversion to a char value (or a wchar_t) before formatting it for output.
[in] | ... | (additional arguments) Depending on the format string, the function may expect a sequence of additional arguments, each containing a value to be used to replace a format specifier in the format string (or a pointer to a storage location, for n). There should be at least as many of these arguments as the number of values specified in the format specifiers. Additional arguments are ignored by the function. |
Example:
|
inline |
Queue a notification in the GUI.
[in] | type | The message type.
| ||||||||||
[in] | header | Header Name (if leaved empty becomes addon name used) | ||||||||||
[in] | message | Message to display on Kodi | ||||||||||
[in] | imageFile | [opt] The image file to show on message (to use must be type set to QUEUE_OWN_STYLE) | ||||||||||
[in] | displayTime | [opt] The time how long message is displayed (default 5 sec) (to use must be type set to QUEUE_OWN_STYLE) | ||||||||||
[in] | withSound | [opt] if true also warning sound becomes played (default with sound) (to use must be type set to QUEUE_OWN_STYLE) | ||||||||||
[in] | messageTime | [opt] how many milli seconds start show of notification (default 1 sec) (to use must be type set to QUEUE_OWN_STYLE) |
Example:
Example:
Example:
|
inline |
Get the MD5 digest of the given text.
[in] | text | text to compute the MD5 for |
Example:
|
inline |
To get a temporary path for the addon.
This gives a temporary path which the addon can use individually for its things.
The content of this folder will be deleted when Kodi is finished!
[in] | append | A string to append to returned temporary path |
|
inline |
Returns your regions setting as a string for the specified id.
[in] | id | id of setting to return
|
Example:
|
inline |
Returns the amount of free memory in MByte (or as bytes) as an long integer.
[out] | free | free memory |
[out] | total | total memory |
[in] | asBytes | [opt] if set to true becomes returned as bytes, otherwise as mega bytes |
Example:
|
inline |
Returns the elapsed idle time in seconds as an integer.
Example:
|
inline |
Get the currently used skin identification name from Kodi.
Example:
|
inline |
Get current Kodi informations and versions, returned data from the following kodi_version_t version; kodi::KodiVersion(version);
is e.g.:
[out] | version | structure to store data from kodi |
Example:
|
inline |
To get keyboard layout characters.
This is used to get the keyboard layout currently used from Kodi by the there set language.
[in] | modifierKey | the key to define the needed layout (uppercase, symbols...) |
[out] | layout_name | name of used layout |
[out] | layout | list of selected keyboard layout |
Example:
|
inline |
To change keyboard layout characters.
This is used to change the keyboard layout currently used from Kodi
[out] | layout_name | new name of used layout (input string not used!) |
Example: