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