diff options
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h')
| -rw-r--r-- | xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h new file mode 100644 index 0000000..12afd02 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h | |||
| @@ -0,0 +1,130 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GENERAL_H | ||
| 12 | #define C_API_GENERAL_H | ||
| 13 | |||
| 14 | #include <stdbool.h> | ||
| 15 | |||
| 16 | #ifdef __cplusplus | ||
| 17 | extern "C" | ||
| 18 | { | ||
| 19 | #endif /* __cplusplus */ | ||
| 20 | |||
| 21 | //============================================================================ | ||
| 22 | /// \ingroup cpp_kodi_Defs | ||
| 23 | /// @brief For kodi::CurrentKeyboardLayout used defines | ||
| 24 | /// | ||
| 25 | typedef enum StdKbButtons | ||
| 26 | { | ||
| 27 | /// The quantity of buttons per row on Kodi's standard keyboard | ||
| 28 | STD_KB_BUTTONS_PER_ROW = 20, | ||
| 29 | /// The quantity of rows on Kodi's standard keyboard | ||
| 30 | STD_KB_BUTTONS_MAX_ROWS = 4, | ||
| 31 | /// Keyboard layout type, this for initial standard | ||
| 32 | STD_KB_MODIFIER_KEY_NONE = 0x00, | ||
| 33 | /// Keyboard layout type, this for shift controled layout (uppercase) | ||
| 34 | STD_KB_MODIFIER_KEY_SHIFT = 0x01, | ||
| 35 | /// Keyboard layout type, this to show symbols | ||
| 36 | STD_KB_MODIFIER_KEY_SYMBOL = 0x02 | ||
| 37 | } StdKbButtons; | ||
| 38 | //---------------------------------------------------------------------------- | ||
| 39 | |||
| 40 | //============================================================================ | ||
| 41 | /// \ingroup cpp_kodi_Defs | ||
| 42 | /// @brief For kodi::QueueNotification() used message types | ||
| 43 | /// | ||
| 44 | typedef enum QueueMsg | ||
| 45 | { | ||
| 46 | /// Show info notification message | ||
| 47 | QUEUE_INFO, | ||
| 48 | /// Show warning notification message | ||
| 49 | QUEUE_WARNING, | ||
| 50 | /// Show error notification message | ||
| 51 | QUEUE_ERROR, | ||
| 52 | /// Show with own given image and parts if set on values | ||
| 53 | QUEUE_OWN_STYLE | ||
| 54 | } QueueMsg; | ||
| 55 | //---------------------------------------------------------------------------- | ||
| 56 | |||
| 57 | //============================================================================ | ||
| 58 | /// \ingroup cpp_kodi_Defs | ||
| 59 | /// @brief Format codes to get string from them. | ||
| 60 | /// | ||
| 61 | /// Used on kodi::GetLanguage(). | ||
| 62 | /// | ||
| 63 | typedef enum LangFormats | ||
| 64 | { | ||
| 65 | /// two letter code as defined in ISO 639-1 | ||
| 66 | LANG_FMT_ISO_639_1, | ||
| 67 | /// three letter code as defined in ISO 639-2/T or ISO 639-2/B | ||
| 68 | LANG_FMT_ISO_639_2, | ||
| 69 | /// full language name in English | ||
| 70 | LANG_FMT_ENGLISH_NAME | ||
| 71 | } LangFormats; | ||
| 72 | //---------------------------------------------------------------------------- | ||
| 73 | |||
| 74 | /* | ||
| 75 | * For interface between add-on and kodi. | ||
| 76 | * | ||
| 77 | * This structure defines the addresses of functions stored inside Kodi which | ||
| 78 | * are then available for the add-on to call | ||
| 79 | * | ||
| 80 | * All function pointers there are used by the C++ interface functions below. | ||
| 81 | * You find the set of them on xbmc/addons/interfaces/General.cpp | ||
| 82 | * | ||
| 83 | * Note: For add-on development itself this is not needed | ||
| 84 | */ | ||
| 85 | typedef struct AddonKeyboardKeyTable | ||
| 86 | { | ||
| 87 | char* keys[STD_KB_BUTTONS_MAX_ROWS][STD_KB_BUTTONS_PER_ROW]; | ||
| 88 | } AddonKeyboardKeyTable; | ||
| 89 | typedef struct AddonToKodiFuncTable_kodi | ||
| 90 | { | ||
| 91 | char* (*get_addon_info)(void* kodiBase, const char* id); | ||
| 92 | bool (*open_settings_dialog)(void* kodiBase); | ||
| 93 | char* (*unknown_to_utf8)(void* kodiBase, const char* source, bool* ret, bool failOnBadChar); | ||
| 94 | char* (*get_localized_string)(void* kodiBase, long label_id); | ||
| 95 | char* (*get_language)(void* kodiBase, int format, bool region); | ||
| 96 | bool (*queue_notification)(void* kodiBase, | ||
| 97 | int type, | ||
| 98 | const char* header, | ||
| 99 | const char* message, | ||
| 100 | const char* imageFile, | ||
| 101 | unsigned int displayTime, | ||
| 102 | bool withSound, | ||
| 103 | unsigned int messageTime); | ||
| 104 | void (*get_md5)(void* kodiBase, const char* text, char* md5); | ||
| 105 | char* (*get_temp_path)(void* kodiBase); | ||
| 106 | char* (*get_region)(void* kodiBase, const char* id); | ||
| 107 | void (*get_free_mem)(void* kodiBase, long* free, long* total, bool as_bytes); | ||
| 108 | int (*get_global_idle_time)(void* kodiBase); | ||
| 109 | bool (*is_addon_avilable)(void* kodiBase, const char* id, char** version, bool* enabled); | ||
| 110 | void (*kodi_version)(void* kodiBase, | ||
| 111 | char** compile_name, | ||
| 112 | int* major, | ||
| 113 | int* minor, | ||
| 114 | char** revision, | ||
| 115 | char** tag, | ||
| 116 | char** tagversion); | ||
| 117 | char* (*get_current_skin_id)(void* kodiBase); | ||
| 118 | bool (*get_keyboard_layout)(void* kodiBase, | ||
| 119 | char** layout_name, | ||
| 120 | int modifier_key, | ||
| 121 | struct AddonKeyboardKeyTable* layout); | ||
| 122 | bool (*change_keyboard_layout)(void* kodiBase, char** layout_name); | ||
| 123 | } AddonToKodiFuncTable_kodi; | ||
| 124 | |||
| 125 | |||
| 126 | #ifdef __cplusplus | ||
| 127 | } /* extern "C" */ | ||
| 128 | #endif /* __cplusplus */ | ||
| 129 | |||
| 130 | #endif /* !C_API_GENERAL_H */ | ||
