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 cpp_quote
("#define CPIOD_PEEK 0x40000000")
26 cpp_quote
("#define CPIOD_FORCE_PROMPT 0x80000000")
30 uuid(359f3443
-bd4a
-11d0
-b188
-00aa0038c969
),
31 pointer_default(unique)
33 interface IMLangCodePages
: IUnknown
35 HRESULT GetCharCodePages
(
37 [out] DWORD
*pdwCodePages
);
38 HRESULT GetStrCodePages
(
39 [in, size_is(cchSrc
)] const WCHAR
*pszSrc
,
41 [in] DWORD dwPriorityCodePages
,
42 [out] DWORD
*pdwCodePages
,
43 [out] LONG *pcchCodePages
);
44 HRESULT CodePageToCodePages
(
46 [out] DWORD
*pdwCodePages
);
47 HRESULT CodePagesToCodePage
(
48 [in] DWORD dwCodePages
,
49 [in] UINT uDefaultCodePage
,
50 [out] UINT
*puCodePage
);
55 uuid(359f3441
-bd4a
-11d0
-b188
-00aa0038c969
),
56 pointer_default(unique)
58 interface IMLangFontLink
: IMLangCodePages
60 HRESULT GetFontCodePages
(
63 [out] DWORD
*pdwCodePages
);
67 [in] DWORD dwCodePages
,
69 [out] HFONT
*phDestFont
);
74 HRESULT ResetFontMapping
();
79 uuid(ae5f1430
-388b
-11d2
-8380-00c04f8f5da1
),
80 pointer_default(unique)
82 interface IEnumScript
: IUnknown
84 const USHORT MAX_SCRIPT_NAME
= 48;
85 const USHORT MAX_MIMEFACE_NAME
= 32;
87 typedef BYTE SCRIPT_ID
;
88 typedef __int64 SCRIPT_IDS
;
90 typedef enum tagSCRIPTCONTF
93 sidMerge
= sidDefault
+ 1,
94 sidAsciiSym
= sidMerge
+ 1,
95 sidAsciiLatin
= sidAsciiSym
+ 1,
96 sidLatin
= sidAsciiLatin
+ 1,
97 sidGreek
= sidLatin
+ 1,
98 sidCyrillic
= sidGreek
+ 1,
99 sidArmenian
= sidCyrillic
+ 1,
100 sidHebrew
= sidArmenian
+ 1,
101 sidArabic
= sidHebrew
+ 1,
102 sidDevanagari
= sidArabic
+ 1,
103 sidBengali
= sidDevanagari
+ 1,
104 sidGurmukhi
= sidBengali
+ 1,
105 sidGujarati
= sidGurmukhi
+ 1,
106 sidOriya
= sidGujarati
+ 1,
107 sidTamil
= sidOriya
+ 1,
108 sidTelugu
= sidTamil
+ 1,
109 sidKannada
= sidTelugu
+ 1,
110 sidMalayalam
= sidKannada
+ 1,
111 sidThai
= sidMalayalam
+ 1,
112 sidLao
= sidThai
+ 1,
113 sidTibetan
= sidLao
+ 1,
114 sidGeorgian
= sidTibetan
+ 1,
115 sidHangul
= sidGeorgian
+ 1,
116 sidKana
= sidHangul
+ 1,
117 sidBopomofo
= sidKana
+ 1,
118 sidHan
= sidBopomofo
+ 1,
119 sidEthiopic
= sidHan
+ 1,
120 sidCanSyllabic
= sidEthiopic
+ 1,
121 sidCherokee
= sidCanSyllabic
+ 1,
122 sidYi
= sidCherokee
+ 1,
123 sidBraille
= sidYi
+ 1,
124 sidRunic
= sidBraille
+ 1,
125 sidOgham
= sidRunic
+ 1,
126 sidSinhala
= sidOgham
+ 1,
127 sidSyriac
= sidSinhala
+ 1,
128 sidBurmese
= sidSyriac
+ 1,
129 sidKhmer
= sidBurmese
+ 1,
130 sidThaana
= sidKhmer
+ 1,
131 sidMongolian
= sidThaana
+ 1,
132 sidUserDefined
= sidMongolian
+ 1,
133 sidLim
= sidUserDefined
+ 1,
134 sidFEFirst
= sidHangul
,
138 typedef enum tagSCRIPTFONTCONTF
140 SCRIPTCONTF_FIXED_FONT
= 0x1,
141 SCRIPTCONTF_PROPORTIONAL_FONT
= 0x2,
142 SCRIPTCONTF_SCRIPT_USER
= 0x10000,
143 SCRIPTCONTF_SCRIPT_HIDE
= 0x20000,
144 SCRIPTCONTF_SCRIPT_SYSTEM
= 0x40000
147 typedef struct tagSCRIPFONTINFO
150 WCHAR wszFont
[MAX_MIMEFACE_NAME
];
151 } SCRIPTFONTINFO
, *PSCRIPTFONTINFO
;
153 typedef struct tagSCRIPTINFO
{
156 WCHAR wszDescription
[MAX_SCRIPT_NAME
];
157 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
158 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
159 } SCRIPTINFO
, *PSCRIPTINFO
;
162 [out] IEnumScript
**ppEnum
);
166 [out] PSCRIPTINFO rgelt
,
167 [out] ULONG
*pceltFetched
);
177 uuid(dccfc162
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
178 pointer_default(unique)
180 interface IMLangFontLink2
: IMLangCodePages
182 typedef struct tagUNICODERANGE
188 typedef [unique] IMLangFontLink2
*PMLANGFONTLINK2
;
190 HRESULT GetFontCodePages
(
193 [out] DWORD
*pdwCodePages
);
198 HRESULT ResetFontMapping
();
202 [in] DWORD dwCodePages
,
206 HRESULT GetFontUnicodeRanges
(
208 [in,out] UINT
*puiRanges
,
209 [out] UNICODERANGE
* pUranges
);
211 HRESULT GetScriptFontInfo
(
214 [in,out] UINT
*puiFonts
,
215 [out] SCRIPTFONTINFO
* pScriptFont
);
217 HRESULT CodePageToScriptID
(
218 [in] UINT uiCodePage
,
219 [out] SCRIPT_ID
*pSid
);
224 uuid(c04d65ce
-b70d
-11d0
-b188
-00aa0038c969
),
225 pointer_default(unique)
227 interface IMLangString
: IUnknown
233 [out] DWORD
* pdwCookie
,
234 [out] LONG* plActualPos
,
235 [out] LONG* plActualLen
);
238 [in] DWORD dwCookie
);
241 [in] BOOL fNoAccess
);
244 [out, retval] LONG* plLen
);
248 [in] IUnknown
*pSrcMLStr
,
252 HRESULT RegisterAttr
(
254 [out] DWORD
* pdwCookie
);
255 HRESULT UnregisterAttr
(
256 [in] DWORD dwCookie
);
258 [out] IEnumUnknown
**ppEnumUnk
);
262 [out] IUnknown
**ppUnk
);
267 [in] IUnknown
*pUnkOuter
,
268 [in] DWORD dwClsContext
,
269 [in] const IID
* piid
,
270 [out] IUnknown
** ppDestMLStr
,
271 [out] LONG* plDestPos
,
272 [out] LONG* plDestLen
);
278 uuid(f5be2ee1
-bfd7
-11d0
-b188
-00aa0038c969
),
279 pointer_default(unique)
281 interface IMLangLineBreakConsole
: IUnknown
284 [in] IMLangString
* pSrcMLStr
,
287 [in] LONG cMinColumns
,
288 [in] LONG cMaxColumns
,
289 [out] LONG* plLineLen
,
290 [out] LONG* plSkipLen
);
294 [in, size_is(cchSrc
)] const WCHAR
* pszSrc
,
296 [in] LONG cMaxColumns
,
297 [out] LONG* pcchLine
,
298 [out] LONG* pcchSkip
);
303 [in, size_is(cchSrc
)] const CHAR* pszSrc
,
305 [in] LONG cMaxColumns
,
306 [out] LONG* pcchLine
,
307 [out] LONG* pcchSkip
);
312 uuid(275c23e3
-3747-11d0
-9fea
-00aa003f8646
),
313 pointer_default(unique)
315 interface IEnumCodePage
: IUnknown
317 const USHORT MAX_MIMECP_NAME
= 64;
318 const USHORT MAX_MIMECSET_NAME
= 50;
320 typedef enum tagMIMECONTF
322 MIMECONTF_MAILNEWS
= 0x00000001,
323 MIMECONTF_BROWSER
= 0x00000002,
324 MIMECONTF_MINIMAL
= 0x00000004,
325 MIMECONTF_IMPORT
= 0x00000008,
326 MIMECONTF_SAVABLE_MAILNEWS
= 0x00000100,
327 MIMECONTF_SAVABLE_BROWSER
= 0x00000200,
328 MIMECONTF_EXPORT
= 0x00000400,
329 MIMECONTF_PRIVCONVERTER
= 0x00010000,
330 MIMECONTF_VALID
= 0x00020000,
331 MIMECONTF_VALID_NLS
= 0x00040000,
332 MIMECONTF_MIME_IE4
= 0x10000000,
333 MIMECONTF_MIME_LATEST
= 0x20000000,
334 MIMECONTF_MIME_REGISTRY
= 0x40000000
337 typedef struct tagMIMECPINFO
{
340 UINT uiFamilyCodePage
;
341 WCHAR wszDescription
[MAX_MIMECP_NAME
];
342 WCHAR wszWebCharset
[MAX_MIMECSET_NAME
];
343 WCHAR wszHeaderCharset
[MAX_MIMECSET_NAME
];
344 WCHAR wszBodyCharset
[MAX_MIMECSET_NAME
];
345 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
346 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
348 } MIMECPINFO
, *PMIMECPINFO
;
350 typedef struct tagMIMECSETINFO
353 UINT uiInternetEncoding
;
354 WCHAR wszCharset
[MAX_MIMECSET_NAME
];
355 } MIMECSETINFO
, *PMIMECSETINFO
;
358 [out] IEnumCodePage
**ppEnum
);
362 [out] PMIMECPINFO rgelt
,
363 [out] ULONG
*pceltFetched
);
373 uuid(d66d6f98
-cdaa
-11d0
-b822
-00c04fc9b31f
),
374 pointer_default(unique)
376 interface IMLangConvertCharset
: IUnknown
378 typedef enum tagMLCONVCHARF
380 MLCONVCHARF_AUTODETECT
= 1,
381 MLCONVCHARF_ENTITIZE
= 2,
382 MLCONVCHARF_NCR_ENTITIZE
= 2,
383 MLCONVCHARF_NAME_ENTITIZE
= 4,
384 MLCONVCHARF_USEDEFCHAR
= 8,
385 MLCONVCHARF_NOBESTFITCHARS
= 16,
386 MLCONVCHARF_DETECTJPN
= 32
389 typedef enum tagMLCPF
391 MLDETECTF_MAILNEWS
= 0x0001,
392 MLDETECTF_BROWSER
= 0x0002,
393 MLDETECTF_VALID
= 0x0004,
394 MLDETECTF_VALID_NLS
= 0x0008,
395 MLDETECTF_PRESERVE_ORDER
= 0x0010,
396 MLDETECTF_PREFERRED_ONLY
= 0x0020,
397 MLDETECTF_FILTER_SPECIALCHAR
= 0x0040,
398 MLDETECTF_EURO_UTF8
= 0x0080
402 [in] UINT uiSrcCodePage
,
403 [in] UINT uiDstCodePage
,
404 [in] DWORD dwProperty
);
406 HRESULT GetSourceCodePage
(
407 [out] UINT
*puiSrcCodePage
);
409 HRESULT GetDestinationCodePage
(
410 [out] UINT
*puiDstCodePage
);
413 [out] DWORD
*pdwProperty
);
415 HRESULT DoConversion
(
417 [in,out] UINT
*pcSrcSize
,
419 [in,out] UINT
*pcDstSize
);
421 HRESULT DoConversionToUnicode
(
423 [in,out] UINT
*pcSrcSize
,
425 [in,out] UINT
*pcDstSize
);
427 HRESULT DoConversionFromUnicode
(
429 [in,out] UINT
*pcSrcSize
,
431 [in,out] UINT
*pcDstSize
);
435 uuid(d66d6f99
-cdaa
-11d0
-b822
-00c04fc9b31f
)
437 coclass CMLangConvertCharset
439 [default] interface IMLangConvertCharset
;
444 uuid(3dc39d1d
-c030
-11d0
-b81b
-00c04fc9b31f
),
445 pointer_default(unique)
447 interface IEnumRfc1766
: IUnknown
449 const USHORT MAX_RFC1766_NAME
= 6;
450 const USHORT MAX_LOCALE_NAME
= 32;
452 typedef struct tagRFC1766INFO
455 WCHAR wszRfc1766
[MAX_RFC1766_NAME
];
456 WCHAR wszLocaleName
[MAX_LOCALE_NAME
];
457 } RFC1766INFO
, *PRFC1766INFO
;
460 [out] IEnumRfc1766
**ppEnum
);
464 [out] PRFC1766INFO rgelt
,
465 [out] ULONG
*pceltFetched
);
475 uuid(275c23e1
-3747-11d0
-9fea
-00aa003f8646
),
476 pointer_default(unique)
478 interface IMultiLanguage
: IUnknown
480 HRESULT GetNumberOfCodePageInfo
(
481 [out] UINT
*pcCodePage
);
483 HRESULT GetCodePageInfo
(
484 [in] UINT uiCodePage
,
485 [out] PMIMECPINFO pCodePageInfo
);
487 HRESULT GetFamilyCodePage
(
488 [in] UINT uiCodePage
,
489 [out] UINT
*puiFamilyCodePage
);
491 HRESULT EnumCodePages
(
493 [out] IEnumCodePage
**ppEnumCodePage
);
495 HRESULT GetCharsetInfo
(
497 [in] PMIMECSETINFO pCharsetInfo
);
499 HRESULT IsConvertible
(
500 [in] DWORD dwSrcEncoding
,
501 [in] DWORD dwDstEncoding
);
503 HRESULT ConvertString
(
504 [in,out] DWORD
*pdwMode
,
505 [in] DWORD dwSrcEncoding
,
506 [in] DWORD dwDstEncoding
,
508 [in,out] UINT
*pcSrcSize
,
510 [in,out] UINT
*pcDstSize
);
512 HRESULT ConvertStringToUnicode
(
513 [in,out] DWORD
*pdwMode
,
514 [in] DWORD dwEncoding
,
516 [in,out] UINT
*pcSrcSize
,
518 [in,out] UINT
*pcDstSize
);
520 HRESULT ConvertStringFromUnicode
(
521 [in,out] DWORD
*pdwMode
,
522 [in] DWORD dwEncoding
,
524 [in,out] UINT
*pcSrcSize
,
526 [in,out] UINT
*pcDstSize
);
528 HRESULT ConvertStringReset
();
530 HRESULT GetRfc1766FromLcid
(
532 [out] BSTR *pbstrRfc1766
);
534 HRESULT GetLcidFromRfc1766
(
536 [in] BSTR bstrRfc1766
);
539 [out] IEnumRfc1766
**ppEnumRfc1766
);
541 HRESULT GetRfc1766Info
(
543 [out] PRFC1766INFO pRfc1766Info
);
545 HRESULT CreateConvertCharset
(
546 [in] UINT uiSrcCodePage
,
547 [in] UINT uiDstCodePage
,
548 [in] DWORD dwProperty
,
549 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
555 uuid(dccfc164
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
556 pointer_default(unique)
558 interface IMultiLanguage2
: IUnknown
560 typedef struct tagDetectEncodingInfo
566 } DetectEncodingInfo
, *pDetectEncodingInfo
;
568 HRESULT GetNumberOfCodePageInfo
(
569 [out] UINT
*pcCodePage
);
571 HRESULT GetCodePageInfo
(
572 [in] UINT uiCodePage
,
574 [out] PMIMECPINFO pCodePageInfo
);
576 HRESULT GetFamilyCodePage
(
577 [in] UINT uiCodePage
,
578 [out] UINT
*puiFamilyCodePage
);
580 HRESULT EnumCodePages
(
583 [out] IEnumCodePage
**ppEnumCodePage
);
585 HRESULT GetCharsetInfo
(
587 [in] PMIMECSETINFO pCharsetInfo
);
589 HRESULT IsConvertible
(
590 [in] DWORD dwSrcEncoding
,
591 [in] DWORD dwDstEncoding
);
593 HRESULT ConvertString
(
594 [in,out] DWORD
*pdwMode
,
595 [in] DWORD dwSrcEncoding
,
596 [in] DWORD dwDstEncoding
,
598 [in,out] UINT
*pcSrcSize
,
600 [in,out] UINT
*pcDstSize
);
602 HRESULT ConvertStringToUnicode
(
603 [in,out] DWORD
*pdwMode
,
604 [in] DWORD dwEncoding
,
606 [in,out] UINT
*pcSrcSize
,
608 [in,out] UINT
*pcDstSize
);
610 HRESULT ConvertStringFromUnicode
(
611 [in,out] DWORD
*pdwMode
,
612 [in] DWORD dwEncoding
,
614 [in,out] UINT
*pcSrcSize
,
616 [in,out] UINT
*pcDstSize
);
618 HRESULT ConvertStringReset
();
620 HRESULT GetRfc1766FromLcid
(
622 [out] BSTR *pbstrRfc1766
);
624 HRESULT GetLcidFromRfc1766
(
626 [in] BSTR bstrRfc1766
);
630 [out] IEnumRfc1766
**ppEnumRfc1766
);
632 HRESULT GetRfc1766Info
(
635 [out] PRFC1766INFO pRfc1766Info
);
637 HRESULT CreateConvertCharset
(
638 [in] UINT uiSrcCodePage
,
639 [in] UINT uiDstCodePage
,
640 [in] DWORD dwProperty
,
641 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
643 HRESULT ConvertStringInIStream
(
644 [in,out] DWORD
*pdwMode
,
646 [in] WCHAR
*lpFallBack
,
647 [in] DWORD dwSrcEncoding
,
648 [in] DWORD dwDstEncoding
,
649 [in] IStream
*pstmIn
,
650 [in] IStream
*pstmOut
);
652 HRESULT ConvertStringToUnicodeEx
(
653 [in,out] DWORD
*pdwMode
,
654 [in] DWORD dwEncoding
,
656 [in,out] UINT
*pcSrcSize
,
658 [in,out] UINT
*pcDstSize
,
660 [in] WCHAR
*lpFallBack
);
662 HRESULT ConvertStringFromUnicodeEx
(
663 [in,out] DWORD
*pdwMode
,
664 [in] DWORD dwEncoding
,
666 [in,out] UINT
*pcSrcSize
,
668 [in,out] UINT
*pcDstSize
,
670 [in] WCHAR
*lpFallBack
);
672 HRESULT DetectCodepageInIStream
(
674 [in] DWORD dwPrefWinCodePage
,
675 [in] IStream
*pstmIn
,
676 [in,out] DetectEncodingInfo
*lpEncoding
,
677 [in,out] INT *pnScores
);
679 HRESULT DetectInputCodepage
(
681 [in] DWORD dwPrefWinCodePage
,
683 [in,out] INT *pcSrcSize
,
684 [in,out] DetectEncodingInfo
*lpEncoding
,
685 [in,out] INT *pnScores
);
687 HRESULT ValidateCodePage
(
688 [in] UINT uiCodePage
,
691 HRESULT GetCodePageDescription
(
692 [in] UINT uiCodePage
,
694 [in,out,size_is(cchWideChar
)] LPWSTR lpWideCharStr
,
695 [in] int cchWideChar
);
697 HRESULT IsCodePageInstallable
(
698 [in] UINT uiCodePage
);
700 HRESULT SetMimeDBSource
(
701 [in] MIMECONTF dwSource
);
703 HRESULT GetNumberOfScripts
(
704 [out] UINT
*pnScripts
);
709 [out] IEnumScript
**ppEnumScript
);
711 HRESULT ValidateCodePageEx
( /* undocumented on MSDN */
712 [in] UINT uiCodePage
,
714 [in] DWORD dwfIODControl
);
719 uuid(4e5868ab
-b157
-4623-9acc
-6a1d9caebe04
),
720 pointer_default(unique)
722 interface IMultiLanguage3
: IMultiLanguage2
724 typedef [unique] IMultiLanguage3
*LPMULTILANGUAGE3
;
725 HRESULT DetectOutboundCodePage
(
727 [in] LPCWSTR lpWideCharStr
,
728 [in] UINT cchWideChar
,
729 [in] UINT
*puiPreferredCodePages
,
730 [in] UINT nPreferredCodePages
,
731 [in] UINT
*puiDetectedCodePages
,
732 [in, out] UINT
*pnDetectedCodePages
,
733 [in] WCHAR
*lpSpecialChar
);
735 HRESULT DetectOutboundCodePageInIStream
(
737 [in] IStream
*pStrIn
,
738 [in] UINT
*puiPreferredCodePages
,
739 [in] UINT nPreferredCodePages
,
740 [in] UINT
*puiDetectedCodePages
,
741 [in, out] UINT
*pnDetectedCodePages
,
742 [in] WCHAR
*lpSpecialChar
);
746 uuid(275C23E2
-3747-11d0
-9FEA
-00AA003f8646
)
748 coclass CMultiLanguage
750 [default] interface IMultiLanguage
;
751 interface IMLangCodePages
;
752 interface IMLangFontLink
;
753 /* interface IMLangLineBreakConsole; */
754 interface IMLangFontLink2
;
757 cpp_quote
("STDAPI LcidToRfc1766A(LCID, LPSTR, INT);")
758 cpp_quote
("STDAPI LcidToRfc1766W(LCID, LPWSTR, INT);")
759 cpp_quote
("#define LcidToRfc1766 WINELIB_NAME_AW(LcidToRfc1766)")
761 cpp_quote
("STDAPI Rfc1766ToLcidA(LCID *, LPCSTR);")
762 cpp_quote
("STDAPI Rfc1766ToLcidW(LCID *, LPCWSTR);")
763 cpp_quote
("#define Rfc1766ToLcid WINELIB_NAME_AW(Rfc1766ToLcid)")
765 cpp_quote
("STDAPI GetGlobalFontLinkObject(void **unknown);")
766 cpp_quote
("STDAPI IsConvertINetStringAvailable(DWORD, DWORD);")
767 cpp_quote
("STDAPI ConvertINetString(LPDWORD, DWORD, DWORD, LPCSTR, LPINT, LPSTR, LPINT);")
768 cpp_quote
("STDAPI ConvertINetMultiByteToUnicode(LPDWORD, DWORD, LPCSTR, LPINT, LPWSTR, LPINT);")
769 cpp_quote
("STDAPI ConvertINetUnicodeToMultiByte(LPDWORD, DWORD, LPCWSTR, LPINT, LPSTR, LPINT);")