push 7bb4e6a724086e39bb3a77eb03fa4dcdb495b071
[wine/hacks.git] / include / msctf.idl
blob40853eea2820f17293e68422e424e6dae841d9f4
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
25 cpp_quote("#include <winuser.h>")
27 cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
28 cpp_quote("#define TF_E_ALREADY_EXISTS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0506)")
29 cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
30 cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
31 cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
33 /* GUIDs for Categories */
34 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
35 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
36 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
37 cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
39 typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie;
40 typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
41 typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
43 cpp_quote("#define TF_MOD_ALT 0x0001")
44 cpp_quote("#define TF_MOD_CONTROL 0x0002")
45 cpp_quote("#define TF_MOD_SHIFT 0x0004")
46 cpp_quote("#define TF_MOD_RALT 0x0008")
47 cpp_quote("#define TF_MOD_RCONTROL 0x0010")
48 cpp_quote("#define TF_MOD_RSHIFT 0x0020")
49 cpp_quote("#define TF_MOD_LALT 0x0040")
50 cpp_quote("#define TF_MOD_LCONTROL 0x0080")
51 cpp_quote("#define TF_MOD_LSHIFT 0x0100")
52 cpp_quote("#define TF_MOD_ON_KEYUP 0x0200")
53 cpp_quote("#define TF_MOD_IGNORE_ALL_MODIFIER 0x0400")
55 interface ITfDocumentMgr;
56 interface ITfContext;
57 interface IEnumTfDocumentMgrs;
58 interface IEnumTfContexts;
59 interface ITfFunctionProvider;
60 interface IEnumTfFunctionProviders;
61 interface ITfCompartmentMgr;
62 interface ITfEditSession;
63 interface ITfRange;
64 interface ITfContextView;
65 interface IEnumTfContextViews;
66 interface ITfProperty;
67 interface ITfReadOnlyProperty;
68 interface IEnumTfProperties;
69 interface ITfRangeBackup;
70 interface IEnumTfLanguageProfiles;
71 interface ITfEditRecord;
72 interface ITfCompositionView;
73 interface ITfKeyEventSink;
75 typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
77 CLSID clsid;
78 LANGID langid;
79 GUID catid;
80 BOOL fActive;
81 GUID guidProfile;
82 } TF_LANGUAGEPROFILE;
84 typedef [uuid(77c12f95-b783-450d-879f-1cd2362c6521)] struct TF_PRESERVEDKEY
86 UINT uVKey;
87 UINT uModifiers;
88 } TF_PRESERVEDKEY;
91 object,
92 uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
93 pointer_default(unique)
95 interface ITfThreadMgr: IUnknown
97 HRESULT Activate(
98 [out] TfClientId *ptid);
100 HRESULT Deactivate();
102 HRESULT CreateDocumentMgr(
103 [out] ITfDocumentMgr **ppdim);
105 HRESULT EnumDocumentMgrs(
106 [out] IEnumTfDocumentMgrs **ppEnum);
108 HRESULT GetFocus(
109 [out] ITfDocumentMgr **ppdimFocus);
111 HRESULT SetFocus(
112 [in] ITfDocumentMgr *pdimFocus);
114 HRESULT AssociateFocus(
115 [in] HWND hwnd,
116 [in, unique] ITfDocumentMgr *pdimNew,
117 [out] ITfDocumentMgr **ppdimPrev);
119 HRESULT IsThreadFocus(
120 [out] BOOL *pfThreadFocus);
122 HRESULT GetFunctionProvider(
123 [in] REFCLSID clsid,
124 [out] ITfFunctionProvider **ppFuncProv);
126 HRESULT EnumFunctionProviders(
127 [out] IEnumTfFunctionProviders **ppEnum);
129 HRESULT GetGlobalCompartment(
130 [out] ITfCompartmentMgr **ppCompMgr);
135 object,
136 uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
137 pointer_default(unique)
139 interface ITfDocumentMgr: IUnknown
141 HRESULT CreateContext(
142 [in] TfClientId tidOwner,
143 [in] DWORD dwFlags,
144 [in, unique] IUnknown *punk,
145 [out] ITfContext **ppic,
146 [out] TfEditCookie *pecTextStore);
148 HRESULT Push(
149 [in] ITfContext *pic);
151 const DWORD TF_POPF_ALL = 0x0001;
153 HRESULT Pop(
154 [in] DWORD dwFlags);
156 HRESULT GetTop(
157 [out] ITfContext **ppic);
159 HRESULT GetBase(
160 [out] ITfContext **ppic);
162 HRESULT EnumContexts(
163 [out] IEnumTfContexts **ppEnum);
167 object,
168 uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
169 pointer_default(unique)
171 interface ITfContext : IUnknown
173 const DWORD TF_ES_ASYNCDONTCARE = 0x0;
174 const DWORD TF_ES_SYNC = 0x1;
175 const DWORD TF_ES_READ = 0x2;
176 const DWORD TF_ES_READWRITE = 0x6;
177 const DWORD TF_ES_ASYNC = 0x8;
179 HRESULT RequestEditSession(
180 [in] TfClientId tid,
181 [in] ITfEditSession *pes,
182 [in] DWORD dwFlags,
183 [out] HRESULT *phrSession);
185 HRESULT InWriteSession(
186 [in] TfClientId tid,
187 [out] BOOL *pfWriteSession);
189 typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE, TF_AE_START, TF_AE_END } TfActiveSelEnd;
191 typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
193 TfActiveSelEnd ase;
194 BOOL fInterimChar;
195 } TF_SELECTIONSTYLE;
197 typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
199 ITfRange *range;
200 TF_SELECTIONSTYLE style;
201 } TF_SELECTION;
203 const ULONG TF_DEFAULT_SELECTION = TS_DEFAULT_SELECTION;
205 HRESULT GetSelection(
206 [in] TfEditCookie ec,
207 [in] ULONG ulIndex,
208 [in] ULONG ulCount,
209 [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
210 [out] ULONG *pcFetched);
212 HRESULT SetSelection(
213 [in] TfEditCookie ec,
214 [in] ULONG ulCount,
215 [in, size_is(ulCount)] const TF_SELECTION *pSelection);
217 HRESULT GetStart(
218 [in] TfEditCookie ec,
219 [out] ITfRange **ppStart);
221 HRESULT GetEnd(
222 [in] TfEditCookie ec,
223 [out] ITfRange **ppEnd);
225 typedef [uuid(bc7d979a-846a-444d-afef-0a9bfa82b961)] TS_STATUS TF_STATUS;
226 const DWORD TF_SD_READONLY = TS_SD_READONLY;
227 const DWORD TF_SD_LOADING = TS_SD_LOADING;
228 const DWORD TF_SS_DISJOINTSEL = TS_SS_DISJOINTSEL;
229 const DWORD TF_SS_REGIONS = TS_SS_REGIONS;
230 const DWORD TF_SS_TRANSITORY = TS_SS_TRANSITORY;
233 HRESULT GetActiveView(
234 [out] ITfContextView **ppView);
236 HRESULT EnumViews(
237 [out] IEnumTfContextViews **ppEnum);
239 HRESULT GetStatus(
240 [out] TF_STATUS *pdcs);
242 HRESULT GetProperty(
243 [in] REFGUID guidProp,
244 [out] ITfProperty **ppProp);
246 HRESULT GetAppProperty(
247 [in] REFGUID guidProp,
248 [out] ITfReadOnlyProperty **ppProp);
250 HRESULT TrackProperties(
251 [in, size_is(cProp)] const GUID **prgProp,
252 [in] ULONG cProp,
253 [in, size_is(cAppProp)] const GUID **prgAppProp,
254 [in] ULONG cAppProp,
255 [out] ITfReadOnlyProperty **ppProperty);
257 HRESULT EnumProperties(
258 [out] IEnumTfProperties **ppEnum);
260 HRESULT GetDocumentMgr(
261 [out] ITfDocumentMgr **ppDm);
263 HRESULT CreateRangeBackup(
264 [in] TfEditCookie ec,
265 [in] ITfRange *pRange,
266 [out] ITfRangeBackup **ppBackup);
271 object,
272 uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
273 pointer_default(unique)
275 interface ITfSource : IUnknown
277 HRESULT AdviseSink(
278 [in] REFIID riid,
279 [in, iid_is(riid)] IUnknown *punk,
280 [out] DWORD *pdwCookie);
282 HRESULT UnadviseSink(
283 [in] DWORD dwCookie);
287 object,
288 local,
289 uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
290 pointer_default(unique)
292 interface ITfInputProcessorProfiles : IUnknown
294 HRESULT Register(
295 [in] REFCLSID rclsid);
297 HRESULT Unregister(
298 [in] REFCLSID rclsid);
300 HRESULT AddLanguageProfile(
301 [in] REFCLSID rclsid,
302 [in] LANGID langid,
303 [in] REFGUID guidProfile,
304 [in, size_is(cchDesc)] const WCHAR *pchDesc,
305 [in] ULONG cchDesc,
306 [in, size_is(cchFile)] const WCHAR *pchIconFile,
307 [in] ULONG cchFile,
308 [in] ULONG uIconIndex);
310 HRESULT RemoveLanguageProfile(
311 [in] REFCLSID rclsid,
312 [in] LANGID langid,
313 [in] REFGUID guidProfile);
315 HRESULT EnumInputProcessorInfo(
316 [out] IEnumGUID **ppEnum);
318 HRESULT GetDefaultLanguageProfile(
319 [in] LANGID langid,
320 [in] REFGUID catid,
321 [out] CLSID *pclsid,
322 [out] GUID *pguidProfile);
324 HRESULT SetDefaultLanguageProfile(
325 [in] LANGID langid,
326 [in] REFCLSID rclsid,
327 [in] REFGUID guidProfiles);
329 HRESULT ActivateLanguageProfile(
330 [in] REFCLSID rclsid,
331 [in] LANGID langid,
332 [in] REFGUID guidProfiles);
334 HRESULT GetActiveLanguageProfile(
335 [in] REFCLSID rclsid,
336 [out] LANGID *plangid,
337 [out] GUID *pguidProfile);
339 HRESULT GetLanguageProfileDescription(
340 [in] REFCLSID rclsid,
341 [in] LANGID langid,
342 [in] REFGUID guidProfile,
343 [out] BSTR *pbstrProfile);
345 HRESULT GetCurrentLanguage(
346 [out] LANGID *plangid);
348 HRESULT ChangeCurrentLanguage(
349 [in] LANGID langid);
351 HRESULT GetLanguageList(
352 [out] LANGID **ppLangId,
353 [out] ULONG *pulCount);
355 HRESULT EnumLanguageProfiles(
356 [in] LANGID langid,
357 [out] IEnumTfLanguageProfiles **ppEnum);
359 HRESULT EnableLanguageProfile(
360 [in] REFCLSID rclsid,
361 [in] LANGID langid,
362 [in] REFGUID guidProfile,
363 [in] BOOL fEnable);
365 HRESULT IsEnabledLanguageProfile(
366 [in] REFCLSID rclsid,
367 [in] LANGID langid,
368 [in] REFGUID guidProfile,
369 [out] BOOL *pfEnable);
371 HRESULT EnableLanguageProfileByDefault(
372 [in] REFCLSID rclsid,
373 [in] LANGID langid,
374 [in] REFGUID guidProfile,
375 [in] BOOL fEnable);
377 HRESULT SubstituteKeyboardLayout(
378 [in] REFCLSID rclsid,
379 [in] LANGID langid,
380 [in] REFGUID guidProfile,
381 [in] HKL hKL);
385 object,
386 local,
387 uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
388 pointer_default(unique)
390 interface ITfCategoryMgr : IUnknown
392 HRESULT RegisterCategory([in] REFCLSID rclsid,
393 [in] REFGUID rcatid,
394 [in] REFGUID rguid);
396 HRESULT UnregisterCategory([in] REFCLSID rclsid,
397 [in] REFGUID rcatid,
398 [in] REFGUID rguid);
400 HRESULT EnumCategoriesInItem([in] REFGUID rguid,
401 [out] IEnumGUID **ppEnum);
403 HRESULT EnumItemsInCategory([in] REFGUID rcatid,
404 [out] IEnumGUID **ppEnum);
406 HRESULT FindClosestCategory([in] REFGUID rguid,
407 [out] GUID *pcatid,
408 [in, size_is(ulCount)] const GUID **ppcatidList,
409 [in] ULONG ulCount);
411 HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
412 [in] REFGUID rguid,
413 [in, size_is(cch)] const WCHAR *pchDesc,
414 [in] ULONG cch);
416 HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
417 [in] REFGUID rguid);
419 HRESULT GetGUIDDescription([in] REFGUID rguid,
420 [out] BSTR *pbstrDesc);
422 HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
423 [in] REFGUID rguid,
424 [in] DWORD dw);
426 HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
427 [in] REFGUID rguid);
429 HRESULT GetGUIDDWORD([in] REFGUID rguid,
430 [out] DWORD *pdw);
432 HRESULT RegisterGUID([in] REFGUID rguid,
433 [out] TfGuidAtom *pguidatom);
435 HRESULT GetGUID([in] TfGuidAtom guidatom,
436 [out] GUID *pguid);
438 HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
439 [in] REFGUID rguid,
440 [out] BOOL *pfEqual);
444 object,
445 uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
446 pointer_default(unique)
448 interface ITfTextEditSink : IUnknown
450 HRESULT OnEndEdit(
451 [in] ITfContext *pic,
452 [in] TfEditCookie ecReadOnly,
453 [in] ITfEditRecord *pEditRecord);
457 object,
458 uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
459 pointer_default(unique)
461 interface ITfContextOwnerCompositionSink : IUnknown
463 HRESULT OnStartComposition(
464 [in] ITfCompositionView *pComposition,
465 [out] BOOL *pfOk);
467 HRESULT OnUpdateComposition(
468 [in] ITfCompositionView *pComposition,
469 [in] ITfRange *pRangeNew);
471 HRESULT OnEndComposition(
472 [in] ITfCompositionView *pComposition);
476 object,
477 uuid(3d61bf11-ac5f-42c8-a4cb-931bcc28c744),
478 pointer_default(unique)
480 interface IEnumTfLanguageProfiles : IUnknown
482 HRESULT Clone(
483 [out] IEnumTfLanguageProfiles **ppEnum);
485 HRESULT Next(
486 [in] ULONG ulCount,
487 [out, size_is(ulCount), length_is(*pcFetch)] TF_LANGUAGEPROFILE *pProfile,
488 [out] ULONG *pcFetch);
490 HRESULT Reset();
492 HRESULT Skip(
493 [in] ULONG ulCount);
497 object,
498 local,
499 uuid(aa80e7f7-2021-11d2-93e0-0060b067b86e),
500 pointer_default(unique)
502 interface ITfTextInputProcessor : IUnknown
504 HRESULT Activate(
505 [in] ITfThreadMgr *ptim,
506 [in] TfClientId tid);
508 HRESULT Deactivate();
512 object,
513 uuid(aa80e80e-2021-11d2-93e0-0060b067b86e),
514 pointer_default(unique)
516 interface ITfThreadMgrEventSink : IUnknown
518 HRESULT OnInitDocumentMgr(
519 [in] ITfDocumentMgr *pdim);
521 HRESULT OnUninitDocumentMgr(
522 [in] ITfDocumentMgr *pdim);
524 HRESULT OnSetFocus(
525 [in] ITfDocumentMgr *pdimFocus,
526 [in] ITfDocumentMgr *pdimPrevFocus);
528 HRESULT OnPushContext(
529 [in] ITfContext *pic);
531 HRESULT OnPopContext(
532 [in] ITfContext *pic);
536 object,
537 local,
538 uuid(aa80e7f0-2021-11d2-93e0-0060b067b86e),
539 pointer_default(unique)
541 interface ITfKeystrokeMgr : IUnknown
543 HRESULT AdviseKeyEventSink(
544 [in] TfClientId tid,
545 [in] ITfKeyEventSink *pSink,
546 [in] BOOL fForeground);
548 HRESULT UnadviseKeyEventSink(
549 [in] TfClientId tid);
551 HRESULT GetForeground(
552 [out] CLSID *pclsid);
554 HRESULT TestKeyDown(
555 [in] WPARAM wParam,
556 [in] LPARAM lParam,
557 [out] BOOL *pfEaten);
559 HRESULT TestKeyUp(
560 [in] WPARAM wParam,
561 [in] LPARAM lParam,
562 [out] BOOL *pfEaten);
564 HRESULT KeyDown(
565 [in] WPARAM wParam,
566 [in] LPARAM lParam,
567 [out] BOOL *pfEaten);
569 HRESULT KeyUp(
570 [in] WPARAM wParam,
571 [in] LPARAM lParam,
572 [out] BOOL *pfEaten);
574 HRESULT GetPreservedKey(
575 [in] ITfContext *pic,
576 [in] const TF_PRESERVEDKEY *pprekey,
577 [out] GUID *pguid);
579 HRESULT IsPreservedKey(
580 [in] REFGUID rguid,
581 [in] const TF_PRESERVEDKEY *pprekey,
582 [out] BOOL *pfRegistered);
584 HRESULT PreserveKey(
585 [in] TfClientId tid,
586 [in] REFGUID rguid,
587 [in] const TF_PRESERVEDKEY *prekey,
588 [in, size_is(cchDesc)] const WCHAR *pchDesc,
589 [in] ULONG cchDesc);
591 HRESULT UnpreserveKey(
592 [in] REFGUID rguid,
593 [in] const TF_PRESERVEDKEY *pprekey);
595 HRESULT SetPreservedKeyDescription(
596 [in] REFGUID rguid,
597 [in, size_is(cchDesc)] const WCHAR *pchDesc,
598 [in] ULONG cchDesc);
600 HRESULT GetPreservedKeyDescription(
601 [in] REFGUID rguid,
602 [out] BSTR *pbstrDesc);
604 HRESULT SimulatePreservedKey(
605 [in] ITfContext *pic,
606 [in] REFGUID rguid,
607 [out] BOOL *pfEaten);
611 object,
612 local,
613 uuid(aa80e7f5-2021-11d2-93e0-0060b067b86e),
614 pointer_default(unique)
616 interface ITfKeyEventSink : IUnknown
618 HRESULT OnSetFocus(
619 [in] BOOL fForeground);
621 HRESULT OnTestKeyDown(
622 [in] ITfContext *pic,
623 [in] WPARAM wParam,
624 [in] LPARAM lParam,
625 [out] BOOL *pfEaten);
627 HRESULT OnTestKeyUp(
628 [in] ITfContext *pic,
629 [in] WPARAM wParam,
630 [in] LPARAM lParam,
631 [out] BOOL *pfEaten);
633 HRESULT OnKeyDown(
634 [in] ITfContext *pic,
635 [in] WPARAM wParam,
636 [in] LPARAM lParam,
637 [out] BOOL *pfEaten);
639 HRESULT OnKeyUp(
640 [in] ITfContext *pic,
641 [in] WPARAM wParam,
642 [in] LPARAM lParam,
643 [out] BOOL *pfEaten);
645 HRESULT OnPreservedKey(
646 [in] ITfContext *pic,
647 [in] REFGUID rguid,
648 [out] BOOL *pfEaten);
652 object,
653 local,
654 uuid(8f1b8ad8-0b6b-4874-90c5-bd76011e8f7c),
655 pointer_default(unique)
657 interface ITfMessagePump : IUnknown
659 HRESULT PeekMessageA(
660 [out] LPMSG pMsg,
661 [in] HWND hwnd,
662 [in] UINT wMsgFilterMin,
663 [in] UINT wMsgFilterMax,
664 [in] UINT wRemoveMsg,
665 [out] BOOL *pfResult);
667 HRESULT GetMessageA(
668 [out] LPMSG pMsg,
669 [in] HWND hwnd,
670 [in] UINT wMsgFilterMin,
671 [in] UINT wMsgFilterMax,
672 [out] BOOL *pfResult);
674 HRESULT PeekMessageW(
675 [out] LPMSG pMsg,
676 [in] HWND hwnd,
677 [in] UINT wMsgFilterMin,
678 [in] UINT wMsgFilterMax,
679 [in] UINT wRemoveMsg,
680 [out] BOOL *pfResult);
682 HRESULT GetMessageW(
683 [out] LPMSG pMsg,
684 [in] HWND hwnd,
685 [in] UINT wMsgFilterMin,
686 [in] UINT wMsgFilterMax,
687 [out] BOOL *pfResult);
691 object,
692 local,
693 uuid(d60a7b49-1b9f-4be2-b702-47e9dc05dec3),
694 pointer_default(unique)
696 interface ITfClientId : IUnknown
698 HRESULT GetClientId(
699 [in] REFCLSID rclsid,
700 [out] TfClientId *ptid);
704 object,
705 uuid(43c9fe15-f494-4c17-9de2-b8a4ac350aa8),
706 pointer_default(unique)
708 interface ITfLanguageProfileNotifySink : IUnknown
710 HRESULT OnLanguageChange(
711 [in] LANGID langid,
712 [out] BOOL *pfAccept);
714 HRESULT OnLanguageChanged();