os/textandloc/charconvfw/charconv_fw/inc/convdata.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/charconvfw/charconv_fw/inc/convdata.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,195 @@
     1.4 +/*
     1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     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.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#if !defined(__CONVDATA_H__)
    1.23 +#define __CONVDATA_H__
    1.24 +
    1.25 +/**
    1.26 +This structure doesn't intend to be used by external developers.
    1.27 +For plugin creators, all they need is to include this header file in order to compile. All the plugin data are generated from provided perl scripts. 
    1.28 + 
    1.29 +Any use of this structure externally are not proved to be compatible in future. 
    1.30 +@internalComponent
    1.31 +*/
    1.32 +struct SCnvConversionData
    1.33 +	{
    1.34 +/** Specifies the default endian-ness of the current character set. Used by SetDefaultEndiannessOfForeignCharacters(). */
    1.35 +	enum TEndianness // the values of these *must not* change they are used hard-coded in CNVTOOL.PL
    1.36 +		{
    1.37 +		EUnspecified		=0,
    1.38 +		EFixedLittleEndian	=1,
    1.39 +		EFixedBigEndian		=2
    1.40 +		};
    1.41 +	struct SVariableByteData
    1.42 +		{
    1.43 +		struct SRange
    1.44 +			{
    1.45 +			TUint8 iFirstInitialByteValueInRange;
    1.46 +			TUint8 iLastInitialByteValueInRange;
    1.47 +			TUint8 iNumberOfSubsequentBytes;
    1.48 +			TUint8 iSpare;
    1.49 +			};
    1.50 +		TInt iNumberOfRanges;
    1.51 +		const SRange* iRangeArray;
    1.52 +		};
    1.53 +	struct SOneDirectionData
    1.54 +		{
    1.55 +		struct SRange
    1.56 +			{
    1.57 +			enum TAlgorithm
    1.58 +				{
    1.59 +				// each of these, with the exception of EDirect, has a corresponding member of UData
    1.60 +				EDirect,
    1.61 +				EOffset,
    1.62 +				EIndexedTable16,
    1.63 +				EKeyedTable1616,
    1.64 +				EKeyedTable16OfIndexedTables16,
    1.65 +				EIndexedTable32,
    1.66 +				EKeyedTable3232,
    1.67 +				EKeyedTable32OfIndexedTables32
    1.68 +				};
    1.69 +			union UData
    1.70 +				{
    1.71 +				struct SIndexedTable16
    1.72 +					{
    1.73 +					struct SEntry
    1.74 +						{
    1.75 +						TUint16 iOutputCharacterCode;
    1.76 +						};
    1.77 +					const SEntry* iEntryArray;
    1.78 +					};
    1.79 +				struct SKeyedTable1616
    1.80 +					{
    1.81 +					struct SEntry
    1.82 +						{
    1.83 +						TUint16 iKey;
    1.84 +						TUint16 iOutputCharacterCode;
    1.85 +						};
    1.86 +					TInt iNumberOfEntries;
    1.87 +					const SEntry* iEntryArray;
    1.88 +					};
    1.89 +				struct SKeyedTable16OfIndexedTables16
    1.90 +					{
    1.91 +					struct SKeyedEntry
    1.92 +						{
    1.93 +						TUint16 iFirstInputCharacterCodeInIndexedTable;
    1.94 +						TUint16 iLastInputCharacterCodeInIndexedTable;
    1.95 +						const TUint16* iIndexedEntryArray;
    1.96 +						};
    1.97 +					TInt iNumberOfKeyedEntries;
    1.98 +					const SKeyedEntry* iKeyedEntryArray;
    1.99 +					};
   1.100 +				struct SIndexedTable32
   1.101 +					{
   1.102 +					struct SEntry
   1.103 +						{
   1.104 +						TUint32 iOutputCharacterCode;
   1.105 +						};
   1.106 +					const SEntry* iEntryArray;
   1.107 +					};
   1.108 +				struct SKeyedTable3232
   1.109 +					{
   1.110 +					struct SEntry
   1.111 +						{
   1.112 +						TUint32 iKey;
   1.113 +						TUint32 iOutputCharacterCode;
   1.114 +						};
   1.115 +					TInt iNumberOfEntries;
   1.116 +					const SEntry* iEntryArray;
   1.117 +					};
   1.118 +				struct SKeyedTable32OfIndexedTables32
   1.119 +					{
   1.120 +					struct SKeyedEntry
   1.121 +						{
   1.122 +						TUint32 iFirstInputCharacterCodeInIndexedTable;
   1.123 +						TUint32 iLastInputCharacterCodeInIndexedTable;
   1.124 +						const TUint32* iIndexedEntryArray;
   1.125 +						};
   1.126 +					TInt iNumberOfKeyedEntries;
   1.127 +					const SKeyedEntry* iKeyedEntryArray;
   1.128 +					};
   1.129 +				TInt iOffset;
   1.130 +				SIndexedTable16 iIndexedTable16;
   1.131 +				SKeyedTable1616 iKeyedTable1616;
   1.132 +				SKeyedTable16OfIndexedTables16 iKeyedTable16OfIndexedTables16;
   1.133 +				SIndexedTable32 iIndexedTable32;
   1.134 +				SKeyedTable3232 iKeyedTable3232;
   1.135 +				SKeyedTable32OfIndexedTables32 iKeyedTable32OfIndexedTables32;
   1.136 +				};
   1.137 +			TUint iFirstInputCharacterCodeInRange;
   1.138 +			TUint iLastInputCharacterCodeInRange;
   1.139 +			TUint8 iAlgorithm; // one of the TAlgorithm values
   1.140 +			TUint8 iSizeOfOutputCharacterCodeInBytesIfForeign; // only used in SCnvConversionData::iUnicodeToForeignData
   1.141 +			TUint16 iSpare;
   1.142 +#if defined(CONST_STATIC_UNIONS_ARE_POSSIBLE)
   1.143 +			UData iData;
   1.144 +#else
   1.145 +			struct
   1.146 +				{
   1.147 +				TUint iWord1;
   1.148 +				TUint iWord2;
   1.149 +				} iData;
   1.150 +#endif
   1.151 +			};
   1.152 +		TInt iNumberOfRanges;
   1.153 +		const SRange* iRangeArray;
   1.154 +		};
   1.155 +	TEndianness iEndiannessOfForeignCharacters;
   1.156 +	SVariableByteData iForeignVariableByteData;
   1.157 +	SOneDirectionData iForeignToUnicodeData;
   1.158 +	SOneDirectionData iUnicodeToForeignData;
   1.159 +	TAny* iSpareForFutureUse_1;
   1.160 +	TAny* iSpareForFutureUse_2;
   1.161 +	};
   1.162 +
   1.163 +/**
   1.164 +@internalComponent
   1.165 +*/
   1.166 +#define UData_SIndexedTable16(a) \
   1.167 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry*>(a)) 
   1.168 +/**
   1.169 +@internalComponent
   1.170 +*/
   1.171 +#define UData_SKeyedTable1616(a) \
   1.172 +	static_cast<TUint>ARRAY_LENGTH(a), \
   1.173 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*>(a))
   1.174 +/**
   1.175 +@internalComponent
   1.176 +*/
   1.177 +#define UData_SKeyedTable16OfIndexedTables16(a)	\
   1.178 +	static_cast<TUint>ARRAY_LENGTH(a), \
   1.179 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry *>(a)) 
   1.180 +/**
   1.181 +@internalComponent
   1.182 +*/
   1.183 +#define UData_SIndexedTable32(a) \
   1.184 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable32::SEntry*>(a)) 
   1.185 +/**
   1.186 +@internalComponent
   1.187 +*/
   1.188 +#define UData_SKeyedTable3232(a) \
   1.189 +	static_cast<TUint>ARRAY_LENGTH(a), \
   1.190 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable3232::SEntry*>(a))
   1.191 +/**
   1.192 +@internalComponent
   1.193 +*/
   1.194 +#define UData_SKeyedTable32OfIndexedTables32(a)	\
   1.195 +	static_cast<TUint>ARRAY_LENGTH(a), \
   1.196 +	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable32OfIndexedTables32::SKeyedEntry *>(a)) 
   1.197 +#endif
   1.198 +