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
23 /* FIXME: LANDID is defined in winnt.h and mlang.h in the platform SDK */
24 cpp_quote
("#ifndef _WINNT_")
30 uuid(359f3443
-bd4a
-11d0
-b188
-00aa0038c969
),
31 pointer_default(unique)
33 interface IMLangCodePages
: IUnknown
35 HRESULT GetCharCodePages
(
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(275c23e3
-3747-11d0
-9fea
-00aa003f8646
),
178 pointer_default(unique)
180 interface IEnumCodePage
: IUnknown
182 const USHORT MAX_MIMECP_NAME
= 64;
183 const USHORT MAX_MIMECSET_NAME
= 50;
185 typedef enum tagMIMECONTF
187 MIMECONTF_MAILNEWS
= 0x00000001,
188 MIMECONTF_BROWSER
= 0x00000002,
189 MIMECONTF_MINIMAL
= 0x00000004,
190 MIMECONTF_IMPORT
= 0x00000008,
191 MIMECONTF_SAVABLE_MAILNEWS
= 0x00000100,
192 MIMECONTF_SAVABLE_BROWSER
= 0x00000200,
193 MIMECONTF_EXPORT
= 0x00000400,
194 MIMECONTF_PRIVCONVERTER
= 0x00010000,
195 MIMECONTF_VALID
= 0x00020000,
196 MIMECONTF_VALID_NLS
= 0x00040000,
197 MIMECONTF_MIME_IE4
= 0x10000000,
198 MIMECONTF_MIME_LATEST
= 0x20000000,
199 MIMECONTF_MIME_REGISTRY
= 0x40000000
202 typedef struct tagMIMECPINFO
{
205 UINT uiFamilyCodePage
;
206 WCHAR wszDescription
[MAX_MIMECP_NAME
];
207 WCHAR wszWebCharset
[MAX_MIMECSET_NAME
];
208 WCHAR wszHeaderCharset
[MAX_MIMECSET_NAME
];
209 WCHAR wszBodyCharset
[MAX_MIMECSET_NAME
];
210 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
211 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
213 } MIMECPINFO
, *PMIMECPINFO
;
215 typedef struct tagMIMECSETINFO
218 UINT uiInternetEncoding
;
219 WCHAR wszCharset
[MAX_MIMECSET_NAME
];
220 } MIMECSETINFO
, *PMIMECSETINFO
;
223 [out] IEnumCodePage
**ppEnum
);
227 [out] PMIMECPINFO rgelt
,
228 [out] ULONG
*pceltFetched
);
238 pointer_default(unique)
240 interface IMLangConvertCharset
: IUnknown
243 [in] UINT uiSrcCodePage
,
244 [in] UINT uiDstCodePage
,
245 [in] DWORD dwProperty
);
247 HRESULT GetSourceCodePage
(
248 [out] UINT
*puiSrcCodePage
);
250 HRESULT GetDestinationCodePage
(
251 [out] UINT
*puiDstCodePage
);
254 [out] DWORD
*pdwProperty
);
256 HRESULT DoConversion
(
258 [in,out] UINT
*pcSrcSize
,
260 [in,out] UINT
*pcDstSize
);
262 HRESULT DoConversionToUnicode
(
264 [in,out] UINT
*pcSrcSize
,
266 [in,out] UINT
*pcDstSize
);
268 HRESULT DoConversionFromUnicode
(
270 [in,out] UINT
*pcSrcSize
,
272 [in,out] UINT
*pcDstSize
);
277 uuid(3dc39d1d
-c030
-11d0
-b81b
-00c04fc9b31f
),
278 pointer_default(unique)
280 interface IEnumRfc1766
: IUnknown
282 const USHORT MAX_RFC1766_NAME
= 6;
283 const USHORT MAX_LOCALE_NAME
= 32;
285 typedef struct tagRFC1766INFO
288 WCHAR wszRfc1766
[MAX_RFC1766_NAME
];
289 WCHAR wszLocaleName
[MAX_LOCALE_NAME
];
290 } RFC1766INFO
, *PRFC1766INFO
;
293 [out] IEnumRfc1766
**ppEnum
);
297 [out] PRFC1766INFO rgelt
,
298 [out] ULONG
*pceltFetched
);
308 uuid(275c23e1
-3747-11d0
-9fea
-00aa003f8646
),
309 pointer_default(unique)
311 interface IMultiLanguage
: IUnknown
313 HRESULT GetNumberOfCodePageInfo
(
314 [out] UINT
*pcCodePage
);
316 HRESULT GetCodePageInfo
(
317 [in] UINT uiCodePage
,
318 [out] PMIMECPINFO pCodePageInfo
);
320 HRESULT GetFamilyCodePage
(
321 [in] UINT uiCodePage
,
322 [out] UINT
*puiFamilyCodePage
);
324 HRESULT EnumCodePages
(
326 [out] IEnumCodePage
**ppEnumCodePage
);
328 HRESULT GetCharsetInfo
(
330 [in] PMIMECSETINFO pCharsetInfo
);
332 HRESULT IsConvertible
(
333 [in] DWORD dwSrcEncoding
,
334 [in] DWORD dwDstEncoding
);
336 HRESULT ConvertString
(
337 [in,out] DWORD
*pdwMode
,
338 [in] DWORD dwSrcEncoding
,
339 [in] DWORD dwDstEncoding
,
341 [in,out] UINT
*pcSrcSize
,
343 [in,out] UINT
*pcDstSize
);
345 HRESULT ConvertStringToUnicode
(
346 [in,out] DWORD
*pdwMode
,
347 [in] DWORD dwEncoding
,
349 [in,out] UINT
*pcSrcSize
,
351 [in,out] UINT
*pcDstSize
);
353 HRESULT ConvertStringFromUnicode
(
354 [in,out] DWORD
*pdwMode
,
355 [in] DWORD dwEncoding
,
357 [in,out] UINT
*pcSrcSize
,
359 [in,out] UINT
*pcDstSize
);
361 HRESULT ConvertStringReset
();
363 HRESULT GetRfc1766FromLcid
(
365 [out] BSTR *pbstrRfc1766
);
367 HRESULT GetLcidFromRfc1766
(
369 [in] BSTR bstrRfc1766
);
372 [out] IEnumRfc1766
**ppEnumRfc1766
);
374 HRESULT GetRfc1766Info
(
376 [out] PRFC1766INFO pRfc1766Info
);
378 HRESULT CreateConvertCharset
(
379 [in] UINT uiSrcCodePage
,
380 [in] UINT uiDstCodePage
,
381 [in] DWORD dwProperty
,
382 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
388 uuid(dccfc164
-2b38
-11d2
-b7ec
-00c04f8f5d9a
),
389 pointer_default(unique)
391 interface IMultiLanguage2
: IUnknown
393 typedef struct tagDetectEncodingInfo
399 } DetectEncodingInfo
, *pDetectEncodingInfo
;
401 HRESULT GetNumberOfCodePageInfo
(
402 [out] UINT
*pcCodePage
);
404 HRESULT GetCodePageInfo
(
405 [in] UINT uiCodePage
,
407 [out] PMIMECPINFO pCodePageInfo
);
409 HRESULT GetFamilyCodePage
(
410 [in] UINT uiCodePage
,
411 [out] UINT
*puiFamilyCodePage
);
413 HRESULT EnumCodePages
(
416 [out] IEnumCodePage
**ppEnumCodePage
);
418 HRESULT GetCharsetInfo
(
420 [in] PMIMECSETINFO pCharsetInfo
);
422 HRESULT IsConvertible
(
423 [in] DWORD dwSrcEncoding
,
424 [in] DWORD dwDstEncoding
);
426 HRESULT ConvertString
(
427 [in,out] DWORD
*pdwMode
,
428 [in] DWORD dwSrcEncoding
,
429 [in] DWORD dwDstEncoding
,
431 [in,out] UINT
*pcSrcSize
,
433 [in,out] UINT
*pcDstSize
);
435 HRESULT ConvertStringToUnicode
(
436 [in,out] DWORD
*pdwMode
,
437 [in] DWORD dwEncoding
,
439 [in,out] UINT
*pcSrcSize
,
441 [in,out] UINT
*pcDstSize
);
443 HRESULT ConvertStringFromUnicode
(
444 [in,out] DWORD
*pdwMode
,
445 [in] DWORD dwEncoding
,
447 [in,out] UINT
*pcSrcSize
,
449 [in,out] UINT
*pcDstSize
);
451 HRESULT ConvertStringReset
();
453 HRESULT GetRfc1766FromLcid
(
455 [out] BSTR *pbstrRfc1766
);
457 HRESULT GetLcidFromRfc1766
(
459 [in] BSTR bstrRfc1766
);
463 [out] IEnumRfc1766
**ppEnumRfc1766
);
465 HRESULT GetRfc1766Info
(
468 [out] PRFC1766INFO pRfc1766Info
);
470 HRESULT CreateConvertCharset
(
471 [in] UINT uiSrcCodePage
,
472 [in] UINT uiDstCodePage
,
473 [in] DWORD dwProperty
,
474 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
476 HRESULT ConvertStringInIStream
(
477 [in,out] DWORD
*pdwMode
,
479 [in] WCHAR
*lpFallBack
,
480 [in] DWORD dwSrcEncoding
,
481 [in] DWORD dwDstEncoding
,
482 [in] IStream
*pstmIn
,
483 [in] IStream
*pstmOut
);
485 HRESULT ConvertStringToUnicodeEx
(
486 [in,out] DWORD
*pdwMode
,
487 [in] DWORD dwEncoding
,
489 [in,out] UINT
*pcSrcSize
,
491 [in,out] UINT
*pcDstSize
,
493 [in] WCHAR
*lpFallBack
);
495 HRESULT ConvertStringFromUnicodeEx
(
496 [in,out] DWORD
*pdwMode
,
497 [in] DWORD dwEncoding
,
499 [in,out] UINT
*pcSrcSize
,
501 [in,out] UINT
*pcDstSize
,
503 [in] WCHAR
*lpFallBack
);
505 HRESULT DetectCodepageInIStream
(
507 [in] DWORD dwPrefWinCodePage
,
508 [in] IStream
*pstmIn
,
509 [in,out] DetectEncodingInfo
*lpEncoding
,
510 [in,out] INT *pnScores
);
512 HRESULT DetectInputCodepage
(
514 [in] DWORD dwPrefWinCodePage
,
516 [in,out] INT *pcSrcSize
,
517 [in,out] DetectEncodingInfo
*lpEncoding
,
518 [in,out] INT *pnScores
);
520 HRESULT ValidateCodePage
(
521 [in] UINT uiCodePage
,
524 HRESULT GetCodePageDescription
(
525 [in] UINT uiCodePage
,
527 [in,out] LPWSTR lpWideCharStr
,
528 [in] int cchWideChar
);
530 HRESULT IsCodePageInstallable
(
531 [in] UINT uiCodePage
);
533 HRESULT SetMimeDBSource
(
534 [in] MIMECONTF dwSource
);
536 HRESULT GetNumberOfScripts
(
537 [out] UINT
*pnScripts
);
542 [out] IEnumScript
**ppEnumScript
);
544 HRESULT ValidateCodePageEx
( /* undocumented on MSDN */
545 [in] UINT uiCodePage
,
547 [in] DWORD dwfIODControl
);
551 uuid(275C23E2
-3747-11d0
-9FEA
-00AA003f8646
)
553 coclass CMultiLanguage
555 [default] interface IMultiLanguage
;
556 interface IMLangCodePages
;
557 interface IMLangFontLink
;
558 /* interface IMLangLineBreakConsole; */
561 cpp_quote
("STDAPI LcidToRfc1766A(LCID, LPSTR, INT);")
562 cpp_quote
("STDAPI LcidToRfc1766W(LCID, LPWSTR, INT);")
563 cpp_quote
("#define LcidToRfc1766 WINELIB_NAME_AW(LcidToRfc1766)")
565 cpp_quote
("STDAPI Rfc1766ToLcidA(LCID *, LPCSTR);")
566 cpp_quote
("STDAPI Rfc1766ToLcidW(LCID *, LPCWSTR);")
567 cpp_quote
("#define Rfc1766ToLcid WINELIB_NAME_AW(Rfc1766ToLcid)")
569 cpp_quote
("STDAPI GetGlobalFontLinkObject(void);")
570 cpp_quote
("STDAPI IsConvertINetStringAvailable(DWORD, DWORD);")
571 cpp_quote
("STDAPI ConvertINetString(LPDWORD, DWORD, DWORD, LPCSTR, LPINT, LPSTR, LPINT);")
572 cpp_quote
("STDAPI ConvertINetMultiByteToUnicode(LPDWORD, DWORD, LPCSTR, LPINT, LPWSTR, LPINT);")
573 cpp_quote
("STDAPI ConvertINetUnicodeToMultiByte(LPDWORD, DWORD, LPCWSTR, LPINT, LPSTR, LPINT);")