xbmc
Settings.h
1 /*
2  * Copyright (C) 2017-2021 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 "commons/Exception.h"
12 #include "interfaces/legacy/AddonClass.h"
13 #include "interfaces/legacy/AddonString.h"
14 #include "interfaces/legacy/Exception.h"
15 #include "interfaces/legacy/Tuple.h"
16 #include "settings/lib/SettingDefinitions.h"
17 
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
22 class CSettingsBase;
23 
24 namespace XBMCAddon
25 {
26 namespace xbmcaddon
27 {
28 
29 XBMCCOMMONS_STANDARD_EXCEPTION(SettingCallbacksNotSupportedException);
30 
31 //
51 //
52 class Settings : public AddonClass
53 {
54 public:
55 #if !defined SWIG && !defined DOXYGEN_SHOULD_SKIP_THIS
56  std::shared_ptr<CSettingsBase> settings;
57 #endif
58 
59 #ifndef SWIG
60  Settings(std::shared_ptr<CSettingsBase> settings);
61 #endif
62 
63  virtual ~Settings() = default;
64 
65 #ifdef DOXYGEN_SHOULD_USE_THIS
66  getBool(...);
86 #else
87  bool getBool(const char* id);
88 #endif
89 
90 #ifdef DOXYGEN_SHOULD_USE_THIS
91  getInt(...);
111 #else
112  int getInt(const char* id);
113 #endif
114 
115 #ifdef DOXYGEN_SHOULD_USE_THIS
116  getNumber(...);
136 #else
137  double getNumber(const char* id);
138 #endif
139 
140 #ifdef DOXYGEN_SHOULD_USE_THIS
141  getString(...);
161 #else
162  String getString(const char* id);
163 #endif
164 
165 #ifdef DOXYGEN_SHOULD_USE_THIS
166  getBoolList(...);
186 #else
187  std::vector<bool> getBoolList(const char* id);
188 #endif
189 
190 #ifdef DOXYGEN_SHOULD_USE_THIS
191  getIntList(...);
211 #else
212  std::vector<int> getIntList(const char* id);
213 #endif
214 
215 #ifdef DOXYGEN_SHOULD_USE_THIS
216  getNumberList(...);
236 #else
237  std::vector<double> getNumberList(const char* id);
238 #endif
239 
240 #ifdef DOXYGEN_SHOULD_USE_THIS
241  getStringList(...);
261 #else
262  std::vector<String> getStringList(const char* id);
263 #endif
264 
265 #ifdef DOXYGEN_SHOULD_USE_THIS
266  setBool(...);
290 #else
291  void setBool(const char* id, bool value);
292 #endif
293 
294 #ifdef DOXYGEN_SHOULD_USE_THIS
295  setInt(...);
319 #else
320  void setInt(const char* id, int value);
321 #endif
322 
323 #ifdef DOXYGEN_SHOULD_USE_THIS
324  setNumber(...);
348 #else
349  void setNumber(const char* id, double value);
350 #endif
351 
352 #ifdef DOXYGEN_SHOULD_USE_THIS
353  setString(...);
377 #else
378  void setString(const char* id, const String& value);
379 #endif
380 
381 #ifdef DOXYGEN_SHOULD_USE_THIS
382  setBoolList(...);
406 #else
407  void setBoolList(const char* id, const std::vector<bool>& values);
408 #endif
409 
410 #ifdef DOXYGEN_SHOULD_USE_THIS
411  setIntList(...);
435 #else
436  void setIntList(const char* id, const std::vector<int>& values);
437 #endif
438 
439 #ifdef DOXYGEN_SHOULD_USE_THIS
440  setNumberList(...);
464 #else
465  void setNumberList(const char* id, const std::vector<double>& values);
466 #endif
467 
468 #ifdef DOXYGEN_SHOULD_USE_THIS
469  setStringList(...);
493 #else
494  void setStringList(const char* id, const std::vector<String>& values);
495 #endif
496 };
498 
499 } // namespace xbmcaddon
500 } // namespace XBMCAddon
Definition: Settings.h:52
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: settings.py:1
Basic wrapper around CSettingsManager providing the framework for properly setting up the settings ma...
Definition: SettingsBase.h:31
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57