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(
39 [out] DWORD *pdwCodePages);
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(c04d65ce-b70d-11d0-b188-00aa0038c969),
227 pointer_default(unique)
229 interface IMLangString : IUnknown
235 [out] DWORD* pdwCookie,
236 [out] long* plActualPos,
237 [out] long* plActualLen);
240 [in] DWORD dwCookie);
243 [in] BOOL fNoAccess);
246 [out, retval] long* plLen);
250 [in] IUnknown *pSrcMLStr,
254 HRESULT RegisterAttr(
256 [out] DWORD* pdwCookie);
257 HRESULT UnregisterAttr(
258 [in] DWORD dwCookie);
260 [out] IEnumUnknown **ppEnumUnk);
264 [out] IUnknown **ppUnk);
269 [in] IUnknown *pUnkOuter,
270 [in] DWORD dwClsContext,
271 [in] const IID* piid,
272 [out] IUnknown** ppDestMLStr,
273 [out] long* plDestPos,
274 [out] long* plDestLen);
280 uuid(f5be2ee1-bfd7-11d0-b188-00aa0038c969),
281 pointer_default(unique)
283 interface IMLangLineBreakConsole : IUnknown
286 [in] IMLangString* pSrcMLStr,
289 [in] long cMinColumns,
290 [in] long cMaxColumns,
291 [out] long* plLineLen,
292 [out] long* plSkipLen);
296 [in, size_is(cchSrc)] const WCHAR* pszSrc,
298 [in] long cMaxColumns,
299 [out] long* pcchLine,
300 [out] long* pcchSkip );
305 [in, size_is(cchSrc)] const CHAR* pszSrc,
307 [in] long cMaxColumns,
308 [out] long* pcchLine,
309 [out] long* pcchSkip);
314 uuid(275c23e3-3747-11d0-9fea-00aa003f8646),
315 pointer_default(unique)
317 interface IEnumCodePage : IUnknown
319 const USHORT MAX_MIMECP_NAME = 64;
320 const USHORT MAX_MIMECSET_NAME = 50;
322 typedef enum tagMIMECONTF
324 MIMECONTF_MAILNEWS = 0x00000001,
325 MIMECONTF_BROWSER = 0x00000002,
326 MIMECONTF_MINIMAL = 0x00000004,
327 MIMECONTF_IMPORT = 0x00000008,
328 MIMECONTF_SAVABLE_MAILNEWS = 0x00000100,
329 MIMECONTF_SAVABLE_BROWSER = 0x00000200,
330 MIMECONTF_EXPORT = 0x00000400,
331 MIMECONTF_PRIVCONVERTER = 0x00010000,
332 MIMECONTF_VALID = 0x00020000,
333 MIMECONTF_VALID_NLS = 0x00040000,
334 MIMECONTF_MIME_IE4 = 0x10000000,
335 MIMECONTF_MIME_LATEST = 0x20000000,
336 MIMECONTF_MIME_REGISTRY = 0x40000000
339 typedef struct tagMIMECPINFO {
342 UINT uiFamilyCodePage;
343 WCHAR wszDescription[MAX_MIMECP_NAME];
344 WCHAR wszWebCharset[MAX_MIMECSET_NAME];
345 WCHAR wszHeaderCharset[MAX_MIMECSET_NAME];
346 WCHAR wszBodyCharset[MAX_MIMECSET_NAME];
347 WCHAR wszFixedWidthFont[MAX_MIMEFACE_NAME];
348 WCHAR wszProportionalFont[MAX_MIMEFACE_NAME];
350 } MIMECPINFO, *PMIMECPINFO;
352 typedef struct tagMIMECSETINFO
355 UINT uiInternetEncoding;
356 WCHAR wszCharset[MAX_MIMECSET_NAME];
357 } MIMECSETINFO, *PMIMECSETINFO;
360 [out] IEnumCodePage **ppEnum);
364 [out] PMIMECPINFO rgelt,
365 [out] ULONG *pceltFetched);
375 uuid(d66d6f98-cdaa-11d0-b822-00c04fc9b31f),
376 pointer_default(unique)
378 interface IMLangConvertCharset : IUnknown
381 [in] UINT uiSrcCodePage,
382 [in] UINT uiDstCodePage,
383 [in] DWORD dwProperty);
385 HRESULT GetSourceCodePage(
386 [out] UINT *puiSrcCodePage);
388 HRESULT GetDestinationCodePage(
389 [out] UINT *puiDstCodePage);
392 [out] DWORD *pdwProperty);
394 HRESULT DoConversion(
396 [in,out] UINT *pcSrcSize,
398 [in,out] UINT *pcDstSize);
400 HRESULT DoConversionToUnicode(
402 [in,out] UINT *pcSrcSize,
404 [in,out] UINT *pcDstSize);
406 HRESULT DoConversionFromUnicode(
408 [in,out] UINT *pcSrcSize,
410 [in,out] UINT *pcDstSize);
414 uuid(d66d6f99-cdaa-11d0-b822-00c04fc9b31f)
416 coclass CMLangConvertCharset
418 [default] interface IMLangConvertCharset;
423 uuid(3dc39d1d-c030-11d0-b81b-00c04fc9b31f),
424 pointer_default(unique)
426 interface IEnumRfc1766 : IUnknown
428 const USHORT MAX_RFC1766_NAME = 6;
429 const USHORT MAX_LOCALE_NAME = 32;
431 typedef struct tagRFC1766INFO
434 WCHAR wszRfc1766[MAX_RFC1766_NAME];
435 WCHAR wszLocaleName[MAX_LOCALE_NAME];
436 } RFC1766INFO, *PRFC1766INFO;
439 [out] IEnumRfc1766 **ppEnum);
443 [out] PRFC1766INFO rgelt,
444 [out] ULONG *pceltFetched);
454 uuid(275c23e1-3747-11d0-9fea-00aa003f8646),
455 pointer_default(unique)
457 interface IMultiLanguage : IUnknown
459 HRESULT GetNumberOfCodePageInfo(
460 [out] UINT *pcCodePage);
462 HRESULT GetCodePageInfo(
463 [in] UINT uiCodePage,
464 [out] PMIMECPINFO pCodePageInfo);
466 HRESULT GetFamilyCodePage(
467 [in] UINT uiCodePage,
468 [out] UINT *puiFamilyCodePage);
470 HRESULT EnumCodePages(
472 [out] IEnumCodePage **ppEnumCodePage);
474 HRESULT GetCharsetInfo(
476 [in] PMIMECSETINFO pCharsetInfo);
478 HRESULT IsConvertible(
479 [in] DWORD dwSrcEncoding,
480 [in] DWORD dwDstEncoding);
482 HRESULT ConvertString(
483 [in,out] DWORD *pdwMode,
484 [in] DWORD dwSrcEncoding,
485 [in] DWORD dwDstEncoding,
487 [in,out] UINT *pcSrcSize,
489 [in,out] UINT *pcDstSize);
491 HRESULT ConvertStringToUnicode(
492 [in,out] DWORD *pdwMode,
493 [in] DWORD dwEncoding,
495 [in,out] UINT *pcSrcSize,
497 [in,out] UINT *pcDstSize);
499 HRESULT ConvertStringFromUnicode(
500 [in,out] DWORD *pdwMode,
501 [in] DWORD dwEncoding,
503 [in,out] UINT *pcSrcSize,
505 [in,out] UINT *pcDstSize);
507 HRESULT ConvertStringReset();
509 HRESULT GetRfc1766FromLcid(
511 [out] BSTR *pbstrRfc1766);
513 HRESULT GetLcidFromRfc1766(
515 [in] BSTR bstrRfc1766);
518 [out] IEnumRfc1766 **ppEnumRfc1766);
520 HRESULT GetRfc1766Info(
522 [out] PRFC1766INFO pRfc1766Info);
524 HRESULT CreateConvertCharset(
525 [in] UINT uiSrcCodePage,
526 [in] UINT uiDstCodePage,
527 [in] DWORD dwProperty,
528 [out] IMLangConvertCharset **ppMLangConvertCharset);
534 uuid(dccfc164-2b38-11d2-b7ec-00c04f8f5d9a),
535 pointer_default(unique)
537 interface IMultiLanguage2 : IUnknown
539 typedef struct tagDetectEncodingInfo
545 } DetectEncodingInfo, *pDetectEncodingInfo;
547 HRESULT GetNumberOfCodePageInfo(
548 [out] UINT *pcCodePage);
550 HRESULT GetCodePageInfo(
551 [in] UINT uiCodePage,
553 [out] PMIMECPINFO pCodePageInfo);
555 HRESULT GetFamilyCodePage(
556 [in] UINT uiCodePage,
557 [out] UINT *puiFamilyCodePage);
559 HRESULT EnumCodePages(
562 [out] IEnumCodePage **ppEnumCodePage);
564 HRESULT GetCharsetInfo(
566 [in] PMIMECSETINFO pCharsetInfo);
568 HRESULT IsConvertible(
569 [in] DWORD dwSrcEncoding,
570 [in] DWORD dwDstEncoding);
572 HRESULT ConvertString(
573 [in,out] DWORD *pdwMode,
574 [in] DWORD dwSrcEncoding,
575 [in] DWORD dwDstEncoding,
577 [in,out] UINT *pcSrcSize,
579 [in,out] UINT *pcDstSize);
581 HRESULT ConvertStringToUnicode(
582 [in,out] DWORD *pdwMode,
583 [in] DWORD dwEncoding,
585 [in,out] UINT *pcSrcSize,
587 [in,out] UINT *pcDstSize);
589 HRESULT ConvertStringFromUnicode(
590 [in,out] DWORD *pdwMode,
591 [in] DWORD dwEncoding,
593 [in,out] UINT *pcSrcSize,
595 [in,out] UINT *pcDstSize);
597 HRESULT ConvertStringReset();
599 HRESULT GetRfc1766FromLcid(
601 [out] BSTR *pbstrRfc1766);
603 HRESULT GetLcidFromRfc1766(
605 [in] BSTR bstrRfc1766);
609 [out] IEnumRfc1766 **ppEnumRfc1766);
611 HRESULT GetRfc1766Info(
614 [out] PRFC1766INFO pRfc1766Info);
616 HRESULT CreateConvertCharset(
617 [in] UINT uiSrcCodePage,
618 [in] UINT uiDstCodePage,
619 [in] DWORD dwProperty,
620 [out] IMLangConvertCharset **ppMLangConvertCharset);
622 HRESULT ConvertStringInIStream(
623 [in,out] DWORD *pdwMode,
625 [in] WCHAR *lpFallBack,
626 [in] DWORD dwSrcEncoding,
627 [in] DWORD dwDstEncoding,
628 [in] IStream *pstmIn,
629 [in] IStream *pstmOut);
631 HRESULT ConvertStringToUnicodeEx(
632 [in,out] DWORD *pdwMode,
633 [in] DWORD dwEncoding,
635 [in,out] UINT *pcSrcSize,
637 [in,out] UINT *pcDstSize,
639 [in] WCHAR *lpFallBack);
641 HRESULT ConvertStringFromUnicodeEx(
642 [in,out] DWORD *pdwMode,
643 [in] DWORD dwEncoding,
645 [in,out] UINT *pcSrcSize,
647 [in,out] UINT *pcDstSize,
649 [in] WCHAR *lpFallBack);
651 HRESULT DetectCodepageInIStream(
653 [in] DWORD dwPrefWinCodePage,
654 [in] IStream *pstmIn,
655 [in,out] DetectEncodingInfo *lpEncoding,
656 [in,out] INT *pnScores);
658 HRESULT DetectInputCodepage(
660 [in] DWORD dwPrefWinCodePage,
662 [in,out] INT *pcSrcSize,
663 [in,out] DetectEncodingInfo *lpEncoding,
664 [in,out] INT *pnScores);
666 HRESULT ValidateCodePage(
667 [in] UINT uiCodePage,
670 HRESULT GetCodePageDescription(
671 [in] UINT uiCodePage,
673 [in,out] LPWSTR lpWideCharStr,
674 [in] int cchWideChar);
676 HRESULT IsCodePageInstallable(
677 [in] UINT uiCodePage);
679 HRESULT SetMimeDBSource(
680 [in] MIMECONTF dwSource);
682 HRESULT GetNumberOfScripts(
683 [out] UINT *pnScripts);
688 [out] IEnumScript **ppEnumScript);
690 HRESULT ValidateCodePageEx( /* undocumented on MSDN */
691 [in] UINT uiCodePage,
693 [in] DWORD dwfIODControl);
698 uuid(4e5868ab-b157-4623-9acc-6a1d9caebe04),
699 pointer_default(unique)
701 interface IMultiLanguage3 : IMultiLanguage2
703 typedef [unique] IMultiLanguage3 *LPMULTILANGUAGE3;
704 HRESULT DetectOutboundCodePage(
706 [in] LPCWSTR lpWideCharStr,
707 [in] UINT cchWideChar,
708 [in] UINT *puiPreferredCodePages,
709 [in] UINT nPreferredCodePages,
710 [in] UINT *puiDetectedCodePages,
711 [in, out] UINT *pnDetectedCodePages,
712 [in] WCHAR *lpSpecialChar);
714 HRESULT DetectOutboundCodePageInIStream(
716 [in] IStream *pStrIn,
717 [in] UINT *puiPreferredCodePages,
718 [in] UINT nPreferredCodePages,
719 [in] UINT *puiDetectedCodePages,
720 [in, out] UINT *pnDetectedCodePages,
721 [in] WCHAR *lpSpecialChar);
725 uuid(275C23E2-3747-11d0-9FEA-00AA003f8646)
727 coclass CMultiLanguage
729 [default] interface IMultiLanguage;
730 interface IMLangCodePages;
731 interface IMLangFontLink;
732 /* interface IMLangLineBreakConsole; */
733 interface IMLangFontLink2;
736 cpp_quote("STDAPI LcidToRfc1766A(LCID, LPSTR, INT);")
737 cpp_quote("STDAPI LcidToRfc1766W(LCID, LPWSTR, INT);")
738 cpp_quote("#define LcidToRfc1766 WINELIB_NAME_AW(LcidToRfc1766)")
740 cpp_quote("STDAPI Rfc1766ToLcidA(LCID *, LPCSTR);")
741 cpp_quote("STDAPI Rfc1766ToLcidW(LCID *, LPCWSTR);")
742 cpp_quote("#define Rfc1766ToLcid WINELIB_NAME_AW(Rfc1766ToLcid)")
744 cpp_quote("STDAPI GetGlobalFontLinkObject(void);")
745 cpp_quote("STDAPI IsConvertINetStringAvailable(DWORD, DWORD);")
746 cpp_quote("STDAPI ConvertINetString(LPDWORD, DWORD, DWORD, LPCSTR, LPINT, LPSTR, LPINT);")
747 cpp_quote("STDAPI ConvertINetMultiByteToUnicode(LPDWORD, DWORD, LPCSTR, LPINT, LPWSTR, LPINT);")
748 cpp_quote("STDAPI ConvertINetUnicodeToMultiByte(LPDWORD, DWORD, LPCWSTR, LPINT, LPSTR, LPINT);")