[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / addons / interfaces / AddonBase.h
blob6dcc53c46b74c36dc051f5720b181c8e981f0fa6
1 /*
2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "addons/IAddon.h"
12 #include "addons/kodi-dev-kit/include/kodi/c-api/addon_base.h"
14 extern "C"
16 namespace ADDON
19 typedef void* (*ADDON_GET_INTERFACE_FN)(const std::string& name, const std::string& version);
21 class CAddonDll;
23 /*!
24 * @brief Global general Add-on to Kodi callback functions
26 * To hold general functions not related to a instance type and usable for
27 * every add-on type.
29 * Related add-on header is "./xbmc/addons/kodi-dev-kit/include/kodi/General.h"
31 struct Interface_Base
33 static bool InitInterface(CAddonDll* addon,
34 AddonGlobalInterface& addonInterface,
35 KODI_ADDON_INSTANCE_STRUCT* firstKodiInstance);
36 static void DeInitInterface(AddonGlobalInterface& addonInterface);
37 static void RegisterInterface(ADDON_GET_INTERFACE_FN fn);
38 static bool UpdateSettingInActiveDialog(CAddonDll* addon,
39 AddonInstanceId instanceId,
40 const char* id,
41 const std::string& value);
43 static std::vector<ADDON_GET_INTERFACE_FN> s_registeredInterfaces;
45 /*!
46 * @brief callback functions from add-on to kodi
48 * @note To add a new function use the "_" style to directly identify an
49 * add-on callback function. Everything with CamelCase is only to be used
50 * in Kodi.
52 * The parameter `kodiBase` is used to become the pointer for a `CAddonDll`
53 * class.
55 //@{
56 static void addon_log_msg(const KODI_ADDON_BACKEND_HDL hdl,
57 const int addonLogLevel,
58 const char* strMessage);
59 static char* get_type_version(const KODI_ADDON_BACKEND_HDL hdl, int type);
60 static char* get_addon_path(const KODI_ADDON_BACKEND_HDL hdl);
61 static char* get_lib_path(const KODI_ADDON_BACKEND_HDL hdl);
62 static char* get_user_path(const KODI_ADDON_BACKEND_HDL hdl);
63 static char* get_temp_path(const KODI_ADDON_BACKEND_HDL hdl);
64 static char* get_localized_string(const KODI_ADDON_BACKEND_HDL hdl, long label_id);
65 static char* get_addon_info(const KODI_ADDON_BACKEND_HDL hdl, const char* id);
66 static bool open_settings_dialog(const KODI_ADDON_BACKEND_HDL hdl);
67 static bool is_setting_using_default(const KODI_ADDON_BACKEND_HDL hdl, const char* id);
68 static bool get_setting_bool(const KODI_ADDON_BACKEND_HDL hdl, const char* id, bool* value);
69 static bool get_setting_int(const KODI_ADDON_BACKEND_HDL hdl, const char* id, int* value);
70 static bool get_setting_float(const KODI_ADDON_BACKEND_HDL hdl, const char* id, float* value);
71 static bool get_setting_string(const KODI_ADDON_BACKEND_HDL hdl, const char* id, char** value);
72 static bool set_setting_bool(const KODI_ADDON_BACKEND_HDL hdl, const char* id, bool value);
73 static bool set_setting_int(const KODI_ADDON_BACKEND_HDL hdl, const char* id, int value);
74 static bool set_setting_float(const KODI_ADDON_BACKEND_HDL hdl, const char* id, float value);
75 static bool set_setting_string(const KODI_ADDON_BACKEND_HDL hdl,
76 const char* id,
77 const char* value);
78 static void free_string(const KODI_ADDON_BACKEND_HDL hdl, char* str);
79 static void free_string_array(const KODI_ADDON_BACKEND_HDL hdl, char** arr, int numElements);
80 static void* get_interface(const KODI_ADDON_BACKEND_HDL hdl,
81 const char* name,
82 const char* version);
83 //@}
86 } /* namespace ADDON */
87 } /* extern "C" */