sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #if !defined(__CONVDATA_H__) sl@0: #define __CONVDATA_H__ sl@0: sl@0: /** sl@0: This structure doesn't intend to be used by external developers. sl@0: 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. sl@0: sl@0: Any use of this structure externally are not proved to be compatible in future. sl@0: @internalComponent sl@0: */ sl@0: struct SCnvConversionData sl@0: { sl@0: /** Specifies the default endian-ness of the current character set. Used by SetDefaultEndiannessOfForeignCharacters(). */ sl@0: enum TEndianness // the values of these *must not* change they are used hard-coded in CNVTOOL.PL sl@0: { sl@0: EUnspecified =0, sl@0: EFixedLittleEndian =1, sl@0: EFixedBigEndian =2 sl@0: }; sl@0: struct SVariableByteData sl@0: { sl@0: struct SRange sl@0: { sl@0: TUint8 iFirstInitialByteValueInRange; sl@0: TUint8 iLastInitialByteValueInRange; sl@0: TUint8 iNumberOfSubsequentBytes; sl@0: TUint8 iSpare; sl@0: }; sl@0: TInt iNumberOfRanges; sl@0: const SRange* iRangeArray; sl@0: }; sl@0: struct SOneDirectionData sl@0: { sl@0: struct SRange sl@0: { sl@0: enum TAlgorithm sl@0: { sl@0: // each of these, with the exception of EDirect, has a corresponding member of UData sl@0: EDirect, sl@0: EOffset, sl@0: EIndexedTable16, sl@0: EKeyedTable1616, sl@0: EKeyedTable16OfIndexedTables16, sl@0: EIndexedTable32, sl@0: EKeyedTable3232, sl@0: EKeyedTable32OfIndexedTables32 sl@0: }; sl@0: union UData sl@0: { sl@0: struct SIndexedTable16 sl@0: { sl@0: struct SEntry sl@0: { sl@0: TUint16 iOutputCharacterCode; sl@0: }; sl@0: const SEntry* iEntryArray; sl@0: }; sl@0: struct SKeyedTable1616 sl@0: { sl@0: struct SEntry sl@0: { sl@0: TUint16 iKey; sl@0: TUint16 iOutputCharacterCode; sl@0: }; sl@0: TInt iNumberOfEntries; sl@0: const SEntry* iEntryArray; sl@0: }; sl@0: struct SKeyedTable16OfIndexedTables16 sl@0: { sl@0: struct SKeyedEntry sl@0: { sl@0: TUint16 iFirstInputCharacterCodeInIndexedTable; sl@0: TUint16 iLastInputCharacterCodeInIndexedTable; sl@0: const TUint16* iIndexedEntryArray; sl@0: }; sl@0: TInt iNumberOfKeyedEntries; sl@0: const SKeyedEntry* iKeyedEntryArray; sl@0: }; sl@0: struct SIndexedTable32 sl@0: { sl@0: struct SEntry sl@0: { sl@0: TUint32 iOutputCharacterCode; sl@0: }; sl@0: const SEntry* iEntryArray; sl@0: }; sl@0: struct SKeyedTable3232 sl@0: { sl@0: struct SEntry sl@0: { sl@0: TUint32 iKey; sl@0: TUint32 iOutputCharacterCode; sl@0: }; sl@0: TInt iNumberOfEntries; sl@0: const SEntry* iEntryArray; sl@0: }; sl@0: struct SKeyedTable32OfIndexedTables32 sl@0: { sl@0: struct SKeyedEntry sl@0: { sl@0: TUint32 iFirstInputCharacterCodeInIndexedTable; sl@0: TUint32 iLastInputCharacterCodeInIndexedTable; sl@0: const TUint32* iIndexedEntryArray; sl@0: }; sl@0: TInt iNumberOfKeyedEntries; sl@0: const SKeyedEntry* iKeyedEntryArray; sl@0: }; sl@0: TInt iOffset; sl@0: SIndexedTable16 iIndexedTable16; sl@0: SKeyedTable1616 iKeyedTable1616; sl@0: SKeyedTable16OfIndexedTables16 iKeyedTable16OfIndexedTables16; sl@0: SIndexedTable32 iIndexedTable32; sl@0: SKeyedTable3232 iKeyedTable3232; sl@0: SKeyedTable32OfIndexedTables32 iKeyedTable32OfIndexedTables32; sl@0: }; sl@0: TUint iFirstInputCharacterCodeInRange; sl@0: TUint iLastInputCharacterCodeInRange; sl@0: TUint8 iAlgorithm; // one of the TAlgorithm values sl@0: TUint8 iSizeOfOutputCharacterCodeInBytesIfForeign; // only used in SCnvConversionData::iUnicodeToForeignData sl@0: TUint16 iSpare; sl@0: #if defined(CONST_STATIC_UNIONS_ARE_POSSIBLE) sl@0: UData iData; sl@0: #else sl@0: struct sl@0: { sl@0: TUint iWord1; sl@0: TUint iWord2; sl@0: } iData; sl@0: #endif sl@0: }; sl@0: TInt iNumberOfRanges; sl@0: const SRange* iRangeArray; sl@0: }; sl@0: TEndianness iEndiannessOfForeignCharacters; sl@0: SVariableByteData iForeignVariableByteData; sl@0: SOneDirectionData iForeignToUnicodeData; sl@0: SOneDirectionData iUnicodeToForeignData; sl@0: TAny* iSpareForFutureUse_1; sl@0: TAny* iSpareForFutureUse_2; sl@0: }; sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define UData_SIndexedTable16(a) \ sl@0: reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry*>(a)) sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define UData_SKeyedTable1616(a) \ sl@0: static_cast<TUint>ARRAY_LENGTH(a), \ sl@0: reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*>(a)) sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define UData_SKeyedTable16OfIndexedTables16(a) \ sl@0: static_cast<TUint>ARRAY_LENGTH(a), \ sl@0: reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry *>(a)) sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define UData_SIndexedTable32(a) \ sl@0: reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable32::SEntry*>(a)) sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define UData_SKeyedTable3232(a) \ sl@0: static_cast<TUint>ARRAY_LENGTH(a), \ sl@0: reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable3232::SEntry*>(a)) sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define UData_SKeyedTable32OfIndexedTables32(a) \ sl@0: static_cast<TUint>ARRAY_LENGTH(a), \ sl@0: reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable32OfIndexedTables32::SKeyedEntry *>(a)) sl@0: #endif sl@0: