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(275c23e3
-3747-11d0
-9fea
-00aa003f8646
),
180 pointer_default(unique)
182 interface IEnumCodePage
: IUnknown
184 const USHORT MAX_MIMECP_NAME
= 64;
185 const USHORT MAX_MIMECSET_NAME
= 50;
187 typedef enum tagMIMECONTF
189 MIMECONTF_MAILNEWS
= 0x00000001,
190 MIMECONTF_BROWSER
= 0x00000002,
191 MIMECONTF_MINIMAL
= 0x00000004,
192 MIMECONTF_IMPORT
= 0x00000008,
193 MIMECONTF_SAVABLE_MAILNEWS
= 0x00000100,
194 MIMECONTF_SAVABLE_BROWSER
= 0x00000200,
195 MIMECONTF_EXPORT
= 0x00000400,
196 MIMECONTF_PRIVCONVERTER
= 0x00010000,
197 MIMECONTF_VALID
= 0x00020000,
198 MIMECONTF_VALID_NLS
= 0x00040000,
199 MIMECONTF_MIME_IE4
= 0x10000000,
200 MIMECONTF_MIME_LATEST
= 0x20000000,
201 MIMECONTF_MIME_REGISTRY
= 0x40000000
204 typedef struct tagMIMECPINFO
{
207 UINT uiFamilyCodePage
;
208 WCHAR wszDescription
[MAX_MIMECP_NAME
];
209 WCHAR wszWebCharset
[MAX_MIMECSET_NAME
];
210 WCHAR wszHeaderCharset
[MAX_MIMECSET_NAME
];
211 WCHAR wszBodyCharset
[MAX_MIMECSET_NAME
];
212 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
213 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
215 } MIMECPINFO
, *PMIMECPINFO
;
217 typedef struct tagMIMECSETINFO
220 UINT uiInternetEncoding
;
221 WCHAR wszCharset
[MAX_MIMECSET_NAME
];
222 } MIMECSETINFO
, *PMIMECSETINFO
;
225 [out] IEnumCodePage
**ppEnum
);
229 [out] PMIMECPINFO rgelt
,
230 [out] ULONG
*pceltFetched
);
240 uuid(d66d6f98
-cdaa
-11d0
-b822
-00c04fc9b31f
),
241 pointer_default(unique)
243 interface IMLangConvertCharset
: IUnknown
246 [in] UINT uiSrcCodePage
,
247 [in] UINT uiDstCodePage
,
248 [in] DWORD dwProperty
);
250 HRESULT GetSourceCodePage
(
251 [out] UINT
*puiSrcCodePage
);
253 HRESULT GetDestinationCodePage
(
254 [out] UINT
*puiDstCodePage
);
257 [out] DWORD
*pdwProperty
);
259 HRESULT DoConversion
(
261 [in,out] UINT
*pcSrcSize
,
263 [in,out] UINT
*pcDstSize
);
265 HRESULT DoConversionToUnicode
(
267 [in,out] UINT
*pcSrcSize
,
269 [in,out] UINT
*pcDstSize
);
271 HRESULT DoConversionFromUnicode
(
273 [in,out] UINT
*pcSrcSize
,
275 [in,out] UINT
*pcDstSize
);
279 uuid(d66d6f99
-cdaa
-11d0
-b822
-00c04fc9b31f
)
281 coclass CMLangConvertCharset
283 [default] interface IMLangConvertCharset
;
288 uuid(3dc39d1d
-c030
-11d0
-b81b
-00c04fc9b31f
),
289 pointer_default(unique)
291 interface IEnumRfc1766
: IUnknown
293 const USHORT MAX_RFC1766_NAME
= 6;
294 const USHORT MAX_LOCALE_NAME
= 32;
296 typedef struct tagRFC1766INFO
299 WCHAR wszRfc1766
[MAX_RFC1766_NAME
];
300 WCHAR wszLocaleName
[MAX_LOCALE_NAME
];
301 } RFC1766INFO
, *PRFC1766INFO
;
304 [out] IEnumRfc1766
**ppEnum
);
308 [out] PRFC1766INFO rgelt
,
309 [out] ULONG
*pceltFetched
);
319 uuid(275c23e1
-3747-11d0
-9fea
-00aa003f8646
),
320 pointer_default(unique)
322 interface IMultiLanguage
: IUnknown
324 HRESULT GetNumberOfCodePageInfo
(
325 [out] UINT
*pcCodePage
);
327 HRESULT GetCodePageInfo
(
328 [in] UINT uiCodePage
,
329 [out] PMIMECPINFO pCodePageInfo
);
331 HRESULT GetFamilyCodePage
(
332 [in] UINT uiCodePage
,
333 [out] UINT
*puiFamilyCodePage
);
335 HRESULT EnumCodePages
(
337 [out] IEnumCodePage
**ppEnumCodePage
);
339 HRESULT GetCharsetInfo
(
341 [in] PMIMECSETINFO pCharsetInfo
);
343 HRESULT IsConvertible
(
344 [in] DWORD dwSrcEncoding
,
345 [in] DWORD dwDstEncoding
);
347 HRESULT ConvertString
(
348 [in,out] DWORD
*pdwMode
,
349 [in] DWORD dwSrcEncoding
,
350 [in] DWORD dwDstEncoding
,
352 [in,out] UINT
*pcSrcSize
,
354 [in,out] UINT
*pcDstSize
);
356 HRESULT ConvertStringToUnicode
(
357 [in,out] DWORD
*pdwMode
,
358 [in] DWORD dwEncoding
,
360 [in,out] UINT
*pcSrcSize
,
362 [in,out] UINT
*pcDstSize
);
364 HRESULT ConvertStringFromUnicode
(
365 [in,out] DWORD
*pdwMode
,
366 [in] DWORD dwEncoding
,
368 [in,out] UINT
*pcSrcSize
,
370 [in,out] UINT
*pcDstSize
);
372 HRESULT ConvertStringReset
();
374 HRESULT GetRfc1766FromLcid
(
376 [out] BSTR *pbstrRfc1766
);
378 HRESULT GetLcidFromRfc1766
(
380 [in] BSTR bstrRfc1766
);
383 [out] IEnumRfc1766
**ppEnumRfc1766
);
385 HRESULT GetRfc1766Info
(
387 [out] PRFC1766INFO pRfc1766Info
);
389 HRESULT CreateConvertCharset
(
390 [in] UINT uiSrcCodePage
,
391 [in] UINT uiDstCodePage
,
392 [in] DWORD dwProperty
,
393 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
399 uuid(dccfc164
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
400 pointer_default(unique)
402 interface IMultiLanguage2
: IUnknown
404 typedef struct tagDetectEncodingInfo
410 } DetectEncodingInfo
, *pDetectEncodingInfo
;
412 HRESULT GetNumberOfCodePageInfo
(
413 [out] UINT
*pcCodePage
);
415 HRESULT GetCodePageInfo
(
416 [in] UINT uiCodePage
,
418 [out] PMIMECPINFO pCodePageInfo
);
420 HRESULT GetFamilyCodePage
(
421 [in] UINT uiCodePage
,
422 [out] UINT
*puiFamilyCodePage
);
424 HRESULT EnumCodePages
(
427 [out] IEnumCodePage
**ppEnumCodePage
);
429 HRESULT GetCharsetInfo
(
431 [in] PMIMECSETINFO pCharsetInfo
);
433 HRESULT IsConvertible
(
434 [in] DWORD dwSrcEncoding
,
435 [in] DWORD dwDstEncoding
);
437 HRESULT ConvertString
(
438 [in,out] DWORD
*pdwMode
,
439 [in] DWORD dwSrcEncoding
,
440 [in] DWORD dwDstEncoding
,
442 [in,out] UINT
*pcSrcSize
,
444 [in,out] UINT
*pcDstSize
);
446 HRESULT ConvertStringToUnicode
(
447 [in,out] DWORD
*pdwMode
,
448 [in] DWORD dwEncoding
,
450 [in,out] UINT
*pcSrcSize
,
452 [in,out] UINT
*pcDstSize
);
454 HRESULT ConvertStringFromUnicode
(
455 [in,out] DWORD
*pdwMode
,
456 [in] DWORD dwEncoding
,
458 [in,out] UINT
*pcSrcSize
,
460 [in,out] UINT
*pcDstSize
);
462 HRESULT ConvertStringReset
();
464 HRESULT GetRfc1766FromLcid
(
466 [out] BSTR *pbstrRfc1766
);
468 HRESULT GetLcidFromRfc1766
(
470 [in] BSTR bstrRfc1766
);
474 [out] IEnumRfc1766
**ppEnumRfc1766
);
476 HRESULT GetRfc1766Info
(
479 [out] PRFC1766INFO pRfc1766Info
);
481 HRESULT CreateConvertCharset
(
482 [in] UINT uiSrcCodePage
,
483 [in] UINT uiDstCodePage
,
484 [in] DWORD dwProperty
,
485 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
487 HRESULT ConvertStringInIStream
(
488 [in,out] DWORD
*pdwMode
,
490 [in] WCHAR
*lpFallBack
,
491 [in] DWORD dwSrcEncoding
,
492 [in] DWORD dwDstEncoding
,
493 [in] IStream
*pstmIn
,
494 [in] IStream
*pstmOut
);
496 HRESULT ConvertStringToUnicodeEx
(
497 [in,out] DWORD
*pdwMode
,
498 [in] DWORD dwEncoding
,
500 [in,out] UINT
*pcSrcSize
,
502 [in,out] UINT
*pcDstSize
,
504 [in] WCHAR
*lpFallBack
);
506 HRESULT ConvertStringFromUnicodeEx
(
507 [in,out] DWORD
*pdwMode
,
508 [in] DWORD dwEncoding
,
510 [in,out] UINT
*pcSrcSize
,
512 [in,out] UINT
*pcDstSize
,
514 [in] WCHAR
*lpFallBack
);
516 HRESULT DetectCodepageInIStream
(
518 [in] DWORD dwPrefWinCodePage
,
519 [in] IStream
*pstmIn
,
520 [in,out] DetectEncodingInfo
*lpEncoding
,
521 [in,out] INT *pnScores
);
523 HRESULT DetectInputCodepage
(
525 [in] DWORD dwPrefWinCodePage
,
527 [in,out] INT *pcSrcSize
,
528 [in,out] DetectEncodingInfo
*lpEncoding
,
529 [in,out] INT *pnScores
);
531 HRESULT ValidateCodePage
(
532 [in] UINT uiCodePage
,
535 HRESULT GetCodePageDescription
(
536 [in] UINT uiCodePage
,
538 [in,out] LPWSTR lpWideCharStr
,
539 [in] int cchWideChar
);
541 HRESULT IsCodePageInstallable
(
542 [in] UINT uiCodePage
);
544 HRESULT SetMimeDBSource
(
545 [in] MIMECONTF dwSource
);
547 HRESULT GetNumberOfScripts
(
548 [out] UINT
*pnScripts
);
553 [out] IEnumScript
**ppEnumScript
);
555 HRESULT ValidateCodePageEx
( /* undocumented on MSDN */
556 [in] UINT uiCodePage
,
558 [in] DWORD dwfIODControl
);
563 uuid(4e5868ab
-b157
-4623-9acc
-6a1d9caebe04
),
564 pointer_default(unique)
566 interface IMultiLanguage3
: IMultiLanguage2
568 typedef [unique] IMultiLanguage3
*LPMULTILANGUAGE3
;
569 HRESULT DetectOutboundCodePage
(
571 [in] LPCWSTR lpWideCharStr
,
572 [in] UINT cchWideChar
,
573 [in] UINT
*puiPreferredCodePages
,
574 [in] UINT nPreferredCodePages
,
575 [in] UINT
*puiDetectedCodePages
,
576 [in, out] UINT
*pnDetectedCodePages
,
577 [in] WCHAR
*lpSpecialChar
);
579 HRESULT DetectOutboundCodePageInIStream
(
581 [in] IStream
*pStrIn
,
582 [in] UINT
*puiPreferredCodePages
,
583 [in] UINT nPreferredCodePages
,
584 [in] UINT
*puiDetectedCodePages
,
585 [in, out] UINT
*pnDetectedCodePages
,
586 [in] WCHAR
*lpSpecialChar
);
590 uuid(275C23E2
-3747-11d0
-9FEA
-00AA003f8646
)
592 coclass CMultiLanguage
594 [default] interface IMultiLanguage
;
595 interface IMLangCodePages
;
596 interface IMLangFontLink
;
597 /* interface IMLangLineBreakConsole; */
600 cpp_quote
("STDAPI LcidToRfc1766A(LCID, LPSTR, INT);")
601 cpp_quote
("STDAPI LcidToRfc1766W(LCID, LPWSTR, INT);")
602 cpp_quote
("#define LcidToRfc1766 WINELIB_NAME_AW(LcidToRfc1766)")
604 cpp_quote
("STDAPI Rfc1766ToLcidA(LCID *, LPCSTR);")
605 cpp_quote
("STDAPI Rfc1766ToLcidW(LCID *, LPCWSTR);")
606 cpp_quote
("#define Rfc1766ToLcid WINELIB_NAME_AW(Rfc1766ToLcid)")
608 cpp_quote
("STDAPI GetGlobalFontLinkObject(void);")
609 cpp_quote
("STDAPI IsConvertINetStringAvailable(DWORD, DWORD);")
610 cpp_quote
("STDAPI ConvertINetString(LPDWORD, DWORD, DWORD, LPCSTR, LPINT, LPSTR, LPINT);")
611 cpp_quote
("STDAPI ConvertINetMultiByteToUnicode(LPDWORD, DWORD, LPCSTR, LPINT, LPWSTR, LPINT);")
612 cpp_quote
("STDAPI ConvertINetUnicodeToMultiByte(LPDWORD, DWORD, LPCWSTR, LPINT, LPSTR, LPINT);")