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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 /* FIXME: LANGID is defined in winnt.h and mlang.h in the platform SDK */
26 cpp_quote
("#ifndef _WINNT_")
32 uuid(359f3443
-bd4a
-11d0
-b188
-00aa0038c969
),
33 pointer_default(unique)
35 interface IMLangCodePages
: IUnknown
37 HRESULT GetCharCodePages
(
40 HRESULT GetStrCodePages
(
41 [in, size_is(cchSrc
)] const WCHAR
*pszSrc
,
43 [in] DWORD dwPriorityCodePages
,
44 [out] DWORD
*pdwCodePages
,
45 [out] long *pcchCodePages
);
46 HRESULT CodePageToCodePages
(
48 [out] DWORD
*pdwCodePages
);
49 HRESULT CodePagesToCodePage
(
50 [in] DWORD dwCodePages
,
51 [in] UINT uDefaultCodePage
,
52 [out] UINT
*puCodePage
);
57 uuid(359f3441
-bd4a
-11d0
-b188
-00aa0038c969
),
58 pointer_default(unique)
60 interface IMLangFontLink
: IMLangCodePages
62 HRESULT GetFontCodePages
(
65 [out] DWORD
*pdwCodePages
);
69 [in] DWORD dwCodePages
,
71 [out] HFONT
*phDestFont
);
76 HRESULT ResetFontMapping
();
81 uuid(ae5f1430
-388b
-11d2
-8380-00c04f8f5da1
),
82 pointer_default(unique)
84 interface IEnumScript
: IUnknown
86 const USHORT MAX_SCRIPT_NAME
= 48;
87 const USHORT MAX_MIMEFACE_NAME
= 32;
89 typedef BYTE SCRIPT_ID
;
90 typedef __int64 SCRIPT_IDS
;
92 typedef enum tagSCRIPTCONTF
95 sidMerge
= sidDefault
+ 1,
96 sidAsciiSym
= sidMerge
+ 1,
97 sidAsciiLatin
= sidAsciiSym
+ 1,
98 sidLatin
= sidAsciiLatin
+ 1,
99 sidGreek
= sidLatin
+ 1,
100 sidCyrillic
= sidGreek
+ 1,
101 sidArmenian
= sidCyrillic
+ 1,
102 sidHebrew
= sidArmenian
+ 1,
103 sidArabic
= sidHebrew
+ 1,
104 sidDevanagari
= sidArabic
+ 1,
105 sidBengali
= sidDevanagari
+ 1,
106 sidGurmukhi
= sidBengali
+ 1,
107 sidGujarati
= sidGurmukhi
+ 1,
108 sidOriya
= sidGujarati
+ 1,
109 sidTamil
= sidOriya
+ 1,
110 sidTelugu
= sidTamil
+ 1,
111 sidKannada
= sidTelugu
+ 1,
112 sidMalayalam
= sidKannada
+ 1,
113 sidThai
= sidMalayalam
+ 1,
114 sidLao
= sidThai
+ 1,
115 sidTibetan
= sidLao
+ 1,
116 sidGeorgian
= sidTibetan
+ 1,
117 sidHangul
= sidGeorgian
+ 1,
118 sidKana
= sidHangul
+ 1,
119 sidBopomofo
= sidKana
+ 1,
120 sidHan
= sidBopomofo
+ 1,
121 sidEthiopic
= sidHan
+ 1,
122 sidCanSyllabic
= sidEthiopic
+ 1,
123 sidCherokee
= sidCanSyllabic
+ 1,
124 sidYi
= sidCherokee
+ 1,
125 sidBraille
= sidYi
+ 1,
126 sidRunic
= sidBraille
+ 1,
127 sidOgham
= sidRunic
+ 1,
128 sidSinhala
= sidOgham
+ 1,
129 sidSyriac
= sidSinhala
+ 1,
130 sidBurmese
= sidSyriac
+ 1,
131 sidKhmer
= sidBurmese
+ 1,
132 sidThaana
= sidKhmer
+ 1,
133 sidMongolian
= sidThaana
+ 1,
134 sidUserDefined
= sidMongolian
+ 1,
135 sidLim
= sidUserDefined
+ 1,
136 sidFEFirst
= sidHangul
,
140 typedef enum tagSCRIPTFONTCONTF
142 SCRIPTCONTF_FIXED_FONT
= 0x1,
143 SCRIPTCONTF_PROPORTIONAL_FONT
= 0x2,
144 SCRIPTCONTF_SCRIPT_USER
= 0x10000,
145 SCRIPTCONTF_SCRIPT_HIDE
= 0x20000,
146 SCRIPTCONTF_SCRIPT_SYSTEM
= 0x40000
149 typedef struct tagSCRIPFONTINFO
152 WCHAR wszFont
[MAX_MIMEFACE_NAME
];
153 } SCRIPTFONTINFO
, *PSCRIPTFONTINFO
;
155 typedef struct tagSCRIPTINFO
{
158 WCHAR wszDescription
[MAX_SCRIPT_NAME
];
159 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
160 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
161 } SCRIPTINFO
, *PSCRIPTINFO
;
164 [out] IEnumScript
**ppEnum
);
168 [out] PSCRIPTINFO rgelt
,
169 [out] ULONG
*pceltFetched
);
179 uuid(dccfc162
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
180 pointer_default(unique)
182 interface IMLangFontLink2
: IMLangCodePages
184 typedef struct tagUNICODERANGE
190 typedef [unique] IMLangFontLink2
*PMLANGFONTLINK2
;
192 HRESULT GetFontCodePages
(
195 [out] DWORD
*pdwCodePages
);
200 HRESULT ResetFontMapping
();
204 [in] DWORD dwCodePages
,
208 HRESULT GetFontUnicodeRanges
(
210 [in,out] UINT
*puiRanges
,
211 [out] UNICODERANGE
* pUranges
);
213 HRESULT GetScriptFontInfo
(
216 [in,out] UINT
*puiFonts
,
217 [out] SCRIPTFONTINFO
* pScriptFont
);
219 HRESULT CodePageToScriptID
(
220 [in] UINT uiCodePage
,
221 [out] SCRIPT_ID
*pSid
);
226 uuid(275c23e3
-3747-11d0
-9fea
-00aa003f8646
),
227 pointer_default(unique)
229 interface IEnumCodePage
: IUnknown
231 const USHORT MAX_MIMECP_NAME
= 64;
232 const USHORT MAX_MIMECSET_NAME
= 50;
234 typedef enum tagMIMECONTF
236 MIMECONTF_MAILNEWS
= 0x00000001,
237 MIMECONTF_BROWSER
= 0x00000002,
238 MIMECONTF_MINIMAL
= 0x00000004,
239 MIMECONTF_IMPORT
= 0x00000008,
240 MIMECONTF_SAVABLE_MAILNEWS
= 0x00000100,
241 MIMECONTF_SAVABLE_BROWSER
= 0x00000200,
242 MIMECONTF_EXPORT
= 0x00000400,
243 MIMECONTF_PRIVCONVERTER
= 0x00010000,
244 MIMECONTF_VALID
= 0x00020000,
245 MIMECONTF_VALID_NLS
= 0x00040000,
246 MIMECONTF_MIME_IE4
= 0x10000000,
247 MIMECONTF_MIME_LATEST
= 0x20000000,
248 MIMECONTF_MIME_REGISTRY
= 0x40000000
251 typedef struct tagMIMECPINFO
{
254 UINT uiFamilyCodePage
;
255 WCHAR wszDescription
[MAX_MIMECP_NAME
];
256 WCHAR wszWebCharset
[MAX_MIMECSET_NAME
];
257 WCHAR wszHeaderCharset
[MAX_MIMECSET_NAME
];
258 WCHAR wszBodyCharset
[MAX_MIMECSET_NAME
];
259 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
260 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
262 } MIMECPINFO
, *PMIMECPINFO
;
264 typedef struct tagMIMECSETINFO
267 UINT uiInternetEncoding
;
268 WCHAR wszCharset
[MAX_MIMECSET_NAME
];
269 } MIMECSETINFO
, *PMIMECSETINFO
;
272 [out] IEnumCodePage
**ppEnum
);
276 [out] PMIMECPINFO rgelt
,
277 [out] ULONG
*pceltFetched
);
287 uuid(d66d6f98
-cdaa
-11d0
-b822
-00c04fc9b31f
),
288 pointer_default(unique)
290 interface IMLangConvertCharset
: IUnknown
293 [in] UINT uiSrcCodePage
,
294 [in] UINT uiDstCodePage
,
295 [in] DWORD dwProperty
);
297 HRESULT GetSourceCodePage
(
298 [out] UINT
*puiSrcCodePage
);
300 HRESULT GetDestinationCodePage
(
301 [out] UINT
*puiDstCodePage
);
304 [out] DWORD
*pdwProperty
);
306 HRESULT DoConversion
(
308 [in,out] UINT
*pcSrcSize
,
310 [in,out] UINT
*pcDstSize
);
312 HRESULT DoConversionToUnicode
(
314 [in,out] UINT
*pcSrcSize
,
316 [in,out] UINT
*pcDstSize
);
318 HRESULT DoConversionFromUnicode
(
320 [in,out] UINT
*pcSrcSize
,
322 [in,out] UINT
*pcDstSize
);
326 uuid(d66d6f99
-cdaa
-11d0
-b822
-00c04fc9b31f
)
328 coclass CMLangConvertCharset
330 [default] interface IMLangConvertCharset
;
335 uuid(3dc39d1d
-c030
-11d0
-b81b
-00c04fc9b31f
),
336 pointer_default(unique)
338 interface IEnumRfc1766
: IUnknown
340 const USHORT MAX_RFC1766_NAME
= 6;
341 const USHORT MAX_LOCALE_NAME
= 32;
343 typedef struct tagRFC1766INFO
346 WCHAR wszRfc1766
[MAX_RFC1766_NAME
];
347 WCHAR wszLocaleName
[MAX_LOCALE_NAME
];
348 } RFC1766INFO
, *PRFC1766INFO
;
351 [out] IEnumRfc1766
**ppEnum
);
355 [out] PRFC1766INFO rgelt
,
356 [out] ULONG
*pceltFetched
);
366 uuid(275c23e1
-3747-11d0
-9fea
-00aa003f8646
),
367 pointer_default(unique)
369 interface IMultiLanguage
: IUnknown
371 HRESULT GetNumberOfCodePageInfo
(
372 [out] UINT
*pcCodePage
);
374 HRESULT GetCodePageInfo
(
375 [in] UINT uiCodePage
,
376 [out] PMIMECPINFO pCodePageInfo
);
378 HRESULT GetFamilyCodePage
(
379 [in] UINT uiCodePage
,
380 [out] UINT
*puiFamilyCodePage
);
382 HRESULT EnumCodePages
(
384 [out] IEnumCodePage
**ppEnumCodePage
);
386 HRESULT GetCharsetInfo
(
388 [in] PMIMECSETINFO pCharsetInfo
);
390 HRESULT IsConvertible
(
391 [in] DWORD dwSrcEncoding
,
392 [in] DWORD dwDstEncoding
);
394 HRESULT ConvertString
(
395 [in,out] DWORD
*pdwMode
,
396 [in] DWORD dwSrcEncoding
,
397 [in] DWORD dwDstEncoding
,
399 [in,out] UINT
*pcSrcSize
,
401 [in,out] UINT
*pcDstSize
);
403 HRESULT ConvertStringToUnicode
(
404 [in,out] DWORD
*pdwMode
,
405 [in] DWORD dwEncoding
,
407 [in,out] UINT
*pcSrcSize
,
409 [in,out] UINT
*pcDstSize
);
411 HRESULT ConvertStringFromUnicode
(
412 [in,out] DWORD
*pdwMode
,
413 [in] DWORD dwEncoding
,
415 [in,out] UINT
*pcSrcSize
,
417 [in,out] UINT
*pcDstSize
);
419 HRESULT ConvertStringReset
();
421 HRESULT GetRfc1766FromLcid
(
423 [out] BSTR *pbstrRfc1766
);
425 HRESULT GetLcidFromRfc1766
(
427 [in] BSTR bstrRfc1766
);
430 [out] IEnumRfc1766
**ppEnumRfc1766
);
432 HRESULT GetRfc1766Info
(
434 [out] PRFC1766INFO pRfc1766Info
);
436 HRESULT CreateConvertCharset
(
437 [in] UINT uiSrcCodePage
,
438 [in] UINT uiDstCodePage
,
439 [in] DWORD dwProperty
,
440 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
446 uuid(dccfc164
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
447 pointer_default(unique)
449 interface IMultiLanguage2
: IUnknown
451 typedef struct tagDetectEncodingInfo
457 } DetectEncodingInfo
, *pDetectEncodingInfo
;
459 HRESULT GetNumberOfCodePageInfo
(
460 [out] UINT
*pcCodePage
);
462 HRESULT GetCodePageInfo
(
463 [in] UINT uiCodePage
,
465 [out] PMIMECPINFO pCodePageInfo
);
467 HRESULT GetFamilyCodePage
(
468 [in] UINT uiCodePage
,
469 [out] UINT
*puiFamilyCodePage
);
471 HRESULT EnumCodePages
(
474 [out] IEnumCodePage
**ppEnumCodePage
);
476 HRESULT GetCharsetInfo
(
478 [in] PMIMECSETINFO pCharsetInfo
);
480 HRESULT IsConvertible
(
481 [in] DWORD dwSrcEncoding
,
482 [in] DWORD dwDstEncoding
);
484 HRESULT ConvertString
(
485 [in,out] DWORD
*pdwMode
,
486 [in] DWORD dwSrcEncoding
,
487 [in] DWORD dwDstEncoding
,
489 [in,out] UINT
*pcSrcSize
,
491 [in,out] UINT
*pcDstSize
);
493 HRESULT ConvertStringToUnicode
(
494 [in,out] DWORD
*pdwMode
,
495 [in] DWORD dwEncoding
,
497 [in,out] UINT
*pcSrcSize
,
499 [in,out] UINT
*pcDstSize
);
501 HRESULT ConvertStringFromUnicode
(
502 [in,out] DWORD
*pdwMode
,
503 [in] DWORD dwEncoding
,
505 [in,out] UINT
*pcSrcSize
,
507 [in,out] UINT
*pcDstSize
);
509 HRESULT ConvertStringReset
();
511 HRESULT GetRfc1766FromLcid
(
513 [out] BSTR *pbstrRfc1766
);
515 HRESULT GetLcidFromRfc1766
(
517 [in] BSTR bstrRfc1766
);
521 [out] IEnumRfc1766
**ppEnumRfc1766
);
523 HRESULT GetRfc1766Info
(
526 [out] PRFC1766INFO pRfc1766Info
);
528 HRESULT CreateConvertCharset
(
529 [in] UINT uiSrcCodePage
,
530 [in] UINT uiDstCodePage
,
531 [in] DWORD dwProperty
,
532 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
534 HRESULT ConvertStringInIStream
(
535 [in,out] DWORD
*pdwMode
,
537 [in] WCHAR
*lpFallBack
,
538 [in] DWORD dwSrcEncoding
,
539 [in] DWORD dwDstEncoding
,
540 [in] IStream
*pstmIn
,
541 [in] IStream
*pstmOut
);
543 HRESULT ConvertStringToUnicodeEx
(
544 [in,out] DWORD
*pdwMode
,
545 [in] DWORD dwEncoding
,
547 [in,out] UINT
*pcSrcSize
,
549 [in,out] UINT
*pcDstSize
,
551 [in] WCHAR
*lpFallBack
);
553 HRESULT ConvertStringFromUnicodeEx
(
554 [in,out] DWORD
*pdwMode
,
555 [in] DWORD dwEncoding
,
557 [in,out] UINT
*pcSrcSize
,
559 [in,out] UINT
*pcDstSize
,
561 [in] WCHAR
*lpFallBack
);
563 HRESULT DetectCodepageInIStream
(
565 [in] DWORD dwPrefWinCodePage
,
566 [in] IStream
*pstmIn
,
567 [in,out] DetectEncodingInfo
*lpEncoding
,
568 [in,out] INT *pnScores
);
570 HRESULT DetectInputCodepage
(
572 [in] DWORD dwPrefWinCodePage
,
574 [in,out] INT *pcSrcSize
,
575 [in,out] DetectEncodingInfo
*lpEncoding
,
576 [in,out] INT *pnScores
);
578 HRESULT ValidateCodePage
(
579 [in] UINT uiCodePage
,
582 HRESULT GetCodePageDescription
(
583 [in] UINT uiCodePage
,
585 [in,out] LPWSTR lpWideCharStr
,
586 [in] int cchWideChar
);
588 HRESULT IsCodePageInstallable
(
589 [in] UINT uiCodePage
);
591 HRESULT SetMimeDBSource
(
592 [in] MIMECONTF dwSource
);
594 HRESULT GetNumberOfScripts
(
595 [out] UINT
*pnScripts
);
600 [out] IEnumScript
**ppEnumScript
);
602 HRESULT ValidateCodePageEx
( /* undocumented on MSDN */
603 [in] UINT uiCodePage
,
605 [in] DWORD dwfIODControl
);
610 uuid(4e5868ab
-b157
-4623-9acc
-6a1d9caebe04
),
611 pointer_default(unique)
613 interface IMultiLanguage3
: IMultiLanguage2
615 typedef [unique] IMultiLanguage3
*LPMULTILANGUAGE3
;
616 HRESULT DetectOutboundCodePage
(
618 [in] LPCWSTR lpWideCharStr
,
619 [in] UINT cchWideChar
,
620 [in] UINT
*puiPreferredCodePages
,
621 [in] UINT nPreferredCodePages
,
622 [in] UINT
*puiDetectedCodePages
,
623 [in, out] UINT
*pnDetectedCodePages
,
624 [in] WCHAR
*lpSpecialChar
);
626 HRESULT DetectOutboundCodePageInIStream
(
628 [in] IStream
*pStrIn
,
629 [in] UINT
*puiPreferredCodePages
,
630 [in] UINT nPreferredCodePages
,
631 [in] UINT
*puiDetectedCodePages
,
632 [in, out] UINT
*pnDetectedCodePages
,
633 [in] WCHAR
*lpSpecialChar
);
637 uuid(275C23E2
-3747-11d0
-9FEA
-00AA003f8646
)
639 coclass CMultiLanguage
641 [default] interface IMultiLanguage
;
642 interface IMLangCodePages
;
643 interface IMLangFontLink
;
644 /* interface IMLangLineBreakConsole; */
645 interface IMLangFontLink2
;
648 cpp_quote
("STDAPI LcidToRfc1766A(LCID, LPSTR, INT);")
649 cpp_quote
("STDAPI LcidToRfc1766W(LCID, LPWSTR, INT);")
650 cpp_quote
("#define LcidToRfc1766 WINELIB_NAME_AW(LcidToRfc1766)")
652 cpp_quote
("STDAPI Rfc1766ToLcidA(LCID *, LPCSTR);")
653 cpp_quote
("STDAPI Rfc1766ToLcidW(LCID *, LPCWSTR);")
654 cpp_quote
("#define Rfc1766ToLcid WINELIB_NAME_AW(Rfc1766ToLcid)")
656 cpp_quote
("STDAPI GetGlobalFontLinkObject(void);")
657 cpp_quote
("STDAPI IsConvertINetStringAvailable(DWORD, DWORD);")
658 cpp_quote
("STDAPI ConvertINetString(LPDWORD, DWORD, DWORD, LPCSTR, LPINT, LPSTR, LPINT);")
659 cpp_quote
("STDAPI ConvertINetMultiByteToUnicode(LPDWORD, DWORD, LPCSTR, LPINT, LPWSTR, LPINT);")
660 cpp_quote
("STDAPI ConvertINetUnicodeToMultiByte(LPDWORD, DWORD, LPCWSTR, LPINT, LPSTR, LPINT);")