CCAux  2.17.0.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.17.0.0", 2019-10-22
8 *
9 * (c) CrossControl 2010-2019
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 
107  EXTERN_C
108  CCAUXDLL_API
110  CCAUXDLL_CALLING_CONV
111  GetPowerMgr(void);
112 
123  EXTERN_C
124  CCAUXDLL_API
125  void
126  CCAUXDLL_CALLING_CONV
128 
141  EXTERN_C
142  CCAUXDLL_API
143  eErr
144  CCAUXDLL_CALLING_CONV
146 
159  EXTERN_C
160  CCAUXDLL_API
161  eErr
162  CCAUXDLL_CALLING_CONV
164 
178  EXTERN_C
179  CCAUXDLL_API
180  eErr
181  CCAUXDLL_CALLING_CONV
183 
195  EXTERN_C
196  CCAUXDLL_API
197  eErr
198  CCAUXDLL_CALLING_CONV
200 
213  EXTERN_C
214  CCAUXDLL_API
215  eErr
216  CCAUXDLL_CALLING_CONV
217  PowerMgr_hasResumed(POWERMGRHANDLE, bool* resumed);
218 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif /* CC_POWERMGR_H_ */
225 
226 
Definition: PowerMgr.h:79
Definition: PowerMgr.h:54
eErr
Definition: CCAuxTypes.h:159
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_setAppReadyForSuspendOrShutdown(POWERMGRHANDLE)
Definition: PowerMgr.h:67
EXTERN_C CCAUXDLL_API POWERMGRHANDLE CCAUXDLL_CALLING_CONV GetPowerMgr(void)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_hasResumed(POWERMGRHANDLE, bool *resumed)
void * POWERMGRHANDLE
Definition: PowerMgr.h:86
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_getPowerMgrStatus(POWERMGRHANDLE, PowerMgrStatus *status)
Definition: About.h:30
PowerMgrStatus
Definition: PowerMgr.h:70
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_getConfiguration(POWERMGRHANDLE, PowerMgrConf *conf)
Definition: PowerMgr.h:75
Definition: PowerMgr.h:59
Definition: PowerMgr.h:83
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_registerControlledSuspendOrShutDown(POWERMGRHANDLE, PowerMgrConf conf)
PowerMgrConf
Definition: PowerMgr.h:47
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV PowerMgr_release(POWERMGRHANDLE)