textandloc_pub/character_conversion_api/inc/CONVDATA.H
changeset 0 1fb32624e06b
child 16 56cd22a7a1cb
equal deleted inserted replaced
-1:000000000000 0:1fb32624e06b
       
     1 /*
       
     2 * Copyright (c) 1997-2000 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #if !defined(__CONVDATA_H__)
       
    21 #define __CONVDATA_H__
       
    22 
       
    23 /**
       
    24 @internalComponent
       
    25 */
       
    26 struct SCnvConversionData
       
    27 	{
       
    28 /** Specifies the default endian-ness of the current character set. Used by SetDefaultEndiannessOfForeignCharacters(). */
       
    29 	enum TEndianness // the values of these *must not* change they are used hard-coded in CNVTOOL.PL
       
    30 		{
       
    31 		EUnspecified		=0,
       
    32 		EFixedLittleEndian	=1,
       
    33 		EFixedBigEndian		=2
       
    34 		};
       
    35 	struct SVariableByteData
       
    36 		{
       
    37 		struct SRange
       
    38 			{
       
    39 			TUint8 iFirstInitialByteValueInRange;
       
    40 			TUint8 iLastInitialByteValueInRange;
       
    41 			TUint8 iNumberOfSubsequentBytes;
       
    42 			TUint8 iSpare;
       
    43 			};
       
    44 		TInt iNumberOfRanges;
       
    45 		const SRange* iRangeArray;
       
    46 		};
       
    47 	struct SOneDirectionData
       
    48 		{
       
    49 		struct SRange
       
    50 			{
       
    51 			enum TAlgorithm
       
    52 				{
       
    53 				// each of these, with the exception of EDirect, has a corresponding member of UData
       
    54 				EDirect,
       
    55 				EOffset,
       
    56 				EIndexedTable16,
       
    57 				EKeyedTable1616,
       
    58 				EKeyedTable16OfIndexedTables16
       
    59 				};
       
    60 			union UData
       
    61 				{
       
    62 				struct SIndexedTable16
       
    63 					{
       
    64 					struct SEntry
       
    65 						{
       
    66 						TUint16 iOutputCharacterCode;
       
    67 						};
       
    68 					const SEntry* iEntryArray;
       
    69 					};
       
    70 				struct SKeyedTable1616
       
    71 					{
       
    72 					struct SEntry
       
    73 						{
       
    74 						TUint16 iKey;
       
    75 						TUint16 iOutputCharacterCode;
       
    76 						};
       
    77 					TInt iNumberOfEntries;
       
    78 					const SEntry* iEntryArray;
       
    79 					};
       
    80 				struct SKeyedTable16OfIndexedTables16
       
    81 					{
       
    82 					struct SKeyedEntry
       
    83 						{
       
    84 						TUint16 iFirstInputCharacterCodeInIndexedTable;
       
    85 						TUint16 iLastInputCharacterCodeInIndexedTable;
       
    86 						const TUint16* iIndexedEntryArray;
       
    87 						};
       
    88 					TInt iNumberOfKeyedEntries;
       
    89 					const SKeyedEntry* iKeyedEntryArray;
       
    90 					};
       
    91 				TInt iOffset;
       
    92 				SIndexedTable16 iIndexedTable16;
       
    93 				SKeyedTable1616 iKeyedTable1616;
       
    94 				SKeyedTable16OfIndexedTables16 iKeyedTable16OfIndexedTables16;
       
    95 				};
       
    96 			TUint iFirstInputCharacterCodeInRange;
       
    97 			TUint iLastInputCharacterCodeInRange;
       
    98 			TUint8 iAlgorithm; // one of the TAlgorithm values
       
    99 			TUint8 iSizeOfOutputCharacterCodeInBytesIfForeign; // only used in SCnvConversionData::iUnicodeToForeignData
       
   100 			TUint16 iSpare;
       
   101 #if defined(CONST_STATIC_UNIONS_ARE_POSSIBLE)
       
   102 			UData iData;
       
   103 #else
       
   104 			struct
       
   105 				{
       
   106 				TUint iWord1;
       
   107 				TUint iWord2;
       
   108 				} iData;
       
   109 #endif
       
   110 			};
       
   111 		TInt iNumberOfRanges;
       
   112 		const SRange* iRangeArray;
       
   113 		};
       
   114 	TEndianness iEndiannessOfForeignCharacters;
       
   115 	SVariableByteData iForeignVariableByteData;
       
   116 	SOneDirectionData iForeignToUnicodeData;
       
   117 	SOneDirectionData iUnicodeToForeignData;
       
   118 	TAny* iSpareForFutureUse_1;
       
   119 	TAny* iSpareForFutureUse_2;
       
   120 	};
       
   121 
       
   122 /**
       
   123 @internalComponent
       
   124 */
       
   125 #define UData_SIndexedTable16(a) \
       
   126 	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry*>(a)) 
       
   127 /**
       
   128 @internalComponent
       
   129 */
       
   130 #define UData_SKeyedTable1616(a) \
       
   131 	static_cast<TUint>ARRAY_LENGTH(a), \
       
   132 	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*>(a))
       
   133 /**
       
   134 @internalComponent
       
   135 */
       
   136 #define UData_SKeyedTable16OfIndexedTables16(a)	\
       
   137 	static_cast<TUint>ARRAY_LENGTH(a), \
       
   138 	reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry *>(a)) 
       
   139 
       
   140 #endif
       
   141