|
1 /* |
|
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * The API provides the P&S power state keys that are updated by the HW Resource |
|
16 * Manager Server. These keys provide up-to-date information on the charging |
|
17 * status, battery level and battery state of the device. Any application may |
|
18 * subscribe to these P&S keys that are updated to receive notifications of |
|
19 * any change in state. |
|
20 * This interface relies on the Publish and Subscribe (P&S) interface provided |
|
21 * by Symbian. P&S is used by HW Resource Manager to globally publish the power |
|
22 * state information. |
|
23 * The P&D UID is #KPSUidHWRMPowerState and following keys are provided: |
|
24 * - #KHWRMBatteryLevel |
|
25 * - #KHWRMBatteryStatus |
|
26 * - #KHWRMChargingStatus |
|
27 * |
|
28 */ |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 /** |
|
34 @file hwrmpowerstatesdkpskeys.h |
|
35 @publishedAll |
|
36 @released |
|
37 */ |
|
38 |
|
39 #ifndef HWRMPOWERSTATESDKPSKEYS_H |
|
40 #define HWRMPOWERSTATESDKPSKEYS_H |
|
41 |
|
42 #include <e32std.h> |
|
43 |
|
44 /** |
|
45 * P&S UID for all power state information keys provided by this API. |
|
46 * |
|
47 * @publishedAll |
|
48 * @released |
|
49 */ |
|
50 const TUid KPSUidHWRMPowerState = { 0x10205041 }; |
|
51 |
|
52 |
|
53 /** |
|
54 * P&S key to represent the battery level of the device. It can also be related |
|
55 * to the number of battery bars displayed. This property is updated only when |
|
56 * battery level changes. Valid values are defined by the enum EPSHWRMBatteryLevel |
|
57 * and range from -1 to 7. <br> |
|
58 * If an error has occurred or the battery level has not yet been initialized, |
|
59 * the enumeration value of #EBatteryLevelUnknown is used. In all other cases |
|
60 * the battery level is used with level 0 being the lowest (battery empty) and |
|
61 * level 7 the highest (battery full). |
|
62 * |
|
63 * @see EPSHWRMBatteryLevel |
|
64 * |
|
65 * @publishedAll |
|
66 * @released |
|
67 */ |
|
68 const TUint32 KHWRMBatteryLevel = 0x00000001; |
|
69 |
|
70 /** |
|
71 * Battery level of device. Can be related to the number of battery bars |
|
72 * displayed by the device. |
|
73 * |
|
74 * @publishedAll |
|
75 * @released |
|
76 */ |
|
77 enum EPSHWRMBatteryLevel |
|
78 { |
|
79 /** |
|
80 Uninitialized or some other error |
|
81 */ |
|
82 EBatteryLevelUnknown = -1, |
|
83 /** |
|
84 Battery level 0. The lowest battery level. |
|
85 */ |
|
86 EBatteryLevelLevel0 = 0, |
|
87 /** |
|
88 Battery level 1. |
|
89 */ |
|
90 EBatteryLevelLevel1 = 1, |
|
91 /** |
|
92 Battery level 2. |
|
93 */ |
|
94 EBatteryLevelLevel2 = 2, |
|
95 /** |
|
96 Battery level 3. |
|
97 */ |
|
98 EBatteryLevelLevel3 = 3, |
|
99 /** |
|
100 Battery level 4. |
|
101 */ |
|
102 EBatteryLevelLevel4 = 4, |
|
103 /** |
|
104 Battery level 5. |
|
105 */ |
|
106 EBatteryLevelLevel5 = 5, |
|
107 /** |
|
108 Battery level 6. |
|
109 */ |
|
110 EBatteryLevelLevel6 = 6, |
|
111 /** |
|
112 Battery level 7. The highest battery level. |
|
113 */ |
|
114 EBatteryLevelLevel7 = 7 |
|
115 }; |
|
116 |
|
117 |
|
118 /** |
|
119 * Battery status of device. |
|
120 * This property may be updated to same status as previously, to indicate |
|
121 * the note in question needs to be shown again. |
|
122 * |
|
123 * #EBatteryStatusLow update comes approximately ten times before |
|
124 * battery is completely empty and it comes at approximately |
|
125 * 10 minute intervals. If phone is in-call mode, update comes at |
|
126 * approximately 1 minute intervals. |
|
127 * |
|
128 * #EBatteryStatusEmpty comes slightly before phone must power down |
|
129 * automatically because of insufficient battery power. |
|
130 * |
|
131 * @see EPSHWRMBatteryStatus |
|
132 * |
|
133 * @publishedAll |
|
134 * @released |
|
135 */ |
|
136 const TUint32 KHWRMBatteryStatus = 0x00000002; |
|
137 |
|
138 /** |
|
139 * Battery status of device. |
|
140 * |
|
141 * @publishedAll |
|
142 * @released |
|
143 */ |
|
144 enum EPSHWRMBatteryStatus |
|
145 { |
|
146 /** |
|
147 Uninitialized or some other error |
|
148 */ |
|
149 EBatteryStatusUnknown = -1, |
|
150 /** |
|
151 This can also be used during charging |
|
152 */ |
|
153 EBatteryStatusOk = 0, |
|
154 /** |
|
155 Show note to user "Battery low" |
|
156 */ |
|
157 EBatteryStatusLow = 1, |
|
158 /** |
|
159 Show "recharge battery" note to user |
|
160 */ |
|
161 EBatteryStatusEmpty = 2 |
|
162 }; |
|
163 |
|
164 /** |
|
165 * Charging status of device. |
|
166 * This property is updated only when charging status changes. |
|
167 * |
|
168 * @see EPSHWRMChargingStatus |
|
169 * |
|
170 * @publishedAll |
|
171 * @released |
|
172 */ |
|
173 const TUint32 KHWRMChargingStatus = 0x00000003; |
|
174 |
|
175 /** |
|
176 * Charging status of device. |
|
177 * |
|
178 * @publishedAll |
|
179 * @released |
|
180 */ |
|
181 enum EPSHWRMChargingStatus |
|
182 { |
|
183 /** |
|
184 Some error has occurred when charger is connected or charging. |
|
185 */ |
|
186 EChargingStatusError = -1, |
|
187 /** |
|
188 Charger not connected/uninitialized |
|
189 */ |
|
190 EChargingStatusNotConnected = 0, |
|
191 /** |
|
192 Device is charging |
|
193 */ |
|
194 EChargingStatusCharging = 1, |
|
195 /** |
|
196 Charger is connected, device not charging |
|
197 */ |
|
198 EChargingStatusNotCharging = 2, |
|
199 /** |
|
200 Charging almost completed |
|
201 */ |
|
202 EChargingStatusAlmostComplete = 3, |
|
203 /** |
|
204 Charging completed |
|
205 */ |
|
206 EChargingStatusChargingComplete = 4, |
|
207 /** |
|
208 Charging continued after brief interruption |
|
209 */ |
|
210 EChargingStatusChargingContinued = 5 |
|
211 }; |
|
212 |
|
213 |
|
214 #endif // HWRMPOWERSTATESDKPSKEYS_H |
|
215 |
|
216 // End of File |