|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __ASSRVNEXTDSTCHANGEOBSERVER_H__ |
|
17 #define __ASSRVNEXTDSTCHANGEOBSERVER_H__ |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <e32base.h> |
|
21 #include <e32property.h> |
|
22 |
|
23 #include <asshddefs.h> |
|
24 |
|
25 class CASSrvAlarmQueue; |
|
26 |
|
27 /** This class is used to listen to changes to the DST changes |
|
28 that are published by the time zone server. The time of the next and |
|
29 previous DST change and the next and previous offset can be retrieved. |
|
30 */ |
|
31 class CASSrvDSTChange : public CActive |
|
32 { |
|
33 private: |
|
34 |
|
35 /** This is a copy of the struct used to publish the DST change in tz. We cannot |
|
36 use the same one as we do not want a dependancy between these components |
|
37 */ |
|
38 struct TNextDSTChange |
|
39 { |
|
40 TUint8 iVersion; |
|
41 TTime iNextDSTChangeUTC; |
|
42 TInt iNextUTCOffset; |
|
43 TTime iPreviousDSTChangeUTC; |
|
44 TInt iPreviousUTCOffset; |
|
45 TInt iReserved[12]; |
|
46 }; |
|
47 |
|
48 public: |
|
49 static CASSrvDSTChange* NewL(CASSrvAlarmQueue& aASSrvAlarmQueue); |
|
50 ~CASSrvDSTChange(); |
|
51 |
|
52 TTime NextDSTChangeUTC() const; |
|
53 TTimeIntervalMinutes NextUTCOffset() const; |
|
54 |
|
55 TTime PreviousDSTChangeUTC() const; |
|
56 TTimeIntervalMinutes PreviousUTCOffset() const; |
|
57 |
|
58 private: // from CActive |
|
59 void RunL(); |
|
60 void DoCancel(); |
|
61 |
|
62 private: |
|
63 CASSrvDSTChange(CASSrvAlarmQueue& aASSrvAlarmQueue); |
|
64 void ConstructL(); |
|
65 |
|
66 void UpdatePropertyValuesL(); |
|
67 |
|
68 private: |
|
69 CASSrvAlarmQueue& iASSrvAlarmQueue; |
|
70 RProperty iDSTChangeProperty; |
|
71 |
|
72 TTime iNextDSTChangeUTC; |
|
73 TTimeIntervalMinutes iNextUTCOffset; |
|
74 |
|
75 TTime iPreviousDSTChangeUTC; |
|
76 TTimeIntervalMinutes iPreviousUTCOffset; |
|
77 }; |
|
78 |
|
79 #endif __ASSRVNEXTDSTCHANGEOBSERVER_H__ |