[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / powermanagement / PowerManager.h
blob319be9dd420bdf99207e7c2671804d21f9133d04
1 /*
2 * Copyright (C) 2005-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.
7 */
9 #pragma once
11 #include "IPowerSyscall.h"
13 #include <memory>
14 #include <string>
15 #include <utility>
16 #include <vector>
18 class CFileItem;
19 class CSetting;
20 class CSettings;
22 struct IntegerSettingOption;
24 // This class will wrap and handle PowerSyscalls.
25 // It will handle and decide if syscalls are needed.
26 class CPowerManager : public IPowerEventsCallback
28 public:
29 CPowerManager();
30 ~CPowerManager() override;
32 void Initialize();
33 void SetDefaults();
35 bool Powerdown();
36 bool Suspend();
37 bool Hibernate();
38 bool Reboot();
40 bool CanPowerdown();
41 bool CanSuspend();
42 bool CanHibernate();
43 bool CanReboot();
45 int BatteryLevel();
47 void ProcessEvents();
49 static void SettingOptionsShutdownStatesFiller(const std::shared_ptr<const CSetting>& setting,
50 std::vector<IntegerSettingOption>& list,
51 int& current,
52 void* data);
54 IPowerSyscall* GetPowerSyscall() const { return m_instance.get(); }
56 private:
57 void OnSleep() override;
58 void OnWake() override;
59 void OnLowBattery() override;
60 void RestorePlayerState();
61 void StorePlayerState();
63 // Construction parameters
64 std::shared_ptr<CSettings> m_settings;
66 std::unique_ptr<IPowerSyscall> m_instance;
67 std::unique_ptr<CFileItem> m_lastPlayedFileItem;
68 std::string m_lastUsedPlayer;