epoc32/include/mw/tzlocalizationdatatypes.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/mw/tzlocalizationdatatypes.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/mw/tzlocalizationdatatypes.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,9 +1,9 @@
     1.4  // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5  // All rights reserved.
     1.6  // This component and the accompanying materials are made available
     1.7 -// 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
     1.8 +// under the terms of "Eclipse Public License v1.0"
     1.9  // which accompanies this distribution, and is available
    1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12  //
    1.13  // Initial Contributors:
    1.14  // Nokia Corporation - initial contribution.
    1.15 @@ -16,36 +16,51 @@
    1.16  #ifndef __TZLOCAL_DATATYPES_H__
    1.17  #define __TZLOCAL_DATATYPES_H__
    1.18  
    1.19 -#include <e32base.h>	//CBase
    1.20 +#include <e32base.h>
    1.21  
    1.22  /**
    1.23 -Encapsulates the correspondence between a time zone ID and a resource ID and
    1.24 +The resource structure LOCALIZED_TIMEZONE (defined in TimeZoneLocalization.rh) is used
    1.25 +to represent a time zone item in a resource file. One of the members of this structure is
    1.26 +WORD time_zone_id which stores the id of the time zone.
    1.27 +
    1.28 +This class stores a time zone id (iTzId) and its associated resource id (iResourceId). This
    1.29  facilitates fast finding of resources in the resource file.  For internal use only.
    1.30  
    1.31 +For instance for a time zone defined as follow in the resource file, iTzId would be 2728 and 
    1.32 +iResourceId would be r_tz_europe_tirane (more precisely the resource id assigned to r_tz_europe_tirane
    1.33 +by the resource compiler).
    1.34 +
    1.35 +RESOURCE LOCALIZED_TIMEZONE r_tz_europe_tirane
    1.36 +	{
    1.37 +	time_zone_id = 2728;
    1.38 +	standard_name = 2728_standard_name;
    1.39 +	daylight_name = 2728_daylight_name;
    1.40 +	short_standard_name = 2728_short_standard_name;
    1.41 +	short_daylight_name = 2728_short_daylight_name;
    1.42 +	cities = 
    1.43 +		{
    1.44 +		TIMEZONE_CITY
    1.45 +			{
    1.46 +			city_group_id = 5;
    1.47 +			city_name = 2728_tirane_name;
    1.48 +			}
    1.49 +		};
    1.50 +	}
    1.51 +
    1.52  @internalTechnology
    1.53  */
    1.54  class TTzLocalizedId
    1.55  	{
    1.56  	public:
    1.57 -		// Represents an invalid UTC offset of 25 hours and 1 minutes, in minutes
    1.58 -		enum TTzUTCOffset
    1.59 -			{
    1.60 -			ETzInvalidUTCOffset = 1501
    1.61 -			};
    1.62 -
    1.63 -	public:
    1.64 -		TTzLocalizedId(const TUint16 aTzId, const TUint aResourceId =0);
    1.65 +		explicit TTzLocalizedId(const TUint16 aTzId, const TUint aResourceId);
    1.66  
    1.67  		//Accessor methods
    1.68  		inline TUint16 TimeZoneId() const;
    1.69  		inline TUint ResourceId() const;
    1.70 -		inline TInt UTCOffset() const;
    1.71 -		inline void SetUTCOffset(TInt aOffsetInMinutes);
    1.72 -
    1.73 +		
    1.74  	private:
    1.75  		TUint16 iTzId;
    1.76  		TUint iResourceId;
    1.77 -		TInt iUTCOffset;	//UTC offset stored in minutes
    1.78  	};
    1.79  
    1.80  /**
    1.81 @@ -82,11 +97,15 @@
    1.82  		CTzLocalizedCity(const TUint8 aGroupId, const TTzLocalizedId& aTzLocalizedId);
    1.83  
    1.84  	private:
    1.85 -		//Member data
    1.86  		HBufC* iName;
    1.87  		TUint8 iGroupId;
    1.88  		TTzLocalizedId iTzLocalizedId;
    1.89          TInt iCityIndex;
    1.90 +        /**
    1.91 +        When sorting arrays in UTC order the UTC offset is stored here. It is expressed in minutes.
    1.92 +        This value should only be used for this purpose.
    1.93 +        */
    1.94 +        TInt iUTCOffset;
    1.95  	};
    1.96  
    1.97  /**
    1.98 @@ -111,7 +130,6 @@
    1.99  		CTzLocalizedCityGroup(const TUint8 aGroupId);
   1.100  
   1.101  	private:
   1.102 -		//Member data
   1.103  		HBufC* iName;
   1.104  		TUint8 iGroupId;
   1.105  	};
   1.106 @@ -119,7 +137,7 @@
   1.107  /**
   1.108  Encapsulates a group of LDML localized timezone names.
   1.109  LDML stands for Locale Data Markup Language. For details, see 
   1.110 -http://www.openi18n.org/specs/ldml/1.0/ldml-spec.htm.
   1.111 +http://www.openi18n.org/specs/ldml/1.0/ldml-spec.htm
   1.112  
   1.113  @publishedAll
   1.114  @released
   1.115 @@ -186,12 +204,16 @@
   1.116  		CTzLocalizedTimeZone(const TTzLocalizedId& aTzLocalizedId);
   1.117  
   1.118  	private:
   1.119 -		//Member data
   1.120  		TTzLocalizedId iTzLocalizedId;
   1.121  		HBufC* iStandardName;
   1.122  		HBufC* iDaylightName;
   1.123  		HBufC* iShortStandardName;
   1.124  		HBufC* iShortDaylightName;
   1.125 +		/**
   1.126 +        When sorting arrays in UTC order the UTC offset is stored here. It is expressed in minutes.
   1.127 +        This value should only be used for this purpose.
   1.128 +        */
   1.129 +		TInt iUTCOffset;
   1.130  	};
   1.131  
   1.132  /**
   1.133 @@ -213,11 +235,11 @@
   1.134  		inline void Remove(TInt aIndex);
   1.135  		inline void Sort(TLinearOrder<T> aOrder);
   1.136  		inline TInt Find(T* aEntry,TIdentityRelation<T> aIdentityRelation);
   1.137 +		inline void ReserveL(TInt aCount);
   1.138  
   1.139  		inline CTzLocalizedArray();
   1.140  
   1.141  	private:
   1.142 -		//Member data
   1.143  		RPointerArray<T> iArray;
   1.144  	};
   1.145  
   1.146 @@ -243,6 +265,7 @@
   1.147  		IMPORT_C void Remove(TInt aIndex);
   1.148  		IMPORT_C void Sort(TLinearOrder<CTzLocalizedCity> anOrder);
   1.149  		IMPORT_C TInt Find(CTzLocalizedCity* anEntry,TIdentityRelation<CTzLocalizedCity> aIdentityRelation);
   1.150 +		void ReserveL(TInt aCount);
   1.151  	};
   1.152  	
   1.153  /**
   1.154 @@ -264,6 +287,7 @@
   1.155  		IMPORT_C void Remove(TInt aIndex);
   1.156  		IMPORT_C void Sort(TLinearOrder<CTzLocalizedCityGroup> anOrder);
   1.157  		IMPORT_C TInt Find(CTzLocalizedCityGroup* anEntry,TIdentityRelation<CTzLocalizedCityGroup> aIdentityRelation);
   1.158 +		void ReserveL(TInt aCount);
   1.159  	};
   1.160  
   1.161  /**
   1.162 @@ -285,11 +309,9 @@
   1.163  		IMPORT_C void Remove(TInt aIndex);
   1.164  		IMPORT_C void Sort(TLinearOrder<CTzLocalizedTimeZone> anOrder);
   1.165  		IMPORT_C TInt Find(CTzLocalizedTimeZone* anEntry,TIdentityRelation<CTzLocalizedTimeZone> aIdentityRelation);
   1.166 +		void ReserveL(TInt aCount);
   1.167  	};
   1.168  
   1.169  #include <tzlocalizationdatatypes.inl>
   1.170  
   1.171  #endif //__TZLOCAL_DATATYPES_H__
   1.172 -//==================================================================
   1.173 -// End of file
   1.174 -//==================================================================