CCAux  2.8.3.0
CCAux API reference
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator
PowerMgr.h
Go to the documentation of this file.
1 /************************************************
2 *
3 * CROSSCONTROL AUX API
4 *
5 * PowerMgr.h
6 *
7 * Version 2.8.3.0, 2016-04-06
8 *
9 * (c) maximatecc 2013
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  * This framework can be used with multiple applications at the same time.
23  * Note that a shutdown initiated by the OS may not be caught by this framework.
24  * Applications may need to handle that case with a separate exit handler.
25  *
26  * Example Usage:
27  * @include powermgr_example.cpp
28  *
29  ************************************************/
30 
31 #ifndef CC_POWERMGR_H_
32 #define CC_POWERMGR_H_
33 
34 #include "CCAuxErrors.h"
35 #include "CCAuxTypes.h"
36 #include "CCPlatform.h"
37 
38 #ifdef __cplusplus
39 namespace CrossControl
40 {
41 #endif
42 
46  typedef enum PowerMgrConf
47  {
53  Normal = 0,
54 
59 
67  }
69 
70  typedef enum PowerMgrStatus
71  {
84  }
86 
87  typedef void* POWERMGRHANDLE;
88 
102  EXTERN_C
103  CCAUXDLL_API
105  CCAUXDLL_CALLING_CONV
106  GetPowerMgr(void);
107 
118  EXTERN_C
119  CCAUXDLL_API
120  void
121  CCAUXDLL_CALLING_CONV
123 
136  EXTERN_C
137  CCAUXDLL_API
138  eErr
139  CCAUXDLL_CALLING_CONV
141 
154  EXTERN_C
155  CCAUXDLL_API
156  eErr
157  CCAUXDLL_CALLING_CONV
159 
173  EXTERN_C
174  CCAUXDLL_API
175  eErr
176  CCAUXDLL_CALLING_CONV
178 
190  EXTERN_C
191  CCAUXDLL_API
192  eErr
193  CCAUXDLL_CALLING_CONV
195 
208  EXTERN_C
209  CCAUXDLL_API
210  eErr
211  CCAUXDLL_CALLING_CONV
212  PowerMgr_hasResumed(POWERMGRHANDLE, bool* resumed);
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif /* CC_POWERMGR_H_ */
219 
220