CCAux  2.15.2.0
CCAux API reference
PowerMgr.h
Go to the documentation of this file.
1 /************************************************
2  *
3  * CROSSCONTROL AUX API
4  *
5  * PowerMgr.h
6  *
7  * Version 2.15.2.0, 2020-07-08
8  *
9  * (c) CrossControl 2010-2020
10  *
11 
12  * File description:
13  * Access functions for managing application shutdown/cleanup
14  * when suspend or shutdown events occur. An application can use this framework
15  * to delay a suspend/shutdown until it is ready with any tasks it needs to do.
16  * It is also possible to use existing OS functions to achieve the same result.
17  *
18  * Note that applications should not use these functions to delay a suspend/shutdown
19  * request for a long time (up to 20s may be okay). The computer will eventually
20  * be shut down forcibly if the application does not respond.
21  *
22  * It is not recommended for multiple applications to access the PowerMgr
23  * functionality simultaneously, although it is supported on some platforms.
24  *
25  * Note that a shutdown initiated by the OS will not be caught by this framework.
26  *
27  * Example Usage:
28  * @include powermgr_example.cpp
29  *
30  ************************************************/
31 
32 #ifndef CC_POWERMGR_H_
33 #define CC_POWERMGR_H_
34 
35 #include "CCAuxErrors.h"
36 #include "CCAuxTypes.h"
37 #include "CCPlatform.h"
38 
39 #ifdef __cplusplus
40 namespace CrossControl
41 {
42 #endif
43 
47  typedef enum
48  {
54  Normal = 0,
55 
60 
68  } PowerMgrConf;
69 
70  typedef enum
71  {
85 
86  typedef void* POWERMGRHANDLE;
87 
101  EXTERN_C
102  CCAUXDLL_API
104  CCAUXDLL_CALLING_CONV
105  GetPowerMgr(void);
106 
117  EXTERN_C
118  CCAUXDLL_API
119  void
120  CCAUXDLL_CALLING_CONV
122 
135  EXTERN_C
136  CCAUXDLL_API
137  eErr
138  CCAUXDLL_CALLING_CONV
140 
153  EXTERN_C
154  CCAUXDLL_API
155  eErr
156  CCAUXDLL_CALLING_CONV
158 
172  EXTERN_C
173  CCAUXDLL_API
174  eErr
175  CCAUXDLL_CALLING_CONV
177 
189  EXTERN_C
190  CCAUXDLL_API
191  eErr
192  CCAUXDLL_CALLING_CONV
194 
207  EXTERN_C
208  CCAUXDLL_API
209  eErr
210  CCAUXDLL_CALLING_CONV
211  PowerMgr_hasResumed(POWERMGRHANDLE, bool* resumed);
212 
213 #ifdef __cplusplus
214 }
215 #endif
216 
217 #endif /* CC_POWERMGR_H_ */
218 
219 
Definition: PowerMgr.h:79
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV PowerMgr_release(POWERMGRHANDLE)
Definition: PowerMgr.h:54
eErr
Definition: CCAuxTypes.h:159
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_getPowerMgrStatus(POWERMGRHANDLE, PowerMgrStatus *status)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_registerControlledSuspendOrShutDown(POWERMGRHANDLE, PowerMgrConf conf)
Definition: PowerMgr.h:67
void * POWERMGRHANDLE
Definition: PowerMgr.h:86
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_setAppReadyForSuspendOrShutdown(POWERMGRHANDLE)
Definition: About.h:30
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_getConfiguration(POWERMGRHANDLE, PowerMgrConf *conf)
PowerMgrStatus
Definition: PowerMgr.h:70
Definition: PowerMgr.h:75
EXTERN_C CCAUXDLL_API POWERMGRHANDLE CCAUXDLL_CALLING_CONV GetPowerMgr(void)
Definition: PowerMgr.h:59
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_hasResumed(POWERMGRHANDLE, bool *resumed)
Definition: PowerMgr.h:83
PowerMgrConf
Definition: PowerMgr.h:47