epoc32/include/convdata.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/convdata.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,136 @@
     1.4 +// Copyright (c) 1997-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 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#if !defined(__CONVDATA_H__)
    1.20 +#define __CONVDATA_H__
    1.21 +
    1.22 +/**
    1.23 +@internalComponent
    1.24 +*/
    1.25 +struct SCnvConversionData
    1.26 +	{
    1.27 +/** Specifies the default endian-ness of the current character set. Used by SetDefaultEndiannessOfForeignCharacters(). */
    1.28 +	enum TEndianness // the values of these *must not* change they are used hard-coded in CNVTOOL.PL
    1.29 +		{
    1.30 +		EUnspecified		=0,
    1.31 +		EFixedLittleEndian	=1,
    1.32 +		EFixedBigEndian		=2
    1.33 +		};
    1.34 +	struct SVariableByteData
    1.35 +		{
    1.36 +		struct SRange
    1.37 +			{
    1.38 +			TUint8 iFirstInitialByteValueInRange;
    1.39 +			TUint8 iLastInitialByteValueInRange;
    1.40 +			TUint8 iNumberOfSubsequentBytes;
    1.41 +			TUint8 iSpare;
    1.42 +			};
    1.43 +		TInt iNumberOfRanges;
    1.44 +		const SRange* iRangeArray;
    1.45 +		};
    1.46 +	struct SOneDirectionData
    1.47 +		{
    1.48 +		struct SRange
    1.49 +			{
    1.50 +			enum TAlgorithm
    1.51 +				{
    1.52 +				// each of these, with the exception of EDirect, has a corresponding member of UData
    1.53 +				EDirect,
    1.54 +				EOffset,
    1.55 +				EIndexedTable16,
    1.56 +				EKeyedTable1616,
    1.57 +				EKeyedTable16OfIndexedTables16
    1.58 +				};
    1.59 +			union UData
    1.60 +				{
    1.61 +				struct SIndexedTable16
    1.62 +					{
    1.63 +					struct SEntry
    1.64 +						{
    1.65 +						TUint16 iOutputCharacterCode;
    1.66 +						};
    1.67 +					const SEntry* iEntryArray;
    1.68 +					};
    1.69 +				struct SKeyedTable1616
    1.70 +					{
    1.71 +					struct SEntry
    1.72 +						{
    1.73 +						TUint16 iKey;
    1.74 +						TUint16 iOutputCharacterCode;
    1.75 +						};
    1.76 +					TInt iNumberOfEntries;
    1.77 +					const SEntry* iEntryArray;
    1.78 +					};
    1.79 +				struct SKeyedTable16OfIndexedTables16
    1.80 +					{
    1.81 +					struct SKeyedEntry
    1.82 +						{
    1.83 +						TUint16 iFirstInputCharacterCodeInIndexedTable;
    1.84 +						TUint16 iLastInputCharacterCodeInIndexedTable;
    1.85 +						const TUint16* iIndexedEntryArray;
    1.86 +						};
    1.87 +					TInt iNumberOfKeyedEntries;
    1.88 +					const SKeyedEntry* iKeyedEntryArray;
    1.89 +					};
    1.90 +				TInt iOffset;
    1.91 +				SIndexedTable16 iIndexedTable16;
    1.92 +				SKeyedTable1616 iKeyedTable1616;
    1.93 +				SKeyedTable16OfIndexedTables16 iKeyedTable16OfIndexedTables16;
    1.94 +				};
    1.95 +			TUint iFirstInputCharacterCodeInRange;
    1.96 +			TUint iLastInputCharacterCodeInRange;
    1.97 +			TUint8 iAlgorithm; // one of the TAlgorithm values
    1.98 +			TUint8 iSizeOfOutputCharacterCodeInBytesIfForeign; // only used in SCnvConversionData::iUnicodeToForeignData
    1.99 +			TUint16 iSpare;
   1.100 +#if defined(CONST_STATIC_UNIONS_ARE_POSSIBLE)
   1.101 +			UData iData;
   1.102 +#else
   1.103 +			struct
   1.104 +				{
   1.105 +				TUint iWord1;
   1.106 +				TUint iWord2;
   1.107 +				} iData;
   1.108 +#endif
   1.109 +			};
   1.110 +		TInt iNumberOfRanges;
   1.111 +		const SRange* iRangeArray;
   1.112 +		};
   1.113 +	TEndianness iEndiannessOfForeignCharacters;
   1.114 +	SVariableByteData iForeignVariableByteData;
   1.115 +	SOneDirectionData iForeignToUnicodeData;
   1.116 +	SOneDirectionData iUnicodeToForeignData;
   1.117 +	TAny* iSpareForFutureUse_1;
   1.118 +	TAny* iSpareForFutureUse_2;
   1.119 +	};
   1.120 +
   1.121 +/**
   1.122 +@internalComponent
   1.123 +*/
   1.124 +#define UData_SIndexedTable16(a) \
   1.125 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry*>(a)) 
   1.126 +/**
   1.127 +@internalComponent
   1.128 +*/
   1.129 +#define UData_SKeyedTable1616(a) \
   1.130 +	static_cast<TUint>ARRAY_LENGTH(a), \
   1.131 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*>(a))
   1.132 +/**
   1.133 +@internalComponent
   1.134 +*/
   1.135 +#define UData_SKeyedTable16OfIndexedTables16(a)	\
   1.136 +	static_cast<TUint>ARRAY_LENGTH(a), \
   1.137 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry *>(a)) 
   1.138 +
   1.139 +#endif