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