xbmc
Addon.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 #include "AddonClass.h"
12 #include "AddonString.h"
13 #include "Exception.h"
14 #include "Settings.h"
15 #include "addons/IAddon.h"
16 
17 namespace XBMCAddon
18 {
19  namespace xbmcaddon
20  {
21  XBMCCOMMONS_STANDARD_EXCEPTION(AddonException);
22 
59  class Addon : public AddonClass
60  {
61  ADDON::AddonPtr pAddon;
62 
63  String getDefaultId();
64 
65  String getAddonVersion();
66 
67  bool UpdateSettingInActiveDialog(const char* id, const String& value);
68 
69  public:
70  explicit Addon(const char* id = NULL);
71  ~Addon() override;
72 
73 #ifdef DOXYGEN_SHOULD_USE_THIS
74  getLocalizedString(...);
96 #else
97  String getLocalizedString(int id);
98 #endif
99 
100 #ifdef DOXYGEN_SHOULD_USE_THIS
101  getSettings(...);
121 #else
122  Settings* getSettings();
123 #endif
124 
125 #ifdef DOXYGEN_SHOULD_USE_THIS
126  getSetting(...);
149 #else
150  String getSetting(const char* id);
151 #endif
152 
153 #ifdef DOXYGEN_SHOULD_USE_THIS
154  getSettingBool(...);
178 #else
179  bool getSettingBool(const char* id);
180 #endif
181 
182 #ifdef DOXYGEN_SHOULD_USE_THIS
183  getSettingInt(...);
207 #else
208  int getSettingInt(const char* id);
209 #endif
210 
211 #ifdef DOXYGEN_SHOULD_USE_THIS
212  getSettingNumber(...);
236 #else
237  double getSettingNumber(const char* id);
238 #endif
239 
240 #ifdef DOXYGEN_SHOULD_USE_THIS
241  getSettingString(...);
265 #else
266  String getSettingString(const char* id);
267 #endif
268 
269 #ifdef DOXYGEN_SHOULD_USE_THIS
270  setSetting(...);
295 #else
296  void setSetting(const char* id, const String& value);
297 #endif
298 
299 #ifdef DOXYGEN_SHOULD_USE_THIS
300  setSettingBool(...);
327 #else
328  bool setSettingBool(const char* id, bool value);
329 #endif
330 
331 #ifdef DOXYGEN_SHOULD_USE_THIS
332  setSettingInt(...);
359 #else
360  bool setSettingInt(const char* id, int value);
361 #endif
362 
363 #ifdef DOXYGEN_SHOULD_USE_THIS
364  setSettingNumber(...);
391 #else
392  bool setSettingNumber(const char* id, double value);
393 #endif
394 
395 #ifdef DOXYGEN_SHOULD_USE_THIS
396  setSettingString(...);
423 #else
424  bool setSettingString(const char* id, const String& value);
425 #endif
426 
427 #ifdef DOXYGEN_SHOULD_USE_THIS
428  openSettings();
443 #else
444  void openSettings();
445 #endif
446 
447 #ifdef DOXYGEN_SHOULD_USE_THIS
448  getAddonInfo(...);
477 #else
478  String getAddonInfo(const char* id);
479 #endif
480  };
482  }
483 }
Definition: Settings.h:52
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: Addon.h:59
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57