Kodi Development  19.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 #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  //============================================================================
25  typedef enum StdKbButtons
26  {
38  //----------------------------------------------------------------------------
39 
40  //============================================================================
44  typedef enum QueueMsg
45  {
55  //----------------------------------------------------------------------------
56 
57  //============================================================================
63  typedef enum LangFormats
64  {
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  {
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);
124 
125 
126 #ifdef __cplusplus
127 } /* extern "C" */
128 #endif /* __cplusplus */
129 
130 #endif /* !C_API_GENERAL_H */
STD_KB_BUTTONS_MAX_ROWS
@ STD_KB_BUTTONS_MAX_ROWS
The quantity of rows on Kodi's standard keyboard.
Definition: general.h:30
QUEUE_OWN_STYLE
@ QUEUE_OWN_STYLE
Show with own given image and parts if set on values.
Definition: general.h:53
LANG_FMT_ISO_639_1
@ LANG_FMT_ISO_639_1
two letter code as defined in ISO 639-1
Definition: general.h:66
STD_KB_BUTTONS_PER_ROW
@ STD_KB_BUTTONS_PER_ROW
The quantity of buttons per row on Kodi's standard keyboard.
Definition: general.h:28
LANG_FMT_ISO_639_2
@ LANG_FMT_ISO_639_2
three letter code as defined in ISO 639-2/T or ISO 639-2/B
Definition: general.h:68
AddonKeyboardKeyTable
Definition: general.h:86
QUEUE_ERROR
@ QUEUE_ERROR
Show error notification message.
Definition: general.h:51
STD_KB_MODIFIER_KEY_SYMBOL
@ STD_KB_MODIFIER_KEY_SYMBOL
Keyboard layout type, this to show symbols.
Definition: general.h:36
QUEUE_WARNING
@ QUEUE_WARNING
Show warning notification message.
Definition: general.h:49
QUEUE_INFO
@ QUEUE_INFO
Show info notification message.
Definition: general.h:47
STD_KB_MODIFIER_KEY_SHIFT
@ STD_KB_MODIFIER_KEY_SHIFT
Keyboard layout type, this for shift controled layout (uppercase)
Definition: general.h:34
StdKbButtons
StdKbButtons
For kodi::CurrentKeyboardLayout used defines.
Definition: general.h:26
LANG_FMT_ENGLISH_NAME
@ LANG_FMT_ENGLISH_NAME
full language name in English
Definition: general.h:70
AddonToKodiFuncTable_kodi
Definition: general.h:90
STD_KB_MODIFIER_KEY_NONE
@ STD_KB_MODIFIER_KEY_NONE
Keyboard layout type, this for initial standard.
Definition: general.h:32
QueueMsg
QueueMsg
For kodi::QueueNotification() used message types.
Definition: general.h:45
LangFormats
LangFormats
Format codes to get string from them.
Definition: general.h:64