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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* FIXME: LANDID is defined in winnt.h and mlang.h in the platform SDK */
24 cpp_quote
("#ifndef __WINE_WINNT_H")
30 pointer_default(unique)
32 interface IMLangCodePages
: IUnknown
34 HRESULT GetCharCodePages
(
37 HRESULT GetStrCodePages
(
38 [in, size_is(cchSrc
)] const WCHAR
*pszSrc
,
40 [in] DWORD dwPriorityCodePages
,
41 [out] DWORD
*pdwCodePages
,
42 [out] long *pcchCodePages
);
43 HRESULT CodePageToCodePages
(
45 [out] DWORD
*pdwCodePages
);
46 HRESULT CodePagesToCodePage
(
47 [in] DWORD dwCodePages
,
48 [in] UINT uDefaultCodePage
,
49 [out] UINT
*puCodePage
);
54 pointer_default(unique)
56 interface IMLangFontLink
: IMLangCodePages
58 HRESULT GetFontCodePages
(
61 [out] DWORD
*pdwCodePages
);
65 [in] DWORD dwCodePages
,
67 [out] HFONT
*phDestFont
);
72 HRESULT ResetFontMapping
();
77 pointer_default(unique)
79 interface IEnumScript
: IUnknown
81 const USHORT MAX_SCRIPT_NAME
= 48;
83 typedef BYTE SCRIPT_ID
;
85 typedef struct tagSCRIPTINFO
{
88 WCHAR wszDescription
[MAX_SCRIPT_NAME
];
89 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
90 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
91 } SCRIPTINFO
, *PSCRIPTINFO
;
94 [out] IEnumScript
**ppEnum
);
98 [out] PSCRIPTINFO rgelt
,
99 [out] ULONG
*pceltFetched
);
109 pointer_default(unique)
111 interface IEnumCodePage
: IUnknown
113 const USHORT MAX_MIMECP_NAME
= 64;
114 const USHORT MAX_MIMECSET_NAME
= 50;
115 const USHORT MAX_MIMEFACE_NAME
= 32;
117 typedef enum tagMIMECONTF
119 MIMECONTF_MAILNEWS
= 0x00000001,
120 MIMECONTF_BROWSER
= 0x00000002,
121 MIMECONTF_MINIMAL
= 0x00000004,
122 MIMECONTF_IMPORT
= 0x00000008,
123 MIMECONTF_SAVABLE_MAILNEWS
= 0x00000100,
124 MIMECONTF_SAVABLE_BROWSER
= 0x00000200,
125 MIMECONTF_EXPORT
= 0x00000400,
126 MIMECONTF_PRIVCONVERTER
= 0x00010000,
127 MIMECONTF_VALID
= 0x00020000,
128 MIMECONTF_VALID_NLS
= 0x00040000,
129 MIMECONTF_MIME_IE4
= 0x10000000,
130 MIMECONTF_MIME_LATEST
= 0x20000000,
131 MIMECONTF_MIME_REGISTRY
= 0x40000000
134 typedef struct tagMIMECPINFO
{
137 UINT uiFamilyCodePage
;
138 WCHAR wszDescription
[MAX_MIMECP_NAME
];
139 WCHAR wszWebCharset
[MAX_MIMECSET_NAME
];
140 WCHAR wszHeaderCharset
[MAX_MIMECSET_NAME
];
141 WCHAR wszBodyCharset
[MAX_MIMECSET_NAME
];
142 WCHAR wszFixedWidthFont
[MAX_MIMEFACE_NAME
];
143 WCHAR wszProportionalFont
[MAX_MIMEFACE_NAME
];
145 } MIMECPINFO
, *PMIMECPINFO
;
147 typedef struct tagMIMECSETINFO
150 UINT uiInternetEncoding
;
151 WCHAR wszCharset
[MAX_MIMECSET_NAME
];
152 } MIMECSETINFO
, *PMIMECSETINFO
;
155 [out] IEnumCodePage
**ppEnum
);
159 [out] PMIMECPINFO rgelt
,
160 [out] ULONG
*pceltFetched
);
170 pointer_default(unique)
172 interface IMLangConvertCharset
: IUnknown
175 [in] UINT uiSrcCodePage
,
176 [in] UINT uiDstCodePage
,
177 [in] DWORD dwProperty
);
179 HRESULT GetSourceCodePage
(
180 [out] UINT
*puiSrcCodePage
);
182 HRESULT GetDestinationCodePage
(
183 [out] UINT
*puiDstCodePage
);
186 [out] DWORD
*pdwProperty
);
188 HRESULT DoConversion
(
190 [in,out] UINT
*pcSrcSize
,
192 [in,out] UINT
*pcDstSize
);
194 HRESULT DoConversionToUnicode
(
196 [in,out] UINT
*pcSrcSize
,
198 [in,out] UINT
*pcDstSize
);
200 HRESULT DoConversionFromUnicode
(
202 [in,out] UINT
*pcSrcSize
,
204 [in,out] UINT
*pcDstSize
);
209 pointer_default(unique)
211 interface IEnumRfc1766
: IUnknown
213 typedef struct tagRFC1766INFO
216 WCHAR wszRfc1766
[MAX_RFC1766_NAME
];
217 WCHAR wszLocaleName
[MAX_LOCALE_NAME
];
218 } RFC1766INFO
, *PRFC1766INFO
;
221 [out] IEnumRfc1766
**ppEnum
);
225 [out] PRFC1766INFO rgelt
,
226 [out] ULONG
*pceltFetched
);
236 pointer_default(unique)
238 interface IMultiLanguage
: IUnknown
240 HRESULT GetNumberOfCodePageInfo
(
241 [out] UINT
*pcCodePage
);
243 HRESULT GetCodePageInfo
(
244 [in] UINT uiCodePage
,
245 [out] PMIMECPINFO pCodePageInfo
);
247 HRESULT GetFamilyCodePage
(
248 [in] UINT uiCodePage
,
249 [out] UINT
*puiFamilyCodePage
);
251 HRESULT EnumCodePages
(
253 [out] IEnumCodePage
**ppEnumCodePage
);
255 HRESULT GetCharsetInfo
(
257 [in] PMIMECSETINFO pCharsetInfo
);
259 HRESULT IsConvertible
(
260 [in] DWORD dwSrcEncoding
,
261 [in] DWORD dwDstEncoding
);
263 HRESULT ConvertString
(
264 [in,out] DWORD
*pdwMode
,
265 [in] DWORD dwSrcEncoding
,
266 [in] DWORD dwDstEncoding
,
268 [in,out] UINT
*pcSrcSize
,
270 [in,out] UINT
*pcDstSize
);
272 HRESULT ConvertStringToUnicode
(
273 [in,out] DWORD
*pdwMode
,
274 [in] DWORD dwEncoding
,
276 [in,out] UINT
*pcSrcSize
,
278 [in,out] UINT
*pcDstSize
);
280 HRESULT ConvertStringFromUnicode
(
281 [in,out] DWORD
*pdwMode
,
282 [in] DWORD dwEncoding
,
284 [in,out] UINT
*pcSrcSize
,
286 [in,out] UINT
*pcDstSize
);
288 HRESULT ConvertStringReset
();
290 HRESULT GetRfc1766FromLcid
(
292 [out] BSTR *pbstrRfc1766
);
294 HRESULT GetLcidFromRfc1766
(
296 [in] BSTR bstrRfc1766
);
299 [out] IEnumRfc1766
**ppEnumRfc1766
);
301 HRESULT GetRfc1766Info
(
303 [out] PRFC1766INFO pRfc1766Info
);
305 HRESULT CreateConvertCharset
(
306 [in] UINT uiSrcCodePage
,
307 [in] UINT uiDstCodePage
,
308 [in] DWORD dwProperty
,
309 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
315 pointer_default(unique)
317 interface IMultiLanguage2
: IUnknown
319 typedef struct tagDetectEncodingInfo
325 } DetectEncodingInfo
, *pDetectEncodingInfo
;
327 HRESULT GetNumberOfCodePageInfo
(
328 [out] UINT
*pcCodePage
);
330 HRESULT GetCodePageInfo
(
331 [in] UINT uiCodePage
,
333 [out] PMIMECPINFO pCodePageInfo
);
335 HRESULT GetFamilyCodePage
(
336 [in] UINT uiCodePage
,
337 [out] UINT
*puiFamilyCodePage
);
339 HRESULT EnumCodePages
(
342 [out] IEnumCodePage
**ppEnumCodePage
);
344 HRESULT GetCharsetInfo
(
346 [in] PMIMECSETINFO pCharsetInfo
);
348 HRESULT IsConvertible
(
349 [in] DWORD dwSrcEncoding
,
350 [in] DWORD dwDstEncoding
);
352 HRESULT ConvertString
(
353 [in,out] DWORD
*pdwMode
,
354 [in] DWORD dwSrcEncoding
,
355 [in] DWORD dwDstEncoding
,
357 [in,out] UINT
*pcSrcSize
,
359 [in,out] UINT
*pcDstSize
);
361 HRESULT ConvertStringToUnicode
(
362 [in,out] DWORD
*pdwMode
,
363 [in] DWORD dwEncoding
,
365 [in,out] UINT
*pcSrcSize
,
367 [in,out] UINT
*pcDstSize
);
369 HRESULT ConvertStringFromUnicode
(
370 [in,out] DWORD
*pdwMode
,
371 [in] DWORD dwEncoding
,
373 [in,out] UINT
*pcSrcSize
,
375 [in,out] UINT
*pcDstSize
);
377 HRESULT ConvertStringReset
();
379 HRESULT GetRfc1766FromLcid
(
381 [out] BSTR *pbstrRfc1766
);
383 HRESULT GetLcidFromRfc1766
(
385 [in] BSTR bstrRfc1766
);
389 [out] IEnumRfc1766
**ppEnumRfc1766
);
391 HRESULT GetRfc1766Info
(
394 [out] PRFC1766INFO pRfc1766Info
);
396 HRESULT CreateConvertCharset
(
397 [in] UINT uiSrcCodePage
,
398 [in] UINT uiDstCodePage
,
399 [in] DWORD dwProperty
,
400 [out] IMLangConvertCharset
**ppMLangConvertCharset
);
402 HRESULT ConvertStringInIStream
(
403 [in,out] DWORD
*pdwMode
,
405 [in] WCHAR
*lpFallBack
,
406 [in] DWORD dwSrcEncoding
,
407 [in] DWORD dwDstEncoding
,
408 [in] IStream
*pstmIn
,
409 [in] IStream
*pstmOut
);
411 HRESULT ConvertStringToUnicodeEx
(
412 [in,out] DWORD
*pdwMode
,
413 [in] DWORD dwEncoding
,
415 [in,out] UINT
*pcSrcSize
,
417 [in,out] UINT
*pcDstSize
,
419 [in] WCHAR
*lpFallBack
);
421 HRESULT DetectCodepageInIStream
(
423 [in] DWORD dwPrefWinCodePage
,
424 [in] IStream
*pstmIn
,
425 [in,out] DetectEncodingInfo
*lpEncoding
,
426 [in,out] INT *pnScores
);
428 HRESULT DetectInputCodepage
(
430 [in] DWORD dwPrefWinCodePage
,
432 [in,out] INT *pcSrcSize
,
433 [in,out] DetectEncodingInfo
*lpEncoding
,
434 [in,out] INT *pnScores
);
436 HRESULT ValidateCodePage
(
437 [in] UINT uiCodePage
,
440 HRESULT GetCodePageDescription
(
441 [in] UINT uiCodePage
,
443 [in,out] LPWSTR lpWideCharStr
,
444 [in] int cchWideChar
);
446 HRESULT IsCodePageInstallable
(
447 [in] UINT uiCodePage
);
449 HRESULT SetMimeDBSource
(
450 [in] MIMECONTF dwSource
);
452 HRESULT GetNumberOfScripts
(
453 [out] UINT
*pnScripts
);
458 [out] IEnumScript
**ppEnumScript
);
460 HRESULT ValidateCodePageEx
( /* undocumented on MSDN */
461 [in] UINT uiCodePage
,
463 [in] DWORD dwfIODControl
);