CCAux 2.19.0.0
CCAux API reference
PowerMgr.h
Go to the documentation of this file.
1
2/*
3 * Copyright (C) 2010-2022 CrossControl AB - All rights reserved
4 *
5 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 *
7 * This source code is licensed under the proprietary CrossControl software
8 * license v 1.0.Please refer to the software license text for details or
9 * contact info@crosscontrol.com for more info.
10 *
11 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 */
13/*
14 * File description:
15 * Access functions for managing application shutdown/cleanup
16 * when suspend or shutdown events occur. An application can use this framework
17 * to delay a suspend/shutdown until it is ready with any tasks it needs to do.
18 * It is also possible to use existing OS functions to achieve the same result.
19 *
20 * Note that applications should not use these functions to delay a suspend/shutdown
21 * request for a long time (more than 20-30s depending on platform). The computer will
22 * eventually be shut down forcibly if the application does not respond.
23 *
24 * It is not recommended for multiple applications to access the PowerMgr
25 * functionality simultaneously, although it is supported on some platforms.
26 *
27 * Note that a shutdown initiated by the OS will not be caught by this framework.
28 *
29 * Example Usage:
30 * @include powermgr_example.cpp
31 *
32 ************************************************/
33
34#ifndef CC_POWERMGR_H_
35#define CC_POWERMGR_H_
36
37#include "CCAuxErrors.h"
38#include "CCAuxTypes.h"
39#include "CCPlatform.h"
40
41#ifdef __cplusplus
42namespace CrossControl
43{
44#endif
45
49typedef enum
50{
56 Normal = 0,
57
62
71
72typedef enum
73{
87
88typedef void *POWERMGRHANDLE;
89
109EXTERN_C
110CCAUXDLL_API
112CCAUXDLL_CALLING_CONV
114
125EXTERN_C
126CCAUXDLL_API
127void CCAUXDLL_CALLING_CONV PowerMgr_release(POWERMGRHANDLE);
128
141EXTERN_C
142CCAUXDLL_API
144
157EXTERN_C
158CCAUXDLL_API
160
174EXTERN_C
175CCAUXDLL_API
177
189EXTERN_C
190CCAUXDLL_API
192
206EXTERN_C
207CCAUXDLL_API
208eErr CCAUXDLL_CALLING_CONV PowerMgr_hasResumed(POWERMGRHANDLE, bool *resumed);
209
211#ifdef __cplusplus
212}
213#endif
214
215#endif /* CC_POWERMGR_H_ */
EXTERN_C CCAUXDLL_API POWERMGRHANDLE CCAUXDLL_CALLING_CONV GetPowerMgr(void)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_hasResumed(POWERMGRHANDLE, bool *resumed)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_setAppReadyForSuspendOrShutdown(POWERMGRHANDLE)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV PowerMgr_release(POWERMGRHANDLE)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV PowerMgr_getConfiguration(POWERMGRHANDLE, PowerMgrConf *conf)
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: About.h:33
PowerMgrStatus
Definition: PowerMgr.h:73
@ SuspendPending
Definition: PowerMgr.h:81
@ NoRequestsPending
Definition: PowerMgr.h:77
@ ShutdownPending
Definition: PowerMgr.h:85
void * POWERMGRHANDLE
Definition: PowerMgr.h:88
PowerMgrConf
Definition: PowerMgr.h:50
@ Normal
Definition: PowerMgr.h:56
@ BatterySuspend
Definition: PowerMgr.h:69
@ ApplicationControlled
Definition: PowerMgr.h:61
eErr
Definition: CCAuxTypes.h:162