15 |
15 |
16 #ifndef __ASSHDALARM_H__ |
16 #ifndef __ASSHDALARM_H__ |
17 #define __ASSHDALARM_H__ |
17 #define __ASSHDALARM_H__ |
18 |
18 |
19 |
19 |
20 // System includes |
20 // System Includes |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <s32strm.h> |
22 #include <s32strm.h> |
23 |
23 |
24 // User includes |
24 // User Includes |
25 #include <asshddefs.h> |
25 #include <asshddefs.h> |
26 |
26 |
27 /////////////////////////////////////////////////////////////////////////////////////// |
27 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
28 // ----> TASShdAlarm (header) |
28 |
29 /////////////////////////////////////////////////////////////////////////////////////// |
29 /** |
30 |
30 * The Alarm publish and subscribe category |
31 /** The Alarm publish and subscribe category |
31 * |
32 @publishedPartner |
32 * @publishedPartner |
33 @released |
33 * @released |
34 */ |
34 */ |
35 const TUid KAlarmServerPubSubCategory = { 0x101f5027 }; |
35 const TUid KAlarmServerPubSubCategory = { 0x101f5027 }; |
36 |
36 |
37 /** Used for subcribing missed alarms or time zone changes |
37 /** |
38 @publishedPartner |
38 * Used for subcribing missed alarms or time zone changes |
39 @released |
39 * @publishedPartner |
40 */ |
40 * @released |
|
41 */ |
41 const TUint KMissingAlarmPubSubKey = 100; |
42 const TUint KMissingAlarmPubSubKey = 100; |
42 |
43 |
43 /** The publish and subscribe data for KMissingAlarmPubSubKey |
44 /** |
44 @publishedPartner |
45 * The publish and subscribe data for KMissingAlarmPubSubKey |
45 @released |
46 * @publishedPartner |
46 */ |
47 * @released |
|
48 */ |
47 struct TMissedAlarmPubSubData |
49 struct TMissedAlarmPubSubData |
48 { |
50 { |
49 /** The value indicating the changes. |
51 /** |
50 1 - Time zone has been changes but there are no missed alarms |
52 * The value indicating the changes. |
51 2 - Some alarms have been missed after system time or time zone has changed. |
53 * 1 - Time zone has been changes but there are no missed alarms |
52 */ |
54 * 2 - Some alarms have been missed after system time or time zone has changed. |
|
55 */ |
53 TUint8 iValue; |
56 TUint8 iValue; |
54 |
57 |
55 /** The time that system time change took place, in universal (UTC) time */ |
58 /** |
|
59 * The time that system time change took place, in universal (UTC) time |
|
60 */ |
56 TTime iTimeOfChangeUtc; |
61 TTime iTimeOfChangeUtc; |
57 }; |
62 }; |
58 |
63 |
59 /** Used for subscribing to data used when searching for instances in Calendar |
64 #ifdef SYMBIAN_SKIPPED_CALENDAR_ALARMS |
60 @publishedPartner |
65 /** |
61 @released |
66 * Used for subscribing to data used when searching for instances in Calendar |
62 */ |
67 * @publishedPartner |
|
68 * @released |
|
69 */ |
63 const TUint KSkippedAlarmInstancesPubSubKey = 101; |
70 const TUint KSkippedAlarmInstancesPubSubKey = 101; |
64 |
71 |
65 /** The publish and subscribe data for KMissingAlarmInstancesPubSubKey |
72 /** |
66 @publishedPartner |
73 * The publish and subscribe data for KMissingAlarmInstancesPubSubKey |
67 @released |
74 * @publishedPartner |
68 */ |
75 * @released |
|
76 */ |
69 struct TASShdAlarmedInstanceParams |
77 struct TASShdAlarmedInstanceParams |
70 { |
78 { |
71 /** The start of the time range in local time. */ |
79 /** |
|
80 * The start of the time range in local time. |
|
81 */ |
72 TTime iLocalStartTime; |
82 TTime iLocalStartTime; |
73 |
83 |
74 /** The end of the time range in local time. */ |
84 /** |
|
85 * The end of the time range in local time. |
|
86 */ |
75 TTime iLocalEndTime; |
87 TTime iLocalEndTime; |
76 |
88 |
77 /** The alarm time types to include. */ |
89 /** |
|
90 * The alarm time types to include. |
|
91 */ |
78 TASShdAlarmTimeType iTimeType; |
92 TASShdAlarmTimeType iTimeType; |
79 }; |
93 }; |
80 |
94 |
81 |
95 #endif //SYMBIAN_SKIPPED_CALENDAR_ALARMS |
|
96 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
|
97 |
|
98 |
|
99 #ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT |
|
100 |
|
101 /** |
|
102 * Used for subcribing wake-up alarm set and unset notifications |
|
103 * Belonging to the KAlarmServerPubSubCategory alarm publish and subscribe category |
|
104 * |
|
105 * @publishedPartner |
|
106 * @released |
|
107 */ |
|
108 const TUint KWakeupAlarmPubSubKey = 102; |
|
109 |
|
110 /** |
|
111 * Alarm server sets KWakeupAlarmPubSubKey value to EActiveWakeupAlarmSet when there is an active |
|
112 * wakeup alarm in the alarm queue otherwise sets it to EActiveNoWakeupAlarmsSet. |
|
113 * A wakeup alarm starts the device if it is powered off when the alarm expires. If |
|
114 * the device is in normal mode then it works as a clock alarm. |
|
115 * An active wakeup alarm is a wakeup alarm which has been set and has not started to alert yet. |
|
116 * |
|
117 * EActiveWakeupAlarmUninitialized is used to notify the listeners of 'KWakeupAlarmPubSubKey' |
|
118 * key that the Alarm Server has just started at the device boot time and it needs to internalize |
|
119 * Alarm Queue from backup before checking for the presence of active wake-up alarm. |
|
120 * |
|
121 * @publishedPartner |
|
122 * @released |
|
123 */ |
|
124 enum TActiveWakeupAlarmStatus |
|
125 { |
|
126 EActiveWakeupAlarmUninitialized = 100, |
|
127 EActiveWakeupAlarmSet, |
|
128 EActiveNoWakeupAlarmsSet, |
|
129 }; |
|
130 |
|
131 #endif |
|
132 |
|
133 /** |
|
134 * A client-side alarm object. |
|
135 * |
|
136 * It contains all of the information needed to create an alarm in the Alarm Server. |
|
137 * |
|
138 * @publishedAll |
|
139 * @released |
|
140 */ |
82 class TASShdAlarm |
141 class TASShdAlarm |
83 /** A client-side alarm object. |
|
84 |
|
85 It contains all of the information needed to create an alarm in |
|
86 the Alarm Server. |
|
87 @publishedAll |
|
88 @released |
|
89 */ |
|
90 { |
142 { |
91 /////////////////////////////////////////////////////////////////////////////////////// |
143 public: |
92 public: // CONSTRUCT |
|
93 /////////////////////////////////////////////////////////////////////////////////////// |
|
94 |
144 |
95 IMPORT_C TASShdAlarm(); |
145 IMPORT_C TASShdAlarm(); |
96 |
146 |
97 /////////////////////////////////////////////////////////////////////////////////////// |
147 public: |
98 public: // INTERNALIZE / EXTERNALIZE |
|
99 /////////////////////////////////////////////////////////////////////////////////////// |
|
100 |
148 |
101 IMPORT_C void InternalizeL(RReadStream& aStream); |
149 IMPORT_C void InternalizeL(RReadStream& aStream); |
102 |
|
103 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
150 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
104 |
151 |
105 /////////////////////////////////////////////////////////////////////////////////////// |
152 public: |
106 public: // READ-ONLY ACCESS |
153 // Read-Only Access |
107 /////////////////////////////////////////////////////////////////////////////////////// |
154 |
108 |
155 /** |
109 inline TAlarmStatus Status() const |
156 * Returns the alarm status. |
110 /** Returns the alarm status. |
157 * |
111 |
158 * @return Alarm status. |
112 @return Alarm status. */ |
159 */ |
113 { return iStatus; } |
160 inline TAlarmStatus Status() const { return iStatus; } |
114 |
161 |
115 inline TAlarmState State() const |
162 /** |
116 /** Returns the alarm state. |
163 * Returns the alarm state. |
117 |
164 * |
118 @return Alarm state. */ |
165 * @return Alarm state. |
119 { return iState; } |
166 */ |
120 |
167 inline TAlarmState State() const { return iState; } |
121 inline TBool HasAssociatedData() const; |
168 |
122 |
169 IMPORT_C TBool HasAssociatedData() const; |
123 inline TBool HasOwningSession() const; |
170 IMPORT_C TBool HasOwningSession() const; |
124 |
171 IMPORT_C TBool HasBecomeOrphaned() const; |
125 inline TBool HasBecomeOrphaned() const; |
172 |
126 |
173 public: |
127 /////////////////////////////////////////////////////////////////////////////////////// |
|
128 public: // READ-ONLY & MODIFIABLE |
|
129 /////////////////////////////////////////////////////////////////////////////////////// |
|
130 |
174 |
131 IMPORT_C void Reset(); |
175 IMPORT_C void Reset(); |
132 |
176 |
133 inline TAlarmId& Id() |
177 /** |
134 /** Returns a writable version of the alarm's unique identifier. |
178 * Returns a writable version of the alarm's unique identifier. |
135 |
179 * |
136 @return Reference to the unique identifier. */ |
180 * @return Reference to the unique identifier. |
137 { return iAlarmId; } |
181 */ |
138 |
182 inline TAlarmId& Id() { return iAlarmId; } |
139 inline TAlarmId Id() const |
183 |
140 /** Return the alarm's unique identifier. |
184 /** |
141 |
185 * Return the alarm's unique identifier. |
142 @return The unique identifier. */ |
186 * |
143 { return iAlarmId; } |
187 * @return The unique identifier. |
|
188 */ |
|
189 inline TAlarmId Id() const { return iAlarmId; } |
144 |
190 |
145 //The Secure ID is only used in the secured platform |
191 /** |
146 |
192 * The Secure ID is only used in the secured platform |
|
193 */ |
|
194 |
147 // adds a SID to the alarms private field |
195 // adds a SID to the alarms private field |
148 inline void SetSid(const TSecureId& aSecureID) |
196 inline void SetSid(const TSecureId& aSecureID) {iTASShdAlarmSID = aSecureID;} |
149 {iTASShdAlarmSID = aSecureID;} |
197 |
150 |
|
151 // returns the SID of the alarm's creator |
198 // returns the SID of the alarm's creator |
152 inline TSecureId GetSid() const |
199 inline TSecureId GetSid() const {return iTASShdAlarmSID;} |
153 {return iTASShdAlarmSID;} |
200 |
154 |
201 /** |
155 inline TTime& NextDueTime() |
202 * Returns a writable version of the next time the alarm is scheduled to expire. |
156 /** Returns a writable version of the next time the alarm is scheduled to expire. |
203 * |
157 |
204 * @return Next expiry time. |
158 @return Next expiry time. */ |
205 */ |
159 { return iNextDueTime; } |
206 inline TTime& NextDueTime() { return iNextDueTime; } |
160 |
207 |
161 inline const TTime& NextDueTime() const |
208 /** |
162 /** Returns the next time that the alarm is scheduled to expire. |
209 * Returns the next time that the alarm is scheduled to expire. |
163 |
210 * |
164 @return Next expiry time. */ |
211 * @return Next expiry time. |
165 { return iNextDueTime; } |
212 */ |
166 |
213 inline const TTime& NextDueTime() const { return iNextDueTime; } |
167 inline TTime& OriginalExpiryTime() |
214 |
168 /** Returns a writable version of the alarm's original expiry time. |
215 /** |
169 |
216 * Returns a writable version of the alarm's original expiry time. |
170 @return Original expiry time. */ |
217 * |
171 { return iOriginalExpiryTime; } |
218 * @return Original expiry time. |
172 |
219 */ |
173 inline const TTime& OriginalExpiryTime() const |
220 inline TTime& OriginalExpiryTime() { return iOriginalExpiryTime; } |
174 /** Returns the alarm's original expiry time. |
221 |
175 |
222 /** |
176 The original expiry time is the same as the next due time, unless the alarm |
223 * Returns the alarm's original expiry time. |
177 has been snoozed. In that case, the original expiry time is the time when |
224 * |
178 the alarm first expired, and the next due time is when it is to re-awaken |
225 * The original expiry time is the same as the next due time, unless the alarm |
179 after the snooze. |
226 * has been snoozed. In that case, the original expiry time is the time when |
180 |
227 * the alarm first expired, and the next due time is when it is to re-awaken |
181 @return Original expiry time. */ |
228 * after the snooze. |
182 { return iOriginalExpiryTime; } |
229 * |
183 |
230 * @return Original expiry time. |
184 inline TAlarmCategory& Category() |
231 */ |
185 /** Returns a writable version of the alarm's category. |
232 inline const TTime& OriginalExpiryTime() const { return iOriginalExpiryTime; } |
186 |
233 |
187 Clients can use the category to tag each alarm with a specific code. This |
234 /** |
188 allows clients to identify all related alarms, such as all alarms associated |
235 * Returns a writable version of the alarm's category. |
189 with a particular application or application engine. |
236 * |
190 |
237 * Clients can use the category to tag each alarm with a specific code. This |
191 @return Alarm category. */ |
238 * allows clients to identify all related alarms, such as all alarms associated |
192 { return iCategory; } |
239 * with a particular application or application engine. |
193 |
240 * |
194 inline TAlarmCategory Category() const |
241 * @return Alarm category. |
195 /** Return this alarm's category. |
242 */ |
196 |
243 inline TAlarmCategory& Category() { return iCategory; } |
197 @return Alarm category. */ |
244 |
198 { return iCategory; } |
245 /** |
199 |
246 * Return this alarm's category. |
200 inline TAlarmCharacteristicsFlags& Characteristics() |
247 * |
201 /** Returns a writable version of the alarm's characteristics. |
248 * @return Alarm category. |
202 |
249 */ |
203 @return Alarm characteristics bit flags. */ |
250 inline TAlarmCategory Category() const { return iCategory; } |
204 { return iCharacteristics; } |
251 |
205 |
252 /** |
206 inline TAlarmCharacteristicsFlags Characteristics() const |
253 * Returns a writable version of the alarm's characteristics. |
207 /** Returns the alarm's characteristics |
254 * |
208 |
255 * @return Alarm characteristics bit flags. |
209 @return Alarm characteristics bit flags. */ |
256 */ |
210 { return iCharacteristics; } |
257 inline TAlarmCharacteristicsFlags& Characteristics() { return iCharacteristics; } |
211 |
258 |
212 inline TAlarmRepeatDefinition& RepeatDefinition() |
259 /** |
213 /** Returns a writable version of the alarm's repeat definition. |
260 * Returns the alarm's characteristics |
214 |
261 * |
215 The repeat definition controls the alarm's behaviour after it has expired. |
262 * @return Alarm characteristics bit flags. |
216 For example, you can set the repeat definition so that the server automatically |
263 */ |
217 queues the alarm to expire again in exactly 24 hours time. |
264 inline TAlarmCharacteristicsFlags Characteristics() const { return iCharacteristics; } |
218 |
265 |
219 @return Alarm repeat definition. */ |
266 /** |
220 { return iRepeatDefinition; } |
267 * Returns a writable version of the alarm's repeat definition. |
221 |
268 * |
222 inline TAlarmRepeatDefinition RepeatDefinition() const |
269 * The repeat definition controls the alarm's behaviour after it has expired. |
223 /** Returns the repeat definition for the alarm. |
270 * For example, you can set the repeat definition so that the server automatically |
224 |
271 * queues the alarm to expire again in exactly 24 hours time. |
225 @return The alarm's repeat definition. */ |
272 * |
226 { return iRepeatDefinition; } |
273 * @return Alarm repeat definition. |
227 |
274 */ |
228 inline TAlarmMessage& Message() |
275 inline TAlarmRepeatDefinition& RepeatDefinition() { return iRepeatDefinition; } |
229 /** Returns a writable version of the alarm's message. |
276 |
230 |
277 /** |
231 The message is usually displayed in the application UI |
278 * Returns the repeat definition for the alarm. |
232 when the alarm expires. |
279 * |
233 |
280 * @return The alarm's repeat definition. |
234 @return Reference to the alarm's associated message. */ |
281 */ |
235 { return iMessage; } |
282 inline TAlarmRepeatDefinition RepeatDefinition() const { return iRepeatDefinition; } |
236 |
283 |
237 inline const TAlarmMessage& Message() const |
284 /** |
238 /** Returns the alarm's message. |
285 * Returns a writable version of the alarm's message. |
239 |
286 * |
240 The message is usually displayed in the application UI when the alarm expires. |
287 * The message is usually displayed in the application UI when the alarm expires. |
241 |
288 * |
242 @return Reference to the alarm's associated message. */ |
289 * @return Reference to the alarm's associated message. |
243 { return iMessage; } |
290 */ |
244 |
291 inline TAlarmMessage& Message() { return iMessage; } |
245 inline TAlarmSoundName& SoundName() |
292 |
246 /** Return a writable version of the alarm sound's filename. |
293 /** |
247 |
294 * Returns the alarm's message. |
248 @return Reference to the alarm's sound filename. */ |
295 * |
249 { return iSoundName; } |
296 * The message is usually displayed in the application UI when the alarm expires. |
250 |
297 * |
251 inline const TAlarmSoundName& SoundName() const |
298 * @return Reference to the alarm's associated message. |
252 /** Returns the alarm's sound filename. |
299 */ |
253 |
300 inline const TAlarmMessage& Message() const { return iMessage; } |
254 @return Sound filename. */ |
301 |
255 { return iSoundName; } |
302 /** |
256 |
303 * Return a writable version of the alarm sound's filename. |
257 inline TAlarmDayOrTimed DayOrTimed() const |
304 * |
258 /** Returns the alarm session type. |
305 * @return Reference to the alarm's sound filename. |
259 |
306 */ |
260 @return Alarm session type. */ |
307 inline TAlarmSoundName& SoundName() { return iSoundName; } |
261 { return iDayOrTimed; } |
308 |
262 |
309 /** |
263 |
310 * Returns the alarm's sound filename. |
264 inline TAlarmDayOrTimed& DayOrTimed() |
311 * |
265 /** Returns a writable version of the alarm type, i.e. day, timed |
312 * @return Sound filename. |
266 |
313 */ |
267 @return iDayOrTimed. */ |
314 inline const TAlarmSoundName& SoundName() const { return iSoundName; } |
268 { return iDayOrTimed; } |
315 |
269 |
316 /** |
|
317 * Returns the alarm session type. |
|
318 * |
|
319 * @return Alarm session type. |
|
320 */ |
|
321 inline TAlarmDayOrTimed DayOrTimed() const { return iDayOrTimed; } |
|
322 |
|
323 /** |
|
324 * Returns a writable version of the alarm type, i.e. day, timed |
|
325 * |
|
326 * @return iDayOrTimed. |
|
327 */ |
|
328 inline TAlarmDayOrTimed& DayOrTimed() { return iDayOrTimed; } |
270 |
329 |
271 IMPORT_C void SetUtcNextDueTime(TTime aUtcTime); |
330 IMPORT_C void SetUtcNextDueTime(TTime aUtcTime); |
272 |
|
273 IMPORT_C void SetDeQueueIfDueTimeInPast(); |
331 IMPORT_C void SetDeQueueIfDueTimeInPast(); |
274 |
332 |
|
333 #ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT |
|
334 IMPORT_C void SetWakeup(TBool aEnabled); |
|
335 IMPORT_C TBool IsWakeup() const; |
|
336 #endif |
|
337 |
|
338 #ifdef SYMBIAN_ALARM_REPEAT_EXTENSIONS |
275 IMPORT_C TInt SetAlarmDays(TUint8 aAlarmDays); |
339 IMPORT_C TInt SetAlarmDays(TUint8 aAlarmDays); |
276 IMPORT_C TUint8 AlarmDays() const; |
340 IMPORT_C TUint8 AlarmDays() const; |
277 IMPORT_C void SetContinuous(TBool aContinuous); |
341 IMPORT_C void SetContinuous(TBool aContinuous); |
278 IMPORT_C TBool Continuous(); |
342 IMPORT_C TBool Continuous(); |
279 |
343 #endif |
280 /////////////////////////////////////////////////////////////////////////////////////// |
344 |
281 public: // CLIENT DATA ACCESS |
345 public: |
282 /////////////////////////////////////////////////////////////////////////////////////// |
346 // CLient Data Access |
283 |
347 |
284 inline TBitFlags16& ClientFlags() |
348 /** |
285 /** Returns a writable version of the alarm's client flags. |
349 * Returns a writable version of the alarm's client flags. |
286 |
350 * |
287 The client flags may be used for any client-specific data - |
351 * The client flags may be used for any client-specific data - the alarm server does not use them. |
288 the alarm server does not use them. |
352 * |
289 |
353 * @return Reference to the alarm's bit flags. |
290 @return Reference to the alarm's bit flags. */ |
354 */ |
291 { return iClientFlags; } |
355 inline TBitFlags16& ClientFlags() { return iClientFlags; } |
292 |
356 |
293 inline TBitFlags16 ClientFlags() const |
357 /** |
294 /** Returns this alarm's client flags. |
358 * Returns this alarm's client flags. |
295 |
359 * |
296 @return Reference to the alarm's bit flags. */ |
360 * @return Reference to the alarm's bit flags. |
297 { return iClientFlags; } |
361 */ |
298 |
362 inline TBitFlags16 ClientFlags() const { return iClientFlags; } |
299 inline TInt ClientData1() const |
363 |
300 /** Returns the client data from slot 1 for this alarm. |
364 /** |
301 |
365 * Returns the client data from slot 1 for this alarm. |
302 @return The first client-specific integer. */ |
366 * |
303 { return iClientData1; } |
367 * @return The first client-specific integer. |
304 |
368 */ |
305 inline TInt& ClientData1() |
369 inline TInt ClientData1() const { return iClientData1; } |
306 /** Returns a writable version of the client data from slot 1 for this alarm. |
370 |
307 |
371 /** |
308 @return Reference to the first client-specific integer. */ |
372 * Returns a writable version of the client data from slot 1 for this alarm. |
309 { return iClientData1; } |
373 * |
310 |
374 * @return Reference to the first client-specific integer. |
311 inline TInt ClientData2() const |
375 */ |
312 /** Returns the client data from slot 2 for this alarm. |
376 inline TInt& ClientData1() { return iClientData1; } |
313 |
377 |
314 @return The second client-specific integer. */ |
378 /** |
315 { return iClientData2; } |
379 * Returns the client data from slot 2 for this alarm. |
316 |
380 * |
317 inline TInt& ClientData2() |
381 * @return The second client-specific integer. |
318 /** Returns the client data from slot 2 for this alarm. |
382 */ |
319 |
383 inline TInt ClientData2() const { return iClientData2; } |
320 @return The second client-specific integer. */ |
384 |
321 { return iClientData2; } |
385 /** |
|
386 * Returns the client data from slot 2 for this alarm. |
|
387 * |
|
388 * @return The second client-specific integer. |
|
389 */ |
|
390 inline TInt& ClientData2() { return iClientData2; } |
322 |
391 |
323 inline TBool IsFloating() const |
392 |
324 /** Tests whether the alarm is floating. |
393 /** |
325 |
394 * Tests whether the alarm is floating. |
326 Floating alarms expire at a given wall-clock time regardless of the current locale and |
395 * |
327 whether any daylight saving time rules are in force. |
396 * Floating alarms expire at a given wall-clock time regardless of the |
328 |
397 * current locale and whether any daylight saving time rules are in force. |
329 @return True if the alarm is floating. |
398 * |
330 */ |
399 * @return True if the alarm is floating. |
331 { return iCharacteristics.IsClear(EAlarmCharacteristicsIsFixed); } |
400 */ |
332 |
401 inline TBool IsFloating() const { return iCharacteristics.IsClear(EAlarmCharacteristicsIsFixed); } |
333 |
402 |
334 |
403 protected: |
335 |
404 // Internal Flags |
336 |
405 |
337 /////////////////////////////////////////////////////////////////////////////////////// |
406 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
338 protected: // INTERNAL FLAGS |
|
339 /////////////////////////////////////////////////////////////////////////////////////// |
|
340 |
|
341 /* |
407 /* |
342 * @internalAll |
408 * @internalAll |
343 */ |
409 */ |
344 enum TASShdAlarmFlags |
410 enum TASShdAlarmFlags |
345 { |
411 { |
346 |
412 /** |
347 /* |
413 * @publishedAll |
348 * @internalAll |
|
349 */ |
414 */ |
350 EASShdAlarmFlagsHasAssociatedData = 0, |
415 EASShdAlarmFlagsHasAssociatedData = 0, |
351 |
416 |
352 /* |
417 /** |
353 * @internalAll |
418 * @publishedAll |
354 */ |
419 */ |
355 EASShdAlarmFlagsHasOwningSession = 1, |
420 EASShdAlarmFlagsHasOwningSession = 1, |
356 |
421 |
357 /* |
422 /** |
358 * @internalAll |
423 * @publishedAll |
359 */ |
424 */ |
360 EASShdAlarmFlagsHasBecomeOrphaned = 2, |
425 EASShdAlarmFlagsHasBecomeOrphaned = 2, |
361 |
426 |
362 /* |
427 /** |
363 * @internalAll Set if alarm is disabled manually so that can not be enabled when |
428 * Set if alarm is disabled manually so that can not be enabled when locale changes. |
364 * locale changes. |
429 * |
|
430 * @publishedAll |
365 */ |
431 */ |
366 EASShdAlarmFlagsPermanentDisabled = 4 |
432 EASShdAlarmFlagsPermanentDisabled = 4 |
367 |
|
368 }; |
433 }; |
|
434 #endif |
369 |
435 |
370 private: |
436 private: |
|
437 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
438 |
|
439 #ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT |
371 /* |
440 /* |
372 * @internalComponent |
441 * @internalComponent |
373 */ |
442 */ |
374 enum TASShdAlarmFlags2 |
443 enum TASShdAlarmFlags2 |
375 { |
444 { |
376 EASShdAlarmFlag2Wakeup = 0, |
445 EASShdAlarmFlag2Wakeup = 0, |
377 }; |
446 }; |
378 |
447 #endif |
|
448 |
|
449 #ifdef SYMBIAN_ALARM_REPEAT_EXTENSIONS |
|
450 /* |
|
451 * @internalComponent |
|
452 */ |
379 enum TASShdAlarmFlags2AlarmRepeatExtensions |
453 enum TASShdAlarmFlags2AlarmRepeatExtensions |
380 { |
454 { |
381 EASShdAlarmFlag2AlarmDayMonday = 1, |
455 EASShdAlarmFlag2AlarmDayMonday = 1, |
382 EASShdAlarmFlag2AlarmDayTuesday = 2, |
456 EASShdAlarmFlag2AlarmDayTuesday = 2, |
383 EASShdAlarmFlag2AlarmDayWednesday = 3, |
457 EASShdAlarmFlag2AlarmDayWednesday = 3, |
385 EASShdAlarmFlag2AlarmDayFriday = 5, |
459 EASShdAlarmFlag2AlarmDayFriday = 5, |
386 EASShdAlarmFlag2AlarmDaySaturday = 6, |
460 EASShdAlarmFlag2AlarmDaySaturday = 6, |
387 EASShdAlarmFlag2AlarmDaySunday = 7, |
461 EASShdAlarmFlag2AlarmDaySunday = 7, |
388 EASShdAlarmFlag2Continuous = 8 |
462 EASShdAlarmFlag2Continuous = 8 |
389 }; |
463 }; |
|
464 #endif |
|
465 |
|
466 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
390 |
467 |
391 |
468 |
392 /////////////////////////////////////////////////////////////////////////////////////// |
469 protected: |
393 protected: // MEMBER DATA |
470 |
394 /////////////////////////////////////////////////////////////////////////////////////// |
471 /** |
395 |
|
396 /* |
|
397 * Various flags - used internally by the alarm object |
472 * Various flags - used internally by the alarm object |
398 */ |
473 */ |
399 TBitFlags8 iFlags; |
474 TBitFlags8 iFlags; |
400 |
475 |
401 /* |
476 /** |
402 * This represents the desired behaviour for a given alarm. |
477 * This represents the desired behaviour for a given alarm. |
403 * The Alarm Server uses this information to control the |
478 * The Alarm Server uses this information to control the |
404 * behaviour of the alarm. |
479 * behaviour of the alarm. |
405 * |
480 * |
406 * @see TAlarmCharacteristics |
481 * @see TAlarmCharacteristics |
407 */ |
482 */ |
408 TAlarmCharacteristicsFlags iCharacteristics; |
483 TAlarmCharacteristicsFlags iCharacteristics; |
409 |
484 |
410 /* |
485 /** |
411 * The unique identifier assoicated with each alarm maintained |
486 * The unique identifier assoicated with each alarm maintained |
412 * by the alarm world server. |
487 * by the alarm world server. |
413 */ |
488 */ |
414 TAlarmId iAlarmId; |
489 TAlarmId iAlarmId; |
415 |
490 |
416 /* |
491 /** |
417 * The status of this alarm (e.g. enabled, disabled) |
492 * The status of this alarm (e.g. enabled, disabled) |
418 */ |
493 */ |
419 TAlarmStatus iStatus; |
494 TAlarmStatus iStatus; |
420 |
495 |
421 /* |
496 /** |
422 * The state of this alarm (e.g. queued, notifying, notified, snoozed etc) |
497 * The state of this alarm (e.g. queued, notifying, notified, snoozed etc) |
423 */ |
498 */ |
424 TAlarmState iState; |
499 TAlarmState iState; |
425 |
500 |
426 /* |
501 /** |
427 * The type of this alarm (e.g. day, timed) |
502 * The type of this alarm (e.g. day, timed) |
428 */ |
503 */ |
429 TAlarmDayOrTimed iDayOrTimed; |
504 TAlarmDayOrTimed iDayOrTimed; |
430 |
505 |
431 /* |
506 /** |
432 * Controls how the alarm repeats after it has expired. Note that |
507 * Controls how the alarm repeats after it has expired. Note that |
433 * session alarms are not allowed to repeat (they must be "once |
508 * session alarms are not allowed to repeat (they must be "once |
434 * only"). |
509 * only"). |
435 */ |
510 */ |
436 TAlarmRepeatDefinition iRepeatDefinition; |
511 TAlarmRepeatDefinition iRepeatDefinition; |
437 |
512 |
438 /* |
513 /** |
439 * This UID is supplied by the client and is used to indicate |
514 * This UID is supplied by the client and is used to indicate |
440 * the category that this alarm is part of. The Alarm Server |
515 * the category that this alarm is part of. The Alarm Server |
441 * is category-agnostic, that is, this information is for |
516 * is category-agnostic, that is, this information is for |
442 * the client's use only |
517 * the client's use only |
443 */ |
518 */ |
444 TAlarmCategory iCategory; |
519 TAlarmCategory iCategory; |
445 |
520 |
446 /* |
521 /** |
447 * The date and time at which this alarm is next due. For alarms |
522 * The date and time at which this alarm is next due. For alarms |
448 * that haven't been snoozed, then this is the original due time. |
523 * that haven't been snoozed, then this is the original due time. |
449 * |
524 * |
450 * For alarms that have been snoozed, this is the time at which |
525 * For alarms that have been snoozed, this is the time at which |
451 * the alarm will reawaken. |
526 * the alarm will reawaken. |
452 */ |
527 */ |
453 TTime iNextDueTime; |
528 TTime iNextDueTime; |
454 |
529 |
455 /* |
530 /** |
456 * This attribute is only used in the instance whereby an alarm |
531 * This attribute is only used in the instance whereby an alarm |
457 * is snoozed. It represents the time at which the alarm first |
532 * is snoozed. It represents the time at which the alarm first |
458 * expired. |
533 * expired. |
459 */ |
534 */ |
460 TTime iOriginalExpiryTime; |
535 TTime iOriginalExpiryTime; |
461 |
536 |
462 /* |
537 /** |
463 * The message associated with this alarm, typically used |
538 * The message associated with this alarm, typically used |
464 * in an application UI to inform the user as to the reason |
539 * in an application UI to inform the user as to the reason |
465 * for the alarm. |
540 * for the alarm. |
466 */ |
541 */ |
467 TAlarmMessage iMessage; |
542 TAlarmMessage iMessage; |
468 |
543 |
469 /* |
544 /** |
470 * A descriptor which holds the name of the sound file which |
545 * A descriptor which holds the name of the sound file which |
471 * should be played when the alarm expires. |
546 * should be played when the alarm expires. |
472 */ |
547 */ |
473 TAlarmSoundName iSoundName; |
548 TAlarmSoundName iSoundName; |
474 |
549 |
475 /////////////////////////////////////////////////////////////////////////////////////// |
550 protected: |
476 protected: // CLIENT SPECIFIC DATA |
551 |
477 /////////////////////////////////////////////////////////////////////////////////////// |
552 // Client Specific Data |
478 |
553 |
479 /* |
554 /** |
480 * Flags for use by any particular client. These will |
555 * Flags for use by any particular client. These will |
481 * only be relevant to a client who can interpret them. |
556 * only be relevant to a client who can interpret them. |
482 */ |
557 */ |
483 TBitFlags16 iClientFlags; |
558 TBitFlags16 iClientFlags; |
484 |
559 |
485 /* |
560 /** |
486 * For arbitrary client data 1 |
561 * For arbitrary client data 1 |
487 */ |
562 */ |
488 TInt iClientData1; |
563 TInt iClientData1; |
489 |
564 |
490 /* |
565 /** |
491 * For arbitrary client data 2 |
566 * For arbitrary client data 2 |
492 */ |
567 */ |
493 TInt iClientData2; |
568 TInt iClientData2; |
494 |
569 |
495 /////////////////////////////////////////////////////////////////////////////////////// |
570 private: |
496 private: // BC PROOFING |
571 // Binary Compatibility Proofing |
497 /////////////////////////////////////////////////////////////////////////////////////// |
|
498 TSecureId iTASShdAlarmSID; |
572 TSecureId iTASShdAlarmSID; |
499 /* |
573 |
|
574 #ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT |
|
575 /** |
500 * Various flags - used internally by the alarm object |
576 * Various flags - used internally by the alarm object |
501 */ |
577 */ |
502 TBitFlags16 iFlags2; |
578 TBitFlags16 iFlags2; |
503 TUint16 iTASShdAlarm_2; |
579 TUint16 iTASShdAlarm_2; |
|
580 #else |
|
581 |
|
582 #ifdef SYMBIAN_ALARM_REPEAT_EXTENSIONS |
|
583 /** |
|
584 * Various flags - used internally by the alarm object |
|
585 */ |
|
586 TBitFlags16 iFlags2; |
|
587 TUint16 iTASShdAlarm_2; |
|
588 #else |
|
589 TAny* iTASShdAlarm_2; |
|
590 #endif |
|
591 #endif |
504 TAny* iTASShdAlarm_3; |
592 TAny* iTASShdAlarm_3; |
505 }; |
593 }; |
506 |
594 |
507 |
|
508 /////////////////////////////////////////////////////////////////////////////////////// |
|
509 // ----> TASShdAlarm (inline) |
|
510 /////////////////////////////////////////////////////////////////////////////////////// |
|
511 |
|
512 |
|
513 /** Tests whether the alarm has any associated data. |
|
514 |
|
515 @return True if the alarm has associated data. */ |
|
516 inline TBool TASShdAlarm::HasAssociatedData() const |
|
517 |
|
518 { |
|
519 return iFlags.IsSet(EASShdAlarmFlagsHasAssociatedData); |
|
520 } |
|
521 |
|
522 |
|
523 /** Tests whether the alarm has an active owning session. |
|
524 |
|
525 @return True if the alarm has an active owning session. */ |
|
526 inline TBool TASShdAlarm::HasOwningSession() const |
|
527 |
|
528 { |
|
529 return iFlags.IsSet(EASShdAlarmFlagsHasOwningSession); |
|
530 } |
|
531 |
|
532 inline TBool TASShdAlarm::HasBecomeOrphaned() const |
|
533 /** Tests whether the alarm is orphaned. |
|
534 |
|
535 An alarm is ophaned if it used to have an owning session, but no longer does. |
|
536 If an alarm is owned by a session, it is removed from the queue when the session |
|
537 disconnects. However, orphaned alarms stay in the queue. |
|
538 |
|
539 @return True if the alarm has becomed orphaned. */ |
|
540 { |
|
541 return iFlags.IsSet(EASShdAlarmFlagsHasBecomeOrphaned); |
|
542 } |
|
543 |
|
544 |
|
545 |
|
546 #endif // #ifndef __ASSHDALARM_H__ |
595 #endif // #ifndef __ASSHDALARM_H__ |