2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
21 #ifndef _POWER_MANAGER_H_
22 #define _POWER_MANAGER_H_
23 #include "IPowerSyscall.h"
25 // For systems without PowerSyscalls we have a NullObject
26 class CNullPowerSyscall : public IPowerSyscall
29 virtual bool Powerdown() { return false; }
30 virtual bool Suspend() { return false; }
31 virtual bool Hibernate() { return false; }
32 virtual bool Reboot() { return false; }
34 virtual bool CanPowerdown() { return true; }
35 virtual bool CanSuspend() { return true; }
36 virtual bool CanHibernate() { return true; }
37 virtual bool CanReboot() { return true; }
39 virtual int BatteryLevel() { return 0; }
42 virtual bool PumpPowerEvents(IPowerEventsCallback *callback) { return false; }
45 // This class will wrap and handle PowerSyscalls.
46 // It will handle and decide if syscalls are needed.
47 class CPowerManager : public IPowerEventsCallback
75 IPowerSyscall *m_instance;
78 extern CPowerManager g_powerManager;