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