diff -r e1b950c65cb4 -r 837f303aceeb epoc32/include/mw/tzlocalizationdatatypes.h --- a/epoc32/include/mw/tzlocalizationdatatypes.h Wed Mar 31 12:27:01 2010 +0100 +++ b/epoc32/include/mw/tzlocalizationdatatypes.h Wed Mar 31 12:33:34 2010 +0100 @@ -1,9 +1,9 @@ // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members +// under the terms of "Eclipse Public License v1.0" // which accompanies this distribution, and is available -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". +// at the URL "http://www.eclipse.org/legal/epl-v10.html". // // Initial Contributors: // Nokia Corporation - initial contribution. @@ -16,36 +16,51 @@ #ifndef __TZLOCAL_DATATYPES_H__ #define __TZLOCAL_DATATYPES_H__ -#include //CBase +#include /** -Encapsulates the correspondence between a time zone ID and a resource ID and +The resource structure LOCALIZED_TIMEZONE (defined in TimeZoneLocalization.rh) is used +to represent a time zone item in a resource file. One of the members of this structure is +WORD time_zone_id which stores the id of the time zone. + +This class stores a time zone id (iTzId) and its associated resource id (iResourceId). This facilitates fast finding of resources in the resource file. For internal use only. +For instance for a time zone defined as follow in the resource file, iTzId would be 2728 and +iResourceId would be r_tz_europe_tirane (more precisely the resource id assigned to r_tz_europe_tirane +by the resource compiler). + +RESOURCE LOCALIZED_TIMEZONE r_tz_europe_tirane + { + time_zone_id = 2728; + standard_name = 2728_standard_name; + daylight_name = 2728_daylight_name; + short_standard_name = 2728_short_standard_name; + short_daylight_name = 2728_short_daylight_name; + cities = + { + TIMEZONE_CITY + { + city_group_id = 5; + city_name = 2728_tirane_name; + } + }; + } + @internalTechnology */ class TTzLocalizedId { public: - // Represents an invalid UTC offset of 25 hours and 1 minutes, in minutes - enum TTzUTCOffset - { - ETzInvalidUTCOffset = 1501 - }; - - public: - TTzLocalizedId(const TUint16 aTzId, const TUint aResourceId =0); + explicit TTzLocalizedId(const TUint16 aTzId, const TUint aResourceId); //Accessor methods inline TUint16 TimeZoneId() const; inline TUint ResourceId() const; - inline TInt UTCOffset() const; - inline void SetUTCOffset(TInt aOffsetInMinutes); - + private: TUint16 iTzId; TUint iResourceId; - TInt iUTCOffset; //UTC offset stored in minutes }; /** @@ -82,11 +97,15 @@ CTzLocalizedCity(const TUint8 aGroupId, const TTzLocalizedId& aTzLocalizedId); private: - //Member data HBufC* iName; TUint8 iGroupId; TTzLocalizedId iTzLocalizedId; TInt iCityIndex; + /** + When sorting arrays in UTC order the UTC offset is stored here. It is expressed in minutes. + This value should only be used for this purpose. + */ + TInt iUTCOffset; }; /** @@ -111,7 +130,6 @@ CTzLocalizedCityGroup(const TUint8 aGroupId); private: - //Member data HBufC* iName; TUint8 iGroupId; }; @@ -119,7 +137,7 @@ /** Encapsulates a group of LDML localized timezone names. LDML stands for Locale Data Markup Language. For details, see -http://www.openi18n.org/specs/ldml/1.0/ldml-spec.htm. +http://www.openi18n.org/specs/ldml/1.0/ldml-spec.htm @publishedAll @released @@ -186,12 +204,16 @@ CTzLocalizedTimeZone(const TTzLocalizedId& aTzLocalizedId); private: - //Member data TTzLocalizedId iTzLocalizedId; HBufC* iStandardName; HBufC* iDaylightName; HBufC* iShortStandardName; HBufC* iShortDaylightName; + /** + When sorting arrays in UTC order the UTC offset is stored here. It is expressed in minutes. + This value should only be used for this purpose. + */ + TInt iUTCOffset; }; /** @@ -213,11 +235,11 @@ inline void Remove(TInt aIndex); inline void Sort(TLinearOrder aOrder); inline TInt Find(T* aEntry,TIdentityRelation aIdentityRelation); + inline void ReserveL(TInt aCount); inline CTzLocalizedArray(); private: - //Member data RPointerArray iArray; }; @@ -243,6 +265,7 @@ IMPORT_C void Remove(TInt aIndex); IMPORT_C void Sort(TLinearOrder anOrder); IMPORT_C TInt Find(CTzLocalizedCity* anEntry,TIdentityRelation aIdentityRelation); + void ReserveL(TInt aCount); }; /** @@ -264,6 +287,7 @@ IMPORT_C void Remove(TInt aIndex); IMPORT_C void Sort(TLinearOrder anOrder); IMPORT_C TInt Find(CTzLocalizedCityGroup* anEntry,TIdentityRelation aIdentityRelation); + void ReserveL(TInt aCount); }; /** @@ -285,11 +309,9 @@ IMPORT_C void Remove(TInt aIndex); IMPORT_C void Sort(TLinearOrder anOrder); IMPORT_C TInt Find(CTzLocalizedTimeZone* anEntry,TIdentityRelation aIdentityRelation); + void ReserveL(TInt aCount); }; #include #endif //__TZLOCAL_DATATYPES_H__ -//================================================================== -// End of file -//==================================================================