| 1 |
/* |
| 2 |
* Copyright (C) 2012-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 "settings/lib/ISettingCallback.h" |
| 12 |
#include "utils/Observer.h" |
| 13 |
|
| 14 |
#include <string> |
| 15 |
|
| 16 |
class CSetting; |
| 17 |
class CSettings; |
| 18 |
|
| 19 |
namespace KODI |
| 20 |
{ |
| 21 |
namespace GAME |
| 22 |
{ |
| 23 |
|
| 24 |
/*! |
| 25 |
* \ingroup games |
| 26 |
*/ |
| 27 |
class CGameSettings : public ISettingCallback, public Observable |
| 28 |
{ |
| 29 |
public: |
| 30 |
CGameSettings(); |
| 31 |
~CGameSettings() override; |
| 32 |
|
| 33 |
// General settings |
| 34 |
bool GamesEnabled(); |
| 35 |
bool ShowOSDHelp(); |
| 36 |
void SetShowOSDHelp(bool bShow); |
| 37 |
void ToggleGames(); |
| 38 |
bool AutosaveEnabled(); |
| 39 |
bool RewindEnabled(); |
| 40 |
unsigned int MaxRewindTimeSec(); |
| 41 |
std::string GetRAUsername() const; |
| 42 |
std::string GetRAToken() const; |
| 43 |
|
| 44 |
// Inherited from ISettingCallback |
| 45 |
void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override; |
| 46 |
|
| 47 |
private: |
| 48 |
std::string LoginToRA(const std::string& username, |
| 49 |
const std::string& password, |
| 50 |
std::string token) const; |
| 51 |
bool IsAccountVerified(const std::string& username, const std::string& token) const; |
| 52 |
|
| 53 |
// Construction parameters |
| 54 |
std::shared_ptr<CSettings> m_settings; |
| 55 |
}; |
| 56 |
|
| 57 |
} // namespace GAME |
| 58 |
} // namespace KODI |