|
1 /* |
|
2 * Copyright (c) 1997-2009 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 #if !defined(__CONVDATA_H__) |
|
20 #define __CONVDATA_H__ |
|
21 |
|
22 /** |
|
23 This structure doesn't intend to be used by external developers. |
|
24 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. |
|
25 |
|
26 Any use of this structure externally are not proved to be compatible in future. |
|
27 @internalComponent |
|
28 */ |
|
29 struct SCnvConversionData |
|
30 { |
|
31 /** Specifies the default endian-ness of the current character set. Used by SetDefaultEndiannessOfForeignCharacters(). */ |
|
32 enum TEndianness // the values of these *must not* change they are used hard-coded in CNVTOOL.PL |
|
33 { |
|
34 EUnspecified =0, |
|
35 EFixedLittleEndian =1, |
|
36 EFixedBigEndian =2 |
|
37 }; |
|
38 struct SVariableByteData |
|
39 { |
|
40 struct SRange |
|
41 { |
|
42 TUint8 iFirstInitialByteValueInRange; |
|
43 TUint8 iLastInitialByteValueInRange; |
|
44 TUint8 iNumberOfSubsequentBytes; |
|
45 TUint8 iSpare; |
|
46 }; |
|
47 TInt iNumberOfRanges; |
|
48 const SRange* iRangeArray; |
|
49 }; |
|
50 struct SOneDirectionData |
|
51 { |
|
52 struct SRange |
|
53 { |
|
54 enum TAlgorithm |
|
55 { |
|
56 // each of these, with the exception of EDirect, has a corresponding member of UData |
|
57 EDirect, |
|
58 EOffset, |
|
59 EIndexedTable16, |
|
60 EKeyedTable1616, |
|
61 EKeyedTable16OfIndexedTables16, |
|
62 EIndexedTable32, |
|
63 EKeyedTable3232, |
|
64 EKeyedTable32OfIndexedTables32 |
|
65 }; |
|
66 union UData |
|
67 { |
|
68 struct SIndexedTable16 |
|
69 { |
|
70 struct SEntry |
|
71 { |
|
72 TUint16 iOutputCharacterCode; |
|
73 }; |
|
74 const SEntry* iEntryArray; |
|
75 }; |
|
76 struct SKeyedTable1616 |
|
77 { |
|
78 struct SEntry |
|
79 { |
|
80 TUint16 iKey; |
|
81 TUint16 iOutputCharacterCode; |
|
82 }; |
|
83 TInt iNumberOfEntries; |
|
84 const SEntry* iEntryArray; |
|
85 }; |
|
86 struct SKeyedTable16OfIndexedTables16 |
|
87 { |
|
88 struct SKeyedEntry |
|
89 { |
|
90 TUint16 iFirstInputCharacterCodeInIndexedTable; |
|
91 TUint16 iLastInputCharacterCodeInIndexedTable; |
|
92 const TUint16* iIndexedEntryArray; |
|
93 }; |
|
94 TInt iNumberOfKeyedEntries; |
|
95 const SKeyedEntry* iKeyedEntryArray; |
|
96 }; |
|
97 struct SIndexedTable32 |
|
98 { |
|
99 struct SEntry |
|
100 { |
|
101 TUint32 iOutputCharacterCode; |
|
102 }; |
|
103 const SEntry* iEntryArray; |
|
104 }; |
|
105 struct SKeyedTable3232 |
|
106 { |
|
107 struct SEntry |
|
108 { |
|
109 TUint32 iKey; |
|
110 TUint32 iOutputCharacterCode; |
|
111 }; |
|
112 TInt iNumberOfEntries; |
|
113 const SEntry* iEntryArray; |
|
114 }; |
|
115 struct SKeyedTable32OfIndexedTables32 |
|
116 { |
|
117 struct SKeyedEntry |
|
118 { |
|
119 TUint32 iFirstInputCharacterCodeInIndexedTable; |
|
120 TUint32 iLastInputCharacterCodeInIndexedTable; |
|
121 const TUint32* iIndexedEntryArray; |
|
122 }; |
|
123 TInt iNumberOfKeyedEntries; |
|
124 const SKeyedEntry* iKeyedEntryArray; |
|
125 }; |
|
126 TInt iOffset; |
|
127 SIndexedTable16 iIndexedTable16; |
|
128 SKeyedTable1616 iKeyedTable1616; |
|
129 SKeyedTable16OfIndexedTables16 iKeyedTable16OfIndexedTables16; |
|
130 SIndexedTable32 iIndexedTable32; |
|
131 SKeyedTable3232 iKeyedTable3232; |
|
132 SKeyedTable32OfIndexedTables32 iKeyedTable32OfIndexedTables32; |
|
133 }; |
|
134 TUint iFirstInputCharacterCodeInRange; |
|
135 TUint iLastInputCharacterCodeInRange; |
|
136 TUint8 iAlgorithm; // one of the TAlgorithm values |
|
137 TUint8 iSizeOfOutputCharacterCodeInBytesIfForeign; // only used in SCnvConversionData::iUnicodeToForeignData |
|
138 TUint16 iSpare; |
|
139 #if defined(CONST_STATIC_UNIONS_ARE_POSSIBLE) |
|
140 UData iData; |
|
141 #else |
|
142 struct |
|
143 { |
|
144 TUint iWord1; |
|
145 TUint iWord2; |
|
146 } iData; |
|
147 #endif |
|
148 }; |
|
149 TInt iNumberOfRanges; |
|
150 const SRange* iRangeArray; |
|
151 }; |
|
152 TEndianness iEndiannessOfForeignCharacters; |
|
153 SVariableByteData iForeignVariableByteData; |
|
154 SOneDirectionData iForeignToUnicodeData; |
|
155 SOneDirectionData iUnicodeToForeignData; |
|
156 TAny* iSpareForFutureUse_1; |
|
157 TAny* iSpareForFutureUse_2; |
|
158 }; |
|
159 |
|
160 /** |
|
161 @internalComponent |
|
162 */ |
|
163 #define UData_SIndexedTable16(a) \ |
|
164 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry*>(a)) |
|
165 /** |
|
166 @internalComponent |
|
167 */ |
|
168 #define UData_SKeyedTable1616(a) \ |
|
169 static_cast<TUint>ARRAY_LENGTH(a), \ |
|
170 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*>(a)) |
|
171 /** |
|
172 @internalComponent |
|
173 */ |
|
174 #define UData_SKeyedTable16OfIndexedTables16(a) \ |
|
175 static_cast<TUint>ARRAY_LENGTH(a), \ |
|
176 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry *>(a)) |
|
177 /** |
|
178 @internalComponent |
|
179 */ |
|
180 #define UData_SIndexedTable32(a) \ |
|
181 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable32::SEntry*>(a)) |
|
182 /** |
|
183 @internalComponent |
|
184 */ |
|
185 #define UData_SKeyedTable3232(a) \ |
|
186 static_cast<TUint>ARRAY_LENGTH(a), \ |
|
187 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable3232::SEntry*>(a)) |
|
188 /** |
|
189 @internalComponent |
|
190 */ |
|
191 #define UData_SKeyedTable32OfIndexedTables32(a) \ |
|
192 static_cast<TUint>ARRAY_LENGTH(a), \ |
|
193 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable32OfIndexedTables32::SKeyedEntry *>(a)) |
|
194 #endif |
|
195 |