msctf: Define ITfContextOwnerCompositionSink. This is implemented by a tsf aware...
[wine.git] / include / msctf.idl
blob49fa875ee10d841467d8abe12aa56b4b3219bac9
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 typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie;
32 typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
33 typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
35 interface ITfDocumentMgr;
36 interface ITfContext;
37 interface IEnumTfDocumentMgrs;
38 interface IEnumTfContexts;
39 interface ITfFunctionProvider;
40 interface IEnumTfFunctionProviders;
41 interface ITfCompartmentMgr;
42 interface ITfEditSession;
43 interface ITfRange;
44 interface ITfContextView;
45 interface IEnumTfContextViews;
46 interface ITfProperty;
47 interface ITfReadOnlyProperty;
48 interface IEnumTfProperties;
49 interface ITfRangeBackup;
50 interface IEnumTfLanguageProfiles;
51 interface ITfEditRecord;
52 interface ITfCompositionView;
55 object,
56 uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
57 pointer_default(unique)
59 interface ITfThreadMgr: IUnknown
61 HRESULT Activate(
62 [out] TfClientId *ptid);
64 HRESULT Deactivate();
66 HRESULT CreateDocumentMgr(
67 [out] ITfDocumentMgr **ppdim);
69 HRESULT EnumDocumentMgrs(
70 [out] IEnumTfDocumentMgrs **ppEnum);
72 HRESULT GetFocus(
73 [out] ITfDocumentMgr **ppdimFocus);
75 HRESULT SetFocus(
76 [in] ITfDocumentMgr *pdimFocus);
78 HRESULT AssociateFocus(
79 [in] HWND hwnd,
80 [in, unique] ITfDocumentMgr *pdimNew,
81 [out] ITfDocumentMgr **ppdimPrev);
83 HRESULT IsThreadFocus(
84 [out] BOOL *pfThreadFocus);
86 HRESULT GetFunctionProvider(
87 [in] REFCLSID clsid,
88 [out] ITfFunctionProvider **ppFuncProv);
90 HRESULT EnumFunctionProviders(
91 [out] IEnumTfFunctionProviders **ppEnum);
93 HRESULT GetGlobalCompartment(
94 [out] ITfCompartmentMgr **ppCompMgr);
99 object,
100 uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
101 pointer_default(unique)
103 interface ITfDocumentMgr: IUnknown
105 HRESULT CreateContext(
106 [in] TfClientId tidOwner,
107 [in] DWORD dwFlags,
108 [in, unique] IUnknown *punk,
109 [out] ITfContext **ppic,
110 [out] TfEditCookie *pecTextStore);
112 HRESULT Push(
113 [in] ITfContext *pic);
115 const DWORD TF_POPF_ALL = 0x0001;
117 HRESULT Pop(
118 [in] DWORD dwFlags);
120 HRESULT GetTop(
121 [out] ITfContext **ppic);
123 HRESULT GetBase(
124 [out] ITfContext **ppic);
126 HRESULT EnumContexts(
127 [out] IEnumTfContexts **ppEnum);
131 object,
132 uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
133 pointer_default(unique)
135 interface ITfContext : IUnknown
137 const DWORD TF_ES_ASYNCDONTCARE = 0x0;
138 const DWORD TF_ES_SYNC = 0x1;
139 const DWORD TF_ES_READ = 0x2;
140 const DWORD TF_ES_READWRITE = 0x6;
141 const DWORD TF_ES_ASYNC = 0x8;
143 HRESULT RequestEditSession(
144 [in] TfClientId tid,
145 [in] ITfEditSession *pes,
146 [in] DWORD dwFlags,
147 [out] HRESULT *phrSession);
149 HRESULT InWriteSession(
150 [in] TfClientId tid,
151 [out] BOOL *pfWriteSession);
153 typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE, TF_AE_START, TF_AE_END } TfActiveSelEnd;
155 typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
157 TfActiveSelEnd ase;
158 BOOL fInterimChar;
159 } TF_SELECTIONSTYLE;
161 typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
163 ITfRange *range;
164 TF_SELECTIONSTYLE style;
165 } TF_SELECTION;
167 const ULONG TF_DEFAULT_SELECTION = TS_DEFAULT_SELECTION;
169 HRESULT GetSelection(
170 [in] TfEditCookie ec,
171 [in] ULONG ulIndex,
172 [in] ULONG ulCount,
173 [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
174 [out] ULONG *pcFetched);
176 HRESULT SetSelection(
177 [in] TfEditCookie ec,
178 [in] ULONG ulCount,
179 [in, size_is(ulCount)] const TF_SELECTION *pSelection);
181 HRESULT GetStart(
182 [in] TfEditCookie ec,
183 [out] ITfRange **ppStart);
185 HRESULT GetEnd(
186 [in] TfEditCookie ec,
187 [out] ITfRange **ppEnd);
189 typedef [uuid(bc7d979a-846a-444d-afef-0a9bfa82b961)] TS_STATUS TF_STATUS;
190 const DWORD TF_SD_READONLY = TS_SD_READONLY;
191 const DWORD TF_SD_LOADING = TS_SD_LOADING;
192 const DWORD TF_SS_DISJOINTSEL = TS_SS_DISJOINTSEL;
193 const DWORD TF_SS_REGIONS = TS_SS_REGIONS;
194 const DWORD TF_SS_TRANSITORY = TS_SS_TRANSITORY;
197 HRESULT GetActiveView(
198 [out] ITfContextView **ppView);
200 HRESULT EnumViews(
201 [out] IEnumTfContextViews **ppEnum);
203 HRESULT GetStatus(
204 [out] TF_STATUS *pdcs);
206 HRESULT GetProperty(
207 [in] REFGUID guidProp,
208 [out] ITfProperty **ppProp);
210 HRESULT GetAppProperty(
211 [in] REFGUID guidProp,
212 [out] ITfReadOnlyProperty **ppProp);
214 HRESULT TrackProperties(
215 [in, size_is(cProp)] const GUID **prgProp,
216 [in] ULONG cProp,
217 [in, size_is(cAppProp)] const GUID **prgAppProp,
218 [in] ULONG cAppProp,
219 [out] ITfReadOnlyProperty **ppProperty);
221 HRESULT EnumProperties(
222 [out] IEnumTfProperties **ppEnum);
224 HRESULT GetDocumentMgr(
225 [out] ITfDocumentMgr **ppDm);
227 HRESULT CreateRangeBackup(
228 [in] TfEditCookie ec,
229 [in] ITfRange *pRange,
230 [out] ITfRangeBackup **ppBackup);
235 object,
236 uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
237 pointer_default(unique)
239 interface ITfSource : IUnknown
241 HRESULT AdviseSink(
242 [in] REFIID riid,
243 [in, iid_is(riid)] IUnknown *punk,
244 [out] DWORD *pdwCookie);
246 HRESULT UnadviseSink(
247 [in] DWORD dwCookie);
251 object,
252 local,
253 uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
254 pointer_default(unique)
256 interface ITfInputProcessorProfiles : IUnknown
258 HRESULT Register(
259 [in] REFCLSID rclsid);
261 HRESULT Unregister(
262 [in] REFCLSID rclsid);
264 HRESULT AddLanguageProfile(
265 [in] REFCLSID rclsid,
266 [in] LANGID langid,
267 [in] REFGUID guidProfile,
268 [in, size_is(cchDesc)] const WCHAR *pchDesc,
269 [in] ULONG cchDesc,
270 [in, size_is(cchFile)] const WCHAR *pchIconFile,
271 [in] ULONG cchFile,
272 [in] ULONG uIconIndex);
274 HRESULT RemoveLanguageProfile(
275 [in] REFCLSID rclsid,
276 [in] LANGID langid,
277 [in] REFGUID guidProfile);
279 HRESULT EnumInputProcessorInfo(
280 [out] IEnumGUID **ppEnum);
282 HRESULT GetDefaultLanguageProfile(
283 [in] LANGID langid,
284 [in] REFGUID catid,
285 [out] CLSID *pclsid,
286 [out] GUID *pguidProfile);
288 HRESULT SetDefaultLanguageProfile(
289 [in] LANGID langid,
290 [in] REFCLSID rclsid,
291 [in] REFGUID guidProfiles);
293 HRESULT ActivateLanguageProfile(
294 [in] REFCLSID rclsid,
295 [in] LANGID langid,
296 [in] REFGUID guidProfiles);
298 HRESULT GetActiveLanguageProfile(
299 [in] REFCLSID rclsid,
300 [out] LANGID *plangid,
301 [out] GUID *pguidProfile);
303 HRESULT GetLanguageProfileDescription(
304 [in] REFCLSID rclsid,
305 [in] LANGID langid,
306 [in] REFGUID guidProfile,
307 [out] BSTR *pbstrProfile);
309 HRESULT GetCurrentLanguage(
310 [out] LANGID *plangid);
312 HRESULT ChangeCurrentLanguage(
313 [in] LANGID langid);
315 HRESULT GetLanguageList(
316 [out] LANGID **ppLangId,
317 [out] ULONG *pulCount);
319 HRESULT EnumLanguageProfiles(
320 [in] LANGID langid,
321 [out] IEnumTfLanguageProfiles **ppEnum);
323 HRESULT EnableLanguageProfile(
324 [in] REFCLSID rclsid,
325 [in] LANGID langid,
326 [in] REFGUID guidProfile,
327 [in] BOOL fEnable);
329 HRESULT IsEnabledLanguageProfile(
330 [in] REFCLSID rclsid,
331 [in] LANGID langid,
332 [in] REFGUID guidProfile,
333 [out] BOOL *pfEnable);
335 HRESULT EnableLanguageProfileByDefault(
336 [in] REFCLSID rclsid,
337 [in] LANGID langid,
338 [in] REFGUID guidProfile,
339 [in] BOOL fEnable);
341 HRESULT SubstituteKeyboardLayout(
342 [in] REFCLSID rclsid,
343 [in] LANGID langid,
344 [in] REFGUID guidProfile,
345 [in] HKL hKL);
349 object,
350 local,
351 uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
352 pointer_default(unique)
354 interface ITfCategoryMgr : IUnknown
356 HRESULT RegisterCategory([in] REFCLSID rclsid,
357 [in] REFGUID rcatid,
358 [in] REFGUID rguid);
360 HRESULT UnregisterCategory([in] REFCLSID rclsid,
361 [in] REFGUID rcatid,
362 [in] REFGUID rguid);
364 HRESULT EnumCategoriesInItem([in] REFGUID rguid,
365 [out] IEnumGUID **ppEnum);
367 HRESULT EnumItemsInCategory([in] REFGUID rcatid,
368 [out] IEnumGUID **ppEnum);
370 HRESULT FindClosestCategory([in] REFGUID rguid,
371 [out] GUID *pcatid,
372 [in, size_is(ulCount)] const GUID **ppcatidList,
373 [in] ULONG ulCount);
375 HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
376 [in] REFGUID rguid,
377 [in, size_is(cch)] const WCHAR *pchDesc,
378 [in] ULONG cch);
380 HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
381 [in] REFGUID rguid);
383 HRESULT GetGUIDDescription([in] REFGUID rguid,
384 [out] BSTR *pbstrDesc);
386 HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
387 [in] REFGUID rguid,
388 [in] DWORD dw);
390 HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
391 [in] REFGUID rguid);
393 HRESULT GetGUIDDWORD([in] REFGUID rguid,
394 [out] DWORD *pdw);
396 HRESULT RegisterGUID([in] REFGUID rguid,
397 [out] TfGuidAtom *pguidatom);
399 HRESULT GetGUID([in] TfGuidAtom guidatom,
400 [out] GUID *pguid);
402 HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
403 [in] REFGUID rguid,
404 [out] BOOL *pfEqual);
408 object,
409 uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
410 pointer_default(unique)
412 interface ITfTextEditSink : IUnknown
414 HRESULT OnEndEdit(
415 [in] ITfContext *pic,
416 [in] TfEditCookie ecReadOnly,
417 [in] ITfEditRecord *pEditRecord);
421 object,
422 uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
423 pointer_default(unique)
425 interface ITfContextOwnerCompositionSink : IUnknown
427 HRESULT OnStartComposition(
428 [in] ITfCompositionView *pComposition,
429 [out] BOOL *pfOk);
431 HRESULT OnUpdateComposition(
432 [in] ITfCompositionView *pComposition,
433 [in] ITfRange *pRangeNew);
435 HRESULT OnEndComposition(
436 [in] ITfCompositionView *pComposition);