[video] fix selection after changing video or extra art
[xbmc.git] / xbmc / pvr / guilib / PVRGUIActionsPowerManagement.h
blobbf99819881f9d7fa3bf070b184f72be935d4eb60
1 /*
2 * Copyright (C) 2016-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 "pvr/IPVRComponent.h"
12 #include "pvr/settings/PVRSettings.h"
14 #include <memory>
16 class CFileItem;
18 namespace PVR
20 class CPVRTimerInfoTag;
22 class CPVRGUIActionsPowerManagement : public IPVRComponent
24 public:
25 CPVRGUIActionsPowerManagement();
26 ~CPVRGUIActionsPowerManagement() override = default;
28 /*!
29 * @brief Check whether the system Kodi is running on can be powered down
30 * (shutdown/reboot/suspend/hibernate) without stopping any active recordings and/or without
31 * preventing the start of recordings scheduled for now + pvrpowermanagement.backendidletime.
32 * @param bAskUser True to informs user in case of potential data loss. User can decide to allow
33 * powerdown anyway. False to not to ask user and to not confirm power down.
34 * @return True if system can be safely powered down, false otherwise.
36 bool CanSystemPowerdown(bool bAskUser = true) const;
38 private:
39 CPVRGUIActionsPowerManagement(const CPVRGUIActionsPowerManagement&) = delete;
40 CPVRGUIActionsPowerManagement const& operator=(CPVRGUIActionsPowerManagement const&) = delete;
42 bool AllLocalBackendsIdle(std::shared_ptr<CPVRTimerInfoTag>& causingEvent) const;
43 bool EventOccursOnLocalBackend(const std::shared_ptr<CPVRTimerInfoTag>& event) const;
44 bool IsNextEventWithinBackendIdleTime() const;
46 CPVRSettings m_settings;
49 namespace GUI
51 // pretty scope and name
52 using PowerManagement = CPVRGUIActionsPowerManagement;
53 } // namespace GUI
55 } // namespace PVR