push 585d7e65360c48afb4ab4cda479488021d096fbc
[wine/hacks.git] / include / msctf.idl
blob1c3e652d7cc03920d172f5ace303336624497260
1 /*
2 * Copyright 2008 Aric Stewart, CodeWeavers
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
19 #ifndef DO_NO_IMPORTS
20 import "oaidl.idl";
21 import "comcat.idl";
22 import "textstor.idl";
23 /* import "ctfutb.idl"; */
24 #endif
26 cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
27 cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
28 cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
29 cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
31 /* GUIDs for Categories */
32 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
33 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
34 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
35 cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
37 typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie;
38 typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
39 typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
41 interface ITfDocumentMgr;
42 interface ITfContext;
43 interface IEnumTfDocumentMgrs;
44 interface IEnumTfContexts;
45 interface ITfFunctionProvider;
46 interface IEnumTfFunctionProviders;
47 interface ITfCompartmentMgr;
48 interface ITfEditSession;
49 interface ITfRange;
50 interface ITfContextView;
51 interface IEnumTfContextViews;
52 interface ITfProperty;
53 interface ITfReadOnlyProperty;
54 interface IEnumTfProperties;
55 interface ITfRangeBackup;
56 interface IEnumTfLanguageProfiles;
57 interface ITfEditRecord;
58 interface ITfCompositionView;
61 object,
62 uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
63 pointer_default(unique)
65 interface ITfThreadMgr: IUnknown
67 HRESULT Activate(
68 [out] TfClientId *ptid);
70 HRESULT Deactivate();
72 HRESULT CreateDocumentMgr(
73 [out] ITfDocumentMgr **ppdim);
75 HRESULT EnumDocumentMgrs(
76 [out] IEnumTfDocumentMgrs **ppEnum);
78 HRESULT GetFocus(
79 [out] ITfDocumentMgr **ppdimFocus);
81 HRESULT SetFocus(
82 [in] ITfDocumentMgr *pdimFocus);
84 HRESULT AssociateFocus(
85 [in] HWND hwnd,
86 [in, unique] ITfDocumentMgr *pdimNew,
87 [out] ITfDocumentMgr **ppdimPrev);
89 HRESULT IsThreadFocus(
90 [out] BOOL *pfThreadFocus);
92 HRESULT GetFunctionProvider(
93 [in] REFCLSID clsid,
94 [out] ITfFunctionProvider **ppFuncProv);
96 HRESULT EnumFunctionProviders(
97 [out] IEnumTfFunctionProviders **ppEnum);
99 HRESULT GetGlobalCompartment(
100 [out] ITfCompartmentMgr **ppCompMgr);
105 object,
106 uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
107 pointer_default(unique)
109 interface ITfDocumentMgr: IUnknown
111 HRESULT CreateContext(
112 [in] TfClientId tidOwner,
113 [in] DWORD dwFlags,
114 [in, unique] IUnknown *punk,
115 [out] ITfContext **ppic,
116 [out] TfEditCookie *pecTextStore);
118 HRESULT Push(
119 [in] ITfContext *pic);
121 const DWORD TF_POPF_ALL = 0x0001;
123 HRESULT Pop(
124 [in] DWORD dwFlags);
126 HRESULT GetTop(
127 [out] ITfContext **ppic);
129 HRESULT GetBase(
130 [out] ITfContext **ppic);
132 HRESULT EnumContexts(
133 [out] IEnumTfContexts **ppEnum);
137 object,
138 uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
139 pointer_default(unique)
141 interface ITfContext : IUnknown
143 const DWORD TF_ES_ASYNCDONTCARE = 0x0;
144 const DWORD TF_ES_SYNC = 0x1;
145 const DWORD TF_ES_READ = 0x2;
146 const DWORD TF_ES_READWRITE = 0x6;
147 const DWORD TF_ES_ASYNC = 0x8;
149 HRESULT RequestEditSession(
150 [in] TfClientId tid,
151 [in] ITfEditSession *pes,
152 [in] DWORD dwFlags,
153 [out] HRESULT *phrSession);
155 HRESULT InWriteSession(
156 [in] TfClientId tid,
157 [out] BOOL *pfWriteSession);
159 typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE, TF_AE_START, TF_AE_END } TfActiveSelEnd;
161 typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
163 TfActiveSelEnd ase;
164 BOOL fInterimChar;
165 } TF_SELECTIONSTYLE;
167 typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
169 ITfRange *range;
170 TF_SELECTIONSTYLE style;
171 } TF_SELECTION;
173 const ULONG TF_DEFAULT_SELECTION = TS_DEFAULT_SELECTION;
175 HRESULT GetSelection(
176 [in] TfEditCookie ec,
177 [in] ULONG ulIndex,
178 [in] ULONG ulCount,
179 [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
180 [out] ULONG *pcFetched);
182 HRESULT SetSelection(
183 [in] TfEditCookie ec,
184 [in] ULONG ulCount,
185 [in, size_is(ulCount)] const TF_SELECTION *pSelection);
187 HRESULT GetStart(
188 [in] TfEditCookie ec,
189 [out] ITfRange **ppStart);
191 HRESULT GetEnd(
192 [in] TfEditCookie ec,
193 [out] ITfRange **ppEnd);
195 typedef [uuid(bc7d979a-846a-444d-afef-0a9bfa82b961)] TS_STATUS TF_STATUS;
196 const DWORD TF_SD_READONLY = TS_SD_READONLY;
197 const DWORD TF_SD_LOADING = TS_SD_LOADING;
198 const DWORD TF_SS_DISJOINTSEL = TS_SS_DISJOINTSEL;
199 const DWORD TF_SS_REGIONS = TS_SS_REGIONS;
200 const DWORD TF_SS_TRANSITORY = TS_SS_TRANSITORY;
203 HRESULT GetActiveView(
204 [out] ITfContextView **ppView);
206 HRESULT EnumViews(
207 [out] IEnumTfContextViews **ppEnum);
209 HRESULT GetStatus(
210 [out] TF_STATUS *pdcs);
212 HRESULT GetProperty(
213 [in] REFGUID guidProp,
214 [out] ITfProperty **ppProp);
216 HRESULT GetAppProperty(
217 [in] REFGUID guidProp,
218 [out] ITfReadOnlyProperty **ppProp);
220 HRESULT TrackProperties(
221 [in, size_is(cProp)] const GUID **prgProp,
222 [in] ULONG cProp,
223 [in, size_is(cAppProp)] const GUID **prgAppProp,
224 [in] ULONG cAppProp,
225 [out] ITfReadOnlyProperty **ppProperty);
227 HRESULT EnumProperties(
228 [out] IEnumTfProperties **ppEnum);
230 HRESULT GetDocumentMgr(
231 [out] ITfDocumentMgr **ppDm);
233 HRESULT CreateRangeBackup(
234 [in] TfEditCookie ec,
235 [in] ITfRange *pRange,
236 [out] ITfRangeBackup **ppBackup);
241 object,
242 uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
243 pointer_default(unique)
245 interface ITfSource : IUnknown
247 HRESULT AdviseSink(
248 [in] REFIID riid,
249 [in, iid_is(riid)] IUnknown *punk,
250 [out] DWORD *pdwCookie);
252 HRESULT UnadviseSink(
253 [in] DWORD dwCookie);
257 object,
258 local,
259 uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
260 pointer_default(unique)
262 interface ITfInputProcessorProfiles : IUnknown
264 HRESULT Register(
265 [in] REFCLSID rclsid);
267 HRESULT Unregister(
268 [in] REFCLSID rclsid);
270 HRESULT AddLanguageProfile(
271 [in] REFCLSID rclsid,
272 [in] LANGID langid,
273 [in] REFGUID guidProfile,
274 [in, size_is(cchDesc)] const WCHAR *pchDesc,
275 [in] ULONG cchDesc,
276 [in, size_is(cchFile)] const WCHAR *pchIconFile,
277 [in] ULONG cchFile,
278 [in] ULONG uIconIndex);
280 HRESULT RemoveLanguageProfile(
281 [in] REFCLSID rclsid,
282 [in] LANGID langid,
283 [in] REFGUID guidProfile);
285 HRESULT EnumInputProcessorInfo(
286 [out] IEnumGUID **ppEnum);
288 HRESULT GetDefaultLanguageProfile(
289 [in] LANGID langid,
290 [in] REFGUID catid,
291 [out] CLSID *pclsid,
292 [out] GUID *pguidProfile);
294 HRESULT SetDefaultLanguageProfile(
295 [in] LANGID langid,
296 [in] REFCLSID rclsid,
297 [in] REFGUID guidProfiles);
299 HRESULT ActivateLanguageProfile(
300 [in] REFCLSID rclsid,
301 [in] LANGID langid,
302 [in] REFGUID guidProfiles);
304 HRESULT GetActiveLanguageProfile(
305 [in] REFCLSID rclsid,
306 [out] LANGID *plangid,
307 [out] GUID *pguidProfile);
309 HRESULT GetLanguageProfileDescription(
310 [in] REFCLSID rclsid,
311 [in] LANGID langid,
312 [in] REFGUID guidProfile,
313 [out] BSTR *pbstrProfile);
315 HRESULT GetCurrentLanguage(
316 [out] LANGID *plangid);
318 HRESULT ChangeCurrentLanguage(
319 [in] LANGID langid);
321 HRESULT GetLanguageList(
322 [out] LANGID **ppLangId,
323 [out] ULONG *pulCount);
325 HRESULT EnumLanguageProfiles(
326 [in] LANGID langid,
327 [out] IEnumTfLanguageProfiles **ppEnum);
329 HRESULT EnableLanguageProfile(
330 [in] REFCLSID rclsid,
331 [in] LANGID langid,
332 [in] REFGUID guidProfile,
333 [in] BOOL fEnable);
335 HRESULT IsEnabledLanguageProfile(
336 [in] REFCLSID rclsid,
337 [in] LANGID langid,
338 [in] REFGUID guidProfile,
339 [out] BOOL *pfEnable);
341 HRESULT EnableLanguageProfileByDefault(
342 [in] REFCLSID rclsid,
343 [in] LANGID langid,
344 [in] REFGUID guidProfile,
345 [in] BOOL fEnable);
347 HRESULT SubstituteKeyboardLayout(
348 [in] REFCLSID rclsid,
349 [in] LANGID langid,
350 [in] REFGUID guidProfile,
351 [in] HKL hKL);
355 object,
356 local,
357 uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
358 pointer_default(unique)
360 interface ITfCategoryMgr : IUnknown
362 HRESULT RegisterCategory([in] REFCLSID rclsid,
363 [in] REFGUID rcatid,
364 [in] REFGUID rguid);
366 HRESULT UnregisterCategory([in] REFCLSID rclsid,
367 [in] REFGUID rcatid,
368 [in] REFGUID rguid);
370 HRESULT EnumCategoriesInItem([in] REFGUID rguid,
371 [out] IEnumGUID **ppEnum);
373 HRESULT EnumItemsInCategory([in] REFGUID rcatid,
374 [out] IEnumGUID **ppEnum);
376 HRESULT FindClosestCategory([in] REFGUID rguid,
377 [out] GUID *pcatid,
378 [in, size_is(ulCount)] const GUID **ppcatidList,
379 [in] ULONG ulCount);
381 HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
382 [in] REFGUID rguid,
383 [in, size_is(cch)] const WCHAR *pchDesc,
384 [in] ULONG cch);
386 HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
387 [in] REFGUID rguid);
389 HRESULT GetGUIDDescription([in] REFGUID rguid,
390 [out] BSTR *pbstrDesc);
392 HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
393 [in] REFGUID rguid,
394 [in] DWORD dw);
396 HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
397 [in] REFGUID rguid);
399 HRESULT GetGUIDDWORD([in] REFGUID rguid,
400 [out] DWORD *pdw);
402 HRESULT RegisterGUID([in] REFGUID rguid,
403 [out] TfGuidAtom *pguidatom);
405 HRESULT GetGUID([in] TfGuidAtom guidatom,
406 [out] GUID *pguid);
408 HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
409 [in] REFGUID rguid,
410 [out] BOOL *pfEqual);
414 object,
415 uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
416 pointer_default(unique)
418 interface ITfTextEditSink : IUnknown
420 HRESULT OnEndEdit(
421 [in] ITfContext *pic,
422 [in] TfEditCookie ecReadOnly,
423 [in] ITfEditRecord *pEditRecord);
427 object,
428 uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
429 pointer_default(unique)
431 interface ITfContextOwnerCompositionSink : IUnknown
433 HRESULT OnStartComposition(
434 [in] ITfCompositionView *pComposition,
435 [out] BOOL *pfOk);
437 HRESULT OnUpdateComposition(
438 [in] ITfCompositionView *pComposition,
439 [in] ITfRange *pRangeNew);
441 HRESULT OnEndComposition(
442 [in] ITfCompositionView *pComposition);