wininet: Use address length returned by GetAddress in NETCON_connect.
[wine] / include / msctf.idl
1 /*
2  * Copyright 2008 Aric Stewart, CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
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>")
26
27 cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
28 cpp_quote("#define TF_E_DISCONNECTED    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0504)")
29 cpp_quote("#define TF_E_ALREADY_EXISTS  MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0506)")
30 cpp_quote("#define TF_E_NOLOCK          MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0201)")
31
32 cpp_quote("HRESULT WINAPI TF_CreateThreadMgr(ITfThreadMgr **pptim);")
33 cpp_quote("HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim);")
34 cpp_quote("HRESULT WINAPI TF_CreateInputProcessorProfiles(ITfInputProcessorProfiles **ppipr);")
35
36 cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
37 cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
38 cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
39
40 /* GUIDs for Compartments */
41 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_KEYBOARD_DISABLED;")
42 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_KEYBOARD_OPENCLOSE;")
43 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_HANDWRITING_OPENCLOSE;")
44 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_DISABLED;")
45 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_OPENCLOSE;")
46 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_GLOBALSTATE;")
47 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_PERSISTMENUENABLED;")
48 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_EMPTYCONTEXT;")
49 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_TIPUISTATUS;")
50
51 /* GUIDs for Categories */
52 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
53 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
54 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
55 cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
56
57 typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)]  DWORD TfEditCookie;
58 typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
59 typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
60
61 cpp_quote("#define TF_MOD_ALT                   0x0001")
62 cpp_quote("#define TF_MOD_CONTROL               0x0002")
63 cpp_quote("#define TF_MOD_SHIFT                 0x0004")
64 cpp_quote("#define TF_MOD_RALT                  0x0008")
65 cpp_quote("#define TF_MOD_RCONTROL              0x0010")
66 cpp_quote("#define TF_MOD_RSHIFT                0x0020")
67 cpp_quote("#define TF_MOD_LALT                  0x0040")
68 cpp_quote("#define TF_MOD_LCONTROL              0x0080")
69 cpp_quote("#define TF_MOD_LSHIFT                0x0100")
70 cpp_quote("#define TF_MOD_ON_KEYUP              0x0200")
71 cpp_quote("#define TF_MOD_IGNORE_ALL_MODIFIER   0x0400")
72
73 interface ITfDocumentMgr;
74 interface ITfContext;
75 interface IEnumTfDocumentMgrs;
76 interface IEnumTfContexts;
77 interface ITfFunctionProvider;
78 interface IEnumTfFunctionProviders;
79 interface ITfCompartmentMgr;
80 interface ITfEditSession;
81 interface ITfRange;
82 interface ITfContextView;
83 interface IEnumTfContextViews;
84 interface ITfProperty;
85 interface ITfReadOnlyProperty;
86 interface IEnumTfProperties;
87 interface ITfRangeBackup;
88 interface IEnumTfLanguageProfiles;
89 interface ITfEditRecord;
90 interface ITfCompositionView;
91 interface ITfKeyEventSink;
92
93 typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
94 {
95     CLSID clsid;
96     LANGID langid;
97     GUID catid;
98     BOOL fActive;
99     GUID guidProfile;
100 } TF_LANGUAGEPROFILE;
101
102 typedef [uuid(77c12f95-b783-450d-879f-1cd2362c6521)] struct TF_PRESERVEDKEY
103 {
104     UINT uVKey;
105     UINT uModifiers;
106 } TF_PRESERVEDKEY;
107
108 typedef [uuid(5a886226-ae9a-489b-b991-2b1e25ee59a9)]  enum { TF_ANCHOR_START = 0, TF_ANCHOR_END = 1 } TfAnchor;
109
110 [
111     object,
112     uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
113     pointer_default(unique)
114 ]
115 interface ITfThreadMgr: IUnknown
116 {
117     HRESULT Activate(
118         [out] TfClientId *ptid);
119
120     HRESULT Deactivate();
121
122     HRESULT CreateDocumentMgr(
123         [out] ITfDocumentMgr **ppdim);
124
125     HRESULT EnumDocumentMgrs(
126         [out] IEnumTfDocumentMgrs **ppEnum);
127
128     HRESULT GetFocus(
129         [out] ITfDocumentMgr **ppdimFocus);
130
131     HRESULT SetFocus(
132         [in] ITfDocumentMgr *pdimFocus);
133
134     HRESULT AssociateFocus(
135         [in] HWND hwnd,
136         [in, unique] ITfDocumentMgr *pdimNew,
137         [out] ITfDocumentMgr **ppdimPrev);
138
139     HRESULT IsThreadFocus(
140         [out] BOOL *pfThreadFocus);
141
142     HRESULT GetFunctionProvider(
143         [in] REFCLSID clsid,
144         [out] ITfFunctionProvider **ppFuncProv);
145
146     HRESULT EnumFunctionProviders(
147         [out] IEnumTfFunctionProviders **ppEnum);
148
149     HRESULT GetGlobalCompartment(
150         [out] ITfCompartmentMgr **ppCompMgr);
151 };
152
153
154 [
155     object,
156     uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
157     pointer_default(unique)
158 ]
159 interface ITfDocumentMgr: IUnknown
160 {
161     HRESULT CreateContext(
162         [in] TfClientId tidOwner,
163         [in] DWORD dwFlags,
164         [in, unique] IUnknown *punk,
165         [out] ITfContext **ppic,
166         [out] TfEditCookie *pecTextStore);
167
168     HRESULT Push(
169         [in] ITfContext *pic);
170
171     const DWORD TF_POPF_ALL = 0x0001;
172
173     HRESULT Pop(
174         [in] DWORD dwFlags);
175
176     HRESULT GetTop(
177         [out] ITfContext **ppic);
178
179     HRESULT GetBase(
180         [out] ITfContext **ppic);
181
182     HRESULT EnumContexts(
183         [out] IEnumTfContexts **ppEnum);
184 };
185
186 [
187     object,
188     uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
189     pointer_default(unique)
190 ]
191 interface ITfContext : IUnknown
192 {
193     const DWORD TF_ES_ASYNCDONTCARE = 0x0;
194     const DWORD TF_ES_SYNC          = 0x1;
195     const DWORD TF_ES_READ          = 0x2;
196     const DWORD TF_ES_READWRITE     = 0x6;
197     const DWORD TF_ES_ASYNC         = 0x8;
198
199     HRESULT RequestEditSession(
200         [in] TfClientId tid,
201         [in] ITfEditSession *pes,
202         [in] DWORD dwFlags,
203         [out] HRESULT *phrSession);
204
205     HRESULT InWriteSession(
206         [in] TfClientId tid,
207         [out] BOOL *pfWriteSession);
208
209     typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE, TF_AE_START, TF_AE_END } TfActiveSelEnd;
210
211     typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
212     {
213         TfActiveSelEnd ase;
214         BOOL fInterimChar;
215     } TF_SELECTIONSTYLE;
216
217     typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
218     {
219         ITfRange *range;
220         TF_SELECTIONSTYLE style;
221     } TF_SELECTION;
222
223     const ULONG TF_DEFAULT_SELECTION =  TS_DEFAULT_SELECTION;
224
225     HRESULT GetSelection(
226         [in] TfEditCookie ec,
227         [in] ULONG ulIndex,
228         [in] ULONG ulCount,
229         [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
230         [out] ULONG *pcFetched);
231
232     HRESULT SetSelection(
233         [in] TfEditCookie ec,
234         [in] ULONG ulCount,
235         [in, size_is(ulCount)] const TF_SELECTION *pSelection);
236
237     HRESULT GetStart(
238         [in] TfEditCookie ec,
239         [out] ITfRange **ppStart);
240
241     HRESULT GetEnd(
242         [in] TfEditCookie ec,
243         [out] ITfRange **ppEnd);
244
245     typedef [uuid(bc7d979a-846a-444d-afef-0a9bfa82b961)] TS_STATUS TF_STATUS;
246     const DWORD TF_SD_READONLY    = TS_SD_READONLY;
247     const DWORD TF_SD_LOADING     = TS_SD_LOADING;
248     const DWORD TF_SS_DISJOINTSEL = TS_SS_DISJOINTSEL;
249     const DWORD TF_SS_REGIONS     = TS_SS_REGIONS;
250     const DWORD TF_SS_TRANSITORY  = TS_SS_TRANSITORY;
251
252
253     HRESULT GetActiveView(
254         [out] ITfContextView **ppView);
255
256     HRESULT EnumViews(
257         [out] IEnumTfContextViews **ppEnum);
258
259     HRESULT GetStatus(
260         [out] TF_STATUS *pdcs);
261
262     HRESULT GetProperty(
263         [in] REFGUID guidProp,
264         [out] ITfProperty **ppProp);
265
266     HRESULT GetAppProperty(
267         [in] REFGUID guidProp,
268         [out] ITfReadOnlyProperty **ppProp);
269
270     HRESULT TrackProperties(
271         [in, size_is(cProp)] const GUID **prgProp,
272         [in] ULONG cProp,
273         [in, size_is(cAppProp)] const GUID **prgAppProp,
274         [in] ULONG cAppProp,
275         [out] ITfReadOnlyProperty **ppProperty);
276
277     HRESULT EnumProperties(
278         [out] IEnumTfProperties **ppEnum);
279
280     HRESULT GetDocumentMgr(
281         [out] ITfDocumentMgr **ppDm);
282
283     HRESULT CreateRangeBackup(
284         [in] TfEditCookie ec,
285         [in] ITfRange *pRange,
286         [out] ITfRangeBackup **ppBackup);
287
288 };
289
290 [
291   object,
292   uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
293   pointer_default(unique)
294 ]
295 interface ITfSource : IUnknown
296 {
297     HRESULT AdviseSink(
298         [in] REFIID riid,
299         [in, iid_is(riid)] IUnknown *punk,
300         [out] DWORD *pdwCookie);
301
302     HRESULT UnadviseSink(
303         [in] DWORD dwCookie);
304 };
305
306 [
307   object,
308   local,
309   uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
310   pointer_default(unique)
311 ]
312 interface ITfInputProcessorProfiles : IUnknown
313 {
314     HRESULT Register(
315         [in] REFCLSID rclsid);
316
317     HRESULT Unregister(
318         [in] REFCLSID rclsid);
319
320     HRESULT AddLanguageProfile(
321         [in] REFCLSID rclsid,
322         [in] LANGID langid,
323         [in] REFGUID guidProfile,
324         [in, size_is(cchDesc)] const WCHAR *pchDesc,
325         [in] ULONG cchDesc,
326         [in, size_is(cchFile)] const WCHAR *pchIconFile,
327         [in] ULONG cchFile,
328         [in] ULONG uIconIndex);
329
330     HRESULT RemoveLanguageProfile(
331         [in] REFCLSID rclsid,
332         [in] LANGID langid,
333         [in] REFGUID guidProfile);
334
335     HRESULT EnumInputProcessorInfo(
336         [out] IEnumGUID **ppEnum);
337
338     HRESULT GetDefaultLanguageProfile(
339         [in] LANGID langid,
340         [in] REFGUID catid,
341         [out] CLSID *pclsid,
342         [out] GUID *pguidProfile);
343
344     HRESULT SetDefaultLanguageProfile(
345         [in] LANGID langid,
346         [in] REFCLSID rclsid,
347         [in] REFGUID guidProfiles);
348
349     HRESULT ActivateLanguageProfile(
350         [in] REFCLSID rclsid,
351         [in] LANGID langid,
352         [in] REFGUID guidProfiles);
353
354     HRESULT GetActiveLanguageProfile(
355         [in] REFCLSID rclsid,
356         [out] LANGID *plangid,
357         [out] GUID *pguidProfile);
358
359     HRESULT GetLanguageProfileDescription(
360         [in] REFCLSID rclsid,
361         [in] LANGID langid,
362         [in] REFGUID guidProfile,
363         [out] BSTR *pbstrProfile);
364
365     HRESULT GetCurrentLanguage(
366         [out] LANGID *plangid);
367
368     HRESULT ChangeCurrentLanguage(
369         [in] LANGID langid);
370
371     HRESULT GetLanguageList(
372         [out] LANGID **ppLangId,
373         [out] ULONG *pulCount);
374
375     HRESULT EnumLanguageProfiles(
376         [in] LANGID langid,
377         [out] IEnumTfLanguageProfiles **ppEnum);
378
379     HRESULT EnableLanguageProfile(
380         [in] REFCLSID rclsid,
381         [in] LANGID langid,
382         [in] REFGUID guidProfile,
383         [in] BOOL fEnable);
384
385     HRESULT IsEnabledLanguageProfile(
386         [in] REFCLSID rclsid,
387         [in] LANGID langid,
388         [in] REFGUID guidProfile,
389         [out] BOOL *pfEnable);
390
391     HRESULT EnableLanguageProfileByDefault(
392         [in] REFCLSID rclsid,
393         [in] LANGID langid,
394         [in] REFGUID guidProfile,
395         [in] BOOL fEnable);
396
397     HRESULT SubstituteKeyboardLayout(
398         [in] REFCLSID rclsid,
399         [in] LANGID langid,
400         [in] REFGUID guidProfile,
401         [in] HKL hKL);
402 };
403
404 [
405   object,
406   local,
407   uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
408   pointer_default(unique)
409 ]
410 interface ITfCategoryMgr : IUnknown
411 {
412     HRESULT RegisterCategory([in] REFCLSID rclsid,
413                              [in] REFGUID rcatid,
414                              [in] REFGUID rguid);
415
416     HRESULT UnregisterCategory([in] REFCLSID rclsid,
417                                [in] REFGUID rcatid,
418                                [in] REFGUID rguid);
419
420     HRESULT EnumCategoriesInItem([in] REFGUID rguid,
421                                  [out] IEnumGUID **ppEnum);
422
423     HRESULT EnumItemsInCategory([in] REFGUID rcatid,
424                                 [out] IEnumGUID **ppEnum);
425
426     HRESULT FindClosestCategory([in] REFGUID rguid,
427                                 [out] GUID *pcatid,
428                                 [in, size_is(ulCount)] const GUID **ppcatidList,
429                                 [in] ULONG ulCount);
430
431     HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
432                                     [in] REFGUID rguid,
433                                     [in, size_is(cch)] const WCHAR *pchDesc,
434                                     [in] ULONG cch);
435
436     HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
437                                       [in] REFGUID rguid);
438
439     HRESULT GetGUIDDescription([in] REFGUID rguid,
440                                [out] BSTR *pbstrDesc);
441
442     HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
443                               [in] REFGUID rguid,
444                               [in] DWORD dw);
445
446     HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
447                                 [in] REFGUID rguid);
448
449     HRESULT GetGUIDDWORD([in] REFGUID rguid,
450                          [out] DWORD *pdw);
451
452     HRESULT RegisterGUID([in] REFGUID rguid,
453                          [out] TfGuidAtom *pguidatom);
454
455     HRESULT GetGUID([in] TfGuidAtom guidatom,
456                     [out] GUID *pguid);
457
458     HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
459                               [in] REFGUID rguid,
460                               [out] BOOL *pfEqual);
461 };
462
463 [
464   object,
465   uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
466   pointer_default(unique)
467 ]
468 interface ITfTextEditSink : IUnknown
469 {
470     HRESULT OnEndEdit(
471         [in] ITfContext *pic,
472         [in] TfEditCookie ecReadOnly,
473         [in] ITfEditRecord *pEditRecord);
474 };
475
476 [
477     object,
478     uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
479     pointer_default(unique)
480 ]
481 interface ITfContextOwnerCompositionSink : IUnknown
482 {
483     HRESULT OnStartComposition(
484         [in] ITfCompositionView *pComposition,
485         [out] BOOL *pfOk);
486
487     HRESULT OnUpdateComposition(
488         [in] ITfCompositionView *pComposition,
489         [in] ITfRange *pRangeNew);
490
491     HRESULT OnEndComposition(
492         [in] ITfCompositionView *pComposition);
493 };
494
495 [
496   object,
497   uuid(3d61bf11-ac5f-42c8-a4cb-931bcc28c744),
498   pointer_default(unique)
499 ]
500 interface IEnumTfLanguageProfiles : IUnknown
501 {
502     HRESULT Clone(
503         [out] IEnumTfLanguageProfiles **ppEnum);
504
505     HRESULT Next(
506         [in] ULONG ulCount,
507         [out, size_is(ulCount), length_is(*pcFetch)] TF_LANGUAGEPROFILE *pProfile,
508         [out] ULONG *pcFetch);
509
510     HRESULT Reset();
511
512     HRESULT Skip(
513         [in] ULONG ulCount);
514 };
515
516 [
517   object,
518   local,
519   uuid(aa80e7f7-2021-11d2-93e0-0060b067b86e),
520   pointer_default(unique)
521 ]
522 interface ITfTextInputProcessor : IUnknown
523 {
524     HRESULT Activate(
525         [in] ITfThreadMgr *ptim,
526         [in] TfClientId tid);
527
528     HRESULT Deactivate();
529 };
530
531 [
532   object,
533   uuid(aa80e80e-2021-11d2-93e0-0060b067b86e),
534   pointer_default(unique)
535 ]
536 interface ITfThreadMgrEventSink : IUnknown
537 {
538     HRESULT OnInitDocumentMgr(
539         [in] ITfDocumentMgr *pdim);
540
541     HRESULT OnUninitDocumentMgr(
542         [in] ITfDocumentMgr *pdim);
543
544     HRESULT OnSetFocus(
545         [in] ITfDocumentMgr *pdimFocus,
546         [in] ITfDocumentMgr *pdimPrevFocus);
547
548     HRESULT OnPushContext(
549         [in] ITfContext *pic);
550
551     HRESULT OnPopContext(
552         [in] ITfContext *pic);
553 };
554
555 [
556   object,
557   local,
558   uuid(aa80e7f0-2021-11d2-93e0-0060b067b86e),
559   pointer_default(unique)
560 ]
561 interface ITfKeystrokeMgr : IUnknown
562 {
563     HRESULT AdviseKeyEventSink(
564         [in] TfClientId tid,
565         [in] ITfKeyEventSink *pSink,
566         [in] BOOL fForeground);
567
568     HRESULT UnadviseKeyEventSink(
569         [in] TfClientId tid);
570
571     HRESULT GetForeground(
572         [out] CLSID *pclsid);
573
574     HRESULT TestKeyDown(
575         [in] WPARAM wParam,
576         [in] LPARAM lParam,
577         [out] BOOL *pfEaten);
578
579     HRESULT TestKeyUp(
580         [in] WPARAM wParam,
581         [in] LPARAM lParam,
582         [out] BOOL *pfEaten);
583
584     HRESULT KeyDown(
585         [in] WPARAM wParam,
586         [in] LPARAM lParam,
587         [out] BOOL *pfEaten);
588
589     HRESULT KeyUp(
590         [in] WPARAM wParam,
591         [in] LPARAM lParam,
592         [out] BOOL *pfEaten);
593
594     HRESULT GetPreservedKey(
595         [in] ITfContext *pic,
596         [in] const TF_PRESERVEDKEY *pprekey,
597         [out] GUID *pguid);
598
599     HRESULT IsPreservedKey(
600         [in] REFGUID rguid,
601         [in] const TF_PRESERVEDKEY *pprekey,
602         [out] BOOL *pfRegistered);
603
604     HRESULT PreserveKey(
605         [in] TfClientId tid,
606         [in] REFGUID rguid,
607         [in] const TF_PRESERVEDKEY *prekey,
608         [in, size_is(cchDesc)] const WCHAR *pchDesc,
609         [in] ULONG cchDesc);
610
611     HRESULT UnpreserveKey(
612         [in] REFGUID rguid,
613         [in] const TF_PRESERVEDKEY *pprekey);
614
615     HRESULT SetPreservedKeyDescription(
616         [in] REFGUID rguid,
617         [in, size_is(cchDesc)] const WCHAR *pchDesc,
618         [in] ULONG cchDesc);
619
620     HRESULT GetPreservedKeyDescription(
621         [in] REFGUID rguid,
622         [out] BSTR *pbstrDesc);
623
624     HRESULT SimulatePreservedKey(
625         [in] ITfContext *pic,
626         [in] REFGUID rguid,
627         [out] BOOL *pfEaten);
628 };
629
630 [
631   object,
632   local,
633   uuid(aa80e7f5-2021-11d2-93e0-0060b067b86e),
634   pointer_default(unique)
635 ]
636 interface ITfKeyEventSink : IUnknown
637 {
638     HRESULT OnSetFocus(
639         [in] BOOL fForeground);
640
641     HRESULT OnTestKeyDown(
642         [in] ITfContext *pic,
643         [in] WPARAM wParam,
644         [in] LPARAM lParam,
645         [out] BOOL *pfEaten);
646
647     HRESULT OnTestKeyUp(
648         [in] ITfContext *pic,
649         [in] WPARAM wParam,
650         [in] LPARAM lParam,
651         [out] BOOL *pfEaten);
652
653     HRESULT OnKeyDown(
654         [in] ITfContext *pic,
655         [in] WPARAM wParam,
656         [in] LPARAM lParam,
657         [out] BOOL *pfEaten);
658
659     HRESULT OnKeyUp(
660         [in] ITfContext *pic,
661         [in] WPARAM wParam,
662         [in] LPARAM lParam,
663         [out] BOOL *pfEaten);
664
665     HRESULT OnPreservedKey(
666         [in] ITfContext *pic,
667         [in] REFGUID rguid,
668         [out] BOOL *pfEaten);
669 };
670
671 [
672   object,
673   local,
674   uuid(8f1b8ad8-0b6b-4874-90c5-bd76011e8f7c),
675   pointer_default(unique)
676 ]
677 interface ITfMessagePump : IUnknown
678 {
679     HRESULT PeekMessageA(
680         [out] LPMSG pMsg,
681         [in] HWND hwnd,
682         [in] UINT wMsgFilterMin,
683         [in] UINT wMsgFilterMax,
684         [in] UINT wRemoveMsg,
685         [out] BOOL *pfResult);
686
687     HRESULT GetMessageA(
688         [out] LPMSG pMsg,
689         [in] HWND hwnd,
690         [in] UINT wMsgFilterMin,
691         [in] UINT wMsgFilterMax,
692         [out] BOOL *pfResult);
693
694     HRESULT PeekMessageW(
695         [out] LPMSG pMsg,
696         [in] HWND hwnd,
697         [in] UINT wMsgFilterMin,
698         [in] UINT wMsgFilterMax,
699         [in] UINT wRemoveMsg,
700         [out] BOOL *pfResult);
701
702     HRESULT GetMessageW(
703         [out] LPMSG pMsg,
704         [in] HWND hwnd,
705         [in] UINT wMsgFilterMin,
706         [in] UINT wMsgFilterMax,
707         [out] BOOL *pfResult);
708 };
709
710 [
711   object,
712   local,
713   uuid(d60a7b49-1b9f-4be2-b702-47e9dc05dec3),
714   pointer_default(unique)
715 ]
716 interface ITfClientId : IUnknown
717 {
718     HRESULT GetClientId(
719         [in] REFCLSID rclsid,
720         [out] TfClientId *ptid);
721 };
722
723 [
724   object,
725   uuid(43c9fe15-f494-4c17-9de2-b8a4ac350aa8),
726   pointer_default(unique)
727 ]
728 interface ITfLanguageProfileNotifySink : IUnknown
729 {
730     HRESULT OnLanguageChange(
731         [in] LANGID langid,
732         [out] BOOL *pfAccept);
733
734     HRESULT OnLanguageChanged();
735 }
736
737 [
738   object,
739   uuid(aa80e803-2021-11d2-93e0-0060b067b86e),
740   pointer_default(unique)
741 ]
742 interface ITfEditSession : IUnknown
743 {
744     HRESULT DoEditSession(
745         [in] TfEditCookie ec);
746 }
747
748 [
749   object,
750   uuid(aa80e7ff-2021-11d2-93e0-0060b067b86e),
751   pointer_default(unique)
752 ]
753 interface ITfRange : IUnknown
754 {
755     const WCHAR TF_CHAR_EMBEDDED     = TS_CHAR_EMBEDDED;
756
757     typedef [uuid(cf610f06-2882-46f6-abe5-298568b664c4)] enum { TF_GRAVITY_BACKWARD = 0, TF_GRAVITY_FORWARD = 1 } TfGravity;
758
759     typedef [uuid(1e512533-bbdc-4530-9a8e-a1dc0af67468)] enum { TF_SD_BACKWARD = 0, TF_SD_FORWARD = 1 } TfShiftDir;
760
761     const DWORD TF_HF_OBJECT         = 1;
762     const DWORD TF_TF_MOVESTART      = 1;
763     const DWORD TF_TF_IGNOREEND      = 2;
764     const DWORD TF_ST_CORRECTION     = 1;
765     const DWORD TF_IE_CORRECTION     = 1;
766
767     typedef [uuid(49930d51-7d93-448c-a48c-fea5dac192b1)] struct  TF_HALTCOND
768     {
769         ITfRange *pHaltRange;
770         TfAnchor aHaltPos;
771         DWORD dwFlags;
772     } TF_HALTCOND;
773
774     HRESULT GetText(
775         [in] TfEditCookie ec,
776         [in] DWORD dwFlags,
777         [out, size_is(cchMax), length_is(*pcch)] WCHAR *pchText,
778         [in] ULONG cchMax,
779         [out] ULONG *pcch);
780
781     HRESULT SetText(
782         [in] TfEditCookie ec,
783         [in] DWORD dwFlags,
784         [in, size_is(cch), unique] const WCHAR *pchText,
785         [in] LONG cch);
786
787     HRESULT GetFormattedText(
788         [in] TfEditCookie ec,
789         [out] IDataObject **ppDataObject);
790
791     HRESULT GetEmbedded(
792         [in] TfEditCookie ec,
793         [in] REFGUID rguidService,
794         [in] REFIID riid,
795         [out, iid_is(riid)] IUnknown **ppunk);
796
797     HRESULT InsertEmbedded(
798         [in] TfEditCookie ec,
799         [in] DWORD dwFlags,
800         [in] IDataObject *pDataObject);
801
802     HRESULT ShiftStart(
803         [in] TfEditCookie ec,
804         [in] LONG cchReq,
805         [out] LONG *pcch,
806         [in, unique] const TF_HALTCOND *pHalt);
807
808     HRESULT ShiftEnd(
809         [in] TfEditCookie ec,
810         [in] LONG cchReq,
811         [out] LONG *pcch,
812         [in, unique] const TF_HALTCOND *pHalt);
813
814     HRESULT ShiftStartToRange(
815         [in] TfEditCookie ec,
816         [in] ITfRange *pRange,
817         [in] TfAnchor aPos);
818
819     HRESULT ShiftEndToRange(
820         [in] TfEditCookie ec,
821         [in] ITfRange *pRange,
822         [in] TfAnchor aPos);
823
824     HRESULT ShiftStartRegion(
825         [in] TfEditCookie ec,
826         [in] TfShiftDir dir,
827         [out] BOOL *pfNoRegion);
828
829     HRESULT ShiftEndRegion(
830         [in] TfEditCookie ec,
831         [in] TfShiftDir dir,
832         [out] BOOL *pfNoRegion);
833
834     HRESULT IsEmpty(
835         [in] TfEditCookie ec,
836         [out] BOOL *pfEmpty);
837
838     HRESULT Collapse(
839         [in] TfEditCookie ec,
840         [in] TfAnchor aPos);
841
842     HRESULT IsEqualStart(
843         [in] TfEditCookie ec,
844         [in] ITfRange *pWith,
845         [in] TfAnchor aPos,
846         [out] BOOL *pfEqual);
847
848     HRESULT IsEqualEnd(
849         [in] TfEditCookie ec,
850         [in] ITfRange *pWith,
851         [in] TfAnchor aPos,
852         [out] BOOL *pfEqual);
853
854     HRESULT CompareStart(
855         [in] TfEditCookie ec,
856         [in] ITfRange *pWith,
857         [in] TfAnchor aPos,
858         [out] LONG *plResult);
859
860     HRESULT CompareEnd(
861         [in] TfEditCookie ec,
862         [in] ITfRange *pWith,
863         [in] TfAnchor aPos,
864         [out] LONG *plResult);
865
866     HRESULT AdjustForInsert(
867         [in] TfEditCookie ec,
868         [in] ULONG cchInsert,
869         [out] BOOL *pfInsertOk);
870
871     HRESULT GetGravity(
872         [out] TfGravity *pgStart,
873         [out] TfGravity *pgEnd);
874
875     HRESULT SetGravity(
876         [in] TfEditCookie ec,
877         [in] TfGravity gStart,
878         [in] TfGravity gEnd);
879
880     HRESULT Clone(
881         [out] ITfRange **ppClone);
882
883     HRESULT GetContext(
884         [out] ITfContext **ppContext);
885 };
886
887 [
888     object,
889     uuid(55ce16ba-3014-41c1-9ceb-fade1446ac6c),
890     pointer_default(unique)
891 ]
892 interface ITfInsertAtSelection : IUnknown
893 {
894     const DWORD TF_IAS_NOQUERY   = 0x1;
895     const DWORD TF_IAS_QUERYONLY = 0x2;
896     const DWORD TF_IAS_NO_DEFAULT_COMPOSITION = 0x80000000;
897
898     HRESULT InsertTextAtSelection(
899         [in] TfEditCookie ec,
900         [in] DWORD dwFlags,
901         [in, size_is(cch)] const WCHAR *pchText,
902         [in] LONG cch,
903         [out] ITfRange **ppRange);
904
905     HRESULT InsertEmbeddedAtSelection(
906         [in] TfEditCookie ec,
907         [in] DWORD dwFlags,
908         [in] IDataObject *pDataObject,
909         [out] ITfRange **ppRange);
910 };
911
912 [
913   object,
914   uuid(bb08f7a9-607a-4384-8623-056892b64371),
915   pointer_default(unique)
916 ]
917 interface ITfCompartment : IUnknown
918 {
919     HRESULT SetValue(
920         [in] TfClientId tid,
921         [in] const VARIANT *pvarValue);
922
923     HRESULT GetValue(
924         [out] VARIANT *pvarValue);
925 };
926
927 [
928   object,
929   uuid(7dcf57ac-18ad-438b-824d-979bffb74b7c),
930   pointer_default(unique)
931 ]
932 interface ITfCompartmentMgr : IUnknown
933 {
934     HRESULT GetCompartment(
935         [in] REFGUID rguid,
936         [out] ITfCompartment **ppcomp);
937
938     HRESULT ClearCompartment(
939         [in] TfClientId tid,
940         [in] REFGUID rguid);
941
942     HRESULT EnumCompartments(
943         [out] IEnumGUID **ppEnum);
944 };
945
946 [
947   object,
948   uuid(743abd5f-f26d-48df-8cc5-238492419b64),
949   pointer_default(unique)
950 ]
951 interface ITfCompartmentEventSink : IUnknown
952 {
953     HRESULT OnChange(
954         [in] REFGUID rguid);
955 }
956
957 [
958   object,
959   uuid(8f1a7ea6-1654-4502-a86e-b2902344d507),
960   pointer_default(unique)
961 ]
962 interface IEnumTfContexts : IUnknown
963 {
964     HRESULT Clone(
965         [out] IEnumTfContexts **ppEnum);
966
967     HRESULT Next(
968         [in] ULONG ulCount,
969         [out, size_is(ulCount), length_is(*pcFetched)] ITfContext **rgContext,
970         [out] ULONG *pcFetched);
971
972     HRESULT Reset();
973
974     HRESULT Skip(
975         [in] ULONG ulCount);
976 };