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
22 import "textstor.idl";
23 /* import "ctfutb.idl"; */
26 cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
27 cpp_quote("#define TF_E_ALREADY_EXISTS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0506)")
28 cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
29 cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
30 cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
32 /* GUIDs for Categories */
33 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
34 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
35 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
36 cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
38 typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie;
39 typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
40 typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
42 cpp_quote("#define TF_MOD_ALT 0x0001")
43 cpp_quote("#define TF_MOD_CONTROL 0x0002")
44 cpp_quote("#define TF_MOD_SHIFT 0x0004")
45 cpp_quote("#define TF_MOD_RALT 0x0008")
46 cpp_quote("#define TF_MOD_RCONTROL 0x0010")
47 cpp_quote("#define TF_MOD_RSHIFT 0x0020")
48 cpp_quote("#define TF_MOD_LALT 0x0040")
49 cpp_quote("#define TF_MOD_LCONTROL 0x0080")
50 cpp_quote("#define TF_MOD_LSHIFT 0x0100")
51 cpp_quote("#define TF_MOD_ON_KEYUP 0x0200")
52 cpp_quote("#define TF_MOD_IGNORE_ALL_MODIFIER 0x0400")
54 interface ITfDocumentMgr;
56 interface IEnumTfDocumentMgrs;
57 interface IEnumTfContexts;
58 interface ITfFunctionProvider;
59 interface IEnumTfFunctionProviders;
60 interface ITfCompartmentMgr;
61 interface ITfEditSession;
63 interface ITfContextView;
64 interface IEnumTfContextViews;
65 interface ITfProperty;
66 interface ITfReadOnlyProperty;
67 interface IEnumTfProperties;
68 interface ITfRangeBackup;
69 interface IEnumTfLanguageProfiles;
70 interface ITfEditRecord;
71 interface ITfCompositionView;
72 interface ITfKeyEventSink;
74 typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
83 typedef [uuid(77c12f95-b783-450d-879f-1cd2362c6521)] struct TF_PRESERVEDKEY
91 uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
92 pointer_default(unique)
94 interface ITfThreadMgr: IUnknown
97 [out] TfClientId *ptid);
101 HRESULT CreateDocumentMgr(
102 [out] ITfDocumentMgr **ppdim);
104 HRESULT EnumDocumentMgrs(
105 [out] IEnumTfDocumentMgrs **ppEnum);
108 [out] ITfDocumentMgr **ppdimFocus);
111 [in] ITfDocumentMgr *pdimFocus);
113 HRESULT AssociateFocus(
115 [in, unique] ITfDocumentMgr *pdimNew,
116 [out] ITfDocumentMgr **ppdimPrev);
118 HRESULT IsThreadFocus(
119 [out] BOOL *pfThreadFocus);
121 HRESULT GetFunctionProvider(
123 [out] ITfFunctionProvider **ppFuncProv);
125 HRESULT EnumFunctionProviders(
126 [out] IEnumTfFunctionProviders **ppEnum);
128 HRESULT GetGlobalCompartment(
129 [out] ITfCompartmentMgr **ppCompMgr);
135 uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
136 pointer_default(unique)
138 interface ITfDocumentMgr: IUnknown
140 HRESULT CreateContext(
141 [in] TfClientId tidOwner,
143 [in, unique] IUnknown *punk,
144 [out] ITfContext **ppic,
145 [out] TfEditCookie *pecTextStore);
148 [in] ITfContext *pic);
150 const DWORD TF_POPF_ALL = 0x0001;
156 [out] ITfContext **ppic);
159 [out] ITfContext **ppic);
161 HRESULT EnumContexts(
162 [out] IEnumTfContexts **ppEnum);
167 uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
168 pointer_default(unique)
170 interface ITfContext : IUnknown
172 const DWORD TF_ES_ASYNCDONTCARE = 0x0;
173 const DWORD TF_ES_SYNC = 0x1;
174 const DWORD TF_ES_READ = 0x2;
175 const DWORD TF_ES_READWRITE = 0x6;
176 const DWORD TF_ES_ASYNC = 0x8;
178 HRESULT RequestEditSession(
180 [in] ITfEditSession *pes,
182 [out] HRESULT *phrSession);
184 HRESULT InWriteSession(
186 [out] BOOL *pfWriteSession);
188 typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE, TF_AE_START, TF_AE_END } TfActiveSelEnd;
190 typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
196 typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
199 TF_SELECTIONSTYLE style;
202 const ULONG TF_DEFAULT_SELECTION = TS_DEFAULT_SELECTION;
204 HRESULT GetSelection(
205 [in] TfEditCookie ec,
208 [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
209 [out] ULONG *pcFetched);
211 HRESULT SetSelection(
212 [in] TfEditCookie ec,
214 [in, size_is(ulCount)] const TF_SELECTION *pSelection);
217 [in] TfEditCookie ec,
218 [out] ITfRange **ppStart);
221 [in] TfEditCookie ec,
222 [out] ITfRange **ppEnd);
224 typedef [uuid(bc7d979a-846a-444d-afef-0a9bfa82b961)] TS_STATUS TF_STATUS;
225 const DWORD TF_SD_READONLY = TS_SD_READONLY;
226 const DWORD TF_SD_LOADING = TS_SD_LOADING;
227 const DWORD TF_SS_DISJOINTSEL = TS_SS_DISJOINTSEL;
228 const DWORD TF_SS_REGIONS = TS_SS_REGIONS;
229 const DWORD TF_SS_TRANSITORY = TS_SS_TRANSITORY;
232 HRESULT GetActiveView(
233 [out] ITfContextView **ppView);
236 [out] IEnumTfContextViews **ppEnum);
239 [out] TF_STATUS *pdcs);
242 [in] REFGUID guidProp,
243 [out] ITfProperty **ppProp);
245 HRESULT GetAppProperty(
246 [in] REFGUID guidProp,
247 [out] ITfReadOnlyProperty **ppProp);
249 HRESULT TrackProperties(
250 [in, size_is(cProp)] const GUID **prgProp,
252 [in, size_is(cAppProp)] const GUID **prgAppProp,
254 [out] ITfReadOnlyProperty **ppProperty);
256 HRESULT EnumProperties(
257 [out] IEnumTfProperties **ppEnum);
259 HRESULT GetDocumentMgr(
260 [out] ITfDocumentMgr **ppDm);
262 HRESULT CreateRangeBackup(
263 [in] TfEditCookie ec,
264 [in] ITfRange *pRange,
265 [out] ITfRangeBackup **ppBackup);
271 uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
272 pointer_default(unique)
274 interface ITfSource : IUnknown
278 [in, iid_is(riid)] IUnknown *punk,
279 [out] DWORD *pdwCookie);
281 HRESULT UnadviseSink(
282 [in] DWORD dwCookie);
288 uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
289 pointer_default(unique)
291 interface ITfInputProcessorProfiles : IUnknown
294 [in] REFCLSID rclsid);
297 [in] REFCLSID rclsid);
299 HRESULT AddLanguageProfile(
300 [in] REFCLSID rclsid,
302 [in] REFGUID guidProfile,
303 [in, size_is(cchDesc)] const WCHAR *pchDesc,
305 [in, size_is(cchFile)] const WCHAR *pchIconFile,
307 [in] ULONG uIconIndex);
309 HRESULT RemoveLanguageProfile(
310 [in] REFCLSID rclsid,
312 [in] REFGUID guidProfile);
314 HRESULT EnumInputProcessorInfo(
315 [out] IEnumGUID **ppEnum);
317 HRESULT GetDefaultLanguageProfile(
321 [out] GUID *pguidProfile);
323 HRESULT SetDefaultLanguageProfile(
325 [in] REFCLSID rclsid,
326 [in] REFGUID guidProfiles);
328 HRESULT ActivateLanguageProfile(
329 [in] REFCLSID rclsid,
331 [in] REFGUID guidProfiles);
333 HRESULT GetActiveLanguageProfile(
334 [in] REFCLSID rclsid,
335 [out] LANGID *plangid,
336 [out] GUID *pguidProfile);
338 HRESULT GetLanguageProfileDescription(
339 [in] REFCLSID rclsid,
341 [in] REFGUID guidProfile,
342 [out] BSTR *pbstrProfile);
344 HRESULT GetCurrentLanguage(
345 [out] LANGID *plangid);
347 HRESULT ChangeCurrentLanguage(
350 HRESULT GetLanguageList(
351 [out] LANGID **ppLangId,
352 [out] ULONG *pulCount);
354 HRESULT EnumLanguageProfiles(
356 [out] IEnumTfLanguageProfiles **ppEnum);
358 HRESULT EnableLanguageProfile(
359 [in] REFCLSID rclsid,
361 [in] REFGUID guidProfile,
364 HRESULT IsEnabledLanguageProfile(
365 [in] REFCLSID rclsid,
367 [in] REFGUID guidProfile,
368 [out] BOOL *pfEnable);
370 HRESULT EnableLanguageProfileByDefault(
371 [in] REFCLSID rclsid,
373 [in] REFGUID guidProfile,
376 HRESULT SubstituteKeyboardLayout(
377 [in] REFCLSID rclsid,
379 [in] REFGUID guidProfile,
386 uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
387 pointer_default(unique)
389 interface ITfCategoryMgr : IUnknown
391 HRESULT RegisterCategory([in] REFCLSID rclsid,
395 HRESULT UnregisterCategory([in] REFCLSID rclsid,
399 HRESULT EnumCategoriesInItem([in] REFGUID rguid,
400 [out] IEnumGUID **ppEnum);
402 HRESULT EnumItemsInCategory([in] REFGUID rcatid,
403 [out] IEnumGUID **ppEnum);
405 HRESULT FindClosestCategory([in] REFGUID rguid,
407 [in, size_is(ulCount)] const GUID **ppcatidList,
410 HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
412 [in, size_is(cch)] const WCHAR *pchDesc,
415 HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
418 HRESULT GetGUIDDescription([in] REFGUID rguid,
419 [out] BSTR *pbstrDesc);
421 HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
425 HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
428 HRESULT GetGUIDDWORD([in] REFGUID rguid,
431 HRESULT RegisterGUID([in] REFGUID rguid,
432 [out] TfGuidAtom *pguidatom);
434 HRESULT GetGUID([in] TfGuidAtom guidatom,
437 HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
439 [out] BOOL *pfEqual);
444 uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
445 pointer_default(unique)
447 interface ITfTextEditSink : IUnknown
450 [in] ITfContext *pic,
451 [in] TfEditCookie ecReadOnly,
452 [in] ITfEditRecord *pEditRecord);
457 uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
458 pointer_default(unique)
460 interface ITfContextOwnerCompositionSink : IUnknown
462 HRESULT OnStartComposition(
463 [in] ITfCompositionView *pComposition,
466 HRESULT OnUpdateComposition(
467 [in] ITfCompositionView *pComposition,
468 [in] ITfRange *pRangeNew);
470 HRESULT OnEndComposition(
471 [in] ITfCompositionView *pComposition);
476 uuid(3d61bf11-ac5f-42c8-a4cb-931bcc28c744),
477 pointer_default(unique)
479 interface IEnumTfLanguageProfiles : IUnknown
482 [out] IEnumTfLanguageProfiles **ppEnum);
486 [out, size_is(ulCount), length_is(*pcFetch)] TF_LANGUAGEPROFILE *pProfile,
487 [out] ULONG *pcFetch);
498 uuid(aa80e7f7-2021-11d2-93e0-0060b067b86e),
499 pointer_default(unique)
501 interface ITfTextInputProcessor : IUnknown
504 [in] ITfThreadMgr *ptim,
505 [in] TfClientId tid);
507 HRESULT Deactivate();
512 uuid(aa80e80e-2021-11d2-93e0-0060b067b86e),
513 pointer_default(unique)
515 interface ITfThreadMgrEventSink : IUnknown
517 HRESULT OnInitDocumentMgr(
518 [in] ITfDocumentMgr *pdim);
520 HRESULT OnUninitDocumentMgr(
521 [in] ITfDocumentMgr *pdim);
524 [in] ITfDocumentMgr *pdimFocus,
525 [in] ITfDocumentMgr *pdimPrevFocus);
527 HRESULT OnPushContext(
528 [in] ITfContext *pic);
530 HRESULT OnPopContext(
531 [in] ITfContext *pic);
537 uuid(aa80e7f0-2021-11d2-93e0-0060b067b86e),
538 pointer_default(unique)
540 interface ITfKeystrokeMgr : IUnknown
542 HRESULT AdviseKeyEventSink(
544 [in] ITfKeyEventSink *pSink,
545 [in] BOOL fForeground);
547 HRESULT UnadviseKeyEventSink(
548 [in] TfClientId tid);
550 HRESULT GetForeground(
551 [out] CLSID *pclsid);
556 [out] BOOL *pfEaten);
561 [out] BOOL *pfEaten);
566 [out] BOOL *pfEaten);
571 [out] BOOL *pfEaten);
573 HRESULT GetPreservedKey(
574 [in] ITfContext *pic,
575 [in] const TF_PRESERVEDKEY *pprekey,
578 HRESULT IsPreservedKey(
580 [in] const TF_PRESERVEDKEY *pprekey,
581 [out] BOOL *pfRegistered);
586 [in] const TF_PRESERVEDKEY *prekey,
587 [in, size_is(cchDesc)] const WCHAR *pchDesc,
590 HRESULT UnpreserveKey(
592 [in] const TF_PRESERVEDKEY *pprekey);
594 HRESULT SetPreservedKeyDescription(
596 [in, size_is(cchDesc)] const WCHAR *pchDesc,
599 HRESULT GetPreservedKeyDescription(
601 [out] BSTR *pbstrDesc);
603 HRESULT SimulatePreservedKey(
604 [in] ITfContext *pic,
606 [out] BOOL *pfEaten);
612 uuid(aa80e7f5-2021-11d2-93e0-0060b067b86e),
613 pointer_default(unique)
615 interface ITfKeyEventSink : IUnknown
618 [in] BOOL fForeground);
620 HRESULT OnTestKeyDown(
621 [in] ITfContext *pic,
624 [out] BOOL *pfEaten);
627 [in] ITfContext *pic,
630 [out] BOOL *pfEaten);
633 [in] ITfContext *pic,
636 [out] BOOL *pfEaten);
639 [in] ITfContext *pic,
642 [out] BOOL *pfEaten);
644 HRESULT OnPreservedKey(
645 [in] ITfContext *pic,
647 [out] BOOL *pfEaten);