|
1 /* |
|
2 * Copyright (c) 2008 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: The header file of the CClockMCCTzIdMapper class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CLOCK_MCC_TZ_MAPPER_H__ |
|
19 #define __CLOCK_MCC_TZ_MAPPER_H__ |
|
20 |
|
21 // System includes |
|
22 #include <f32file.h> |
|
23 #include <e32base.h> |
|
24 #include <barsc.h> |
|
25 #include <barsread.h> |
|
26 #include <etelmm.h> |
|
27 |
|
28 // Forward declarations |
|
29 class CTzId; |
|
30 |
|
31 /** |
|
32 * @class CClockMCCTzIdMapper |
|
33 * @brief Provides a mapping between numeric Time Zone Ids generated by the |
|
34 * Time Zone Database compiler (tzcompiler.exe) as found in TzIdentities.ini, |
|
35 * and Mobile Country Code (MCC) as defined in ITU E.212 |
|
36 * The international identification plan for mobile terminals and mobile users |
|
37 * @dll clocktimezoneresolver.dll |
|
38 */ |
|
39 class CClockMCCTzIdMapper : public CBase |
|
40 { |
|
41 public: //Construction and Destruction |
|
42 |
|
43 /** |
|
44 * @brief Creates a CClockMCCTzIdMapper object |
|
45 * @return CClockMCCTzIdMapper* |
|
46 */ |
|
47 static CClockMCCTzIdMapper* NewL(); |
|
48 |
|
49 /** |
|
50 * @brief Creates a CClockMCCTzIdMapper object and leaves a copy on the cleanup stack |
|
51 * @return CClockMCCTzIdMapper* |
|
52 */ |
|
53 static CClockMCCTzIdMapper* NewLC(); |
|
54 |
|
55 /** |
|
56 * @brief Destructor |
|
57 */ |
|
58 ~CClockMCCTzIdMapper(); |
|
59 |
|
60 public: // New functions |
|
61 |
|
62 /** |
|
63 * @brief Find all TzIds for a given MCC with optional matching StdTimeOffset |
|
64 * @param aMCC Mobile Country Code to search for |
|
65 * @param aTzIdArray Array of CTzID objects to add matching zones to. |
|
66 * @param aStdTimeOffset Limit returned zones to zones with a matching offset |
|
67 */ |
|
68 void TzIdFromMccL( const RMobilePhone::TMobilePhoneNetworkCountryCode& aMCC, |
|
69 RArray< CTzId >& aTzIdArray, |
|
70 const TTimeIntervalMinutes& aStdTimeOffset = -1 ); |
|
71 |
|
72 /** |
|
73 * @brief Find the MCC for a given TzId |
|
74 * @param aTzId CTzId to search for |
|
75 * @return the MCC of the DST zone, or KErrNotFound if not found. |
|
76 */ |
|
77 TInt MCCFromTzIdL( const CTzId& aTzId ); |
|
78 |
|
79 /** |
|
80 * @brief Find the timezone ID for a given standard offset. |
|
81 * @param aStdTimeOffset Standard offset, of type TTimeIntervalMinutes. |
|
82 * @param aTzIdArray Array of timezone IDs. |
|
83 */ |
|
84 void TzIdFromOffsetL( const TTimeIntervalMinutes& aStdTimeOffset, RArray< CTzId >& aTzIdArray ); |
|
85 |
|
86 /** |
|
87 * @brief Find the UTC offset for a particular zone ignoring DST changes |
|
88 * @param aTz Opened Timezone server session |
|
89 * @param aTzId Timezone to get offset for |
|
90 * @return Offset in minutes from UTC |
|
91 */ |
|
92 TInt UTCOffSetWithoutDSTChangesL( RTz& aTz, const CTzId& aTzId ) const; |
|
93 |
|
94 /** |
|
95 * @brief Find the UTC offset for a particular zone ignoring DST changes |
|
96 * @param aMCC Mobile Country Code to search for |
|
97 * @param aTzIdArray Array of CTzID objects to add matching zones to. |
|
98 */ |
|
99 void DoGetTzIdFromMCCL( TInt aMcc, RArray< CTzId >& aTzIdArray ); |
|
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * @brief Symbian OS 2nd phase constructor is private. |
|
105 */ |
|
106 void ConstructL(); |
|
107 |
|
108 private: // Member data |
|
109 |
|
110 /** |
|
111 * @var iFs |
|
112 * @brief An object of type RFs |
|
113 */ |
|
114 RFs iFs; |
|
115 |
|
116 /** |
|
117 * @var iMCCResourceFile |
|
118 * @brief An object of type RResourceFile |
|
119 */ |
|
120 RResourceFile iMCCResourceFile; |
|
121 |
|
122 /** |
|
123 * @var iResourceReader |
|
124 * @brief An object of type TResourceReader |
|
125 */ |
|
126 TResourceReader iResourceReader; |
|
127 |
|
128 /** |
|
129 * @var iResourceBuffer |
|
130 * @brief An object of type HBufC8* |
|
131 */ |
|
132 HBufC8* iResourceBuffer; |
|
133 |
|
134 /** |
|
135 * @var TMCCResourceOffset |
|
136 * @brief Enum for resource |
|
137 */ |
|
138 enum TMCCResourceOffset |
|
139 { |
|
140 EMCCRssSignature = 1, /** Offset of RSS signature. */ |
|
141 EMCCFirstResource /** The first resource we are interested in. */ |
|
142 }; |
|
143 }; |
|
144 |
|
145 #endif // __CLOCK_MCC_TZ_MAPPER_H__ |
|
146 |
|
147 // End of file |