2 * Copyright (C) 2004 Mike McCormack
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* FIXME: LANDID is defined in winnt.h and mlang.h in the platform SDK */
24 cpp_quote
("#ifndef __WINE_WINNT_H")
30 pointer_default(unique)
32 interface IMLangCodePages
: IUnknown
34 HRESULT GetCharCodePages
(
37 HRESULT GetStrCodePages
(
38 [in, size_is(cchSrc
)] const WCHAR
*pszSrc
,
40 [in] DWORD dwPriorityCodePages
,
41 [out] DWORD
*pdwCodePages
,
42 [out] long *pcchCodePages
);
43 HRESULT CodePageToCodePages
(
45 [out] DWORD
*pdwCodePages
);
46 HRESULT CodePagesToCodePage
(
47 [in] DWORD dwCodePages
,
48 [in] UINT uDefaultCodePage
,
49 [out] UINT
*puCodePage
);
54 pointer_default(unique)
56 interface IMLangFontLink
: IMLangCodePages
58 HRESULT GetFontCodePages
(
61 [out] DWORD
*pdwCodePages
);
65 [in] DWORD dwCodePages
,
67 [out] HFONT
*phDestFont
);
72 HRESULT ResetFontMapping
();
77 pointer_default(unique)
79 interface IEnumScript
: IUnknown
81 const USHORT MAX_SCRIPT_NAME
= 48;
82 const USHORT MAX_MIMEFACE_NAME
= 32;
84 typedef BYTE SCRIPT_ID
;
85 typedef __int64 SCRIPT_IDS
;
87 typedef enum tagSCRIPTCONTF
90 sidMerge
= sidDefault
+ 1,
91 sidAsciiSym
= sidMerge
+ 1,
92 sidAsciiLatin
= sidAsciiSym
+ 1,
93 sidLatin
= sidAsciiLatin
+ 1,
94 sidGreek
= sidLatin
+ 1,
95 sidCyrillic
= sidGreek
+ 1,
96 sidArmenian
= sidCyrillic
+ 1,
97 sidHebrew
= sidArmenian
+ 1,
98 sidArabic
= sidHebrew
+ 1,
99 sidDevanagari
= sidArabic
+ 1,
100 sidBengali
= sidDevanagari
+ 1,
101 sidGurmukhi
= sidBengali
+ 1,
102 sidGujarati
= sidGurmukhi
+ 1,
103 sidOriya
= sidGujarati
+ 1,
104 sidTamil
= sidOriya
+ 1,
105 sidTelugu
= sidTamil
+ 1,
106 sidKannada
= sidTelugu
+ 1,
107 sidMalayalam
= sidKannada
+ 1,
108 sidThai
= sidMalayalam
+ 1,
109 sidLao
= sidThai
+ 1,
110 sidTibetan
= sidLao
+ 1,
111 sidGeorgian
= sidTibetan
+ 1,
112 sidHangul
= sidGeorgian
+ 1,
113 sidKana
= sidHangul
+ 1,
114 sidBopomofo
= sidKana
+ 1,
115 sidHan
= sidBopomofo
+ 1,
116 sidEthiopic
= sidHan
+ 1,
117 sidCanSyllabic
= sidEthiopic
+ 1,
118 sidCherokee
= sidCanSyllabic
+ 1,
119 sidYi
= sidCherokee
+ 1,
120 sidBraille
= sidYi
+ 1,
121 sidRunic
= sidBraille
+ 1,
122 sidOgham
= sidRunic
+ 1,
123 sidSinhala
= sidOgham
+ 1,
124 sidSyriac
= sidSinhala
+ 1,
125 sidBurmese
= sidSyriac
+ 1,
126 sidKhmer
= sidBurmese
+ 1,
127 sidThaana
= sidKhmer
+ 1,
128 sidMongolian
= sidThaana
+ 1,
129 sidUserDefined
= sidMongolian
+ 1,
130 sidLim
= sidUserDefined
+ 1,
131 sidFEFirst
= sidHangul
,
135 typedef enum tagSCRIPTFONTCONTF
137 SCRIPTCONTF_FIXED_FONT
= 0x1,
138 SCRIPTCONTF_PROPORTIONAL_FONT
= 0x2,
139 SCRIPTCONTF_SCRIPT_USER
= 0x10000,
140 SCRIPTCONTF_SCRIPT_HIDE
= 0x20000,
141 SCRIPTCONTF_SCRIPT_SYSTEM
= 0x40000
144 typedef struct tagSCRIPFONTINFO
147 WCHAR wszFont
[MAX_MIMEFACE_NAME
];
148 } SCRIPTFONTINFO
, *PSCRIPTFONTINFO
;
150 typedef struct tagSCRIPTINFO
{
153 WCHAR wszDescription
[MAX_SCRIPT_NAME
];
154 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
155 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
156 } SCRIPTINFO
, *PSCRIPTINFO
;
159 [out] IEnumScript
**ppEnum
);
163 [out] PSCRIPTINFO rgelt
,
164 [out] ULONG
*pceltFetched
);
174 pointer_default(unique)
176 interface IEnumCodePage
: IUnknown
178 const USHORT MAX_MIMECP_NAME
= 64;
179 const USHORT MAX_MIMECSET_NAME
= 50;
181 typedef enum tagMIMECONTF
183 MIMECONTF_MAILNEWS
= 0x00000001,
184 MIMECONTF_BROWSER
= 0x00000002,
185 MIMECONTF_MINIMAL
= 0x00000004,
186 MIMECONTF_IMPORT
= 0x00000008,
187 MIMECONTF_SAVABLE_MAILNEWS
= 0x00000100,
188 MIMECONTF_SAVABLE_BROWSER
= 0x00000200,
189 MIMECONTF_EXPORT
= 0x00000400,
190 MIMECONTF_PRIVCONVERTER
= 0x00010000,
191 MIMECONTF_VALID
= 0x00020000,
192 MIMECONTF_VALID_NLS
= 0x00040000,
193 MIMECONTF_MIME_IE4
= 0x10000000,
194 MIMECONTF_MIME_LATEST
= 0x20000000,
195 MIMECONTF_MIME_REGISTRY
= 0x40000000
198 typedef struct tagMIMECPINFO
{
201 UINT uiFamilyCodePage
;
202 WCHAR wszDescription
[MAX_MIMECP_NAME
];
203 WCHAR wszWebCharset
[MAX_MIMECSET_NAME
];
204 WCHAR wszHeaderCharset
[MAX_MIMECSET_NAME
];
205 WCHAR wszBodyCharset
[MAX_MIMECSET_NAME
];
206 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
207 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
209 } MIMECPINFO
, *PMIMECPINFO
;
211 typedef struct tagMIMECSETINFO
214 UINT uiInternetEncoding
;
215 WCHAR wszCharset
[MAX_MIMECSET_NAME
];
216 } MIMECSETINFO
, *PMIMECSETINFO
;
219 [out] IEnumCodePage
**ppEnum
);
223 [out] PMIMECPINFO rgelt
,
224 [out] ULONG
*pceltFetched
);
234 pointer_default(unique)
236 interface IMLangConvertCharset
: IUnknown
239 [in] UINT uiSrcCodePage
,
240 [in] UINT uiDstCodePage
,
241 [in] DWORD dwProperty
);
243 HRESULT GetSourceCodePage
(
244 [out] UINT
*puiSrcCodePage
);
246 HRESULT GetDestinationCodePage
(
247 [out] UINT
*puiDstCodePage
);
250 [out] DWORD
*pdwProperty
);
252 HRESULT DoConversion
(
254 [in,out] UINT
*pcSrcSize
,
256 [in,out] UINT
*pcDstSize
);
258 HRESULT DoConversionToUnicode
(
260 [in,out] UINT
*pcSrcSize
,
262 [in,out] UINT
*pcDstSize
);
264 HRESULT DoConversionFromUnicode
(
266 [in,out] UINT
*pcSrcSize
,
268 [in,out] UINT
*pcDstSize
);
273 pointer_default(unique)
275 interface IEnumRfc1766
: IUnknown
277 typedef struct tagRFC1766INFO
280 WCHAR wszRfc1766
[MAX_RFC1766_NAME
];
281 WCHAR wszLocaleName
[MAX_LOCALE_NAME
];
282 } RFC1766INFO
, *PRFC1766INFO
;
285 [out] IEnumRfc1766
**ppEnum
);
289 [out] PRFC1766INFO rgelt
,
290 [out] ULONG
*pceltFetched
);
300 pointer_default(unique)
302 interface IMultiLanguage
: IUnknown
304 HRESULT GetNumberOfCodePageInfo
(
305 [out] UINT
*pcCodePage
);
307 HRESULT GetCodePageInfo
(
308 [in] UINT uiCodePage
,
309 [out] PMIMECPINFO pCodePageInfo
);
311 HRESULT GetFamilyCodePage
(
312 [in] UINT uiCodePage
,
313 [out] UINT
*puiFamilyCodePage
);
315 HRESULT EnumCodePages
(
317 [out] IEnumCodePage
**ppEnumCodePage
);
319 HRESULT GetCharsetInfo
(
321 [in] PMIMECSETINFO pCharsetInfo
);
323 HRESULT IsConvertible
(
324 [in] DWORD dwSrcEncoding
,
325 [in] DWORD dwDstEncoding
);
327 HRESULT ConvertString
(
328 [in,out] DWORD
*pdwMode
,
329 [in] DWORD dwSrcEncoding
,
330 [in] DWORD dwDstEncoding
,
332 [in,out] UINT
*pcSrcSize
,
334 [in,out] UINT
*pcDstSize
);
336 HRESULT ConvertStringToUnicode
(
337 [in,out] DWORD
*pdwMode
,
338 [in] DWORD dwEncoding
,
340 [in,out] UINT
*pcSrcSize
,
342 [in,out] UINT
*pcDstSize
);
344 HRESULT ConvertStringFromUnicode
(
345 [in,out] DWORD
*pdwMode
,
346 [in] DWORD dwEncoding
,
348 [in,out] UINT
*pcSrcSize
,
350 [in,out] UINT
*pcDstSize
);
352 HRESULT ConvertStringReset
();
354 HRESULT GetRfc1766FromLcid
(
356 [out] BSTR *pbstrRfc1766
);
358 HRESULT GetLcidFromRfc1766
(
360 [in] BSTR bstrRfc1766
);
363 [out] IEnumRfc1766
**ppEnumRfc1766
);
365 HRESULT GetRfc1766Info
(
367 [out] PRFC1766INFO pRfc1766Info
);
369 HRESULT CreateConvertCharset
(
370 [in] UINT uiSrcCodePage
,
371 [in] UINT uiDstCodePage
,
372 [in] DWORD dwProperty
,
373 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
379 pointer_default(unique)
381 interface IMultiLanguage2
: IUnknown
383 typedef struct tagDetectEncodingInfo
389 } DetectEncodingInfo
, *pDetectEncodingInfo
;
391 HRESULT GetNumberOfCodePageInfo
(
392 [out] UINT
*pcCodePage
);
394 HRESULT GetCodePageInfo
(
395 [in] UINT uiCodePage
,
397 [out] PMIMECPINFO pCodePageInfo
);
399 HRESULT GetFamilyCodePage
(
400 [in] UINT uiCodePage
,
401 [out] UINT
*puiFamilyCodePage
);
403 HRESULT EnumCodePages
(
406 [out] IEnumCodePage
**ppEnumCodePage
);
408 HRESULT GetCharsetInfo
(
410 [in] PMIMECSETINFO pCharsetInfo
);
412 HRESULT IsConvertible
(
413 [in] DWORD dwSrcEncoding
,
414 [in] DWORD dwDstEncoding
);
416 HRESULT ConvertString
(
417 [in,out] DWORD
*pdwMode
,
418 [in] DWORD dwSrcEncoding
,
419 [in] DWORD dwDstEncoding
,
421 [in,out] UINT
*pcSrcSize
,
423 [in,out] UINT
*pcDstSize
);
425 HRESULT ConvertStringToUnicode
(
426 [in,out] DWORD
*pdwMode
,
427 [in] DWORD dwEncoding
,
429 [in,out] UINT
*pcSrcSize
,
431 [in,out] UINT
*pcDstSize
);
433 HRESULT ConvertStringFromUnicode
(
434 [in,out] DWORD
*pdwMode
,
435 [in] DWORD dwEncoding
,
437 [in,out] UINT
*pcSrcSize
,
439 [in,out] UINT
*pcDstSize
);
441 HRESULT ConvertStringReset
();
443 HRESULT GetRfc1766FromLcid
(
445 [out] BSTR *pbstrRfc1766
);
447 HRESULT GetLcidFromRfc1766
(
449 [in] BSTR bstrRfc1766
);
453 [out] IEnumRfc1766
**ppEnumRfc1766
);
455 HRESULT GetRfc1766Info
(
458 [out] PRFC1766INFO pRfc1766Info
);
460 HRESULT CreateConvertCharset
(
461 [in] UINT uiSrcCodePage
,
462 [in] UINT uiDstCodePage
,
463 [in] DWORD dwProperty
,
464 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
466 HRESULT ConvertStringInIStream
(
467 [in,out] DWORD
*pdwMode
,
469 [in] WCHAR
*lpFallBack
,
470 [in] DWORD dwSrcEncoding
,
471 [in] DWORD dwDstEncoding
,
472 [in] IStream
*pstmIn
,
473 [in] IStream
*pstmOut
);
475 HRESULT ConvertStringToUnicodeEx
(
476 [in,out] DWORD
*pdwMode
,
477 [in] DWORD dwEncoding
,
479 [in,out] UINT
*pcSrcSize
,
481 [in,out] UINT
*pcDstSize
,
483 [in] WCHAR
*lpFallBack
);
485 HRESULT ConvertStringFromUnicodeEx
(
486 [in,out] DWORD
*pdwMode
,
487 [in] DWORD dwEncoding
,
489 [in,out] UINT
*pcSrcSize
,
491 [in,out] UINT
*pcDstSize
,
493 [in] WCHAR
*lpFallBack
);
495 HRESULT DetectCodepageInIStream
(
497 [in] DWORD dwPrefWinCodePage
,
498 [in] IStream
*pstmIn
,
499 [in,out] DetectEncodingInfo
*lpEncoding
,
500 [in,out] INT *pnScores
);
502 HRESULT DetectInputCodepage
(
504 [in] DWORD dwPrefWinCodePage
,
506 [in,out] INT *pcSrcSize
,
507 [in,out] DetectEncodingInfo
*lpEncoding
,
508 [in,out] INT *pnScores
);
510 HRESULT ValidateCodePage
(
511 [in] UINT uiCodePage
,
514 HRESULT GetCodePageDescription
(
515 [in] UINT uiCodePage
,
517 [in,out] LPWSTR lpWideCharStr
,
518 [in] int cchWideChar
);
520 HRESULT IsCodePageInstallable
(
521 [in] UINT uiCodePage
);
523 HRESULT SetMimeDBSource
(
524 [in] MIMECONTF dwSource
);
526 HRESULT GetNumberOfScripts
(
527 [out] UINT
*pnScripts
);
532 [out] IEnumScript
**ppEnumScript
);
534 HRESULT ValidateCodePageEx
( /* undocumented on MSDN */
535 [in] UINT uiCodePage
,
537 [in] DWORD dwfIODControl
);
540 cpp_quote
("STDAPI LcidToRfc1766A(LCID, LPSTR, INT);")
541 cpp_quote
("STDAPI LcidToRfc1766W(LCID, LPWSTR, INT);")
542 cpp_quote
("#define LcidToRfc1766 WINELIB_NAME_AW(LcidToRfc1766)")
544 cpp_quote
("STDAPI Rfc1766ToLcidA(LCID *, LPCSTR);")
545 cpp_quote
("STDAPI Rfc1766ToLcidW(LCID *, LPCWSTR);")
546 cpp_quote
("#define Rfc1766ToLcid WINELIB_NAME_AW(Rfc1766ToLcid)")
548 cpp_quote
("STDAPI IsConvertINetStringAvailable(DWORD, DWORD);")
549 cpp_quote
("STDAPI ConvertINetString(LPDWORD, DWORD, DWORD, LPCSTR, LPINT, LPSTR, LPINT);")
550 cpp_quote
("STDAPI ConvertINetMultiByteToUnicode(LPDWORD, DWORD, LPCSTR, LPINT, LPWSTR, LPINT);")
551 cpp_quote
("STDAPI ConvertINetUnicodeToMultiByte(LPDWORD, DWORD, LPCWSTR, LPINT, LPSTR, LPINT);")
553 cpp_quote
("DEFINE_GUID(CLSID_CMultiLanguage, 0x275c23e2, 0x3747, 0x11d0, 0x9f,0xea,0x00,0xaa,0x00,0x3f,0x86,0x46);")
554 cpp_quote
("DEFINE_GUID(IID_IMLangCodePages, 0x359F3443,0xBD4A,0x11D0,0xB1,0x88,0x00,0xAA,0x00,0x38,0xC9,0x69);")
555 cpp_quote
("DEFINE_GUID(IID_IMLangFontLink, 0x359F3441,0xBD4A,0x11D0,0xB1,0x88,0x00,0xAA,0x00,0x38,0xC9,0x69);")
556 cpp_quote
("DEFINE_GUID(IID_IMultiLanguage2, 0xDCCFC164,0x2B38,0x11d2,0xB7,0xEC,0x00,0xC0,0x4F,0x8F,0x5D,0x9A);")
557 cpp_quote
("DEFINE_GUID(IID_IMultiLanguage, 0x275c23e1,0x3747,0x11d0,0x9f,0xea,0x00,0xaa,0x00,0x3f,0x86,0x46);")
558 cpp_quote
("DEFINE_GUID(IID_IEnumCodePage, 0x275c23e3,0x3747,0x11d0,0x9f,0xea,0x00,0xaa,0x00,0x3f,0x86,0x46);")
559 cpp_quote
("DEFINE_GUID(IID_IEnumScript, 0xae5f1430,0x388b,0x11d2,0x83,0x80,0x00,0xc0,0x4f,0x8f,0x5d,0xa1);")