source: filezilla/trunk/fuentes/src/interface/power_management.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 1.2 KB
Line 
1#ifndef __POWER_MANAGEMENT_H__
2#define __POWER_MANAGEMENT_H__
3
4// This simple class prevents the system from entering idle sleep
5// while FileZilla is busy
6
7#include "state.h"
8#ifdef __WXMAC__
9        // >= 10.5 Required for Power Management
10        #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
11                #include <IOKit/pwr_mgt/IOPMLib.h>
12        #endif
13#endif
14
15class CMainFrame;
16#ifdef WITH_LIBDBUS
17class CPowerManagementInhibitor;
18#endif
19
20class CPowerManagement : protected CStateEventHandler
21{
22public:
23        static void Create(CMainFrame* pMainFrame);
24        static void Destroy();
25
26        static bool IsSupported();
27protected:
28        CPowerManagement(CMainFrame* pMainFrame);
29        virtual ~CPowerManagement();
30
31        static CPowerManagement* m_pPowerManagement;
32
33        virtual void OnStateChange(CState* pState, enum t_statechange_notifications notification, const wxString& data, const void* data2);
34
35        void DoSetBusy();
36        void DoSetIdle();
37
38        bool m_busy;
39
40        CMainFrame* m_pMainFrame;
41
42#ifdef WITH_LIBDBUS
43        CPowerManagementInhibitor *m_inhibitor;
44#elif defined(__WXMAC__)
45        #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
46                // >= 10.5 Required for Power Management
47                IOPMAssertionID m_assertionID;
48        #endif
49#endif
50};
51
52#endif //__POWER_MANAGEMENT_H__
Note: See TracBrowser for help on using the repository browser.