|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-9A9654C4-4D7F-485E-8253-B2DB25D3DB78" xml:lang="en"><title>Creating a User-Defined Time Zone</title><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
13 <context id="GUID-56B00847-6F7D-49AB-AFA5-D5ACF0D2EC2F"> <p>This tutorial describes how a device creator creates a user-defined |
|
14 time zone using <codeph>CTzUserData</codeph>.</p>The high-level steps |
|
15 to create a user-defined time zone are described in Procedure section:</context> |
|
16 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-12-1-12-1-1-8-1-5-1-6-1-2-2"> |
|
17 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-12-1-12-1-1-8-1-5-1-6-1-2-2-1"><cmd>Create the |
|
18 TZ rules object using <xref href="GUID-EA377928-E467-3761-B572-36AE27841ADC.dita#GUID-EA377928-E467-3761-B572-36AE27841ADC/GUID-6A1D18BB-D4B4-39E3-B4AF-C5736A152195"><apiname>CTzRules::NewL()</apiname></xref>.</cmd> |
|
19 </step> |
|
20 <step id="GUID-A0FB246B-6F3F-4E32-BCA4-3CF51CACBA3B"><cmd>Use the <xref href="GUID-C40593C4-D60C-39D5-8CB2-4B5D7BBE8ED4.dita#GUID-C40593C4-D60C-39D5-8CB2-4B5D7BBE8ED4/GUID-2E630EE3-1DDB-3F9D-A75B-2119E1B02EF8"><apiname>CTzUserNames::NewL()</apiname></xref> function to create a TZ names object.</cmd> |
|
21 </step> |
|
22 <step id="GUID-81B15C8E-7F6C-4609-B8A0-9DD1F35E4D1C"><cmd>Connect |
|
23 to the TZ server using <xref href="GUID-052221AD-916E-3E47-9510-AC0495A19A70.dita#GUID-052221AD-916E-3E47-9510-AC0495A19A70/GUID-375E314E-3B59-3722-AECA-1DC873507711"><apiname>RTz::Connect()</apiname></xref>.</cmd> |
|
24 </step> |
|
25 <step id="GUID-611E332C-9188-4451-B95F-2FA353D5A109"><cmd>Create a |
|
26 user-defined time zone using <xref href="GUID-1A53F535-96FC-387D-A02D-CAF8B1CEBCF1.dita#GUID-1A53F535-96FC-387D-A02D-CAF8B1CEBCF1/GUID-6D622414-0E99-39E6-8347-BC8CFD709D1D"><apiname>CTzUserData::CreateL()</apiname></xref>. </cmd> |
|
27 </step> |
|
28 </steps> |
|
29 <example><p>An illustration of the procedure is given below. Note |
|
30 that cleanup stack management and <codeph>CTzRules</codeph> object |
|
31 creation details are omitted for clarity. </p><codeblock xml:space="preserve">#include <tz.h> // For CTzUserData etc. |
|
32 #include <…> |
|
33 |
|
34 ... |
|
35 |
|
36 // These strings would typically be supplied by the UI |
|
37 layer. |
|
38 _LIT( KTzUserStdName, ”Mountain Standard Time” ); |
|
39 _LIT( KTzUserShortStdName, ”MST” ); |
|
40 _LIT( KTzUserDstName, ”Mountain Daylight Time” ); |
|
41 _LIT( KTzUserShortDstName, ”MDT” ); |
|
42 _LIT( KTzUserCityName, ”Window Rock” ); |
|
43 _LIT( KTzUserRegionName, ”America” ); |
|
44 |
|
45 // Create TZ rules object. |
|
46 CTzRules* tzRules = ...; |
|
47 |
|
48 // Create TZ names object. |
|
49 CTzUserNames* tzNames = CTzUserNames::NewL( KTzUserStdName, |
|
50 KTzUserShortStdName, |
|
51 KTzUserDstName, |
|
52 KTzUserShortDstName, |
|
53 KTzUserCityName, |
|
54 KTzUserRegionName ); |
|
55 |
|
56 // Connect to TZ Server. |
|
57 RTz tzServer; |
|
58 User::LeaveIfError( tzServer.Connect() ); |
|
59 |
|
60 // Create user-defined TZ. |
|
61 CTzUserData* tzUserData = CTzUserData::NewL( tzServer ); |
|
62 CTzId* userTzId = tzUserData->CreateL( *tzRules, *tzNames ); |
|
63 |
|
64 ...</codeblock></example> |
|
65 </taskbody><related-links> |
|
66 <linklist> |
|
67 <link href="GUID-E0D4EFAC-85E6-4EF6-B65C-1D1602E3A8FD.dita"><linktext>Create |
|
68 a user-defined time zone from an existing time zone </linktext></link> |
|
69 <link href="GUID-676D1493-0035-4AD3-A0E5-A207B25809E4.dita"><linktext>Time |
|
70 Zone Services Overview </linktext></link> |
|
71 </linklist> |
|
72 </related-links></task> |