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