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.
11 #include "pvr/IPVRComponent.h"
12 #include "pvr/settings/PVRSettings.h"
20 class CPVRTimerInfoTag
;
22 class CPVRGUIActionsPowerManagement
: public IPVRComponent
25 CPVRGUIActionsPowerManagement();
26 ~CPVRGUIActionsPowerManagement() override
= default;
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;
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
;
51 // pretty scope and name
52 using PowerManagement
= CPVRGUIActionsPowerManagement
;