4 * Copyright 2002 Lionel Ulmer
5 * Copyright 2003,2004 Mike McCormack
6 * Copyright 2004 Dmitry Timoshkov
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 #include "wine/unicode.h"
41 #include "wine/debug.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(mlang
);
47 #define CP_UNICODE 1200
49 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
51 static HRESULT
MultiLanguage_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
54 * Under what circumstances HKEY_CLASSES_ROOT\MIME\Database\Codepage and
55 * HKEY_CLASSES_ROOT\MIME\Database\Charset are used?
60 const char *description
;
63 const char *web_charset
;
64 const char *header_charset
;
65 const char *body_charset
;
68 /* These data are based on the codepage info in libs/unicode/cpmap.pl */
69 /* FIXME: Add 28604 (Celtic), 28606 (Balkan) */
71 static const MIME_CP_INFO arabic_cp
[] =
74 864, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
75 MIMECONTF_MIME_LATEST
,
76 "ibm864", "ibm864", "ibm864" },
78 1006, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
79 MIMECONTF_MIME_LATEST
,
80 "ibm1006", "ibm1006", "ibm1006" },
82 1256, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
83 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
84 MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
85 "windows-1256", "windows-1256", "windows-1256" },
87 28596, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
88 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
89 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
90 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
91 "iso-8859-6", "iso-8859-6", "iso-8859-6" }
93 static const MIME_CP_INFO baltic_cp
[] =
96 775, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
97 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
98 "ibm775", "ibm775", "ibm775" },
100 1257, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
101 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
102 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
103 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
104 "windows-1257", "windows-1257", "windows-1257" },
106 28594, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
107 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
108 MIMECONTF_EXPORT
| MIMECONTF_VALID
| MIMECONTF_VALID_NLS
|
109 MIMECONTF_MIME_LATEST
,
110 "iso-8859-4", "iso-8859-4", "iso-8859-4" },
112 28603, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
113 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
114 "iso-8859-13", "iso-8859-13", "iso-8859-13" }
116 static const MIME_CP_INFO chinese_simplified_cp
[] =
118 { "Chinese Simplified (GB2312)",
119 936, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
120 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
121 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
122 MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
123 "gb2312", "gb2312", "gb2312" }
125 static const MIME_CP_INFO chinese_traditional_cp
[] =
127 { "Chinese Traditional (Big5)",
128 950, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
129 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
130 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
131 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
132 "big5", "big5", "big5" }
134 static const MIME_CP_INFO central_european_cp
[] =
136 { "Central European (DOS)",
137 852, MIMECONTF_BROWSER
| MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_BROWSER
|
138 MIMECONTF_EXPORT
| MIMECONTF_VALID
| MIMECONTF_VALID_NLS
|
139 MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
140 "ibm852", "ibm852", "ibm852" },
141 { "Central European (Windows)",
142 1250, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
143 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
144 MIMECONTF_EXPORT
| MIMECONTF_VALID
| MIMECONTF_VALID_NLS
|
145 MIMECONTF_MIME_LATEST
,
146 "windows-1250", "windows-1250", "windows-1250" },
147 { "Central European (Mac)",
148 10029, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
149 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
150 "x-mac-ce", "x-mac-ce", "x-mac-ce" },
151 { "Central European (ISO)",
152 28592, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
153 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
154 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
155 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
156 "iso-8859-2", "iso-8859-2", "iso-8859-2" }
158 static const MIME_CP_INFO cyrillic_cp
[] =
161 855, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
162 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
163 "ibm855", "ibm855", "ibm855" },
165 866, MIMECONTF_BROWSER
| MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_BROWSER
|
166 MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
|
167 MIMECONTF_MIME_LATEST
,
168 "cp866", "cp866", "cp866" },
169 #if 0 /* Windows has 20866 as an official code page for KOI8-R */
170 { "Cyrillic (KOI8-R)",
171 878, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
172 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
173 "koi8-r", "koi8-r", "koi8-r" },
175 { "Cyrillic (Windows)",
176 1251, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
177 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
178 MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
179 "windows-1251", "windows-1251", "windows-1251" },
181 10007, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
182 MIMECONTF_MIME_LATEST
,
183 "x-mac-cyrillic", "x-mac-cyrillic", "x-mac-cyrillic" },
184 { "Cyrillic (KOI8-R)",
185 20866, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
186 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
187 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
188 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
189 "koi8-r", "koi8-r", "koi8-r" },
190 { "Cyrillic (KOI8-U)",
191 21866, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
192 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
193 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
194 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
195 "koi8-u", "koi8-u", "koi8-u" },
197 28595, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
198 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
199 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
200 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
201 "iso-8859-5", "iso-8859-5", "iso-8859-5" }
203 static const MIME_CP_INFO greek_cp
[] =
206 737, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
207 MIMECONTF_MIME_LATEST
,
208 "ibm737", "ibm737", "ibm737" },
209 { "Greek, Modern (DOS)",
210 869, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
211 MIMECONTF_MIME_LATEST
,
212 "ibm869", "ibm869", "ibm869" },
213 { "IBM EBCDIC (Greek Modern)",
214 875, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
215 MIMECONTF_MIME_LATEST
,
216 "cp875", "cp875", "cp875" },
218 1253, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
219 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
220 MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
221 "windows-1253", "windows-1253", "windows-1253" },
223 10006, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
224 MIMECONTF_MIME_LATEST
,
225 "x-mac-greek", "x-mac-greek", "x-mac-greek" },
227 28597, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
228 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
229 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
230 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
231 "iso-8859-7", "iso-8859-7", "iso-8859-7" }
233 static const MIME_CP_INFO hebrew_cp
[] =
236 424, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
237 MIMECONTF_MIME_LATEST
,
238 "ibm424", "ibm424", "ibm424" },
240 856, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
241 MIMECONTF_MIME_LATEST
,
242 "cp856", "cp856", "cp856" },
244 862, MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
| MIMECONTF_IMPORT
|
245 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
246 MIMECONTF_MIME_LATEST
,
247 "dos-862", "dos-862", "dos-862" },
248 { "Hebrew (Windows)",
249 1255, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
250 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
251 MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
252 "windows-1255", "windows-1255", "windows-1255" },
253 { "Hebrew (ISO-Visual)",
254 28598, MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
| MIMECONTF_IMPORT
|
255 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
256 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
257 "iso-8859-8", "iso-8859-8", "iso-8859-8" }
259 static const MIME_CP_INFO japanese_cp
[] =
261 { "Japanese (Shift-JIS)",
262 932, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
263 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
264 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
265 MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
266 "shift_jis", "iso-2022-jp", "iso-2022-jp" },
267 { "Japanese (JIS 0208-1990 and 0212-1990)",
268 20932, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
269 MIMECONTF_MIME_LATEST
,
270 "euc-jp", "euc-jp", "euc-jp" }
272 static const MIME_CP_INFO korean_cp
[] =
275 949, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
276 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
277 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
|
278 MIMECONTF_MIME_LATEST
,
279 "ks_c_5601-1987", "ks_c_5601-1987", "ks_c_5601-1987" }
281 static const MIME_CP_INFO thai_cp
[] =
284 874, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_MIME_LATEST
,
285 "ibm-thai", "ibm-thai", "ibm-thai" }
287 static const MIME_CP_INFO turkish_cp
[] =
290 857, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
291 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
292 "ibm857", "ibm857", "ibm857" },
293 { "IBM EBCDIC (Turkish Latin-5)",
294 1026, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
295 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
296 "ibm1026", "ibm1026", "ibm1026" },
297 { "Turkish (Windows)",
298 1254, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
299 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
300 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
301 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
302 "windows-1254", "windows-1254", "windows-1254" },
304 10081, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
305 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
306 "x-mac-turkish", "x-mac-turkish", "x-mac-turkish" },
308 28593, MIMECONTF_MAILNEWS
| MIMECONTF_IMPORT
|
309 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
310 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
311 "iso-8859-3", "iso-8859-3", "iso-8859-3" },
313 28599, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
314 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
315 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
316 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
317 "iso-8859-9", "iso-8859-9", "iso-8859-9" }
319 static const MIME_CP_INFO vietnamese_cp
[] =
321 { "Vietnamese (Windows)",
322 1258, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
323 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
324 MIMECONTF_EXPORT
| MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
|
325 MIMECONTF_MIME_LATEST
,
326 "windows-1258", "windows-1258", "windows-1258" }
328 static const MIME_CP_INFO western_cp
[] =
330 { "IBM EBCDIC (US-Canada)",
331 37, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
332 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
333 "ibm037", "ibm037", "ibm037" },
334 { "OEM United States",
335 437, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
336 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
337 "ibm437", "ibm437", "ibm437" },
338 { "IBM EBCDIC (International)",
339 500, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
340 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
341 "ibm500", "ibm500", "ibm500" },
342 { "Western European (DOS)",
343 850, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
344 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
345 "ibm850", "ibm850", "ibm850" },
346 { "Portuguese (DOS)",
347 860, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
348 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
349 "ibm860", "ibm860", "ibm860" },
351 861, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
352 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
353 "ibm861", "ibm861", "ibm861" },
354 { "French Canadian (DOS)",
355 863, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
356 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
357 "ibm863", "ibm863", "ibm863" },
359 865, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
360 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
361 "ibm865", "ibm865", "ibm865" },
362 { "Western European (Windows)",
363 1252, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_MINIMAL
|
364 MIMECONTF_IMPORT
| MIMECONTF_SAVABLE_MAILNEWS
|
365 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
366 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
367 "windows-1252", "windows-1252", "iso-8859-1" },
368 { "Western European (Mac)",
369 10000, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
370 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
371 "macintosh", "macintosh", "macintosh" },
373 10079, MIMECONTF_IMPORT
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
374 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_LATEST
,
375 "x-mac-icelandic", "x-mac-icelandic", "x-mac-icelandic" },
376 { "Western European (ISO)",
377 28591, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
378 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
379 MIMECONTF_EXPORT
| MIMECONTF_VALID
| MIMECONTF_VALID_NLS
|
380 MIMECONTF_MIME_LATEST
,
381 "iso-8859-1", "iso-8859-1", "iso-8859-1" },
383 28605, MIMECONTF_MAILNEWS
| MIMECONTF_IMPORT
|
384 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
385 MIMECONTF_EXPORT
| MIMECONTF_VALID
| MIMECONTF_VALID_NLS
|
386 MIMECONTF_MIME_LATEST
,
387 "iso-8859-15", "iso-8859-15", "iso-8859-15" }
389 static const MIME_CP_INFO unicode_cp
[] =
392 CP_UNICODE
, MIMECONTF_MINIMAL
| MIMECONTF_IMPORT
|
393 MIMECONTF_SAVABLE_BROWSER
| MIMECONTF_EXPORT
|
394 MIMECONTF_VALID
| MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
|
395 MIMECONTF_MIME_LATEST
,
396 "unicode", "unicode", "unicode" },
398 CP_UTF7
, MIMECONTF_MAILNEWS
| MIMECONTF_IMPORT
|
399 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_EXPORT
| MIMECONTF_VALID
|
400 MIMECONTF_VALID_NLS
| MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
401 "utf-7", "utf-7", "utf-7" },
403 CP_UTF8
, MIMECONTF_MAILNEWS
| MIMECONTF_BROWSER
| MIMECONTF_IMPORT
|
404 MIMECONTF_SAVABLE_MAILNEWS
| MIMECONTF_SAVABLE_BROWSER
|
405 MIMECONTF_EXPORT
| MIMECONTF_VALID
| MIMECONTF_VALID_NLS
|
406 MIMECONTF_MIME_IE4
| MIMECONTF_MIME_LATEST
,
407 "utf-8", "utf-8", "utf-8" }
410 static const struct mlang_data
412 const char *description
;
413 UINT family_codepage
;
415 const MIME_CP_INFO
*mime_cp_info
;
416 const char *fixed_font
;
417 const char *proportional_font
;
420 { "Arabic",1256,sizeof(arabic_cp
)/sizeof(arabic_cp
[0]),arabic_cp
,
421 "Courier","Arial" }, /* FIXME */
422 { "Baltic",1257,sizeof(baltic_cp
)/sizeof(baltic_cp
[0]),baltic_cp
,
423 "Courier","Arial" }, /* FIXME */
424 { "Chinese Simplified",936,sizeof(chinese_simplified_cp
)/sizeof(chinese_simplified_cp
[0]),chinese_simplified_cp
,
425 "Courier","Arial" }, /* FIXME */
426 { "Chinese Traditional",950,sizeof(chinese_traditional_cp
)/sizeof(chinese_traditional_cp
[0]),chinese_traditional_cp
,
427 "Courier","Arial" }, /* FIXME */
428 { "Central European",1250,sizeof(central_european_cp
)/sizeof(central_european_cp
[0]),central_european_cp
,
429 "Courier","Arial" }, /* FIXME */
430 { "Cyrillic",1251,sizeof(cyrillic_cp
)/sizeof(cyrillic_cp
[0]),cyrillic_cp
,
431 "Courier","Arial" }, /* FIXME */
432 { "Greek",1253,sizeof(greek_cp
)/sizeof(greek_cp
[0]),greek_cp
,
433 "Courier","Arial" }, /* FIXME */
434 { "Hebrew",1255,sizeof(hebrew_cp
)/sizeof(hebrew_cp
[0]),hebrew_cp
,
435 "Courier","Arial" }, /* FIXME */
436 { "Japanese",932,sizeof(japanese_cp
)/sizeof(japanese_cp
[0]),japanese_cp
,
437 "Courier","Arial" }, /* FIXME */
438 { "Korean",949,sizeof(korean_cp
)/sizeof(korean_cp
[0]),korean_cp
,
439 "Courier","Arial" }, /* FIXME */
440 { "Thai",874,sizeof(thai_cp
)/sizeof(thai_cp
[0]),thai_cp
,
441 "Courier","Arial" }, /* FIXME */
442 { "Turkish",1254,sizeof(turkish_cp
)/sizeof(turkish_cp
[0]),turkish_cp
,
443 "Courier","Arial" }, /* FIXME */
444 { "Vietnamese",1258,sizeof(vietnamese_cp
)/sizeof(vietnamese_cp
[0]),vietnamese_cp
,
445 "Courier","Arial" }, /* FIXME */
446 { "Western European",1252,sizeof(western_cp
)/sizeof(western_cp
[0]),western_cp
,
447 "Courier","Arial" }, /* FIXME */
448 { "Unicode",CP_UNICODE
,sizeof(unicode_cp
)/sizeof(unicode_cp
[0]),unicode_cp
,
449 "Courier","Arial" } /* FIXME */
452 static void fill_cp_info(const struct mlang_data
*ml_data
, UINT index
, MIMECPINFO
*mime_cp_info
);
454 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpv
)
457 case DLL_PROCESS_ATTACH
:
458 DisableThreadLibraryCalls(hInstDLL
);
460 case DLL_PROCESS_DETACH
:
466 HRESULT WINAPI
ConvertINetMultiByteToUnicode(
476 TRACE("%p %ld %s %p %p %p\n", pdwMode
, dwEncoding
,
477 debugstr_a(pSrcStr
), pcSrcSize
, pDstStr
, pcDstSize
);
483 pcSrcSize
= &src_len
;
494 if (*pcSrcSize
== -1)
495 *pcSrcSize
= lstrlenW((LPCWSTR
)pSrcStr
);
496 *pcDstSize
= min(*pcSrcSize
, *pcDstSize
);
497 *pcSrcSize
*= sizeof(WCHAR
);
499 memmove(pDstStr
, pSrcStr
, *pcDstSize
* sizeof(WCHAR
));
503 if (*pcSrcSize
== -1)
504 *pcSrcSize
= lstrlenA(pSrcStr
);
507 *pcDstSize
= MultiByteToWideChar(dwEncoding
, 0, pSrcStr
, *pcSrcSize
, pDstStr
, *pcDstSize
);
509 *pcDstSize
= MultiByteToWideChar(dwEncoding
, 0, pSrcStr
, *pcSrcSize
, NULL
, 0);
519 HRESULT WINAPI
ConvertINetUnicodeToMultiByte(
530 TRACE("%p %ld %s %p %p %p\n", pdwMode
, dwEncoding
,
531 debugstr_w(pSrcStr
), pcSrcSize
, pDstStr
, pcDstSize
);
537 pcSrcSize
= &src_len
;
548 if (*pcSrcSize
== -1)
549 *pcSrcSize
= lstrlenW(pSrcStr
);
550 *pcDstSize
= min(*pcSrcSize
* sizeof(WCHAR
), *pcDstSize
);
552 memmove(pDstStr
, pSrcStr
, *pcDstSize
);
556 if (*pcSrcSize
== -1)
557 *pcSrcSize
= lstrlenW(pSrcStr
);
560 *pcDstSize
= WideCharToMultiByte(dwEncoding
, 0, pSrcStr
, *pcSrcSize
, pDstStr
, *pcDstSize
, NULL
, NULL
);
562 *pcDstSize
= WideCharToMultiByte(dwEncoding
, 0, pSrcStr
, *pcSrcSize
, NULL
, 0, NULL
, NULL
);
573 HRESULT WINAPI
ConvertINetString(
583 FIXME("%p %ld %ld %s %p %p %p: stub!\n", pdwMode
, dwSrcEncoding
, dwDstEncoding
,
584 debugstr_a(pSrcStr
), pcSrcSize
, pDstStr
, pcDstSize
);
588 static HRESULT
GetFamilyCodePage(
590 UINT
* puiFamilyCodePage
)
594 TRACE("%u %p\n", uiCodePage
, puiFamilyCodePage
);
596 if (!puiFamilyCodePage
) return S_FALSE
;
598 for (i
= 0; i
< sizeof(mlang_data
)/sizeof(mlang_data
[0]); i
++)
600 for (n
= 0; n
< mlang_data
[i
].number_of_cp
; n
++)
602 if (mlang_data
[i
].mime_cp_info
[n
].cp
== uiCodePage
)
604 *puiFamilyCodePage
= mlang_data
[i
].family_codepage
;
613 HRESULT WINAPI
IsConvertINetStringAvailable(
617 UINT src_family
, dst_family
;
619 TRACE("%ld %ld\n", dwSrcEncoding
, dwDstEncoding
);
621 if (GetFamilyCodePage(dwSrcEncoding
, &src_family
) != S_OK
||
622 GetFamilyCodePage(dwDstEncoding
, &dst_family
) != S_OK
)
625 if (src_family
== dst_family
) return S_OK
;
627 /* we can convert any codepage to/from unicode */
628 if (src_family
== CP_UNICODE
|| dst_family
== CP_UNICODE
) return S_OK
;
633 HRESULT WINAPI
LcidToRfc1766A(
638 FIXME("%ld %s %u\n", Locale
, pszRfc1766
, nChar
);
642 HRESULT WINAPI
LcidToRfc1766W(
647 FIXME("%ld %p %u\n", Locale
, pszRfc1766
, nChar
);
651 /******************************************************************************
655 IClassFactory ITF_IClassFactory
;
658 HRESULT (*pfnCreateInstance
)(IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
661 struct object_creation_info
665 HRESULT (*pfnCreateInstance
)(IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
668 static const struct object_creation_info object_creation
[] =
670 { &CLSID_CMultiLanguage
, "CLSID_CMultiLanguage", MultiLanguage_create
},
673 static HRESULT WINAPI
674 MLANGCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
)
676 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
678 TRACE("%s\n", debugstr_guid(riid
) );
680 if (IsEqualGUID(riid
, &IID_IUnknown
)
681 || IsEqualGUID(riid
, &IID_IClassFactory
))
683 IClassFactory_AddRef(iface
);
688 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
689 return E_NOINTERFACE
;
692 static ULONG WINAPI
MLANGCF_AddRef(LPCLASSFACTORY iface
)
694 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
695 return InterlockedIncrement(&This
->ref
);
698 static ULONG WINAPI
MLANGCF_Release(LPCLASSFACTORY iface
)
700 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
702 ULONG ref
= InterlockedDecrement(&This
->ref
);
706 TRACE("Destroying %p\n", This
);
707 HeapFree(GetProcessHeap(), 0, This
);
713 static HRESULT WINAPI
MLANGCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
,
714 REFIID riid
, LPVOID
*ppobj
)
716 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
720 TRACE("(%p)->(%p,%s,%p)\n",This
,pOuter
,debugstr_guid(riid
),ppobj
);
723 hres
= This
->pfnCreateInstance(pOuter
, (LPVOID
*) &punk
);
724 if (SUCCEEDED(hres
)) {
725 hres
= IUnknown_QueryInterface(punk
, riid
, ppobj
);
726 IUnknown_Release(punk
);
728 TRACE("returning (%p) -> %lx\n", *ppobj
, hres
);
732 static HRESULT WINAPI
MLANGCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
)
734 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
735 FIXME("(%p)->(%d),stub!\n",This
,dolock
);
739 static IClassFactoryVtbl MLANGCF_Vtbl
=
741 MLANGCF_QueryInterface
,
744 MLANGCF_CreateInstance
,
748 HRESULT WINAPI
MLANG_DllGetClassObject(REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
751 IClassFactoryImpl
*factory
;
753 TRACE("%s %s %p\n",debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
755 if ( !IsEqualGUID( &IID_IClassFactory
, iid
)
756 && ! IsEqualGUID( &IID_IUnknown
, iid
) )
757 return E_NOINTERFACE
;
759 for (i
=0; i
< sizeof(object_creation
)/sizeof(object_creation
[0]); i
++)
761 if (IsEqualGUID(object_creation
[i
].clsid
, rclsid
))
765 if (i
== sizeof(object_creation
)/sizeof(object_creation
[0]))
767 FIXME("%s: no class found.\n", debugstr_guid(rclsid
));
768 return CLASS_E_CLASSNOTAVAILABLE
;
771 TRACE("Creating a class factory for %s\n",object_creation
[i
].szClassName
);
773 factory
= HeapAlloc(GetProcessHeap(), 0, sizeof(*factory
));
774 if (factory
== NULL
) return E_OUTOFMEMORY
;
776 factory
->ITF_IClassFactory
.lpVtbl
= &MLANGCF_Vtbl
;
779 factory
->pfnCreateInstance
= object_creation
[i
].pfnCreateInstance
;
781 *ppv
= &(factory
->ITF_IClassFactory
);
783 TRACE("(%p) <- %p\n", ppv
, &(factory
->ITF_IClassFactory
) );
789 /******************************************************************************/
791 typedef struct tagMLang_impl
793 IMLangFontLinkVtbl
*vtbl_IMLangFontLink
;
794 IMultiLanguageVtbl
*vtbl_IMultiLanguage
;
795 IMultiLanguage2Vtbl
*vtbl_IMultiLanguage2
;
797 DWORD total_cp
, total_scripts
;
800 static ULONG WINAPI
MLang_AddRef( MLang_impl
* This
)
802 return InterlockedIncrement(&This
->ref
);
805 static ULONG WINAPI
MLang_Release( MLang_impl
* This
)
807 ULONG ref
= InterlockedDecrement(&This
->ref
);
809 TRACE("%p ref = %ld\n", This
, ref
);
812 TRACE("Destroying %p\n", This
);
813 HeapFree(GetProcessHeap(), 0, This
);
819 static HRESULT WINAPI
MLang_QueryInterface(
824 TRACE("%p -> %s\n", This
, debugstr_guid(riid
) );
826 if (IsEqualGUID(riid
, &IID_IUnknown
)
827 || IsEqualGUID(riid
, &IID_IMLangCodePages
)
828 || IsEqualGUID(riid
, &IID_IMLangFontLink
))
831 TRACE("Returning IID_IMLangFontLink %p ref = %ld\n", This
, This
->ref
);
832 *ppvObject
= &(This
->vtbl_IMLangFontLink
);
836 if (IsEqualGUID(riid
, &IID_IMultiLanguage
) )
839 TRACE("Returning IID_IMultiLanguage %p ref = %ld\n", This
, This
->ref
);
840 *ppvObject
= &(This
->vtbl_IMultiLanguage
);
844 if (IsEqualGUID(riid
, &IID_IMultiLanguage2
) )
847 *ppvObject
= &(This
->vtbl_IMultiLanguage2
);
848 TRACE("Returning IID_IMultiLanguage2 %p ref = %ld\n", This
, This
->ref
);
852 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
853 return E_NOINTERFACE
;
856 /******************************************************************************/
858 typedef struct tagEnumCodePage_impl
860 IEnumCodePageVtbl
*vtbl_IEnumCodePage
;
866 static HRESULT WINAPI
fnIEnumCodePage_QueryInterface(
867 IEnumCodePage
* iface
,
871 ICOM_THIS_MULTI(EnumCodePage_impl
, vtbl_IEnumCodePage
, iface
);
873 TRACE("%p -> %s\n", This
, debugstr_guid(riid
) );
875 if (IsEqualGUID(riid
, &IID_IUnknown
)
876 || IsEqualGUID(riid
, &IID_IEnumCodePage
))
878 IEnumCodePage_AddRef(iface
);
879 TRACE("Returning IID_IEnumCodePage %p ref = %ld\n", This
, This
->ref
);
880 *ppvObject
= &(This
->vtbl_IEnumCodePage
);
884 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
885 return E_NOINTERFACE
;
888 static ULONG WINAPI
fnIEnumCodePage_AddRef(
889 IEnumCodePage
* iface
)
891 ICOM_THIS_MULTI(EnumCodePage_impl
, vtbl_IEnumCodePage
, iface
);
892 return InterlockedIncrement(&This
->ref
);
895 static ULONG WINAPI
fnIEnumCodePage_Release(
896 IEnumCodePage
* iface
)
898 ICOM_THIS_MULTI(EnumCodePage_impl
, vtbl_IEnumCodePage
, iface
);
899 ULONG ref
= InterlockedDecrement(&This
->ref
);
901 TRACE("%p ref = %ld\n", This
, ref
);
904 TRACE("Destroying %p\n", This
);
905 HeapFree(GetProcessHeap(), 0, This
->cpinfo
);
906 HeapFree(GetProcessHeap(), 0, This
);
912 static HRESULT WINAPI
fnIEnumCodePage_Clone(
913 IEnumCodePage
* iface
,
914 IEnumCodePage
** ppEnum
)
916 ICOM_THIS_MULTI(EnumCodePage_impl
, vtbl_IEnumCodePage
, iface
);
917 FIXME("%p %p\n", This
, ppEnum
);
921 static HRESULT WINAPI
fnIEnumCodePage_Next(
922 IEnumCodePage
* iface
,
929 ICOM_THIS_MULTI(EnumCodePage_impl
, vtbl_IEnumCodePage
, iface
);
930 TRACE("%p %lu %p %p\n", This
, celt
, rgelt
, pceltFetched
);
932 if (!pceltFetched
) return S_FALSE
;
935 if (!rgelt
) return S_FALSE
;
937 if (This
->pos
+ celt
> This
->total
)
938 celt
= This
->total
- This
->pos
;
940 if (!celt
) return S_FALSE
;
942 memcpy(rgelt
, This
->cpinfo
+ This
->pos
, celt
* sizeof(MIMECPINFO
));
943 *pceltFetched
= celt
;
946 for (i
= 0; i
< celt
; i
++)
948 TRACE("#%lu: %08lx %u %u %s %s %s %s %s %s %d\n",
949 i
, rgelt
[i
].dwFlags
, rgelt
[i
].uiCodePage
,
950 rgelt
[i
].uiFamilyCodePage
,
951 wine_dbgstr_w(rgelt
[i
].wszDescription
),
952 wine_dbgstr_w(rgelt
[i
].wszWebCharset
),
953 wine_dbgstr_w(rgelt
[i
].wszHeaderCharset
),
954 wine_dbgstr_w(rgelt
[i
].wszBodyCharset
),
955 wine_dbgstr_w(rgelt
[i
].wszFixedWidthFont
),
956 wine_dbgstr_w(rgelt
[i
].wszProportionalFont
),
957 rgelt
[i
].bGDICharset
);
962 static HRESULT WINAPI
fnIEnumCodePage_Reset(
963 IEnumCodePage
* iface
)
965 ICOM_THIS_MULTI(EnumCodePage_impl
, vtbl_IEnumCodePage
, iface
);
972 static HRESULT WINAPI
fnIEnumCodePage_Skip(
973 IEnumCodePage
* iface
,
976 ICOM_THIS_MULTI(EnumCodePage_impl
, vtbl_IEnumCodePage
, iface
);
977 TRACE("%p %lu\n", This
, celt
);
979 if (celt
>= This
->total
) return S_FALSE
;
981 This
->pos
= celt
; /* FIXME: should be += ?? */
985 static IEnumCodePageVtbl IEnumCodePage_vtbl
=
987 fnIEnumCodePage_QueryInterface
,
988 fnIEnumCodePage_AddRef
,
989 fnIEnumCodePage_Release
,
990 fnIEnumCodePage_Clone
,
991 fnIEnumCodePage_Next
,
992 fnIEnumCodePage_Reset
,
996 static HRESULT
EnumCodePage_create( MLang_impl
* mlang
, DWORD grfFlags
,
997 LANGID LangId
, IEnumCodePage
** ppEnumCodePage
)
999 EnumCodePage_impl
*ecp
;
1003 TRACE("%p, %08lx, %04x, %p\n", mlang
, grfFlags
, LangId
, ppEnumCodePage
);
1005 if (!grfFlags
) /* enumerate internal data base of encodings */
1006 grfFlags
= MIMECONTF_MIME_LATEST
;
1008 ecp
= HeapAlloc( GetProcessHeap(), 0, sizeof (EnumCodePage_impl
) );
1009 ecp
->vtbl_IEnumCodePage
= &IEnumCodePage_vtbl
;
1013 for (i
= 0; i
< sizeof(mlang_data
)/sizeof(mlang_data
[0]); i
++)
1015 for (n
= 0; n
< mlang_data
[i
].number_of_cp
; n
++)
1017 if (mlang_data
[i
].mime_cp_info
[n
].flags
& grfFlags
)
1022 ecp
->cpinfo
= HeapAlloc(GetProcessHeap(), 0,
1023 sizeof(MIMECPINFO
) * ecp
->total
);
1024 cpinfo
= ecp
->cpinfo
;
1026 for (i
= 0; i
< sizeof(mlang_data
)/sizeof(mlang_data
[0]); i
++)
1028 for (n
= 0; n
< mlang_data
[i
].number_of_cp
; n
++)
1030 if (mlang_data
[i
].mime_cp_info
[n
].flags
& grfFlags
)
1031 fill_cp_info(&mlang_data
[i
], n
, cpinfo
++);
1035 TRACE("enumerated %ld codepages with flags %08lx\n", ecp
->total
, grfFlags
);
1037 *ppEnumCodePage
= (IEnumCodePage
*) ecp
;
1042 /******************************************************************************/
1044 typedef struct tagEnumScript_impl
1046 IEnumScriptVtbl
*vtbl_IEnumScript
;
1048 SCRIPTINFO
*script_info
;
1052 static HRESULT WINAPI
fnIEnumScript_QueryInterface(
1057 ICOM_THIS_MULTI(EnumScript_impl
, vtbl_IEnumScript
, iface
);
1059 TRACE("%p -> %s\n", This
, debugstr_guid(riid
) );
1061 if (IsEqualGUID(riid
, &IID_IUnknown
)
1062 || IsEqualGUID(riid
, &IID_IEnumScript
))
1064 IEnumScript_AddRef(iface
);
1065 TRACE("Returning IID_IEnumScript %p ref = %ld\n", This
, This
->ref
);
1066 *ppvObject
= &(This
->vtbl_IEnumScript
);
1070 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
1071 return E_NOINTERFACE
;
1074 static ULONG WINAPI
fnIEnumScript_AddRef(
1077 ICOM_THIS_MULTI(EnumScript_impl
, vtbl_IEnumScript
, iface
);
1078 return InterlockedIncrement(&This
->ref
);
1081 static ULONG WINAPI
fnIEnumScript_Release(
1084 ICOM_THIS_MULTI(EnumScript_impl
, vtbl_IEnumScript
, iface
);
1085 ULONG ref
= InterlockedDecrement(&This
->ref
);
1087 TRACE("%p ref = %ld\n", This
, ref
);
1090 TRACE("Destroying %p\n", This
);
1091 HeapFree(GetProcessHeap(), 0, This
);
1097 static HRESULT WINAPI
fnIEnumScript_Clone(
1099 IEnumScript
** ppEnum
)
1101 ICOM_THIS_MULTI(EnumScript_impl
, vtbl_IEnumScript
, iface
);
1102 FIXME("%p %p: stub!\n", This
, ppEnum
);
1106 static HRESULT WINAPI
fnIEnumScript_Next(
1110 ULONG
* pceltFetched
)
1112 ICOM_THIS_MULTI(EnumScript_impl
, vtbl_IEnumScript
, iface
);
1113 TRACE("%p %lu %p %p\n", This
, celt
, rgelt
, pceltFetched
);
1115 if (!pceltFetched
|| !rgelt
) return E_FAIL
;
1119 if (This
->pos
+ celt
> This
->total
)
1120 celt
= This
->total
- This
->pos
;
1122 if (!celt
) return S_FALSE
;
1124 memcpy(rgelt
, This
->script_info
+ This
->pos
, celt
* sizeof(SCRIPTINFO
));
1125 *pceltFetched
= celt
;
1131 static HRESULT WINAPI
fnIEnumScript_Reset(
1134 ICOM_THIS_MULTI(EnumScript_impl
, vtbl_IEnumScript
, iface
);
1135 TRACE("%p\n", This
);
1141 static HRESULT WINAPI
fnIEnumScript_Skip(
1145 ICOM_THIS_MULTI(EnumScript_impl
, vtbl_IEnumScript
, iface
);
1146 TRACE("%p %lu\n", This
, celt
);
1148 if (celt
>= This
->total
) return S_FALSE
;
1150 This
->pos
= celt
; /* FIXME: should be += ?? */
1154 static IEnumScriptVtbl IEnumScript_vtbl
=
1156 fnIEnumScript_QueryInterface
,
1157 fnIEnumScript_AddRef
,
1158 fnIEnumScript_Release
,
1159 fnIEnumScript_Clone
,
1161 fnIEnumScript_Reset
,
1165 static HRESULT
EnumScript_create( MLang_impl
* mlang
, DWORD dwFlags
,
1166 LANGID LangId
, IEnumScript
** ppEnumScript
)
1168 EnumScript_impl
*es
;
1171 TRACE("%p, %08lx, %04x, %p: stub!\n", mlang
, dwFlags
, LangId
, ppEnumScript
);
1173 if (!dwFlags
) /* enumerate all available scripts */
1174 dwFlags
= SCRIPTCONTF_SCRIPT_USER
| SCRIPTCONTF_SCRIPT_HIDE
| SCRIPTCONTF_SCRIPT_SYSTEM
;
1176 es
= HeapAlloc( GetProcessHeap(), 0, sizeof (EnumScript_impl
) );
1177 es
->vtbl_IEnumScript
= &IEnumScript_vtbl
;
1180 /* do not enumerate unicode flavours */
1181 es
->total
= sizeof(mlang_data
)/sizeof(mlang_data
[0]) - 1;
1182 es
->script_info
= HeapAlloc(GetProcessHeap(), 0, sizeof(SCRIPTINFO
) * es
->total
);
1184 for (i
= 0; i
< es
->total
; i
++)
1186 es
->script_info
[i
].ScriptId
= i
;
1187 es
->script_info
[i
].uiCodePage
= mlang_data
[i
].family_codepage
;
1188 MultiByteToWideChar(CP_ACP
, 0, mlang_data
[i
].description
, -1,
1189 es
->script_info
[i
].wszDescription
, MAX_SCRIPT_NAME
);
1190 MultiByteToWideChar(CP_ACP
, 0, mlang_data
[i
].fixed_font
, -1,
1191 es
->script_info
[i
].wszFixedWidthFont
, MAX_MIMEFACE_NAME
);
1192 MultiByteToWideChar(CP_ACP
, 0, mlang_data
[i
].proportional_font
, -1,
1193 es
->script_info
[i
].wszProportionalFont
, MAX_MIMEFACE_NAME
);
1196 TRACE("enumerated %ld scripts with flags %08lx\n", es
->total
, dwFlags
);
1198 *ppEnumScript
= (IEnumScript
*)es
;
1203 /******************************************************************************/
1205 static HRESULT WINAPI
fnIMLangFontLink_QueryInterface(
1206 IMLangFontLink
* iface
,
1210 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMLangFontLink
, iface
);
1211 return MLang_QueryInterface( This
, riid
, ppvObject
);
1214 static ULONG WINAPI
fnIMLangFontLink_AddRef(
1215 IMLangFontLink
* iface
)
1217 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMLangFontLink
, iface
);
1218 return MLang_AddRef( This
);
1221 static ULONG WINAPI
fnIMLangFontLink_Release(
1222 IMLangFontLink
* iface
)
1224 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMLangFontLink
, iface
);
1225 return MLang_Release( This
);
1228 static HRESULT WINAPI
fnIMLangFontLink_GetCharCodePages(
1229 IMLangFontLink
* iface
,
1231 DWORD
* pdwCodePages
)
1237 static HRESULT WINAPI
fnIMLangFontLink_GetStrCodePages(
1238 IMLangFontLink
* iface
,
1239 const WCHAR
* pszSrc
,
1241 DWORD dwPriorityCodePages
,
1242 DWORD
* pdwCodePages
,
1243 long* pcchCodePages
)
1249 static HRESULT WINAPI
fnIMLangFontLink_CodePageToCodePages(
1250 IMLangFontLink
* iface
,
1252 DWORD
* pdwCodePages
)
1258 static HRESULT WINAPI
fnIMLangFontLink_CodePagesToCodePage(
1259 IMLangFontLink
* iface
,
1261 UINT uDefaultCodePage
,
1268 static HRESULT WINAPI
fnIMLangFontLink_GetFontCodePages(
1269 IMLangFontLink
* iface
,
1272 DWORD
* pdwCodePages
)
1278 static HRESULT WINAPI
fnIMLangFontLink_MapFont(
1279 IMLangFontLink
* iface
,
1289 static HRESULT WINAPI
fnIMLangFontLink_ReleaseFont(
1290 IMLangFontLink
* iface
,
1297 static HRESULT WINAPI
fnIMLangFontLink_ResetFontMapping(
1298 IMLangFontLink
* iface
)
1305 static IMLangFontLinkVtbl IMLangFontLink_vtbl
=
1307 fnIMLangFontLink_QueryInterface
,
1308 fnIMLangFontLink_AddRef
,
1309 fnIMLangFontLink_Release
,
1310 fnIMLangFontLink_GetCharCodePages
,
1311 fnIMLangFontLink_GetStrCodePages
,
1312 fnIMLangFontLink_CodePageToCodePages
,
1313 fnIMLangFontLink_CodePagesToCodePage
,
1314 fnIMLangFontLink_GetFontCodePages
,
1315 fnIMLangFontLink_MapFont
,
1316 fnIMLangFontLink_ReleaseFont
,
1317 fnIMLangFontLink_ResetFontMapping
,
1320 /******************************************************************************/
1322 static HRESULT WINAPI
fnIMultiLanguage_QueryInterface(
1323 IMultiLanguage
* iface
,
1327 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage
, iface
);
1328 return MLang_QueryInterface( This
, riid
, ppvObject
);
1331 static ULONG WINAPI
fnIMultiLanguage_AddRef( IMultiLanguage
* iface
)
1333 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage
, iface
);
1334 return IMLangFontLink_AddRef( ((IMLangFontLink
*)This
) );
1337 static ULONG WINAPI
fnIMultiLanguage_Release( IMultiLanguage
* iface
)
1339 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage
, iface
);
1340 return IMLangFontLink_Release( ((IMLangFontLink
*)This
) );
1343 static HRESULT WINAPI
fnIMultiLanguage_GetNumberOfCodePageInfo(
1344 IMultiLanguage
* iface
,
1351 static HRESULT WINAPI
fnIMultiLanguage_GetCodePageInfo(
1352 IMultiLanguage
* iface
,
1354 PMIMECPINFO pCodePageInfo
)
1360 static HRESULT WINAPI
fnIMultiLanguage_GetFamilyCodePage(
1361 IMultiLanguage
* iface
,
1363 UINT
* puiFamilyCodePage
)
1365 return GetFamilyCodePage(uiCodePage
, puiFamilyCodePage
);
1368 static HRESULT WINAPI
fnIMultiLanguage_EnumCodePages(
1369 IMultiLanguage
* iface
,
1371 IEnumCodePage
** ppEnumCodePage
)
1373 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage
, iface
);
1374 TRACE("%p %08lx %p\n", This
, grfFlags
, ppEnumCodePage
);
1376 return EnumCodePage_create( This
, grfFlags
, 0, ppEnumCodePage
);
1379 static HRESULT WINAPI
fnIMultiLanguage_GetCharsetInfo(
1380 IMultiLanguage
* iface
,
1382 PMIMECSETINFO pCharsetInfo
)
1388 static HRESULT WINAPI
fnIMultiLanguage_IsConvertible(
1389 IMultiLanguage
* iface
,
1390 DWORD dwSrcEncoding
,
1391 DWORD dwDstEncoding
)
1393 return IsConvertINetStringAvailable(dwSrcEncoding
, dwDstEncoding
);
1396 static HRESULT WINAPI
fnIMultiLanguage_ConvertString(
1397 IMultiLanguage
* iface
,
1399 DWORD dwSrcEncoding
,
1400 DWORD dwDstEncoding
,
1406 return ConvertINetString(pdwMode
, dwSrcEncoding
, dwDstEncoding
,
1407 pSrcStr
, pcSrcSize
, pDstStr
, pcDstSize
);
1410 static HRESULT WINAPI
fnIMultiLanguage_ConvertStringToUnicode(
1411 IMultiLanguage
* iface
,
1419 return ConvertINetMultiByteToUnicode(pdwMode
, dwEncoding
,
1420 pSrcStr
, pcSrcSize
, pDstStr
, pcDstSize
);
1423 static HRESULT WINAPI
fnIMultiLanguage_ConvertStringFromUnicode(
1424 IMultiLanguage
* iface
,
1432 return ConvertINetUnicodeToMultiByte(pdwMode
, dwEncoding
,
1433 pSrcStr
, pcSrcSize
, pDstStr
, pcDstSize
);
1436 static HRESULT WINAPI
fnIMultiLanguage_ConvertStringReset(
1437 IMultiLanguage
* iface
)
1443 static HRESULT WINAPI
fnIMultiLanguage_GetRfc1766FromLcid(
1444 IMultiLanguage
* iface
,
1452 static HRESULT WINAPI
fnIMultiLanguage_GetLcidFromRfc1766(
1453 IMultiLanguage
* iface
,
1461 static HRESULT WINAPI
fnIMultiLanguage_EnumRfc1766(
1462 IMultiLanguage
* iface
,
1463 IEnumRfc1766
** ppEnumRfc1766
)
1469 static HRESULT WINAPI
fnIMultiLanguage_GetRfc1766Info(
1470 IMultiLanguage
* iface
,
1472 PRFC1766INFO pRfc1766Info
)
1478 static HRESULT WINAPI
fnIMultiLanguage_CreateConvertCharset(
1479 IMultiLanguage
* iface
,
1483 IMLangConvertCharset
** ppMLangConvertCharset
)
1489 static IMultiLanguageVtbl IMultiLanguage_vtbl
=
1491 fnIMultiLanguage_QueryInterface
,
1492 fnIMultiLanguage_AddRef
,
1493 fnIMultiLanguage_Release
,
1494 fnIMultiLanguage_GetNumberOfCodePageInfo
,
1495 fnIMultiLanguage_GetCodePageInfo
,
1496 fnIMultiLanguage_GetFamilyCodePage
,
1497 fnIMultiLanguage_EnumCodePages
,
1498 fnIMultiLanguage_GetCharsetInfo
,
1499 fnIMultiLanguage_IsConvertible
,
1500 fnIMultiLanguage_ConvertString
,
1501 fnIMultiLanguage_ConvertStringToUnicode
,
1502 fnIMultiLanguage_ConvertStringFromUnicode
,
1503 fnIMultiLanguage_ConvertStringReset
,
1504 fnIMultiLanguage_GetRfc1766FromLcid
,
1505 fnIMultiLanguage_GetLcidFromRfc1766
,
1506 fnIMultiLanguage_EnumRfc1766
,
1507 fnIMultiLanguage_GetRfc1766Info
,
1508 fnIMultiLanguage_CreateConvertCharset
,
1512 /******************************************************************************/
1514 static HRESULT WINAPI
fnIMultiLanguage2_QueryInterface(
1515 IMultiLanguage2
* iface
,
1519 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1520 return MLang_QueryInterface( This
, riid
, ppvObject
);
1523 static ULONG WINAPI
fnIMultiLanguage2_AddRef( IMultiLanguage2
* iface
)
1525 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1526 return MLang_AddRef( This
);
1529 static ULONG WINAPI
fnIMultiLanguage2_Release( IMultiLanguage2
* iface
)
1531 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1532 return MLang_Release( This
);
1535 static HRESULT WINAPI
fnIMultiLanguage2_GetNumberOfCodePageInfo(
1536 IMultiLanguage2
* iface
,
1539 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1540 TRACE("%p, %p\n", This
, pcCodePage
);
1542 if (!pcCodePage
) return S_FALSE
;
1544 *pcCodePage
= This
->total_cp
;
1548 static void fill_cp_info(const struct mlang_data
*ml_data
, UINT index
, MIMECPINFO
*mime_cp_info
)
1552 if (TranslateCharsetInfo((DWORD
*)ml_data
->family_codepage
, &csi
, TCI_SRCCODEPAGE
))
1553 mime_cp_info
->bGDICharset
= csi
.ciCharset
;
1555 mime_cp_info
->bGDICharset
= DEFAULT_CHARSET
;
1557 mime_cp_info
->dwFlags
= ml_data
->mime_cp_info
[index
].flags
;
1558 mime_cp_info
->uiCodePage
= ml_data
->mime_cp_info
[index
].cp
;
1559 mime_cp_info
->uiFamilyCodePage
= ml_data
->family_codepage
;
1560 MultiByteToWideChar(CP_ACP
, 0, ml_data
->mime_cp_info
[index
].description
, -1,
1561 mime_cp_info
->wszDescription
, sizeof(mime_cp_info
->wszDescription
)/sizeof(WCHAR
));
1562 MultiByteToWideChar(CP_ACP
, 0, ml_data
->mime_cp_info
[index
].web_charset
, -1,
1563 mime_cp_info
->wszWebCharset
, sizeof(mime_cp_info
->wszWebCharset
)/sizeof(WCHAR
));
1564 MultiByteToWideChar(CP_ACP
, 0, ml_data
->mime_cp_info
[index
].header_charset
, -1,
1565 mime_cp_info
->wszHeaderCharset
, sizeof(mime_cp_info
->wszHeaderCharset
)/sizeof(WCHAR
));
1566 MultiByteToWideChar(CP_ACP
, 0, ml_data
->mime_cp_info
[index
].body_charset
, -1,
1567 mime_cp_info
->wszBodyCharset
, sizeof(mime_cp_info
->wszBodyCharset
)/sizeof(WCHAR
));
1569 MultiByteToWideChar(CP_ACP
, 0, ml_data
->fixed_font
, -1,
1570 mime_cp_info
->wszFixedWidthFont
, sizeof(mime_cp_info
->wszFixedWidthFont
)/sizeof(WCHAR
));
1571 MultiByteToWideChar(CP_ACP
, 0, ml_data
->proportional_font
, -1,
1572 mime_cp_info
->wszProportionalFont
, sizeof(mime_cp_info
->wszProportionalFont
)/sizeof(WCHAR
));
1574 TRACE("%08lx %u %u %s %s %s %s %s %s %d\n",
1575 mime_cp_info
->dwFlags
, mime_cp_info
->uiCodePage
,
1576 mime_cp_info
->uiFamilyCodePage
,
1577 wine_dbgstr_w(mime_cp_info
->wszDescription
),
1578 wine_dbgstr_w(mime_cp_info
->wszWebCharset
),
1579 wine_dbgstr_w(mime_cp_info
->wszHeaderCharset
),
1580 wine_dbgstr_w(mime_cp_info
->wszBodyCharset
),
1581 wine_dbgstr_w(mime_cp_info
->wszFixedWidthFont
),
1582 wine_dbgstr_w(mime_cp_info
->wszProportionalFont
),
1583 mime_cp_info
->bGDICharset
);
1586 static HRESULT WINAPI
fnIMultiLanguage2_GetCodePageInfo(
1587 IMultiLanguage2
* iface
,
1590 PMIMECPINFO pCodePageInfo
)
1594 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1595 TRACE("%p, %u, %04x, %p\n", This
, uiCodePage
, LangId
, pCodePageInfo
);
1597 for (i
= 0; i
< sizeof(mlang_data
)/sizeof(mlang_data
[0]); i
++)
1599 for (n
= 0; n
< mlang_data
[i
].number_of_cp
; n
++)
1601 if (mlang_data
[i
].mime_cp_info
[n
].cp
== uiCodePage
)
1603 fill_cp_info(&mlang_data
[i
], n
, pCodePageInfo
);
1612 static HRESULT WINAPI
fnIMultiLanguage2_GetFamilyCodePage(
1613 IMultiLanguage2
* iface
,
1615 UINT
* puiFamilyCodePage
)
1617 return GetFamilyCodePage(uiCodePage
, puiFamilyCodePage
);
1620 static HRESULT WINAPI
fnIMultiLanguage2_EnumCodePages(
1621 IMultiLanguage2
* iface
,
1624 IEnumCodePage
** ppEnumCodePage
)
1626 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1627 TRACE("%p %08lx %04x %p\n", This
, grfFlags
, LangId
, ppEnumCodePage
);
1629 return EnumCodePage_create( This
, grfFlags
, LangId
, ppEnumCodePage
);
1632 static HRESULT WINAPI
fnIMultiLanguage2_GetCharsetInfo(
1633 IMultiLanguage2
* iface
,
1635 PMIMECSETINFO pCharsetInfo
)
1639 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1640 TRACE("%p %s %p\n", This
, debugstr_w(Charset
), pCharsetInfo
);
1642 if (!pCharsetInfo
) return E_FAIL
;
1644 for (i
= 0; i
< sizeof(mlang_data
)/sizeof(mlang_data
[0]); i
++)
1646 for (n
= 0; n
< mlang_data
[i
].number_of_cp
; n
++)
1648 WCHAR csetW
[MAX_MIMECSET_NAME
];
1650 MultiByteToWideChar(CP_ACP
, 0, mlang_data
[i
].mime_cp_info
[n
].web_charset
, -1, csetW
, MAX_MIMECSET_NAME
);
1651 if (!lstrcmpiW(Charset
, csetW
))
1653 pCharsetInfo
->uiCodePage
= mlang_data
[i
].family_codepage
;
1654 pCharsetInfo
->uiInternetEncoding
= mlang_data
[i
].mime_cp_info
[n
].cp
;
1655 strcpyW(pCharsetInfo
->wszCharset
, csetW
);
1662 * Since we do not support charsets like iso-2022-jp and do not have
1663 * them in our database as a primary (web_charset) encoding this loop
1664 * does an attempt to 'approximate' charset name by header_charset.
1666 for (i
= 0; i
< sizeof(mlang_data
)/sizeof(mlang_data
[0]); i
++)
1668 for (n
= 0; n
< mlang_data
[i
].number_of_cp
; n
++)
1670 WCHAR csetW
[MAX_MIMECSET_NAME
];
1672 MultiByteToWideChar(CP_ACP
, 0, mlang_data
[i
].mime_cp_info
[n
].header_charset
, -1, csetW
, MAX_MIMECSET_NAME
);
1673 if (!lstrcmpiW(Charset
, csetW
))
1675 pCharsetInfo
->uiCodePage
= mlang_data
[i
].family_codepage
;
1676 pCharsetInfo
->uiInternetEncoding
= mlang_data
[i
].mime_cp_info
[n
].cp
;
1677 strcpyW(pCharsetInfo
->wszCharset
, csetW
);
1686 static HRESULT WINAPI
fnIMultiLanguage2_IsConvertible(
1687 IMultiLanguage2
* iface
,
1688 DWORD dwSrcEncoding
,
1689 DWORD dwDstEncoding
)
1691 return IsConvertINetStringAvailable(dwSrcEncoding
, dwDstEncoding
);
1694 static HRESULT WINAPI
fnIMultiLanguage2_ConvertString(
1695 IMultiLanguage2
* iface
,
1697 DWORD dwSrcEncoding
,
1698 DWORD dwDstEncoding
,
1704 return ConvertINetString(pdwMode
, dwSrcEncoding
, dwDstEncoding
,
1705 pSrcStr
, pcSrcSize
, pDstStr
, pcDstSize
);
1708 static HRESULT WINAPI
fnIMultiLanguage2_ConvertStringToUnicode(
1709 IMultiLanguage2
* iface
,
1717 return ConvertINetMultiByteToUnicode(pdwMode
, dwEncoding
,
1718 pSrcStr
, pcSrcSize
, pDstStr
, pcDstSize
);
1721 static HRESULT WINAPI
fnIMultiLanguage2_ConvertStringFromUnicode(
1722 IMultiLanguage2
* iface
,
1730 return ConvertINetUnicodeToMultiByte(pdwMode
, dwEncoding
,
1731 pSrcStr
, pcSrcSize
, pDstStr
, pcDstSize
);
1734 static HRESULT WINAPI
fnIMultiLanguage2_ConvertStringReset(
1735 IMultiLanguage2
* iface
)
1741 static HRESULT WINAPI
fnIMultiLanguage2_GetRfc1766FromLcid(
1742 IMultiLanguage2
* iface
,
1750 static HRESULT WINAPI
fnIMultiLanguage2_GetLcidFromRfc1766(
1751 IMultiLanguage2
* iface
,
1759 static HRESULT WINAPI
fnIMultiLanguage2_EnumRfc1766(
1760 IMultiLanguage2
* iface
,
1762 IEnumRfc1766
** ppEnumRfc1766
)
1768 static HRESULT WINAPI
fnIMultiLanguage2_GetRfc1766Info(
1769 IMultiLanguage2
* iface
,
1772 PRFC1766INFO pRfc1766Info
)
1778 static HRESULT WINAPI
fnIMultiLanguage2_CreateConvertCharset(
1779 IMultiLanguage2
* iface
,
1783 IMLangConvertCharset
** ppMLangConvertCharset
)
1789 static HRESULT WINAPI
fnIMultiLanguage2_ConvertStringInIStream(
1790 IMultiLanguage2
* iface
,
1794 DWORD dwSrcEncoding
,
1795 DWORD dwDstEncoding
,
1803 static HRESULT WINAPI
fnIMultiLanguage2_ConvertStringToUnicodeEx(
1804 IMultiLanguage2
* iface
,
1818 static HRESULT WINAPI
fnIMultiLanguage2_ConvertStringFromUnicodeEx(
1819 IMultiLanguage2
* This
,
1833 static HRESULT WINAPI
fnIMultiLanguage2_DetectCodepageInIStream(
1834 IMultiLanguage2
* iface
,
1836 DWORD dwPrefWinCodePage
,
1838 DetectEncodingInfo
* lpEncoding
,
1845 static HRESULT WINAPI
fnIMultiLanguage2_DetectInputCodepage(
1846 IMultiLanguage2
* iface
,
1848 DWORD dwPrefWinCodePage
,
1851 DetectEncodingInfo
* lpEncoding
,
1858 static HRESULT WINAPI
fnIMultiLanguage2_ValidateCodePage(
1859 IMultiLanguage2
* iface
,
1867 static HRESULT WINAPI
fnIMultiLanguage2_GetCodePageDescription(
1868 IMultiLanguage2
* iface
,
1871 LPWSTR lpWideCharStr
,
1878 static HRESULT WINAPI
fnIMultiLanguage2_IsCodePageInstallable(
1879 IMultiLanguage2
* iface
,
1886 static HRESULT WINAPI
fnIMultiLanguage2_SetMimeDBSource(
1887 IMultiLanguage2
* iface
,
1894 static HRESULT WINAPI
fnIMultiLanguage2_GetNumberOfScripts(
1895 IMultiLanguage2
* iface
,
1898 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1899 TRACE("%p %p\n", This
, pnScripts
);
1901 if (!pnScripts
) return S_FALSE
;
1903 *pnScripts
= This
->total_scripts
;
1907 static HRESULT WINAPI
fnIMultiLanguage2_EnumScripts(
1908 IMultiLanguage2
* iface
,
1911 IEnumScript
** ppEnumScript
)
1913 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1914 TRACE("%p %08lx %04x %p\n", This
, dwFlags
, LangId
, ppEnumScript
);
1916 return EnumScript_create( This
, dwFlags
, LangId
, ppEnumScript
);
1919 static HRESULT WINAPI
fnIMultiLanguage2_ValidateCodePageEx(
1920 IMultiLanguage2
* iface
,
1923 DWORD dwfIODControl
)
1925 ICOM_THIS_MULTI(MLang_impl
, vtbl_IMultiLanguage2
, iface
);
1926 FIXME("%p %u %p %08lx: stub!\n", This
, uiCodePage
, hwnd
, dwfIODControl
);
1931 static IMultiLanguage2Vtbl IMultiLanguage2_vtbl
=
1933 fnIMultiLanguage2_QueryInterface
,
1934 fnIMultiLanguage2_AddRef
,
1935 fnIMultiLanguage2_Release
,
1936 fnIMultiLanguage2_GetNumberOfCodePageInfo
,
1937 fnIMultiLanguage2_GetCodePageInfo
,
1938 fnIMultiLanguage2_GetFamilyCodePage
,
1939 fnIMultiLanguage2_EnumCodePages
,
1940 fnIMultiLanguage2_GetCharsetInfo
,
1941 fnIMultiLanguage2_IsConvertible
,
1942 fnIMultiLanguage2_ConvertString
,
1943 fnIMultiLanguage2_ConvertStringToUnicode
,
1944 fnIMultiLanguage2_ConvertStringFromUnicode
,
1945 fnIMultiLanguage2_ConvertStringReset
,
1946 fnIMultiLanguage2_GetRfc1766FromLcid
,
1947 fnIMultiLanguage2_GetLcidFromRfc1766
,
1948 fnIMultiLanguage2_EnumRfc1766
,
1949 fnIMultiLanguage2_GetRfc1766Info
,
1950 fnIMultiLanguage2_CreateConvertCharset
,
1951 fnIMultiLanguage2_ConvertStringInIStream
,
1952 fnIMultiLanguage2_ConvertStringToUnicodeEx
,
1953 fnIMultiLanguage2_ConvertStringFromUnicodeEx
,
1954 fnIMultiLanguage2_DetectCodepageInIStream
,
1955 fnIMultiLanguage2_DetectInputCodepage
,
1956 fnIMultiLanguage2_ValidateCodePage
,
1957 fnIMultiLanguage2_GetCodePageDescription
,
1958 fnIMultiLanguage2_IsCodePageInstallable
,
1959 fnIMultiLanguage2_SetMimeDBSource
,
1960 fnIMultiLanguage2_GetNumberOfScripts
,
1961 fnIMultiLanguage2_EnumScripts
,
1962 fnIMultiLanguage2_ValidateCodePageEx
,
1965 static HRESULT
MultiLanguage_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
1970 TRACE("Creating MultiLanguage object\n");
1973 return CLASS_E_NOAGGREGATION
;
1975 mlang
= HeapAlloc( GetProcessHeap(), 0, sizeof (MLang_impl
) );
1976 mlang
->vtbl_IMLangFontLink
= &IMLangFontLink_vtbl
;
1977 mlang
->vtbl_IMultiLanguage
= &IMultiLanguage_vtbl
;
1978 mlang
->vtbl_IMultiLanguage2
= &IMultiLanguage2_vtbl
;
1980 mlang
->total_cp
= 0;
1981 for (i
= 0; i
< sizeof(mlang_data
)/sizeof(mlang_data
[0]); i
++)
1982 mlang
->total_cp
+= mlang_data
[i
].number_of_cp
;
1984 /* do not enumerate unicode flavours */
1985 mlang
->total_scripts
= sizeof(mlang_data
)/sizeof(mlang_data
[0]) - 1;
1988 *ppObj
= (LPVOID
) mlang
;
1989 TRACE("returning %p\n", mlang
);
1993 /******************************************************************************/
1995 HRESULT WINAPI
MLANG_DllCanUnloadNow(void)