diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h | 209 |
1 files changed, 209 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h new file mode 100644 index 0000000..a4cf963 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h | |||
| @@ -0,0 +1,209 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2017 Team KODI | ||
| 4 | * http://kodi.tv | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with KODI; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <string> | ||
| 23 | #include <time.h> | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Internal Structures to have "C"-Style data transfer | ||
| 27 | */ | ||
| 28 | extern "C" | ||
| 29 | { | ||
| 30 | |||
| 31 | typedef struct AddonToKodiFuncTable_kodi_gui_general | ||
| 32 | { | ||
| 33 | void (*lock)(); | ||
| 34 | void (*unlock)(); | ||
| 35 | int (*get_screen_height)(void* kodiBase); | ||
| 36 | int (*get_screen_width)(void* kodiBase); | ||
| 37 | int (*get_video_resolution)(void* kodiBase); | ||
| 38 | int (*get_current_window_dialog_id)(void* kodiBase); | ||
| 39 | int (*get_current_window_id)(void* kodiBase); | ||
| 40 | } AddonToKodiFuncTable_kodi_gui_general; | ||
| 41 | |||
| 42 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu | ||
| 43 | { | ||
| 44 | int (*open)(void* kodiBase, const char *heading, const char *entries[], unsigned int size); | ||
| 45 | } AddonToKodiFuncTable_kodi_gui_dialogContextMenu; | ||
| 46 | |||
| 47 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress | ||
| 48 | { | ||
| 49 | void* (*new_dialog)(void* kodiBase, const char *title); | ||
| 50 | void (*delete_dialog)(void* kodiBase, void* handle); | ||
| 51 | char* (*get_title)(void* kodiBase, void* handle); | ||
| 52 | void (*set_title)(void* kodiBase, void* handle, const char *title); | ||
| 53 | char* (*get_text)(void* kodiBase, void* handle); | ||
| 54 | void (*set_text)(void* kodiBase, void* handle, const char *text); | ||
| 55 | bool (*is_finished)(void* kodiBase, void* handle); | ||
| 56 | void (*mark_finished)(void* kodiBase, void* handle); | ||
| 57 | float (*get_percentage)(void* kodiBase, void* handle); | ||
| 58 | void (*set_percentage)(void* kodiBase, void* handle, float percentage); | ||
| 59 | void (*set_progress)(void* kodiBase, void* handle, int currentItem, int itemCount); | ||
| 60 | } AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress; | ||
| 61 | |||
| 62 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogFileBrowser | ||
| 63 | { | ||
| 64 | bool (*show_and_get_directory)(void* kodiBase, const char* shares, const char* heading, const char* path_in, char** path_out, bool writeOnly); | ||
| 65 | bool (*show_and_get_file)(void* kodiBase, const char* shares, const char* mask, const char* heading, const char* path_in, char** path_out, bool use_thumbs, bool use_file_directories); | ||
| 66 | bool (*show_and_get_file_from_dir)(void* kodiBase, const char* directory, const char* mask, const char* heading, const char* path_in, char** path_out, bool use_thumbs, bool use_file_directories, bool singleList); | ||
| 67 | bool (*show_and_get_file_list)(void* kodiBase, const char* shares, const char* mask, const char* heading, char*** file_list, unsigned int* entries, bool use_thumbs, bool use_file_directories); | ||
| 68 | bool (*show_and_get_source)(void* kodiBase, const char* path_in, char** path_out, bool allow_network_shares, const char* additional_share, const char* type); | ||
| 69 | bool (*show_and_get_image)(void* kodiBase, const char* shares, const char* heading, const char* path_in, char** path_out); | ||
| 70 | bool (*show_and_get_image_list)(void* kodiBase, const char* shares, const char* heading, char*** file_list, unsigned int* entries); | ||
| 71 | void (*clear_file_list)(void* kodiBase, char*** file_list, unsigned int entries); | ||
| 72 | } AddonToKodiFuncTable_kodi_gui_dialogFileBrowser; | ||
| 73 | |||
| 74 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogKeyboard | ||
| 75 | { | ||
| 76 | bool (*show_and_get_input_with_head)(void* kodiBase, const char* text_in, char** text_out, const char* heading, bool allow_empty_result, bool hiddenInput, unsigned int auto_close_ms); | ||
| 77 | bool (*show_and_get_input)(void* kodiBase, const char* text_in, char** text_out, bool allow_empty_result, unsigned int auto_close_ms); | ||
| 78 | bool (*show_and_get_new_password_with_head)(void* kodiBase, const char* password_in, char** password_out, const char* heading, bool allow_empty_result, unsigned int auto_close_ms); | ||
| 79 | bool (*show_and_get_new_password)(void* kodiBase, const char* password_in, char** password_out, unsigned int auto_close_ms); | ||
| 80 | bool (*show_and_verify_new_password_with_head)(void* kodiBase, char** password_out, const char* heading, bool allow_empty_result, unsigned int auto_close_ms); | ||
| 81 | bool (*show_and_verify_new_password)(void* kodiBase, char** password_out, unsigned int auto_close_ms); | ||
| 82 | int (*show_and_verify_password)(void* kodiBase, const char* password_in, char** password_out, const char* heading, int retries, unsigned int auto_close_ms); | ||
| 83 | bool (*show_and_get_filter)(void* kodiBase, const char* text_in, char** text_out, bool searching, unsigned int auto_close_ms); | ||
| 84 | bool (*send_text_to_active_keyboard)(void* kodiBase, const char* text, bool close_keyboard); | ||
| 85 | bool (*is_keyboard_activated)(void* kodiBase); | ||
| 86 | } AddonToKodiFuncTable_kodi_gui_dialogKeyboard; | ||
| 87 | |||
| 88 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogNumeric | ||
| 89 | { | ||
| 90 | bool (*show_and_verify_new_password)(void* kodiBase, char** password); | ||
| 91 | int (*show_and_verify_password)(void* kodiBase, const char* password, const char *heading, int retries); | ||
| 92 | bool (*show_and_verify_input)(void* kodiBase, const char* verify_in, char** verify_out, const char* heading, bool verify_input); | ||
| 93 | bool (*show_and_get_time)(void* kodiBase, tm *time, const char *heading); | ||
| 94 | bool (*show_and_get_date)(void* kodiBase, tm *date, const char *heading); | ||
| 95 | bool (*show_and_get_ip_address)(void* kodiBase, const char* ip_address_in, char** ip_address_out, const char *heading); | ||
| 96 | bool (*show_and_get_number)(void* kodiBase, const char* input_in, char** input_out, const char *heading, unsigned int auto_close_ms); | ||
| 97 | bool (*show_and_get_seconds)(void* kodiBase, const char* time_in, char** time_out, const char *heading); | ||
| 98 | } AddonToKodiFuncTable_kodi_gui_dialogNumeric; | ||
| 99 | |||
| 100 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogOK | ||
| 101 | { | ||
| 102 | void (*show_and_get_input_single_text)(void* kodiBase, const char *heading, const char *text); | ||
| 103 | void (*show_and_get_input_line_text)(void* kodiBase, const char *heading, const char *line0, const char *line1, const char *line2); | ||
| 104 | } AddonToKodiFuncTable_kodi_gui_dialogOK; | ||
| 105 | |||
| 106 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogProgress | ||
| 107 | { | ||
| 108 | void* (*new_dialog)(void* kodiBase); | ||
| 109 | void (*delete_dialog)(void* kodiBase, void* handle); | ||
| 110 | void (*open)(void* kodiBase, void* handle); | ||
| 111 | void (*set_heading)(void* kodiBase, void* handle, const char* heading); | ||
| 112 | void (*set_line)(void* kodiBase, void* handle, unsigned int lineNo, const char* line); | ||
| 113 | void (*set_can_cancel)(void* kodiBase, void* handle, bool canCancel); | ||
| 114 | bool (*is_canceled)(void* kodiBase, void* handle); | ||
| 115 | void (*set_percentage)(void* kodiBase, void* handle, int percentage); | ||
| 116 | int (*get_percentage)(void* kodiBase, void* handle); | ||
| 117 | void (*show_progress_bar)(void* kodiBase, void* handle, bool pnOff); | ||
| 118 | void (*set_progress_max)(void* kodiBase, void* handle, int max); | ||
| 119 | void (*set_progress_advance)(void* kodiBase, void* handle, int nSteps); | ||
| 120 | bool (*abort)(void* kodiBase, void* handle); | ||
| 121 | } AddonToKodiFuncTable_kodi_gui_dialogProgress; | ||
| 122 | |||
| 123 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogSelect | ||
| 124 | { | ||
| 125 | int (*open)(void* kodiBase, const char *heading, const char *entries[], unsigned int size, int selected, bool autoclose); | ||
| 126 | } AddonToKodiFuncTable_kodi_gui_dialogSelect; | ||
| 127 | |||
| 128 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer | ||
| 129 | { | ||
| 130 | void (*open)(void* kodiBase, const char *heading, const char *text); | ||
| 131 | } AddonToKodiFuncTable_kodi_gui_dialogTextViewer; | ||
| 132 | |||
| 133 | typedef struct AddonToKodiFuncTable_kodi_gui_dialogYesNo | ||
| 134 | { | ||
| 135 | bool (*show_and_get_input_single_text)(void* kodiBase, const char *heading, const char *text, bool *canceled, const char *noLabel, const char *yesLabel); | ||
| 136 | bool (*show_and_get_input_line_text)(void* kodiBase, const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel); | ||
| 137 | bool (*show_and_get_input_line_button_text)(void* kodiBase, const char *heading, const char *line0, const char *line1, const char *line2, bool *canceled, const char *noLabel, const char *yesLabel); | ||
| 138 | } AddonToKodiFuncTable_kodi_gui_dialogYesNo; | ||
| 139 | |||
| 140 | typedef struct AddonToKodiFuncTable_kodi_gui_listItem | ||
| 141 | { | ||
| 142 | void* (*create)(void* kodiBase, const char* label, const char* label2, const char* icon_image, const char* thumbnail_image, const char* path); | ||
| 143 | void (*destroy)(void* kodiBase, void* handle); | ||
| 144 | char* (*get_label)(void* kodiBase, void* handle); | ||
| 145 | void (*set_label)(void* kodiBase, void* handle, const char* label); | ||
| 146 | char* (*get_label2)(void* kodiBase, void* handle); | ||
| 147 | void (*set_label2)(void* kodiBase, void* handle, const char* label); | ||
| 148 | char* (*get_icon_image)(void* kodiBase, void* handle); | ||
| 149 | void (*set_icon_image)(void* kodiBase, void* handle, const char* image); | ||
| 150 | char* (*get_art)(void* kodiBase, void* handle, const char* type); | ||
| 151 | void (*set_art)(void* kodiBase, void* handle, const char* type, const char* image); | ||
| 152 | char* (*get_path)(void* kodiBase, void* handle); | ||
| 153 | void (*set_path)(void* kodiBase, void* handle, const char* path); | ||
| 154 | } AddonToKodiFuncTable_kodi_gui_listItem; | ||
| 155 | |||
| 156 | #define ADDON_MAX_CONTEXT_ENTRIES 20 | ||
| 157 | #define ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH 80 | ||
| 158 | typedef struct gui_context_menu_pair | ||
| 159 | { | ||
| 160 | unsigned int id; | ||
| 161 | char name[ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH]; | ||
| 162 | } gui_context_menu_pair; | ||
| 163 | |||
| 164 | typedef struct AddonToKodiFuncTable_kodi_gui_window | ||
| 165 | { | ||
| 166 | void* (*create)(void* kodiBase, const char* xml_filename, const char* default_skin, bool as_dialog, bool is_media); | ||
| 167 | void (*destroy)(void* kodiBase, void* handle); | ||
| 168 | void (*set_callbacks)(void* kodiBase, void* handle, void* clienthandle, | ||
| 169 | bool (*)(void* handle), | ||
| 170 | bool (*)(void* handle, int), | ||
| 171 | bool (*)(void* handle, int), | ||
| 172 | bool (*)(void* handle, int), | ||
| 173 | void (*)(void* handle, int, gui_context_menu_pair*, unsigned int*), | ||
| 174 | bool (*)(void* handle, int, unsigned int)); | ||
| 175 | bool (*show)(void* kodiBase, void* handle); | ||
| 176 | bool (*close)(void* kodiBase, void* handle); | ||
| 177 | bool (*do_modal)(void* kodiBase, void* handle); | ||
| 178 | void (*clear_item_list)(void* kodiBase, void* handle); | ||
| 179 | void (*add_list_item)(void* kodiBase, void* handle, void* item, int item_position); | ||
| 180 | void* (*get_list_item)(void* kodiBase, void* handle, int listPos); | ||
| 181 | } AddonToKodiFuncTable_kodi_gui_window; | ||
| 182 | |||
| 183 | typedef struct AddonToKodiFuncTable_kodi_gui | ||
| 184 | { | ||
| 185 | AddonToKodiFuncTable_kodi_gui_general* general; | ||
| 186 | AddonToKodiFuncTable_kodi_gui_dialogContextMenu* dialogContextMenu; | ||
| 187 | AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress* dialogExtendedProgress; | ||
| 188 | AddonToKodiFuncTable_kodi_gui_dialogFileBrowser* dialogFileBrowser; | ||
| 189 | AddonToKodiFuncTable_kodi_gui_dialogKeyboard* dialogKeyboard; | ||
| 190 | AddonToKodiFuncTable_kodi_gui_dialogNumeric* dialogNumeric; | ||
| 191 | AddonToKodiFuncTable_kodi_gui_dialogOK* dialogOK; | ||
| 192 | AddonToKodiFuncTable_kodi_gui_dialogProgress* dialogProgress; | ||
| 193 | AddonToKodiFuncTable_kodi_gui_dialogSelect* dialogSelect; | ||
| 194 | AddonToKodiFuncTable_kodi_gui_dialogTextViewer* dialogTextViewer; | ||
| 195 | AddonToKodiFuncTable_kodi_gui_dialogYesNo* dialogYesNo; | ||
| 196 | AddonToKodiFuncTable_kodi_gui_listItem* listItem; | ||
| 197 | AddonToKodiFuncTable_kodi_gui_window* window; | ||
| 198 | } AddonToKodiFuncTable_kodi_gui; | ||
| 199 | |||
| 200 | } /* extern "C" */ | ||
| 201 | |||
| 202 | //============================================================================ | ||
| 203 | /// | ||
| 204 | /// \ingroup cpp_kodi_gui_CControlRendering_Defs cpp_kodi_gui_CWindow_Defs | ||
| 205 | /// @{ | ||
| 206 | /// @brief Handle to use as independent pointer for GUI | ||
| 207 | typedef void* GUIHANDLE; | ||
| 208 | /// @} | ||
| 209 | //---------------------------------------------------------------------------- | ||
