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