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_")
30 cpp_quote
("#define CPIOD_PEEK 0x40000000")
31 cpp_quote
("#define CPIOD_FORCE_PROMPT 0x80000000")
35 uuid(359f3443
-bd4a
-11d0
-b188
-00aa0038c969
),
36 pointer_default(unique)
38 interface IMLangCodePages
: IUnknown
40 HRESULT GetCharCodePages
(
42 [out] DWORD
*pdwCodePages
);
43 HRESULT GetStrCodePages
(
44 [in, size_is(cchSrc
)] const WCHAR
*pszSrc
,
46 [in] DWORD dwPriorityCodePages
,
47 [out] DWORD
*pdwCodePages
,
48 [out] long *pcchCodePages
);
49 HRESULT CodePageToCodePages
(
51 [out] DWORD
*pdwCodePages
);
52 HRESULT CodePagesToCodePage
(
53 [in] DWORD dwCodePages
,
54 [in] UINT uDefaultCodePage
,
55 [out] UINT
*puCodePage
);
60 uuid(359f3441
-bd4a
-11d0
-b188
-00aa0038c969
),
61 pointer_default(unique)
63 interface IMLangFontLink
: IMLangCodePages
65 HRESULT GetFontCodePages
(
68 [out] DWORD
*pdwCodePages
);
72 [in] DWORD dwCodePages
,
74 [out] HFONT
*phDestFont
);
79 HRESULT ResetFontMapping
();
84 uuid(ae5f1430
-388b
-11d2
-8380-00c04f8f5da1
),
85 pointer_default(unique)
87 interface IEnumScript
: IUnknown
89 const USHORT MAX_SCRIPT_NAME
= 48;
90 const USHORT MAX_MIMEFACE_NAME
= 32;
92 typedef BYTE SCRIPT_ID
;
93 typedef __int64 SCRIPT_IDS
;
95 typedef enum tagSCRIPTCONTF
98 sidMerge
= sidDefault
+ 1,
99 sidAsciiSym
= sidMerge
+ 1,
100 sidAsciiLatin
= sidAsciiSym
+ 1,
101 sidLatin
= sidAsciiLatin
+ 1,
102 sidGreek
= sidLatin
+ 1,
103 sidCyrillic
= sidGreek
+ 1,
104 sidArmenian
= sidCyrillic
+ 1,
105 sidHebrew
= sidArmenian
+ 1,
106 sidArabic
= sidHebrew
+ 1,
107 sidDevanagari
= sidArabic
+ 1,
108 sidBengali
= sidDevanagari
+ 1,
109 sidGurmukhi
= sidBengali
+ 1,
110 sidGujarati
= sidGurmukhi
+ 1,
111 sidOriya
= sidGujarati
+ 1,
112 sidTamil
= sidOriya
+ 1,
113 sidTelugu
= sidTamil
+ 1,
114 sidKannada
= sidTelugu
+ 1,
115 sidMalayalam
= sidKannada
+ 1,
116 sidThai
= sidMalayalam
+ 1,
117 sidLao
= sidThai
+ 1,
118 sidTibetan
= sidLao
+ 1,
119 sidGeorgian
= sidTibetan
+ 1,
120 sidHangul
= sidGeorgian
+ 1,
121 sidKana
= sidHangul
+ 1,
122 sidBopomofo
= sidKana
+ 1,
123 sidHan
= sidBopomofo
+ 1,
124 sidEthiopic
= sidHan
+ 1,
125 sidCanSyllabic
= sidEthiopic
+ 1,
126 sidCherokee
= sidCanSyllabic
+ 1,
127 sidYi
= sidCherokee
+ 1,
128 sidBraille
= sidYi
+ 1,
129 sidRunic
= sidBraille
+ 1,
130 sidOgham
= sidRunic
+ 1,
131 sidSinhala
= sidOgham
+ 1,
132 sidSyriac
= sidSinhala
+ 1,
133 sidBurmese
= sidSyriac
+ 1,
134 sidKhmer
= sidBurmese
+ 1,
135 sidThaana
= sidKhmer
+ 1,
136 sidMongolian
= sidThaana
+ 1,
137 sidUserDefined
= sidMongolian
+ 1,
138 sidLim
= sidUserDefined
+ 1,
139 sidFEFirst
= sidHangul
,
143 typedef enum tagSCRIPTFONTCONTF
145 SCRIPTCONTF_FIXED_FONT
= 0x1,
146 SCRIPTCONTF_PROPORTIONAL_FONT
= 0x2,
147 SCRIPTCONTF_SCRIPT_USER
= 0x10000,
148 SCRIPTCONTF_SCRIPT_HIDE
= 0x20000,
149 SCRIPTCONTF_SCRIPT_SYSTEM
= 0x40000
152 typedef struct tagSCRIPFONTINFO
155 WCHAR wszFont
[MAX_MIMEFACE_NAME
];
156 } SCRIPTFONTINFO
, *PSCRIPTFONTINFO
;
158 typedef struct tagSCRIPTINFO
{
161 WCHAR wszDescription
[MAX_SCRIPT_NAME
];
162 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
163 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
164 } SCRIPTINFO
, *PSCRIPTINFO
;
167 [out] IEnumScript
**ppEnum
);
171 [out] PSCRIPTINFO rgelt
,
172 [out] ULONG
*pceltFetched
);
182 uuid(dccfc162
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
183 pointer_default(unique)
185 interface IMLangFontLink2
: IMLangCodePages
187 typedef struct tagUNICODERANGE
193 typedef [unique] IMLangFontLink2
*PMLANGFONTLINK2
;
195 HRESULT GetFontCodePages
(
198 [out] DWORD
*pdwCodePages
);
203 HRESULT ResetFontMapping
();
207 [in] DWORD dwCodePages
,
211 HRESULT GetFontUnicodeRanges
(
213 [in,out] UINT
*puiRanges
,
214 [out] UNICODERANGE
* pUranges
);
216 HRESULT GetScriptFontInfo
(
219 [in,out] UINT
*puiFonts
,
220 [out] SCRIPTFONTINFO
* pScriptFont
);
222 HRESULT CodePageToScriptID
(
223 [in] UINT uiCodePage
,
224 [out] SCRIPT_ID
*pSid
);
229 uuid(c04d65ce
-b70d
-11d0
-b188
-00aa0038c969
),
230 pointer_default(unique)
232 interface IMLangString
: IUnknown
238 [out] DWORD
* pdwCookie
,
239 [out] long* plActualPos
,
240 [out] long* plActualLen
);
243 [in] DWORD dwCookie
);
246 [in] BOOL fNoAccess
);
249 [out, retval] long* plLen
);
253 [in] IUnknown
*pSrcMLStr
,
257 HRESULT RegisterAttr
(
259 [out] DWORD
* pdwCookie
);
260 HRESULT UnregisterAttr
(
261 [in] DWORD dwCookie
);
263 [out] IEnumUnknown
**ppEnumUnk
);
267 [out] IUnknown
**ppUnk
);
272 [in] IUnknown
*pUnkOuter
,
273 [in] DWORD dwClsContext
,
274 [in] const IID
* piid
,
275 [out] IUnknown
** ppDestMLStr
,
276 [out] long* plDestPos
,
277 [out] long* plDestLen
);
283 uuid(f5be2ee1
-bfd7
-11d0
-b188
-00aa0038c969
),
284 pointer_default(unique)
286 interface IMLangLineBreakConsole
: IUnknown
289 [in] IMLangString
* pSrcMLStr
,
292 [in] long cMinColumns
,
293 [in] long cMaxColumns
,
294 [out] long* plLineLen
,
295 [out] long* plSkipLen
);
299 [in, size_is(cchSrc
)] const WCHAR
* pszSrc
,
301 [in] long cMaxColumns
,
302 [out] long* pcchLine
,
303 [out] long* pcchSkip
);
308 [in, size_is(cchSrc
)] const CHAR* pszSrc
,
310 [in] long cMaxColumns
,
311 [out] long* pcchLine
,
312 [out] long* pcchSkip
);
317 uuid(275c23e3
-3747-11d0
-9fea
-00aa003f8646
),
318 pointer_default(unique)
320 interface IEnumCodePage
: IUnknown
322 const USHORT MAX_MIMECP_NAME
= 64;
323 const USHORT MAX_MIMECSET_NAME
= 50;
325 typedef enum tagMIMECONTF
327 MIMECONTF_MAILNEWS
= 0x00000001,
328 MIMECONTF_BROWSER
= 0x00000002,
329 MIMECONTF_MINIMAL
= 0x00000004,
330 MIMECONTF_IMPORT
= 0x00000008,
331 MIMECONTF_SAVABLE_MAILNEWS
= 0x00000100,
332 MIMECONTF_SAVABLE_BROWSER
= 0x00000200,
333 MIMECONTF_EXPORT
= 0x00000400,
334 MIMECONTF_PRIVCONVERTER
= 0x00010000,
335 MIMECONTF_VALID
= 0x00020000,
336 MIMECONTF_VALID_NLS
= 0x00040000,
337 MIMECONTF_MIME_IE4
= 0x10000000,
338 MIMECONTF_MIME_LATEST
= 0x20000000,
339 MIMECONTF_MIME_REGISTRY
= 0x40000000
342 typedef struct tagMIMECPINFO
{
345 UINT uiFamilyCodePage
;
346 WCHAR wszDescription
[MAX_MIMECP_NAME
];
347 WCHAR wszWebCharset
[MAX_MIMECSET_NAME
];
348 WCHAR wszHeaderCharset
[MAX_MIMECSET_NAME
];
349 WCHAR wszBodyCharset
[MAX_MIMECSET_NAME
];
350 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
351 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
353 } MIMECPINFO
, *PMIMECPINFO
;
355 typedef struct tagMIMECSETINFO
358 UINT uiInternetEncoding
;
359 WCHAR wszCharset
[MAX_MIMECSET_NAME
];
360 } MIMECSETINFO
, *PMIMECSETINFO
;
363 [out] IEnumCodePage
**ppEnum
);
367 [out] PMIMECPINFO rgelt
,
368 [out] ULONG
*pceltFetched
);
378 uuid(d66d6f98
-cdaa
-11d0
-b822
-00c04fc9b31f
),
379 pointer_default(unique)
381 interface IMLangConvertCharset
: IUnknown
384 [in] UINT uiSrcCodePage
,
385 [in] UINT uiDstCodePage
,
386 [in] DWORD dwProperty
);
388 HRESULT GetSourceCodePage
(
389 [out] UINT
*puiSrcCodePage
);
391 HRESULT GetDestinationCodePage
(
392 [out] UINT
*puiDstCodePage
);
395 [out] DWORD
*pdwProperty
);
397 HRESULT DoConversion
(
399 [in,out] UINT
*pcSrcSize
,
401 [in,out] UINT
*pcDstSize
);
403 HRESULT DoConversionToUnicode
(
405 [in,out] UINT
*pcSrcSize
,
407 [in,out] UINT
*pcDstSize
);
409 HRESULT DoConversionFromUnicode
(
411 [in,out] UINT
*pcSrcSize
,
413 [in,out] UINT
*pcDstSize
);
417 uuid(d66d6f99
-cdaa
-11d0
-b822
-00c04fc9b31f
)
419 coclass CMLangConvertCharset
421 [default] interface IMLangConvertCharset
;
426 uuid(3dc39d1d
-c030
-11d0
-b81b
-00c04fc9b31f
),
427 pointer_default(unique)
429 interface IEnumRfc1766
: IUnknown
431 const USHORT MAX_RFC1766_NAME
= 6;
432 const USHORT MAX_LOCALE_NAME
= 32;
434 typedef struct tagRFC1766INFO
437 WCHAR wszRfc1766
[MAX_RFC1766_NAME
];
438 WCHAR wszLocaleName
[MAX_LOCALE_NAME
];
439 } RFC1766INFO
, *PRFC1766INFO
;
442 [out] IEnumRfc1766
**ppEnum
);
446 [out] PRFC1766INFO rgelt
,
447 [out] ULONG
*pceltFetched
);
457 uuid(275c23e1
-3747-11d0
-9fea
-00aa003f8646
),
458 pointer_default(unique)
460 interface IMultiLanguage
: IUnknown
462 HRESULT GetNumberOfCodePageInfo
(
463 [out] UINT
*pcCodePage
);
465 HRESULT GetCodePageInfo
(
466 [in] UINT uiCodePage
,
467 [out] PMIMECPINFO pCodePageInfo
);
469 HRESULT GetFamilyCodePage
(
470 [in] UINT uiCodePage
,
471 [out] UINT
*puiFamilyCodePage
);
473 HRESULT EnumCodePages
(
475 [out] IEnumCodePage
**ppEnumCodePage
);
477 HRESULT GetCharsetInfo
(
479 [in] PMIMECSETINFO pCharsetInfo
);
481 HRESULT IsConvertible
(
482 [in] DWORD dwSrcEncoding
,
483 [in] DWORD dwDstEncoding
);
485 HRESULT ConvertString
(
486 [in,out] DWORD
*pdwMode
,
487 [in] DWORD dwSrcEncoding
,
488 [in] DWORD dwDstEncoding
,
490 [in,out] UINT
*pcSrcSize
,
492 [in,out] UINT
*pcDstSize
);
494 HRESULT ConvertStringToUnicode
(
495 [in,out] DWORD
*pdwMode
,
496 [in] DWORD dwEncoding
,
498 [in,out] UINT
*pcSrcSize
,
500 [in,out] UINT
*pcDstSize
);
502 HRESULT ConvertStringFromUnicode
(
503 [in,out] DWORD
*pdwMode
,
504 [in] DWORD dwEncoding
,
506 [in,out] UINT
*pcSrcSize
,
508 [in,out] UINT
*pcDstSize
);
510 HRESULT ConvertStringReset
();
512 HRESULT GetRfc1766FromLcid
(
514 [out] BSTR *pbstrRfc1766
);
516 HRESULT GetLcidFromRfc1766
(
518 [in] BSTR bstrRfc1766
);
521 [out] IEnumRfc1766
**ppEnumRfc1766
);
523 HRESULT GetRfc1766Info
(
525 [out] PRFC1766INFO pRfc1766Info
);
527 HRESULT CreateConvertCharset
(
528 [in] UINT uiSrcCodePage
,
529 [in] UINT uiDstCodePage
,
530 [in] DWORD dwProperty
,
531 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
537 uuid(dccfc164
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
538 pointer_default(unique)
540 interface IMultiLanguage2
: IUnknown
542 typedef struct tagDetectEncodingInfo
548 } DetectEncodingInfo
, *pDetectEncodingInfo
;
550 HRESULT GetNumberOfCodePageInfo
(
551 [out] UINT
*pcCodePage
);
553 HRESULT GetCodePageInfo
(
554 [in] UINT uiCodePage
,
556 [out] PMIMECPINFO pCodePageInfo
);
558 HRESULT GetFamilyCodePage
(
559 [in] UINT uiCodePage
,
560 [out] UINT
*puiFamilyCodePage
);
562 HRESULT EnumCodePages
(
565 [out] IEnumCodePage
**ppEnumCodePage
);
567 HRESULT GetCharsetInfo
(
569 [in] PMIMECSETINFO pCharsetInfo
);
571 HRESULT IsConvertible
(
572 [in] DWORD dwSrcEncoding
,
573 [in] DWORD dwDstEncoding
);
575 HRESULT ConvertString
(
576 [in,out] DWORD
*pdwMode
,
577 [in] DWORD dwSrcEncoding
,
578 [in] DWORD dwDstEncoding
,
580 [in,out] UINT
*pcSrcSize
,
582 [in,out] UINT
*pcDstSize
);
584 HRESULT ConvertStringToUnicode
(
585 [in,out] DWORD
*pdwMode
,
586 [in] DWORD dwEncoding
,
588 [in,out] UINT
*pcSrcSize
,
590 [in,out] UINT
*pcDstSize
);
592 HRESULT ConvertStringFromUnicode
(
593 [in,out] DWORD
*pdwMode
,
594 [in] DWORD dwEncoding
,
596 [in,out] UINT
*pcSrcSize
,
598 [in,out] UINT
*pcDstSize
);
600 HRESULT ConvertStringReset
();
602 HRESULT GetRfc1766FromLcid
(
604 [out] BSTR *pbstrRfc1766
);
606 HRESULT GetLcidFromRfc1766
(
608 [in] BSTR bstrRfc1766
);
612 [out] IEnumRfc1766
**ppEnumRfc1766
);
614 HRESULT GetRfc1766Info
(
617 [out] PRFC1766INFO pRfc1766Info
);
619 HRESULT CreateConvertCharset
(
620 [in] UINT uiSrcCodePage
,
621 [in] UINT uiDstCodePage
,
622 [in] DWORD dwProperty
,
623 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
625 HRESULT ConvertStringInIStream
(
626 [in,out] DWORD
*pdwMode
,
628 [in] WCHAR
*lpFallBack
,
629 [in] DWORD dwSrcEncoding
,
630 [in] DWORD dwDstEncoding
,
631 [in] IStream
*pstmIn
,
632 [in] IStream
*pstmOut
);
634 HRESULT ConvertStringToUnicodeEx
(
635 [in,out] DWORD
*pdwMode
,
636 [in] DWORD dwEncoding
,
638 [in,out] UINT
*pcSrcSize
,
640 [in,out] UINT
*pcDstSize
,
642 [in] WCHAR
*lpFallBack
);
644 HRESULT ConvertStringFromUnicodeEx
(
645 [in,out] DWORD
*pdwMode
,
646 [in] DWORD dwEncoding
,
648 [in,out] UINT
*pcSrcSize
,
650 [in,out] UINT
*pcDstSize
,
652 [in] WCHAR
*lpFallBack
);
654 HRESULT DetectCodepageInIStream
(
656 [in] DWORD dwPrefWinCodePage
,
657 [in] IStream
*pstmIn
,
658 [in,out] DetectEncodingInfo
*lpEncoding
,
659 [in,out] INT *pnScores
);
661 HRESULT DetectInputCodepage
(
663 [in] DWORD dwPrefWinCodePage
,
665 [in,out] INT *pcSrcSize
,
666 [in,out] DetectEncodingInfo
*lpEncoding
,
667 [in,out] INT *pnScores
);
669 HRESULT ValidateCodePage
(
670 [in] UINT uiCodePage
,
673 HRESULT GetCodePageDescription
(
674 [in] UINT uiCodePage
,
676 [in,out] LPWSTR lpWideCharStr
,
677 [in] int cchWideChar
);
679 HRESULT IsCodePageInstallable
(
680 [in] UINT uiCodePage
);
682 HRESULT SetMimeDBSource
(
683 [in] MIMECONTF dwSource
);
685 HRESULT GetNumberOfScripts
(
686 [out] UINT
*pnScripts
);
691 [out] IEnumScript
**ppEnumScript
);
693 HRESULT ValidateCodePageEx
( /* undocumented on MSDN */
694 [in] UINT uiCodePage
,
696 [in] DWORD dwfIODControl
);
701 uuid(4e5868ab
-b157
-4623-9acc
-6a1d9caebe04
),
702 pointer_default(unique)
704 interface IMultiLanguage3
: IMultiLanguage2
706 typedef [unique] IMultiLanguage3
*LPMULTILANGUAGE3
;
707 HRESULT DetectOutboundCodePage
(
709 [in] LPCWSTR lpWideCharStr
,
710 [in] UINT cchWideChar
,
711 [in] UINT
*puiPreferredCodePages
,
712 [in] UINT nPreferredCodePages
,
713 [in] UINT
*puiDetectedCodePages
,
714 [in, out] UINT
*pnDetectedCodePages
,
715 [in] WCHAR
*lpSpecialChar
);
717 HRESULT DetectOutboundCodePageInIStream
(
719 [in] IStream
*pStrIn
,
720 [in] UINT
*puiPreferredCodePages
,
721 [in] UINT nPreferredCodePages
,
722 [in] UINT
*puiDetectedCodePages
,
723 [in, out] UINT
*pnDetectedCodePages
,
724 [in] WCHAR
*lpSpecialChar
);
728 uuid(275C23E2
-3747-11d0
-9FEA
-00AA003f8646
)
730 coclass CMultiLanguage
732 [default] interface IMultiLanguage
;
733 interface IMLangCodePages
;
734 interface IMLangFontLink
;
735 /* interface IMLangLineBreakConsole; */
736 interface IMLangFontLink2
;
739 cpp_quote
("STDAPI LcidToRfc1766A(LCID, LPSTR, INT);")
740 cpp_quote
("STDAPI LcidToRfc1766W(LCID, LPWSTR, INT);")
741 cpp_quote
("#define LcidToRfc1766 WINELIB_NAME_AW(LcidToRfc1766)")
743 cpp_quote
("STDAPI Rfc1766ToLcidA(LCID *, LPCSTR);")
744 cpp_quote
("STDAPI Rfc1766ToLcidW(LCID *, LPCWSTR);")
745 cpp_quote
("#define Rfc1766ToLcid WINELIB_NAME_AW(Rfc1766ToLcid)")
747 cpp_quote
("STDAPI GetGlobalFontLinkObject(void);")
748 cpp_quote
("STDAPI IsConvertINetStringAvailable(DWORD, DWORD);")
749 cpp_quote
("STDAPI ConvertINetString(LPDWORD, DWORD, DWORD, LPCSTR, LPINT, LPSTR, LPINT);")
750 cpp_quote
("STDAPI ConvertINetMultiByteToUnicode(LPDWORD, DWORD, LPCSTR, LPINT, LPWSTR, LPINT);")
751 cpp_quote
("STDAPI ConvertINetUnicodeToMultiByte(LPDWORD, DWORD, LPCWSTR, LPINT, LPSTR, LPINT);")