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 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56 #ifndef SWIG
57  std::shared_ptr<CSettingsBase> settings;
58  Settings(std::shared_ptr<CSettingsBase> settings);
59 #endif
60  virtual ~Settings() = default;
61 #endif
62 
63 #ifdef DOXYGEN_SHOULD_USE_THIS
64  getBool(...);
84 #else
85  bool getBool(const char* id);
86 #endif
87 
88 #ifdef DOXYGEN_SHOULD_USE_THIS
89  getInt(...);
109 #else
110  int getInt(const char* id);
111 #endif
112 
113 #ifdef DOXYGEN_SHOULD_USE_THIS
114  getNumber(...);
134 #else
135  double getNumber(const char* id);
136 #endif
137 
138 #ifdef DOXYGEN_SHOULD_USE_THIS
139  getString(...);
159 #else
160  String getString(const char* id);
161 #endif
162 
163 #ifdef DOXYGEN_SHOULD_USE_THIS
164  getBoolList(...);
184 #else
185  std::vector<bool> getBoolList(const char* id);
186 #endif
187 
188 #ifdef DOXYGEN_SHOULD_USE_THIS
189  getIntList(...);
209 #else
210  std::vector<int> getIntList(const char* id);
211 #endif
212 
213 #ifdef DOXYGEN_SHOULD_USE_THIS
214  getNumberList(...);
234 #else
235  std::vector<double> getNumberList(const char* id);
236 #endif
237 
238 #ifdef DOXYGEN_SHOULD_USE_THIS
239  getStringList(...);
259 #else
260  std::vector<String> getStringList(const char* id);
261 #endif
262 
263 #ifdef DOXYGEN_SHOULD_USE_THIS
264  setBool(...);
287 #else
288  void setBool(const char* id, bool value);
289 #endif
290 
291 #ifdef DOXYGEN_SHOULD_USE_THIS
292  setInt(...);
315 #else
316  void setInt(const char* id, int value);
317 #endif
318 
319 #ifdef DOXYGEN_SHOULD_USE_THIS
320  setNumber(...);
343 #else
344  void setNumber(const char* id, double value);
345 #endif
346 
347 #ifdef DOXYGEN_SHOULD_USE_THIS
348  setString(...);
371 #else
372  void setString(const char* id, const String& value);
373 #endif
374 
375 #ifdef DOXYGEN_SHOULD_USE_THIS
376  setBoolList(...);
399 #else
400  void setBoolList(const char* id, const std::vector<bool>& values);
401 #endif
402 
403 #ifdef DOXYGEN_SHOULD_USE_THIS
404  setIntList(...);
427 #else
428  void setIntList(const char* id, const std::vector<int>& values);
429 #endif
430 
431 #ifdef DOXYGEN_SHOULD_USE_THIS
432  setNumberList(...);
455 #else
456  void setNumberList(const char* id, const std::vector<double>& values);
457 #endif
458 
459 #ifdef DOXYGEN_SHOULD_USE_THIS
460  setStringList(...);
483 #else
484  void setStringList(const char* id, const std::vector<String>& values);
485 #endif
486 };
488 
489 } // namespace xbmcaddon
490 } // 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