Kodi Development  20.0
for Binary and Script based Add-Ons
general.h
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 #ifndef C_API_GENERAL_H
10 #define C_API_GENERAL_H
11 
12 #include <stdbool.h>
13 
14 #ifdef __cplusplus
15 extern "C"
16 {
17 #endif /* __cplusplus */
18 
19  //============================================================================
23  typedef enum StdKbButtons
24  {
36  //----------------------------------------------------------------------------
37 
38  //============================================================================
42  typedef enum QueueMsg
43  {
53  //----------------------------------------------------------------------------
54 
55  //============================================================================
61  typedef enum LangFormats
62  {
70  //----------------------------------------------------------------------------
71 
72  /*
73  * For interface between add-on and kodi.
74  *
75  * This structure defines the addresses of functions stored inside Kodi which
76  * are then available for the add-on to call
77  *
78  * All function pointers there are used by the C++ interface functions below.
79  * You find the set of them on xbmc/addons/interfaces/General.cpp
80  *
81  * Note: For add-on development itself this is not needed
82  */
83  typedef struct AddonKeyboardKeyTable
84  {
88  {
89  char* (*get_addon_info)(void* kodiBase, const char* id);
90  bool (*open_settings_dialog)(void* kodiBase);
91  char* (*unknown_to_utf8)(void* kodiBase, const char* source, bool* ret, bool failOnBadChar);
92  char* (*get_localized_string)(void* kodiBase, long label_id);
93  char* (*get_language)(void* kodiBase, int format, bool region);
94  bool (*queue_notification)(void* kodiBase,
95  int type,
96  const char* header,
97  const char* message,
98  const char* imageFile,
99  unsigned int displayTime,
100  bool withSound,
101  unsigned int messageTime);
102  void (*get_md5)(void* kodiBase, const char* text, char* md5);
103  char* (*get_temp_path)(void* kodiBase);
104  char* (*get_region)(void* kodiBase, const char* id);
105  void (*get_free_mem)(void* kodiBase, long* free, long* total, bool as_bytes);
106  int (*get_global_idle_time)(void* kodiBase);
107  bool (*is_addon_avilable)(void* kodiBase, const char* id, char** version, bool* enabled);
108  void (*kodi_version)(void* kodiBase,
109  char** compile_name,
110  int* major,
111  int* minor,
112  char** revision,
113  char** tag,
114  char** tagversion);
115  char* (*get_current_skin_id)(void* kodiBase);
116  bool (*get_keyboard_layout)(void* kodiBase,
117  char** layout_name,
118  int modifier_key,
119  struct AddonKeyboardKeyTable* layout);
120  bool (*change_keyboard_layout)(void* kodiBase, char** layout_name);
122 
123 
124 #ifdef __cplusplus
125 } /* extern "C" */
126 #endif /* __cplusplus */
127 
128 #endif /* !C_API_GENERAL_H */
LangFormats
Format codes to get string from them.
Definition: general.h:62
QueueMsg
For kodi::QueueNotification() used message types.
Definition: general.h:43
StdKbButtons
For kodi::CurrentKeyboardLayout used defines.
Definition: general.h:24
@ LANG_FMT_ISO_639_1
two letter code as defined in ISO 639-1
Definition: general.h:64
@ LANG_FMT_ENGLISH_NAME
full language name in English
Definition: general.h:68
@ LANG_FMT_ISO_639_2
three letter code as defined in ISO 639-2/T or ISO 639-2/B
Definition: general.h:66
@ QUEUE_WARNING
Show warning notification message.
Definition: general.h:47
@ QUEUE_INFO
Show info notification message.
Definition: general.h:45
@ QUEUE_OWN_STYLE
Show with own given image and parts if set on values.
Definition: general.h:51
@ QUEUE_ERROR
Show error notification message.
Definition: general.h:49
@ STD_KB_BUTTONS_PER_ROW
The quantity of buttons per row on Kodi's standard keyboard.
Definition: general.h:26
@ STD_KB_BUTTONS_MAX_ROWS
The quantity of rows on Kodi's standard keyboard.
Definition: general.h:28
@ STD_KB_MODIFIER_KEY_NONE
Keyboard layout type, this for initial standard.
Definition: general.h:30
@ STD_KB_MODIFIER_KEY_SHIFT
Keyboard layout type, this for shift controled layout (uppercase)
Definition: general.h:32
@ STD_KB_MODIFIER_KEY_SYMBOL
Keyboard layout type, this to show symbols.
Definition: general.h:34
Definition: general.h:84
Definition: general.h:88