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