2 * Copyright (C) 2015-2018 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.
11 #include "settings/lib/ISettingCallback.h"
20 const int AUTO_UPDATES_ON
= 0;
21 const int AUTO_UPDATES_NOTIFY
= 1;
22 const int AUTO_UPDATES_NEVER
= 2;
24 enum class AddonRepoUpdateMode
33 using AddonInfoPtr
= std::shared_ptr
<CAddonInfo
>;
36 using AddonPtr
= std::shared_ptr
<IAddon
>;
38 class CAddonSystemSettings
: public ISettingCallback
41 static CAddonSystemSettings
& GetInstance();
42 void OnSettingAction(const std::shared_ptr
<const CSetting
>& setting
) override
;
43 void OnSettingChanged(const std::shared_ptr
<const CSetting
>& setting
) override
;
45 bool GetActive(AddonType type
, AddonPtr
& addon
);
46 bool SetActive(AddonType type
, const std::string
& addonID
);
47 bool IsActive(const IAddon
& addon
);
50 * Gets Kodi addon auto update mode
52 * @return the autoupdate mode value
54 int GetAddonAutoUpdateMode() const;
58 * Gets Kodi preferred addon repository update mode
60 * @return the preferred mode value
62 AddonRepoUpdateMode
GetAddonRepoUpdateMode() const;
65 * Attempt to unset addon as active. Returns true if addon is no longer active,
66 * false if it could not be unset (e.g. if the addon is the default)
68 bool UnsetActive(const AddonInfoPtr
& addon
);
71 CAddonSystemSettings();
72 CAddonSystemSettings(const CAddonSystemSettings
&) = delete;
73 CAddonSystemSettings
& operator=(const CAddonSystemSettings
&) = delete;
74 ~CAddonSystemSettings() override
= default;
76 const std::map
<AddonType
, std::string
> m_activeSettings
;