msxml3: Implemented xmlnode_get_nodeTypedValue 'boolean' data type handling.
[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 GUID GUID_PROP_TEXTOWNER;")
37 cpp_quote("DEFINE_GUID(GUID_PROP_ATTRIBUTE,0x34b45670,0x7526,0x11d2,0xa1,0x47,0x00,0x10,0x5a,0x27,0x99,0xb5);")
38 cpp_quote("EXTERN_C const GUID GUID_PROP_LANGID;")
39 cpp_quote("EXTERN_C const GUID GUID_PROP_READING;")
40 cpp_quote("EXTERN_C const GUID GUID_PROP_COMPOSING;")
41
42 cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
43 cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
44 cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
45 cpp_quote("DEFINE_GUID(CLSID_TF_DisplayAttributeMgr,0x3ce74de4,0x53d3,0x4d74,0x8b,0x83,0x43,0x1b,0x38,0x28,0xba,0x53);")
46
47 /* GUIDs for Compartments */
48 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_KEYBOARD_DISABLED;")
49 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_KEYBOARD_OPENCLOSE;")
50 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_HANDWRITING_OPENCLOSE;")
51 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_DISABLED;")
52 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_OPENCLOSE;")
53 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_GLOBALSTATE;")
54 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_PERSISTMENUENABLED;")
55 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_EMPTYCONTEXT;")
56 cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_TIPUISTATUS;")
57
58 /* GUIDs for Categories */
59 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
60 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
61 cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
62 cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
63
64 typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)]  DWORD TfEditCookie;
65 typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
66 typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
67
68 cpp_quote("#define TF_MOD_ALT                   0x0001")
69 cpp_quote("#define TF_MOD_CONTROL               0x0002")
70 cpp_quote("#define TF_MOD_SHIFT                 0x0004")
71 cpp_quote("#define TF_MOD_RALT                  0x0008")
72 cpp_quote("#define TF_MOD_RCONTROL              0x0010")
73 cpp_quote("#define TF_MOD_RSHIFT                0x0020")
74 cpp_quote("#define TF_MOD_LALT                  0x0040")
75 cpp_quote("#define TF_MOD_LCONTROL              0x0080")
76 cpp_quote("#define TF_MOD_LSHIFT                0x0100")
77 cpp_quote("#define TF_MOD_ON_KEYUP              0x0200")
78 cpp_quote("#define TF_MOD_IGNORE_ALL_MODIFIER   0x0400")
79
80 interface ITfDocumentMgr;
81 interface ITfContext;
82 interface IEnumTfDocumentMgrs;
83 interface IEnumTfContexts;
84 interface ITfFunctionProvider;
85 interface IEnumTfFunctionProviders;
86 interface ITfCompartmentMgr;
87 interface ITfEditSession;
88 interface ITfRange;
89 interface ITfContextView;
90 interface IEnumTfContextViews;
91 interface ITfProperty;
92 interface ITfReadOnlyProperty;
93 interface IEnumTfProperties;
94 interface ITfRangeBackup;
95 interface IEnumTfLanguageProfiles;
96 interface ITfEditRecord;
97 interface ITfCompositionView;
98 interface ITfKeyEventSink;
99
100 typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
101 {
102     CLSID clsid;
103     LANGID langid;
104     GUID catid;
105     BOOL fActive;
106     GUID guidProfile;
107 } TF_LANGUAGEPROFILE;
108
109 typedef [uuid(77c12f95-b783-450d-879f-1cd2362c6521)] struct TF_PRESERVEDKEY
110 {
111     UINT uVKey;
112     UINT uModifiers;
113 } TF_PRESERVEDKEY;
114
115 typedef [uuid(5a886226-ae9a-489b-b991-2b1e25ee59a9)]  enum { TF_ANCHOR_START = 0, TF_ANCHOR_END = 1 } TfAnchor;
116
117 [
118     object,
119     uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
120     pointer_default(unique)
121 ]
122 interface ITfThreadMgr: IUnknown
123 {
124     HRESULT Activate(
125         [out] TfClientId *ptid);
126
127     HRESULT Deactivate();
128
129     HRESULT CreateDocumentMgr(
130         [out] ITfDocumentMgr **ppdim);
131
132     HRESULT EnumDocumentMgrs(
133         [out] IEnumTfDocumentMgrs **ppEnum);
134
135     HRESULT GetFocus(
136         [out] ITfDocumentMgr **ppdimFocus);
137
138     HRESULT SetFocus(
139         [in] ITfDocumentMgr *pdimFocus);
140
141     HRESULT AssociateFocus(
142         [in] HWND hwnd,
143         [in, unique] ITfDocumentMgr *pdimNew,
144         [out] ITfDocumentMgr **ppdimPrev);
145
146     HRESULT IsThreadFocus(
147         [out] BOOL *pfThreadFocus);
148
149     HRESULT GetFunctionProvider(
150         [in] REFCLSID clsid,
151         [out] ITfFunctionProvider **ppFuncProv);
152
153     HRESULT EnumFunctionProviders(
154         [out] IEnumTfFunctionProviders **ppEnum);
155
156     HRESULT GetGlobalCompartment(
157         [out] ITfCompartmentMgr **ppCompMgr);
158 };
159
160 [
161     object,
162     uuid(d7540241-f9a1-4364-befc-dbcd2c4395b7),
163     pointer_default(unique)
164 ]
165 interface ITfCompositionView : IUnknown
166 {
167     HRESULT GetOwnerClsid([out] CLSID *pclsid);
168
169     HRESULT GetRange([out] ITfRange **ppRange);
170 }
171
172 [
173     object,
174     uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
175     pointer_default(unique)
176 ]
177 interface ITfDocumentMgr: IUnknown
178 {
179     HRESULT CreateContext(
180         [in] TfClientId tidOwner,
181         [in] DWORD dwFlags,
182         [in, unique] IUnknown *punk,
183         [out] ITfContext **ppic,
184         [out] TfEditCookie *pecTextStore);
185
186     HRESULT Push(
187         [in] ITfContext *pic);
188
189     const DWORD TF_POPF_ALL = 0x0001;
190
191     HRESULT Pop(
192         [in] DWORD dwFlags);
193
194     HRESULT GetTop(
195         [out] ITfContext **ppic);
196
197     HRESULT GetBase(
198         [out] ITfContext **ppic);
199
200     HRESULT EnumContexts(
201         [out] IEnumTfContexts **ppEnum);
202 };
203
204 [
205     object,
206     uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
207     pointer_default(unique)
208 ]
209 interface ITfContext : IUnknown
210 {
211     const DWORD TF_ES_ASYNCDONTCARE = 0x0;
212     const DWORD TF_ES_SYNC          = 0x1;
213     const DWORD TF_ES_READ          = 0x2;
214     const DWORD TF_ES_READWRITE     = 0x6;
215     const DWORD TF_ES_ASYNC         = 0x8;
216
217     HRESULT RequestEditSession(
218         [in] TfClientId tid,
219         [in] ITfEditSession *pes,
220         [in] DWORD dwFlags,
221         [out] HRESULT *phrSession);
222
223     HRESULT InWriteSession(
224         [in] TfClientId tid,
225         [out] BOOL *pfWriteSession);
226
227     typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE, TF_AE_START, TF_AE_END } TfActiveSelEnd;
228
229     typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
230     {
231         TfActiveSelEnd ase;
232         BOOL fInterimChar;
233     } TF_SELECTIONSTYLE;
234
235     typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
236     {
237         ITfRange *range;
238         TF_SELECTIONSTYLE style;
239     } TF_SELECTION;
240
241     const ULONG TF_DEFAULT_SELECTION =  TS_DEFAULT_SELECTION;
242
243     HRESULT GetSelection(
244         [in] TfEditCookie ec,
245         [in] ULONG ulIndex,
246         [in] ULONG ulCount,
247         [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
248         [out] ULONG *pcFetched);
249
250     HRESULT SetSelection(
251         [in] TfEditCookie ec,
252         [in] ULONG ulCount,
253         [in, size_is(ulCount)] const TF_SELECTION *pSelection);
254
255     HRESULT GetStart(
256         [in] TfEditCookie ec,
257         [out] ITfRange **ppStart);
258
259     HRESULT GetEnd(
260         [in] TfEditCookie ec,
261         [out] ITfRange **ppEnd);
262
263     typedef [uuid(bc7d979a-846a-444d-afef-0a9bfa82b961)] TS_STATUS TF_STATUS;
264     const DWORD TF_SD_READONLY    = TS_SD_READONLY;
265     const DWORD TF_SD_LOADING     = TS_SD_LOADING;
266     const DWORD TF_SS_DISJOINTSEL = TS_SS_DISJOINTSEL;
267     const DWORD TF_SS_REGIONS     = TS_SS_REGIONS;
268     const DWORD TF_SS_TRANSITORY  = TS_SS_TRANSITORY;
269
270
271     HRESULT GetActiveView(
272         [out] ITfContextView **ppView);
273
274     HRESULT EnumViews(
275         [out] IEnumTfContextViews **ppEnum);
276
277     HRESULT GetStatus(
278         [out] TF_STATUS *pdcs);
279
280     HRESULT GetProperty(
281         [in] REFGUID guidProp,
282         [out] ITfProperty **ppProp);
283
284     HRESULT GetAppProperty(
285         [in] REFGUID guidProp,
286         [out] ITfReadOnlyProperty **ppProp);
287
288     HRESULT TrackProperties(
289         [in, size_is(cProp)] const GUID **prgProp,
290         [in] ULONG cProp,
291         [in, size_is(cAppProp)] const GUID **prgAppProp,
292         [in] ULONG cAppProp,
293         [out] ITfReadOnlyProperty **ppProperty);
294
295     HRESULT EnumProperties(
296         [out] IEnumTfProperties **ppEnum);
297
298     HRESULT GetDocumentMgr(
299         [out] ITfDocumentMgr **ppDm);
300
301     HRESULT CreateRangeBackup(
302         [in] TfEditCookie ec,
303         [in] ITfRange *pRange,
304         [out] ITfRangeBackup **ppBackup);
305
306 };
307
308 [
309   object,
310   uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
311   pointer_default(unique)
312 ]
313 interface ITfSource : IUnknown
314 {
315     HRESULT AdviseSink(
316         [in] REFIID riid,
317         [in, iid_is(riid)] IUnknown *punk,
318         [out] DWORD *pdwCookie);
319
320     HRESULT UnadviseSink(
321         [in] DWORD dwCookie);
322 };
323
324 [
325   object,
326   local,
327   uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
328   pointer_default(unique)
329 ]
330 interface ITfInputProcessorProfiles : IUnknown
331 {
332     HRESULT Register(
333         [in] REFCLSID rclsid);
334
335     HRESULT Unregister(
336         [in] REFCLSID rclsid);
337
338     HRESULT AddLanguageProfile(
339         [in] REFCLSID rclsid,
340         [in] LANGID langid,
341         [in] REFGUID guidProfile,
342         [in, size_is(cchDesc)] const WCHAR *pchDesc,
343         [in] ULONG cchDesc,
344         [in, size_is(cchFile)] const WCHAR *pchIconFile,
345         [in] ULONG cchFile,
346         [in] ULONG uIconIndex);
347
348     HRESULT RemoveLanguageProfile(
349         [in] REFCLSID rclsid,
350         [in] LANGID langid,
351         [in] REFGUID guidProfile);
352
353     HRESULT EnumInputProcessorInfo(
354         [out] IEnumGUID **ppEnum);
355
356     HRESULT GetDefaultLanguageProfile(
357         [in] LANGID langid,
358         [in] REFGUID catid,
359         [out] CLSID *pclsid,
360         [out] GUID *pguidProfile);
361
362     HRESULT SetDefaultLanguageProfile(
363         [in] LANGID langid,
364         [in] REFCLSID rclsid,
365         [in] REFGUID guidProfiles);
366
367     HRESULT ActivateLanguageProfile(
368         [in] REFCLSID rclsid,
369         [in] LANGID langid,
370         [in] REFGUID guidProfiles);
371
372     HRESULT GetActiveLanguageProfile(
373         [in] REFCLSID rclsid,
374         [out] LANGID *plangid,
375         [out] GUID *pguidProfile);
376
377     HRESULT GetLanguageProfileDescription(
378         [in] REFCLSID rclsid,
379         [in] LANGID langid,
380         [in] REFGUID guidProfile,
381         [out] BSTR *pbstrProfile);
382
383     HRESULT GetCurrentLanguage(
384         [out] LANGID *plangid);
385
386     HRESULT ChangeCurrentLanguage(
387         [in] LANGID langid);
388
389     HRESULT GetLanguageList(
390         [out] LANGID **ppLangId,
391         [out] ULONG *pulCount);
392
393     HRESULT EnumLanguageProfiles(
394         [in] LANGID langid,
395         [out] IEnumTfLanguageProfiles **ppEnum);
396
397     HRESULT EnableLanguageProfile(
398         [in] REFCLSID rclsid,
399         [in] LANGID langid,
400         [in] REFGUID guidProfile,
401         [in] BOOL fEnable);
402
403     HRESULT IsEnabledLanguageProfile(
404         [in] REFCLSID rclsid,
405         [in] LANGID langid,
406         [in] REFGUID guidProfile,
407         [out] BOOL *pfEnable);
408
409     HRESULT EnableLanguageProfileByDefault(
410         [in] REFCLSID rclsid,
411         [in] LANGID langid,
412         [in] REFGUID guidProfile,
413         [in] BOOL fEnable);
414
415     HRESULT SubstituteKeyboardLayout(
416         [in] REFCLSID rclsid,
417         [in] LANGID langid,
418         [in] REFGUID guidProfile,
419         [in] HKL hKL);
420 };
421
422 typedef [uuid(c4cc07f1-80cc-4a7b-bc54-98512782cbe3)]
423 enum {
424     TF_LS_NONE      = 0,
425     TF_LS_SOLID     = 1,
426     TF_LS_DOT       = 2,
427     TF_LS_DASH      = 3,
428     TF_LS_SQUIGGLE  = 4
429 } TF_DA_LINESTYLE;
430
431 typedef [uuid(d9b92e21-084a-401b-9c64-1e6dad91a1ab)]
432 enum {
433     TF_CT_NONE      = 0,
434     TF_CT_SYSCOLOR  = 1,
435     TF_CT_COLORREF  = 2
436 } TF_DA_COLORTYPE;
437
438 typedef [uuid(90d0cb5e-6520-4a0f-b47c-c39bd955f0d6)]
439 struct TF_DA_COLOR {
440     TF_DA_COLORTYPE type;
441     [switch_type(TF_DA_COLORTYPE), switch_is(type)]
442     union {
443         [case(TF_CT_SYSCOLOR)] int nIndex;
444         [case(TF_CT_COLORREF)] COLORREF cr;
445     };
446 } TF_DA_COLOR;
447
448 typedef [uuid(33d2fe4b-6c24-4f67-8d75-3bc1819e4126)]
449 enum {
450     TF_ATTR_INPUT                = 0,
451     TF_ATTR_TARGET_CONVERTED     = 1,
452     TF_ATTR_CONVERTED            = 2,
453     TF_ATTR_TARGET_NOTCONVERTED  = 3,
454     TF_ATTR_INPUT_ERROR          = 4,
455     TF_ATTR_FIXEDCONVERTED       = 5,
456     TF_ATTR_OTHER                = -1
457 } TF_DA_ATTR_INFO;
458
459 typedef [uuid(1bf1c305-419b-4182-a4d2-9bfadc3f021f)]
460 struct TF_DISPLAYATTRIBUTE {
461     TF_DA_COLOR      crText;
462     TF_DA_COLOR      crBk;
463     TF_DA_LINESTYLE  lsStyle;
464     BOOL             fBoldLine;
465     TF_DA_COLOR      crLine;
466     TF_DA_ATTR_INFO  bAttr;
467 } TF_DISPLAYATTRIBUTE;
468
469 [
470     object,
471     uuid(70528852-2f26-4aea-8c96-215150578932),
472     pointer_default(unique)
473 ]
474 interface ITfDisplayAttributeInfo : IUnknown
475 {
476     HRESULT GetGUID([out] GUID *pguid);
477
478     HRESULT GetDescription([out] BSTR *pbstrDesc);
479
480     HRESULT GetAttributeInfo([out] TF_DISPLAYATTRIBUTE *pda);
481
482     HRESULT SetAttributeInfo([in] const TF_DISPLAYATTRIBUTE *pda);
483
484     HRESULT Reset();
485 }
486
487 [
488     object,
489     uuid(7cef04d7-cb75-4e80-a7ab-5f5bc7d332de),
490     pointer_default(unique)
491 ]
492 interface IEnumTfDisplayAttributeInfo : IUnknown
493 {
494     HRESULT Clone([out] IEnumTfDisplayAttributeInfo **ppEnum);
495
496     HRESULT Next(
497             [in] ULONG ulCount,
498             [out, size_is(ulCount), length_is(*pcFetched)] ITfDisplayAttributeInfo **rgInfo,
499             [out] ULONG *pcFetched);
500
501     HRESULT Reset();
502
503     HRESULT Skip([in] ULONG ulCount);
504 }
505
506 [
507     object,
508     local,
509     uuid(8ded7393-5db1-475c-9e71-a39111b0ff67),
510     pointer_default(unique)
511 ]
512 interface ITfDisplayAttributeMgr : IUnknown
513 {
514     HRESULT OnUpdateInfo();
515
516     HRESULT EnumDisplayAttributeInfo([out] IEnumTfDisplayAttributeInfo **ppEnum);
517
518     HRESULT GetDisplayAttributeInfo(
519             [in] REFGUID guid,
520             [out] ITfDisplayAttributeInfo **ppInfo,
521             [out] CLSID *pclsidOwner);
522
523 }
524
525 [
526   object,
527   local,
528   uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
529   pointer_default(unique)
530 ]
531 interface ITfCategoryMgr : IUnknown
532 {
533     HRESULT RegisterCategory([in] REFCLSID rclsid,
534                              [in] REFGUID rcatid,
535                              [in] REFGUID rguid);
536
537     HRESULT UnregisterCategory([in] REFCLSID rclsid,
538                                [in] REFGUID rcatid,
539                                [in] REFGUID rguid);
540
541     HRESULT EnumCategoriesInItem([in] REFGUID rguid,
542                                  [out] IEnumGUID **ppEnum);
543
544     HRESULT EnumItemsInCategory([in] REFGUID rcatid,
545                                 [out] IEnumGUID **ppEnum);
546
547     HRESULT FindClosestCategory([in] REFGUID rguid,
548                                 [out] GUID *pcatid,
549                                 [in, size_is(ulCount)] const GUID **ppcatidList,
550                                 [in] ULONG ulCount);
551
552     HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
553                                     [in] REFGUID rguid,
554                                     [in, size_is(cch)] const WCHAR *pchDesc,
555                                     [in] ULONG cch);
556
557     HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
558                                       [in] REFGUID rguid);
559
560     HRESULT GetGUIDDescription([in] REFGUID rguid,
561                                [out] BSTR *pbstrDesc);
562
563     HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
564                               [in] REFGUID rguid,
565                               [in] DWORD dw);
566
567     HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
568                                 [in] REFGUID rguid);
569
570     HRESULT GetGUIDDWORD([in] REFGUID rguid,
571                          [out] DWORD *pdw);
572
573     HRESULT RegisterGUID([in] REFGUID rguid,
574                          [out] TfGuidAtom *pguidatom);
575
576     HRESULT GetGUID([in] TfGuidAtom guidatom,
577                     [out] GUID *pguid);
578
579     HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
580                               [in] REFGUID rguid,
581                               [out] BOOL *pfEqual);
582 };
583
584 [
585   object,
586   uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
587   pointer_default(unique)
588 ]
589 interface ITfTextEditSink : IUnknown
590 {
591     HRESULT OnEndEdit(
592         [in] ITfContext *pic,
593         [in] TfEditCookie ecReadOnly,
594         [in] ITfEditRecord *pEditRecord);
595 };
596
597 [
598     object,
599     uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
600     pointer_default(unique)
601 ]
602 interface ITfContextOwnerCompositionSink : IUnknown
603 {
604     HRESULT OnStartComposition(
605         [in] ITfCompositionView *pComposition,
606         [out] BOOL *pfOk);
607
608     HRESULT OnUpdateComposition(
609         [in] ITfCompositionView *pComposition,
610         [in] ITfRange *pRangeNew);
611
612     HRESULT OnEndComposition(
613         [in] ITfCompositionView *pComposition);
614 };
615
616 [
617   object,
618   uuid(3d61bf11-ac5f-42c8-a4cb-931bcc28c744),
619   pointer_default(unique)
620 ]
621 interface IEnumTfLanguageProfiles : IUnknown
622 {
623     HRESULT Clone(
624         [out] IEnumTfLanguageProfiles **ppEnum);
625
626     HRESULT Next(
627         [in] ULONG ulCount,
628         [out, size_is(ulCount), length_is(*pcFetch)] TF_LANGUAGEPROFILE *pProfile,
629         [out] ULONG *pcFetch);
630
631     HRESULT Reset();
632
633     HRESULT Skip(
634         [in] ULONG ulCount);
635 };
636
637 [
638   object,
639   local,
640   uuid(aa80e7f7-2021-11d2-93e0-0060b067b86e),
641   pointer_default(unique)
642 ]
643 interface ITfTextInputProcessor : IUnknown
644 {
645     HRESULT Activate(
646         [in] ITfThreadMgr *ptim,
647         [in] TfClientId tid);
648
649     HRESULT Deactivate();
650 };
651
652 [
653   object,
654   uuid(aa80e80e-2021-11d2-93e0-0060b067b86e),
655   pointer_default(unique)
656 ]
657 interface ITfThreadMgrEventSink : IUnknown
658 {
659     HRESULT OnInitDocumentMgr(
660         [in] ITfDocumentMgr *pdim);
661
662     HRESULT OnUninitDocumentMgr(
663         [in] ITfDocumentMgr *pdim);
664
665     HRESULT OnSetFocus(
666         [in] ITfDocumentMgr *pdimFocus,
667         [in] ITfDocumentMgr *pdimPrevFocus);
668
669     HRESULT OnPushContext(
670         [in] ITfContext *pic);
671
672     HRESULT OnPopContext(
673         [in] ITfContext *pic);
674 };
675
676 [
677   object,
678   local,
679   uuid(aa80e7f0-2021-11d2-93e0-0060b067b86e),
680   pointer_default(unique)
681 ]
682 interface ITfKeystrokeMgr : IUnknown
683 {
684     HRESULT AdviseKeyEventSink(
685         [in] TfClientId tid,
686         [in] ITfKeyEventSink *pSink,
687         [in] BOOL fForeground);
688
689     HRESULT UnadviseKeyEventSink(
690         [in] TfClientId tid);
691
692     HRESULT GetForeground(
693         [out] CLSID *pclsid);
694
695     HRESULT TestKeyDown(
696         [in] WPARAM wParam,
697         [in] LPARAM lParam,
698         [out] BOOL *pfEaten);
699
700     HRESULT TestKeyUp(
701         [in] WPARAM wParam,
702         [in] LPARAM lParam,
703         [out] BOOL *pfEaten);
704
705     HRESULT KeyDown(
706         [in] WPARAM wParam,
707         [in] LPARAM lParam,
708         [out] BOOL *pfEaten);
709
710     HRESULT KeyUp(
711         [in] WPARAM wParam,
712         [in] LPARAM lParam,
713         [out] BOOL *pfEaten);
714
715     HRESULT GetPreservedKey(
716         [in] ITfContext *pic,
717         [in] const TF_PRESERVEDKEY *pprekey,
718         [out] GUID *pguid);
719
720     HRESULT IsPreservedKey(
721         [in] REFGUID rguid,
722         [in] const TF_PRESERVEDKEY *pprekey,
723         [out] BOOL *pfRegistered);
724
725     HRESULT PreserveKey(
726         [in] TfClientId tid,
727         [in] REFGUID rguid,
728         [in] const TF_PRESERVEDKEY *prekey,
729         [in, size_is(cchDesc)] const WCHAR *pchDesc,
730         [in] ULONG cchDesc);
731
732     HRESULT UnpreserveKey(
733         [in] REFGUID rguid,
734         [in] const TF_PRESERVEDKEY *pprekey);
735
736     HRESULT SetPreservedKeyDescription(
737         [in] REFGUID rguid,
738         [in, size_is(cchDesc)] const WCHAR *pchDesc,
739         [in] ULONG cchDesc);
740
741     HRESULT GetPreservedKeyDescription(
742         [in] REFGUID rguid,
743         [out] BSTR *pbstrDesc);
744
745     HRESULT SimulatePreservedKey(
746         [in] ITfContext *pic,
747         [in] REFGUID rguid,
748         [out] BOOL *pfEaten);
749 };
750
751 [
752   object,
753   local,
754   uuid(aa80e7f5-2021-11d2-93e0-0060b067b86e),
755   pointer_default(unique)
756 ]
757 interface ITfKeyEventSink : IUnknown
758 {
759     HRESULT OnSetFocus(
760         [in] BOOL fForeground);
761
762     HRESULT OnTestKeyDown(
763         [in] ITfContext *pic,
764         [in] WPARAM wParam,
765         [in] LPARAM lParam,
766         [out] BOOL *pfEaten);
767
768     HRESULT OnTestKeyUp(
769         [in] ITfContext *pic,
770         [in] WPARAM wParam,
771         [in] LPARAM lParam,
772         [out] BOOL *pfEaten);
773
774     HRESULT OnKeyDown(
775         [in] ITfContext *pic,
776         [in] WPARAM wParam,
777         [in] LPARAM lParam,
778         [out] BOOL *pfEaten);
779
780     HRESULT OnKeyUp(
781         [in] ITfContext *pic,
782         [in] WPARAM wParam,
783         [in] LPARAM lParam,
784         [out] BOOL *pfEaten);
785
786     HRESULT OnPreservedKey(
787         [in] ITfContext *pic,
788         [in] REFGUID rguid,
789         [out] BOOL *pfEaten);
790 };
791
792 [
793   object,
794   local,
795   uuid(8f1b8ad8-0b6b-4874-90c5-bd76011e8f7c),
796   pointer_default(unique)
797 ]
798 interface ITfMessagePump : IUnknown
799 {
800     HRESULT PeekMessageA(
801         [out] LPMSG pMsg,
802         [in] HWND hwnd,
803         [in] UINT wMsgFilterMin,
804         [in] UINT wMsgFilterMax,
805         [in] UINT wRemoveMsg,
806         [out] BOOL *pfResult);
807
808     HRESULT GetMessageA(
809         [out] LPMSG pMsg,
810         [in] HWND hwnd,
811         [in] UINT wMsgFilterMin,
812         [in] UINT wMsgFilterMax,
813         [out] BOOL *pfResult);
814
815     HRESULT PeekMessageW(
816         [out] LPMSG pMsg,
817         [in] HWND hwnd,
818         [in] UINT wMsgFilterMin,
819         [in] UINT wMsgFilterMax,
820         [in] UINT wRemoveMsg,
821         [out] BOOL *pfResult);
822
823     HRESULT GetMessageW(
824         [out] LPMSG pMsg,
825         [in] HWND hwnd,
826         [in] UINT wMsgFilterMin,
827         [in] UINT wMsgFilterMax,
828         [out] BOOL *pfResult);
829 };
830
831 [
832   object,
833   local,
834   uuid(d60a7b49-1b9f-4be2-b702-47e9dc05dec3),
835   pointer_default(unique)
836 ]
837 interface ITfClientId : IUnknown
838 {
839     HRESULT GetClientId(
840         [in] REFCLSID rclsid,
841         [out] TfClientId *ptid);
842 };
843
844 [
845   object,
846   uuid(43c9fe15-f494-4c17-9de2-b8a4ac350aa8),
847   pointer_default(unique)
848 ]
849 interface ITfLanguageProfileNotifySink : IUnknown
850 {
851     HRESULT OnLanguageChange(
852         [in] LANGID langid,
853         [out] BOOL *pfAccept);
854
855     HRESULT OnLanguageChanged();
856 }
857
858 [
859   object,
860   uuid(aa80e803-2021-11d2-93e0-0060b067b86e),
861   pointer_default(unique)
862 ]
863 interface ITfEditSession : IUnknown
864 {
865     HRESULT DoEditSession(
866         [in] TfEditCookie ec);
867 }
868
869 [
870   object,
871   uuid(aa80e7ff-2021-11d2-93e0-0060b067b86e),
872   pointer_default(unique)
873 ]
874 interface ITfRange : IUnknown
875 {
876     const WCHAR TF_CHAR_EMBEDDED     = TS_CHAR_EMBEDDED;
877
878     typedef [uuid(cf610f06-2882-46f6-abe5-298568b664c4)] enum { TF_GRAVITY_BACKWARD = 0, TF_GRAVITY_FORWARD = 1 } TfGravity;
879
880     typedef [uuid(1e512533-bbdc-4530-9a8e-a1dc0af67468)] enum { TF_SD_BACKWARD = 0, TF_SD_FORWARD = 1 } TfShiftDir;
881
882     const DWORD TF_HF_OBJECT         = 1;
883     const DWORD TF_TF_MOVESTART      = 1;
884     const DWORD TF_TF_IGNOREEND      = 2;
885     const DWORD TF_ST_CORRECTION     = 1;
886     const DWORD TF_IE_CORRECTION     = 1;
887
888     typedef [uuid(49930d51-7d93-448c-a48c-fea5dac192b1)] struct  TF_HALTCOND
889     {
890         ITfRange *pHaltRange;
891         TfAnchor aHaltPos;
892         DWORD dwFlags;
893     } TF_HALTCOND;
894
895     HRESULT GetText(
896         [in] TfEditCookie ec,
897         [in] DWORD dwFlags,
898         [out, size_is(cchMax), length_is(*pcch)] WCHAR *pchText,
899         [in] ULONG cchMax,
900         [out] ULONG *pcch);
901
902     HRESULT SetText(
903         [in] TfEditCookie ec,
904         [in] DWORD dwFlags,
905         [in, size_is(cch), unique] const WCHAR *pchText,
906         [in] LONG cch);
907
908     HRESULT GetFormattedText(
909         [in] TfEditCookie ec,
910         [out] IDataObject **ppDataObject);
911
912     HRESULT GetEmbedded(
913         [in] TfEditCookie ec,
914         [in] REFGUID rguidService,
915         [in] REFIID riid,
916         [out, iid_is(riid)] IUnknown **ppunk);
917
918     HRESULT InsertEmbedded(
919         [in] TfEditCookie ec,
920         [in] DWORD dwFlags,
921         [in] IDataObject *pDataObject);
922
923     HRESULT ShiftStart(
924         [in] TfEditCookie ec,
925         [in] LONG cchReq,
926         [out] LONG *pcch,
927         [in, unique] const TF_HALTCOND *pHalt);
928
929     HRESULT ShiftEnd(
930         [in] TfEditCookie ec,
931         [in] LONG cchReq,
932         [out] LONG *pcch,
933         [in, unique] const TF_HALTCOND *pHalt);
934
935     HRESULT ShiftStartToRange(
936         [in] TfEditCookie ec,
937         [in] ITfRange *pRange,
938         [in] TfAnchor aPos);
939
940     HRESULT ShiftEndToRange(
941         [in] TfEditCookie ec,
942         [in] ITfRange *pRange,
943         [in] TfAnchor aPos);
944
945     HRESULT ShiftStartRegion(
946         [in] TfEditCookie ec,
947         [in] TfShiftDir dir,
948         [out] BOOL *pfNoRegion);
949
950     HRESULT ShiftEndRegion(
951         [in] TfEditCookie ec,
952         [in] TfShiftDir dir,
953         [out] BOOL *pfNoRegion);
954
955     HRESULT IsEmpty(
956         [in] TfEditCookie ec,
957         [out] BOOL *pfEmpty);
958
959     HRESULT Collapse(
960         [in] TfEditCookie ec,
961         [in] TfAnchor aPos);
962
963     HRESULT IsEqualStart(
964         [in] TfEditCookie ec,
965         [in] ITfRange *pWith,
966         [in] TfAnchor aPos,
967         [out] BOOL *pfEqual);
968
969     HRESULT IsEqualEnd(
970         [in] TfEditCookie ec,
971         [in] ITfRange *pWith,
972         [in] TfAnchor aPos,
973         [out] BOOL *pfEqual);
974
975     HRESULT CompareStart(
976         [in] TfEditCookie ec,
977         [in] ITfRange *pWith,
978         [in] TfAnchor aPos,
979         [out] LONG *plResult);
980
981     HRESULT CompareEnd(
982         [in] TfEditCookie ec,
983         [in] ITfRange *pWith,
984         [in] TfAnchor aPos,
985         [out] LONG *plResult);
986
987     HRESULT AdjustForInsert(
988         [in] TfEditCookie ec,
989         [in] ULONG cchInsert,
990         [out] BOOL *pfInsertOk);
991
992     HRESULT GetGravity(
993         [out] TfGravity *pgStart,
994         [out] TfGravity *pgEnd);
995
996     HRESULT SetGravity(
997         [in] TfEditCookie ec,
998         [in] TfGravity gStart,
999         [in] TfGravity gEnd);
1000
1001     HRESULT Clone(
1002         [out] ITfRange **ppClone);
1003
1004     HRESULT GetContext(
1005         [out] ITfContext **ppContext);
1006 };
1007
1008 [
1009     object,
1010     uuid(057a6296-029b-4154-b79a-0d461d4ea94c),
1011     pointer_default(unique)
1012 ]
1013 interface ITfRangeACP : ITfRange
1014 {
1015     HRESULT GetExtent([out] LONG *pacpAnchor,
1016                       [out] LONG *pcch);
1017
1018     HRESULT SetExtent([in] LONG acpAnchor,
1019                       [in] LONG cch);
1020 }
1021
1022 [
1023     object,
1024     uuid(55ce16ba-3014-41c1-9ceb-fade1446ac6c),
1025     pointer_default(unique)
1026 ]
1027 interface ITfInsertAtSelection : IUnknown
1028 {
1029     const DWORD TF_IAS_NOQUERY   = 0x1;
1030     const DWORD TF_IAS_QUERYONLY = 0x2;
1031     const DWORD TF_IAS_NO_DEFAULT_COMPOSITION = 0x80000000;
1032
1033     HRESULT InsertTextAtSelection(
1034         [in] TfEditCookie ec,
1035         [in] DWORD dwFlags,
1036         [in, size_is(cch)] const WCHAR *pchText,
1037         [in] LONG cch,
1038         [out] ITfRange **ppRange);
1039
1040     HRESULT InsertEmbeddedAtSelection(
1041         [in] TfEditCookie ec,
1042         [in] DWORD dwFlags,
1043         [in] IDataObject *pDataObject,
1044         [out] ITfRange **ppRange);
1045 };
1046
1047 [
1048     object,
1049     uuid(6834b120-88cb-11d2-bf45-00105a2799b5),
1050     pointer_default(unique)
1051 ]
1052 interface ITfPropertyStore : IUnknown
1053 {
1054     const DWORD TF_TU_CORRECTION = 0x1;
1055
1056     HRESULT GetType([out] GUID *pguid);
1057
1058     HRESULT GetDataType([out] DWORD *pdwReserved);
1059
1060     HRESULT GetData([out] VARIANT *pvarValue);
1061
1062     HRESULT OnTextUpdated(
1063             [in] DWORD dwFlags,
1064             [in] ITfRange *pRangeNew,
1065             [out] BOOL *pfAccept);
1066
1067     HRESULT Shrink(
1068             [in] ITfRange *pRangeNew,
1069             [out] BOOL *pfFree);
1070
1071     HRESULT Divide(
1072             [in] ITfRange *pRangeThis,
1073             [in] ITfRange *pRangeNew,
1074             [out] ITfPropertyStore **ppPropStore);
1075
1076     HRESULT Clone(
1077             [out] ITfPropertyStore **pPropStore);
1078
1079     HRESULT GetPropertyRangeCreator(
1080             [out] CLSID *pclsid);
1081
1082     HRESULT Serialize(
1083             [in] IStream *pStream,
1084             [out] ULONG *pcb);
1085 }
1086
1087 [
1088     object,
1089     uuid(f99d3f40-8e32-11d2-bf46-00105a2799b5),
1090     pointer_default(unique)
1091 ]
1092 interface IEnumTfRanges : IUnknown
1093 {
1094     HRESULT Clone([out] IEnumTfRanges **ppEnum);
1095
1096     HRESULT Next(
1097             [in] ULONG ulCount,
1098             [out, size_is(ulCount), length_is(*pcFetched)] ITfRange **ppRange,
1099             [out] ULONG *pcFetched);
1100
1101     HRESULT Reset();
1102
1103     HRESULT Skip(ULONG ulCount);
1104 }
1105
1106 [
1107     object,
1108     uuid(5efd22Ba-7838-46cb-88e2-cadb14124f8f),
1109     pointer_default(unique)
1110 ]
1111 interface IEnumITfCompositionView : IUnknown
1112 {
1113     HRESULT Clone([out] IEnumITfCompositionView **ppEnum);
1114
1115     HRESULT Next(
1116             [in] ULONG ulCount,
1117             [out, size_is(ulCount), length_is(*pcFetched)] ITfCompositionView **rgCompositionView,
1118             [out] ULONG *pcFetched);
1119
1120     HRESULT Reset();
1121
1122     HRESULT Skip([in] ULONG ulCount);
1123 }
1124
1125 [
1126     object,
1127     uuid(20168d64-5a8f-4a5a-b7bd-cfa29f4D0fd9),
1128     pointer_default(unique)
1129 ]
1130 interface ITfComposition : IUnknown
1131 {
1132     HRESULT GetRange([out] ITfRange **ppRange);
1133
1134     HRESULT ShiftStart(
1135             [in] TfEditCookie ecWrite,
1136             [in] ITfRange *pNewStart);
1137
1138     HRESULT ShiftEnd(
1139             [in] TfEditCookie ecWrite,
1140             [in] ITfRange *pNewEnd);
1141
1142     HRESULT EndComposition([in] TfEditCookie ecWrite);
1143 }
1144
1145 [
1146     object,
1147     uuid(a781718c-579a-4b15-a280-32b8577acc5e),
1148     pointer_default(unique)
1149 ]
1150 interface ITfCompositionSink : IUnknown
1151 {
1152     HRESULT OnCompositionTerminated(
1153             [in] TfEditCookie ecWrite,
1154             [in] ITfComposition *pComposition);
1155 }
1156
1157 [
1158     object,
1159     uuid(d40C8aae-aC92-4fc7-9a11-0ee0e23aa39b),
1160     pointer_default(unique)
1161 ]
1162 interface ITfContextComposition : IUnknown
1163 {
1164     HRESULT StartComposition(
1165             [in] TfEditCookie ecWrite,
1166             [in] ITfRange *pCompositionRange,
1167             [in] ITfCompositionSink *pSink,
1168             [out] ITfComposition **ppComposition);
1169
1170     HRESULT EnumCompositions([out] IEnumITfCompositionView **ppEnum);
1171
1172     HRESULT FindComposition(
1173             [in] TfEditCookie ecRead,
1174             [in] ITfRange *pTestRange,
1175             [out] IEnumITfCompositionView **ppEnum);
1176
1177     HRESULT TakeOwnership(
1178             [in] TfEditCookie ecWrite,
1179             [in] ITfCompositionView *pComposition,
1180             [in] ITfCompositionSink *pSink,
1181             [out] ITfComposition **ppComposition);
1182 }
1183
1184 [
1185     object,
1186     uuid(86462810-593b-4916-9764-19c08e9ce110),
1187     pointer_default(unique)
1188 ]
1189 interface ITfContextOwnerCompositionServices : ITfContextComposition
1190 {
1191     HRESULT TerminateComposition([in] ITfCompositionView *pComposition);
1192 }
1193
1194 [
1195     object,
1196     uuid(17d49a3d-f8b8-4b2f-b254-52319dd64c53),
1197     pointer_default(unique)
1198 ]
1199 interface ITfReadOnlyProperty : IUnknown
1200 {
1201     HRESULT GetType([out] GUID *pguid);
1202
1203     HRESULT EnumRanges(
1204             [in] TfEditCookie ec,
1205             [out] IEnumTfRanges **ppEnum,
1206             [in] ITfRange *pTargetRange);
1207
1208     HRESULT GetValue(
1209             [in] TfEditCookie ec,
1210             [in] ITfRange *pRange,
1211             [out] VARIANT *pvarValue);
1212
1213     HRESULT GetContext([out] ITfContext **ppContext);
1214 }
1215
1216 [
1217     object,
1218     uuid(e2449660-9542-11d2-bf46-00105a2799b5),
1219     pointer_default(unique)
1220 ]
1221 interface ITfProperty : ITfReadOnlyProperty
1222 {
1223     HRESULT FindRange(
1224             [in] TfEditCookie ec,
1225             [in] ITfRange *pRange,
1226             [out] ITfRange **ppRange,
1227             [in] TfAnchor aPos);
1228
1229     HRESULT SetValueStore(
1230             [in] TfEditCookie ec,
1231             [in] ITfRange *pRange,
1232             [in] ITfPropertyStore *pPropStore);
1233
1234     HRESULT SetValue(
1235             [in] TfEditCookie ec,
1236             [in] ITfRange *pRange,
1237             [in] const VARIANT *pvarValue);
1238
1239     HRESULT Clear(
1240             [in] TfEditCookie ec,
1241             [in] ITfRange *pRange);
1242 }
1243
1244 [
1245   object,
1246   uuid(bb08f7a9-607a-4384-8623-056892b64371),
1247   pointer_default(unique)
1248 ]
1249 interface ITfCompartment : IUnknown
1250 {
1251     HRESULT SetValue(
1252         [in] TfClientId tid,
1253         [in] const VARIANT *pvarValue);
1254
1255     HRESULT GetValue(
1256         [out] VARIANT *pvarValue);
1257 };
1258
1259 [
1260   object,
1261   uuid(7dcf57ac-18ad-438b-824d-979bffb74b7c),
1262   pointer_default(unique)
1263 ]
1264 interface ITfCompartmentMgr : IUnknown
1265 {
1266     HRESULT GetCompartment(
1267         [in] REFGUID rguid,
1268         [out] ITfCompartment **ppcomp);
1269
1270     HRESULT ClearCompartment(
1271         [in] TfClientId tid,
1272         [in] REFGUID rguid);
1273
1274     HRESULT EnumCompartments(
1275         [out] IEnumGUID **ppEnum);
1276 };
1277
1278 [
1279   object,
1280   uuid(743abd5f-f26d-48df-8cc5-238492419b64),
1281   pointer_default(unique)
1282 ]
1283 interface ITfCompartmentEventSink : IUnknown
1284 {
1285     HRESULT OnChange(
1286         [in] REFGUID rguid);
1287 }
1288
1289 [
1290   object,
1291   uuid(8f1a7ea6-1654-4502-a86e-b2902344d507),
1292   pointer_default(unique)
1293 ]
1294 interface IEnumTfContexts : IUnknown
1295 {
1296     HRESULT Clone(
1297         [out] IEnumTfContexts **ppEnum);
1298
1299     HRESULT Next(
1300         [in] ULONG ulCount,
1301         [out, size_is(ulCount), length_is(*pcFetched)] ITfContext **rgContext,
1302         [out] ULONG *pcFetched);
1303
1304     HRESULT Reset();
1305
1306     HRESULT Skip(
1307         [in] ULONG ulCount);
1308 };
1309
1310 [
1311   object,
1312   uuid(aa80e808-2021-11d2-93e0-0060b067b86e),
1313   pointer_default(unique)
1314 ]
1315 interface IEnumTfDocumentMgrs : IUnknown
1316 {
1317     HRESULT Clone(
1318         [out] IEnumTfDocumentMgrs **ppEnum);
1319
1320     HRESULT Next(
1321         [in] ULONG ulCount,
1322         [out, size_is(ulCount), length_is(*pcFetched)] ITfDocumentMgr **rgDocumentMgr,
1323         [out] ULONG *pcFetched);
1324
1325     HRESULT Reset();
1326
1327     HRESULT Skip(
1328         [in] ULONG ulCount);
1329 };
1330
1331 [
1332   object,
1333   uuid(73131f9c-56a9-49dd-b0ee-d046633f7528),
1334   pointer_default(unique)
1335 ]
1336 interface ITfSourceSingle : IUnknown
1337 {
1338     HRESULT AdviseSingleSink(
1339         [in] TfClientId tid,
1340         [in] REFIID riid,
1341         [in, iid_is(riid)] IUnknown *punk);
1342
1343     HRESULT UnadviseSingleSink(
1344         [in] TfClientId tid,
1345         [in] REFIID riid);
1346 };
1347
1348 [
1349   object,
1350   local,
1351   uuid(c0f1db0c-3a20-405c-a303-96b6010a885f),
1352   pointer_default(unique)
1353 ]
1354 interface ITfThreadFocusSink : IUnknown
1355 {
1356     HRESULT OnSetThreadFocus();
1357
1358     HRESULT OnKillThreadFocus();
1359 };