williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __TIMEZONE_H__
|
williamr@2
|
17 |
#define __TIMEZONE_H__
|
williamr@2
|
18 |
|
williamr@4
|
19 |
|
williamr@2
|
20 |
#include <e32base.h>
|
williamr@2
|
21 |
#include <s32std.h>
|
williamr@4
|
22 |
#include <s32strm.h>
|
williamr@2
|
23 |
#include <tzdefines.h>
|
williamr@4
|
24 |
#include <tzid.h>
|
williamr@2
|
25 |
#include <tzupdate.h>
|
williamr@4
|
26 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
27 |
#include <tzlocalizedcityrecord.h> //This should be be included as it is internalTechnology.
|
williamr@4
|
28 |
#include <tzlocalizedtimezonerecord.h> // Same as above and probably should not be exported to the epoc include
|
williamr@4
|
29 |
#endif
|
williamr@2
|
30 |
|
williamr@4
|
31 |
|
williamr@4
|
32 |
// Forward class references.
|
williamr@2
|
33 |
class CTzRules;
|
williamr@2
|
34 |
class CTzRuleHolder;
|
williamr@4
|
35 |
class CTzLocalizedCityRecord;
|
williamr@4
|
36 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS // This can be forward declared i.e. it should not be included as it is internal.
|
williamr@4
|
37 |
class CTzLocalizedTimeZoneRecord;
|
williamr@4
|
38 |
#endif
|
williamr@2
|
39 |
|
williamr@4
|
40 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@2
|
41 |
/**
|
williamr@4
|
42 |
The CTzUserNames class is used to encapsulate the names for a user-defined
|
williamr@4
|
43 |
time zone.
|
williamr@2
|
44 |
|
williamr@4
|
45 |
When creating an instance of this class the client can specify the following
|
williamr@4
|
46 |
names:
|
williamr@4
|
47 |
|
williamr@4
|
48 |
- Long standard time name, for example "Mountain Standard Time"
|
williamr@4
|
49 |
- Short standard time name, for example "MST"
|
williamr@4
|
50 |
- Long daylight saving time name, for example "Mountain Daylight Time"
|
williamr@4
|
51 |
- Short daylight saving time name, for example "MDT"
|
williamr@4
|
52 |
- City name, for example "Shiprock"
|
williamr@4
|
53 |
- Region name, for example "America"
|
williamr@4
|
54 |
|
williamr@4
|
55 |
The client can also read these names.
|
williamr@4
|
56 |
|
williamr@4
|
57 |
@publishedPartner
|
williamr@2
|
58 |
@released
|
williamr@4
|
59 |
*/
|
williamr@4
|
60 |
class CTzUserNames : public CBase
|
williamr@4
|
61 |
{
|
williamr@2
|
62 |
public:
|
williamr@4
|
63 |
IMPORT_C static CTzUserNames* NewL(const TDesC& aStandardName,
|
williamr@4
|
64 |
const TDesC& aShortStandardName, const TDesC& aDaylightSaveName,
|
williamr@4
|
65 |
const TDesC& aShortDaylightSaveName, const TDesC& aCityName,
|
williamr@4
|
66 |
const TDesC& aRegionName);
|
williamr@4
|
67 |
IMPORT_C static CTzUserNames* NewLC(const TDesC& aStandardName,
|
williamr@4
|
68 |
const TDesC& aShortStandardName, const TDesC& aDayLightSaveName,
|
williamr@4
|
69 |
const TDesC& aShortDaylightSaveName, const TDesC& aCityName,
|
williamr@4
|
70 |
const TDesC& aRegionName);
|
williamr@4
|
71 |
IMPORT_C ~CTzUserNames();
|
williamr@2
|
72 |
|
williamr@4
|
73 |
IMPORT_C const TDesC& StandardName() const;
|
williamr@4
|
74 |
IMPORT_C const TDesC& ShortStandardName() const;
|
williamr@4
|
75 |
IMPORT_C const TDesC& DaylightSaveName() const;
|
williamr@4
|
76 |
IMPORT_C const TDesC& ShortDaylightSaveName() const;
|
williamr@4
|
77 |
IMPORT_C const TDesC& CityName() const;
|
williamr@4
|
78 |
IMPORT_C const TDesC& RegionName() const;
|
williamr@2
|
79 |
|
williamr@4
|
80 |
IMPORT_C static CTzUserNames* NewL(RReadStream& aStream);
|
williamr@4
|
81 |
IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
82 |
IMPORT_C void InternalizeL(RReadStream& aStream);
|
williamr@4
|
83 |
IMPORT_C TInt SizeOfObject() const;
|
williamr@2
|
84 |
|
williamr@2
|
85 |
private:
|
williamr@4
|
86 |
CTzUserNames();
|
williamr@4
|
87 |
void ConstructL(const TDesC& aStandardName, const TDesC& aShortStandardName,
|
williamr@4
|
88 |
const TDesC& aDayLightSaveName, const TDesC& aShortDayLightSaveName,
|
williamr@4
|
89 |
const TDesC& aCityName, const TDesC& aRegionName);
|
williamr@4
|
90 |
|
williamr@2
|
91 |
private:
|
williamr@4
|
92 |
HBufC* iStandardName;
|
williamr@4
|
93 |
HBufC* iShortStandardName;
|
williamr@4
|
94 |
HBufC* iDaylightName;
|
williamr@4
|
95 |
HBufC* iShortDaylightName;
|
williamr@4
|
96 |
HBufC* iCityName;
|
williamr@4
|
97 |
HBufC* iRegionName;
|
williamr@4
|
98 |
};
|
williamr@4
|
99 |
#else
|
williamr@4
|
100 |
class CTzUserNames;
|
williamr@4
|
101 |
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@2
|
102 |
/**
|
williamr@2
|
103 |
The client interface to the time zone server.
|
williamr@2
|
104 |
|
williamr@2
|
105 |
This class performs two basic functions:
|
williamr@4
|
106 |
|
williamr@2
|
107 |
1. Converts between UTC time and local time.
|
williamr@2
|
108 |
2. Sets the current local time zone.
|
williamr@2
|
109 |
|
williamr@2
|
110 |
NOTE: The presence of a time zone server will alter the behaviour of the
|
williamr@2
|
111 |
time zone related function calls User::SetUTCOffset() and
|
williamr@4
|
112 |
User::SetUTCTimeAndOffset(). The time zone server is shutdown when the last
|
williamr@4
|
113 |
session (RTz) is closed. Therefore, to maintain consistent time related
|
williamr@4
|
114 |
behaviour, licensees may want to keep a system level time zone server session
|
williamr@4
|
115 |
open at all times.
|
williamr@2
|
116 |
|
williamr@4
|
117 |
Exceptional cases occur when a user requests conversion for a non-existent local
|
williamr@4
|
118 |
time or a double local time.
|
williamr@2
|
119 |
|
williamr@4
|
120 |
Non-existent local times occur when the local time changes from winter to summer
|
williamr@4
|
121 |
for DST.
|
williamr@2
|
122 |
|
williamr@4
|
123 |
For example, 01:59 local time is non-existent on the day of a change to BST in
|
williamr@4
|
124 |
Europe/London since the time changes directly from 12:59:59 to 2:00.
|
williamr@2
|
125 |
|
williamr@4
|
126 |
A double local time occurs when the local time changes from summer to winter.
|
williamr@2
|
127 |
|
williamr@4
|
128 |
For example, if the time changes at 02:00 AM BST to 01:00 AM GMT then local
|
williamr@4
|
129 |
times between 01:00 and 01:59 occur twice.
|
williamr@2
|
130 |
|
williamr@4
|
131 |
The conversion applies the DST offset if the local time value is double and
|
williamr@4
|
132 |
applies the standard UTC offset if the local time does not exists.
|
williamr@2
|
133 |
|
williamr@4
|
134 |
This decision makes the conversion process asymmetrical around the discontinuity
|
williamr@4
|
135 |
in the local time when there is a DST change.
|
williamr@2
|
136 |
|
williamr@4
|
137 |
An example conversion from a double local time to UTC and from UTC to a double
|
williamr@4
|
138 |
local time is:
|
williamr@2
|
139 |
|
williamr@2
|
140 |
01:59 AM BST => 00:59 AM UTC
|
williamr@2
|
141 |
01:59 AM UTC => 01:59 AM GMT
|
williamr@2
|
142 |
|
williamr@2
|
143 |
An example conversion from a non-existent local time to UTC
|
williamr@2
|
144 |
and from UTC to local time is:
|
williamr@2
|
145 |
|
williamr@2
|
146 |
01:59 AM GMT => 01:59 AM UTC
|
williamr@2
|
147 |
01:59 AM UTC => 02:59 AM BST
|
williamr@2
|
148 |
|
williamr@2
|
149 |
@publishedAll
|
williamr@2
|
150 |
@released
|
williamr@2
|
151 |
@since 9.1
|
williamr@2
|
152 |
*/
|
williamr@2
|
153 |
class RTz : public RSessionBase
|
williamr@2
|
154 |
{
|
williamr@2
|
155 |
public:
|
williamr@2
|
156 |
/**
|
williamr@4
|
157 |
Automatic DST update mode.
|
williamr@2
|
158 |
*/
|
williamr@2
|
159 |
enum TTzAutoDSTUpdateModes
|
williamr@2
|
160 |
{
|
williamr@2
|
161 |
/** No auto update notification when a DST event occurs. */
|
williamr@2
|
162 |
ETZAutoDSTUpdateOff = 0,
|
williamr@2
|
163 |
|
williamr@4
|
164 |
/** Automatic time update will occur and the client app will be
|
williamr@4
|
165 |
notified. */
|
williamr@2
|
166 |
ETZAutoDSTUpdateOn,
|
williamr@2
|
167 |
|
williamr@4
|
168 |
/** Client app needs to confirm that the time should be updated whenever
|
williamr@4
|
169 |
a DST event occurs. */
|
williamr@2
|
170 |
ETZAutoDSTNotificationOnly,
|
williamr@2
|
171 |
};
|
williamr@2
|
172 |
|
williamr@4
|
173 |
/**
|
williamr@4
|
174 |
Time zone server change events.
|
williamr@4
|
175 |
*/
|
williamr@2
|
176 |
enum TTzChanges
|
williamr@2
|
177 |
{
|
williamr@2
|
178 |
/** Used for notifying that the timezone database has changed.*/
|
williamr@2
|
179 |
ETZDatabaseChanged = 1,
|
williamr@4
|
180 |
/** Used for notifying that the system timezone has changed.*/
|
williamr@2
|
181 |
ETZSystemTimeZoneChanged,
|
williamr@2
|
182 |
/** Used for notifying that the DST rule has changed. */
|
williamr@2
|
183 |
ETZDSTRuleChanged,
|
williamr@2
|
184 |
/** Used for notifying that an automatic time update has taken place. */
|
williamr@4
|
185 |
ETZAutomaticTimeUpdate,
|
williamr@4
|
186 |
/** Used for notifying that a change in localization resources has taken
|
williamr@4
|
187 |
place. */
|
williamr@4
|
188 |
ETZLocalizationDataChanged
|
williamr@2
|
189 |
};
|
williamr@2
|
190 |
|
williamr@4
|
191 |
/**
|
williamr@4
|
192 |
Time zone server panic codes.
|
williamr@4
|
193 |
*/
|
williamr@2
|
194 |
enum TPanic
|
williamr@2
|
195 |
{
|
williamr@2
|
196 |
/** This panic indicates that the time zone server has not been found.*/
|
williamr@2
|
197 |
EPanicServerNotFound = 1,
|
williamr@2
|
198 |
/** This panic indicates that the server has died.*/
|
williamr@2
|
199 |
EPanicServerDead,
|
williamr@2
|
200 |
/** This panic indicates that the time zone ID is not set.*/
|
williamr@2
|
201 |
EPanicTimeZoneNameIdNotSet,
|
williamr@2
|
202 |
/** This panic indicates that an out of range index was accessed.*/
|
williamr@2
|
203 |
EPanicRulesIndexOutofRange,
|
williamr@4
|
204 |
/** This panic indicates that there are no rules present for this time
|
williamr@4
|
205 |
zone.*/
|
williamr@2
|
206 |
EPanicTimeNotCoveredByRules,
|
williamr@2
|
207 |
/** This panic indicates that the time zone rules are unusable.*/
|
williamr@2
|
208 |
EPanicBadTimeZoneRules,
|
williamr@4
|
209 |
/** This panic indicates that an unsupported time reference has been
|
williamr@4
|
210 |
accessed.*/
|
williamr@2
|
211 |
EPanicUnsupportedTimeReference,
|
williamr@2
|
212 |
/** This panic indicates that the time zone ID is not supported.*/
|
williamr@2
|
213 |
EPanicUnsupportedTimeZoneNoId,
|
williamr@4
|
214 |
/** This panic indicates that a request for notification is already
|
williamr@4
|
215 |
pending from the client.*/
|
williamr@2
|
216 |
EPanicNotificationRequestPending,
|
williamr@4
|
217 |
/** This panic indicates that an incorrect data has been sent to the
|
williamr@4
|
218 |
server.*/
|
williamr@4
|
219 |
EPanicInvalidArgument,
|
williamr@4
|
220 |
/** This panic indicates that a table in the user-defined time zone
|
williamr@4
|
221 |
database has not conformed to the declared schema. */
|
williamr@4
|
222 |
EPanicBadSchema
|
williamr@2
|
223 |
};
|
williamr@2
|
224 |
|
williamr@4
|
225 |
/**
|
williamr@4
|
226 |
The software install observer plugin can distinguish between changes to the
|
williamr@4
|
227 |
resource files or the rules database. This enumeration indicates the filter
|
williamr@4
|
228 |
index that is used for the resource files and rules database filters.
|
williamr@4
|
229 |
This enum should not be used externally.
|
williamr@4
|
230 |
*/
|
williamr@4
|
231 |
enum TSWIObserverFilterIndex
|
williamr@4
|
232 |
{
|
williamr@4
|
233 |
/** The index of the Tz private directory filter. */
|
williamr@4
|
234 |
EFilterTzPrivate=0,
|
williamr@4
|
235 |
/** The index of the resources filter. */
|
williamr@4
|
236 |
EFilterResourceTimezonelocalization
|
williamr@4
|
237 |
};
|
williamr@4
|
238 |
|
williamr@4
|
239 |
public:
|
williamr@2
|
240 |
/**
|
williamr@4
|
241 |
This should not be used externally.
|
williamr@2
|
242 |
*/
|
williamr@2
|
243 |
IMPORT_C static void Panic(TPanic aPanic);
|
williamr@2
|
244 |
|
williamr@2
|
245 |
/**
|
williamr@4
|
246 |
This should not be used externally.
|
williamr@2
|
247 |
*/
|
williamr@2
|
248 |
IMPORT_C CTzId* GetTimeZoneIdL() const;
|
williamr@2
|
249 |
|
williamr@2
|
250 |
/**
|
williamr@4
|
251 |
This should not be used externally.
|
williamr@2
|
252 |
*/
|
williamr@2
|
253 |
IMPORT_C void SetTimeZoneL(CTzId& aZone) const;
|
williamr@2
|
254 |
|
williamr@2
|
255 |
IMPORT_C void Close();
|
williamr@2
|
256 |
IMPORT_C TInt Connect();
|
williamr@2
|
257 |
|
williamr@2
|
258 |
IMPORT_C ~RTz();
|
williamr@2
|
259 |
IMPORT_C RTz();
|
williamr@2
|
260 |
|
williamr@2
|
261 |
IMPORT_C TInt ConvertToLocalTime(TTime& aTime) const;
|
williamr@2
|
262 |
IMPORT_C TInt ConvertToLocalTime(TTime& aTime, const CTzId& aZone) const;
|
williamr@2
|
263 |
IMPORT_C TInt ConvertToUniversalTime(TTime& aTime) const;
|
williamr@2
|
264 |
IMPORT_C TInt ConvertToUniversalTime(TTime& aTime, const CTzId& aZone) const;
|
williamr@2
|
265 |
|
williamr@4
|
266 |
IMPORT_C void GetOffsetsForTimeZoneIdsL(const RArray<TInt>& aTzNumericIds,
|
williamr@4
|
267 |
RArray<TInt>& aOffsets) const;
|
williamr@2
|
268 |
|
williamr@2
|
269 |
IMPORT_C TInt AutoUpdateSettingL();
|
williamr@2
|
270 |
IMPORT_C void SetAutoUpdateBehaviorL(TTzAutoDSTUpdateModes aUpdateEnabled);
|
williamr@2
|
271 |
|
williamr@2
|
272 |
// Methods for setting the system time.
|
williamr@2
|
273 |
IMPORT_C TInt SetHomeTime(const TTime& aLocalTime) const;
|
williamr@2
|
274 |
|
williamr@2
|
275 |
IMPORT_C TBool IsDaylightSavingOnL(CTzId& aZone) const;
|
williamr@2
|
276 |
IMPORT_C TBool IsDaylightSavingOnL(CTzId& aZone, const TTime& aUTCTime) const;
|
williamr@2
|
277 |
|
williamr@2
|
278 |
// Get Encoded Rules for Current Local Time Zone
|
williamr@4
|
279 |
IMPORT_C CTzRules* GetTimeZoneRulesL(const TTime& aStartTime,
|
williamr@4
|
280 |
const TTime& aEndTime, TTzTimeReference aTimeRef) const;
|
williamr@4
|
281 |
IMPORT_C CTzRules* GetTimeZoneRulesL(const CTzId& aZone,
|
williamr@4
|
282 |
const TTime& aStartTime, const TTime& aEndTime,
|
williamr@4
|
283 |
TTzTimeReference aTimeRef) const;
|
williamr@2
|
284 |
|
williamr@2
|
285 |
void RegisterTzChangeNotifier(TRequestStatus& aStatus) const;
|
williamr@2
|
286 |
TInt CancelRequestForNotice() const;
|
williamr@2
|
287 |
TVersion Version() const;
|
williamr@2
|
288 |
|
williamr@4
|
289 |
IMPORT_C void NotifyHomeTimeZoneChangedL(const NTzUpdate::TTimeZoneChange&
|
williamr@4
|
290 |
aChange) const;
|
williamr@2
|
291 |
|
williamr@4
|
292 |
IMPORT_C void SetUnknownZoneTimeL(const TTime& aUTCTime,
|
williamr@4
|
293 |
const TInt aUTCOffset);
|
williamr@4
|
294 |
IMPORT_C void SetUnknownZoneTimeL(const TTime& aUTCTime,
|
williamr@4
|
295 |
const TInt aUTCOffset, TBool aPersistInCenRep);
|
williamr@2
|
296 |
|
williamr@4
|
297 |
IMPORT_C void LocalizationReadCitiesL(RPointerArray<CTzLocalizedCityRecord>&
|
williamr@4
|
298 |
aCities);
|
williamr@4
|
299 |
IMPORT_C void LocalizationReadCitiesL(RPointerArray<CTzLocalizedCityRecord>&
|
williamr@4
|
300 |
aCities, TInt aTimeZoneId);
|
williamr@4
|
301 |
IMPORT_C void LocalizationReadCitiesInGroupL(RPointerArray<CTzLocalizedCityRecord>&
|
williamr@4
|
302 |
aCities, TUint8 aGroupId);
|
williamr@4
|
303 |
IMPORT_C CTzLocalizedTimeZoneRecord* LocalizationReadFrequentlyUsedZoneL(
|
williamr@4
|
304 |
TInt aFrequentlyUsedZone);
|
williamr@4
|
305 |
IMPORT_C CTzLocalizedCityRecord* LocalizationReadCachedTimeZoneCityL(
|
williamr@4
|
306 |
TInt aFrequentlyUsedZone);
|
williamr@4
|
307 |
IMPORT_C void LocalizationCloseDbL();
|
williamr@4
|
308 |
IMPORT_C void LocalizationOpenDbL();
|
williamr@4
|
309 |
IMPORT_C void LocalizationWriteCityL(const TDesC& aCityName, TInt aCityTzId,
|
williamr@4
|
310 |
TUint8 aCityGroupId, TUint aCityTzResourceId);
|
williamr@4
|
311 |
IMPORT_C void LocalizationDeleteCityL(const TDesC& aCityName,
|
williamr@4
|
312 |
TInt aCityTzId);
|
williamr@4
|
313 |
IMPORT_C void LocalizationWriteFrequentlyUsedZoneL(const CTzLocalizedTimeZoneRecord&
|
williamr@4
|
314 |
aTimeZone, const CTzLocalizedCityRecord& aCity,
|
williamr@4
|
315 |
TInt aFrequentlyUsedZone);
|
williamr@4
|
316 |
IMPORT_C void LocalizationWriteAllFrequentlyUsedZonesL(const RPointerArray<CTzLocalizedTimeZoneRecord>& aTimeZones,
|
williamr@4
|
317 |
const RPointerArray<CTzLocalizedCityRecord>& aCities);
|
williamr@4
|
318 |
|
williamr@4
|
319 |
// Debug only methods.
|
williamr@4
|
320 |
IMPORT_C void SwiObsBeginL();
|
williamr@4
|
321 |
IMPORT_C void SwiObsFileChangedL(TSWIObserverFilterIndex aType);
|
williamr@4
|
322 |
IMPORT_C void SwiObsEndL();
|
williamr@2
|
323 |
|
williamr@4
|
324 |
// Debug only methods.
|
williamr@2
|
325 |
IMPORT_C void __dbgClearCacheL(TBool aRestartCaching);
|
williamr@4
|
326 |
IMPORT_C TInt __dbgRequestAllocatedCellsL(TInt aHeapSizeInBytes);
|
williamr@4
|
327 |
IMPORT_C void __dbgSetHeapFailL(RAllocator::TAllocFail aType, TInt aRate);
|
williamr@4
|
328 |
IMPORT_C void __dbgResetHeapL();
|
williamr@2
|
329 |
|
williamr@2
|
330 |
TBool StartCachingL();
|
williamr@2
|
331 |
TUint16 CurrentCachedTzId();
|
williamr@2
|
332 |
|
williamr@4
|
333 |
// User-defined time zone access.
|
williamr@4
|
334 |
CTzId* CreateUserTimeZoneL(const CTzRules& aTzUserRules, const CTzUserNames& aTzUserNames);
|
williamr@4
|
335 |
CTzUserNames* GetUserTimeZoneNamesL(const CTzId& aTzId) const;
|
williamr@4
|
336 |
void UpdateUserTimeZoneL(const CTzId& aTzId, const CTzRules& aTzUserRules, const CTzUserNames& aTzUserNames);
|
williamr@4
|
337 |
void DeleteUserTimeZoneL(const CTzId& aTzId);
|
williamr@4
|
338 |
void GetUserTimeZoneIdsL(RPointerArray<CTzId>& aTzIds) const;
|
williamr@4
|
339 |
|
williamr@2
|
340 |
private:
|
williamr@2
|
341 |
static TInt StartServer();
|
williamr@2
|
342 |
TInt DoConnect();
|
williamr@2
|
343 |
void doConvertL(const CTzId& aZone, TTime& aTime,
|
williamr@2
|
344 |
TTzTimeReference aTimerRef) const;
|
williamr@2
|
345 |
void doConvertL(TTime& aTime,
|
williamr@2
|
346 |
TTzTimeReference aTimerRef) const;
|
williamr@4
|
347 |
|
williamr@4
|
348 |
|
williamr@4
|
349 |
|
williamr@2
|
350 |
private:
|
williamr@2
|
351 |
CTzRuleHolder* iRulesHolder;
|
williamr@2
|
352 |
};
|
williamr@2
|
353 |
|
williamr@4
|
354 |
|
williamr@2
|
355 |
/**
|
williamr@2
|
356 |
Encapsulates a TTime and a TTzTimeReference.
|
williamr@2
|
357 |
|
williamr@2
|
358 |
@publishedAll
|
williamr@2
|
359 |
@released
|
williamr@2
|
360 |
*/
|
williamr@2
|
361 |
class TTimeWithReference
|
williamr@2
|
362 |
{
|
williamr@2
|
363 |
public:
|
williamr@2
|
364 |
static inline TTimeWithReference Max();
|
williamr@4
|
365 |
|
williamr@2
|
366 |
inline TTimeWithReference();
|
williamr@2
|
367 |
inline TTimeWithReference(TTime aTime, TTzTimeReference aTimeReference=ETzUtcTimeReference);
|
williamr@2
|
368 |
inline TTimeWithReference(TDateTime aTime, TTzTimeReference aTimeReference=ETzUtcTimeReference);
|
williamr@4
|
369 |
|
williamr@2
|
370 |
inline bool operator==(const TTimeWithReference& aTime) const;
|
williamr@2
|
371 |
inline bool operator!=(const TTimeWithReference& aTime) const;
|
williamr@2
|
372 |
|
williamr@2
|
373 |
TTime iTime;
|
williamr@2
|
374 |
TTzTimeReference iTimeReference;
|
williamr@2
|
375 |
};
|
williamr@2
|
376 |
|
williamr@2
|
377 |
|
williamr@2
|
378 |
inline TTimeWithReference TTimeWithReference::Max()
|
williamr@2
|
379 |
{
|
williamr@2
|
380 |
return TTimeWithReference(
|
williamr@2
|
381 |
TDateTime(9999,EDecember,30,23,59,59,0),
|
williamr@2
|
382 |
ETzUtcTimeReference);
|
williamr@2
|
383 |
}
|
williamr@2
|
384 |
|
williamr@4
|
385 |
|
williamr@2
|
386 |
inline TTimeWithReference::TTimeWithReference()
|
williamr@4
|
387 |
: iTime(0), iTimeReference(ETzUtcTimeReference)
|
williamr@2
|
388 |
{
|
williamr@2
|
389 |
}
|
williamr@4
|
390 |
|
williamr@4
|
391 |
|
williamr@2
|
392 |
inline TTimeWithReference::TTimeWithReference(TTime aTime, TTzTimeReference aTimeReference)
|
williamr@4
|
393 |
: iTime(aTime), iTimeReference(aTimeReference)
|
williamr@2
|
394 |
{
|
williamr@2
|
395 |
}
|
williamr@4
|
396 |
|
williamr@4
|
397 |
|
williamr@2
|
398 |
inline TTimeWithReference::TTimeWithReference(TDateTime aTime, TTzTimeReference aTimeReference)
|
williamr@4
|
399 |
: iTime(aTime), iTimeReference(aTimeReference)
|
williamr@2
|
400 |
{
|
williamr@2
|
401 |
}
|
williamr@4
|
402 |
|
williamr@4
|
403 |
|
williamr@2
|
404 |
inline bool TTimeWithReference::operator==(const TTimeWithReference& aTime) const
|
williamr@2
|
405 |
{
|
williamr@2
|
406 |
return(aTime.iTime == iTime && aTime.iTimeReference == iTimeReference);
|
williamr@2
|
407 |
}
|
williamr@4
|
408 |
|
williamr@4
|
409 |
|
williamr@2
|
410 |
inline bool TTimeWithReference::operator!=(const TTimeWithReference& aTime) const
|
williamr@2
|
411 |
{
|
williamr@2
|
412 |
return(!(*this == aTime));
|
williamr@2
|
413 |
}
|
williamr@4
|
414 |
|
williamr@4
|
415 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
416 |
/**
|
williamr@4
|
417 |
The CTzUserData class allows the client to create, read, update or delete
|
williamr@4
|
418 |
user-defined time zones.
|
williamr@4
|
419 |
|
williamr@4
|
420 |
A user-defined time zone is comprised of time zone rules (encapsulated in a
|
williamr@4
|
421 |
CTzRules object) and time zone names (encapsulated in a CTzUserNames object).
|
williamr@4
|
422 |
|
williamr@4
|
423 |
A time zone identifier (encapsulated in a CTzId object) is used to uniquely
|
williamr@4
|
424 |
identify a user-defined time zone.
|
williamr@4
|
425 |
|
williamr@4
|
426 |
The CTzUserData class also allows the time zone identifiers for all existing
|
williamr@4
|
427 |
user-defined time zones to be determined.
|
williamr@4
|
428 |
|
williamr@4
|
429 |
@publishedPartner
|
williamr@4
|
430 |
@released
|
williamr@4
|
431 |
*/
|
williamr@4
|
432 |
class CTzUserData : public CBase
|
williamr@4
|
433 |
{
|
williamr@4
|
434 |
public:
|
williamr@4
|
435 |
IMPORT_C static CTzUserData* NewL(RTz& aTzServer);
|
williamr@4
|
436 |
IMPORT_C ~CTzUserData();
|
williamr@4
|
437 |
|
williamr@4
|
438 |
IMPORT_C CTzId* CreateL(const CTzRules& aTzUserRules, const CTzUserNames&
|
williamr@4
|
439 |
aTzUserNames);
|
williamr@4
|
440 |
IMPORT_C CTzRules* ReadRulesL(const CTzId& aTzId) const;
|
williamr@4
|
441 |
IMPORT_C CTzUserNames* ReadNamesL(const CTzId& aTzId) const;
|
williamr@4
|
442 |
IMPORT_C void UpdateL(const CTzId& aTzId, const CTzRules& aTzUserRules,
|
williamr@4
|
443 |
const CTzUserNames& aTzUserNames);
|
williamr@4
|
444 |
IMPORT_C void DeleteL(const CTzId& aTzId);
|
williamr@4
|
445 |
IMPORT_C void GetTzIdsL(RPointerArray<CTzId>& aTzIds) const;
|
williamr@4
|
446 |
|
williamr@4
|
447 |
private:
|
williamr@4
|
448 |
CTzUserData(RTz& aTzServer);
|
williamr@4
|
449 |
|
williamr@4
|
450 |
private:
|
williamr@4
|
451 |
RTz& iTzServer;
|
williamr@4
|
452 |
};
|
williamr@4
|
453 |
|
williamr@4
|
454 |
#endif // SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
455 |
|
williamr@2
|
456 |
#endif
|