2 * Copyright 2008 Aric Stewart, CodeWeavers
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.
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.
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
22 import
"textstor.idl";
23 /* import "ctfutb.idl"; */
25 cpp_quote
("#include <winuser.h>")
27 cpp_quote
("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
28 cpp_quote
("#define TF_E_ALREADY_EXISTS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0506)")
29 cpp_quote
("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
30 cpp_quote
("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
31 cpp_quote
("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
33 /* GUIDs for Categories */
34 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
35 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
36 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
37 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
39 typedef [uuid(7213778c
-7bb0
-4270-b050
-6189ee594e97
)] DWORD TfEditCookie
;
40 typedef [uuid(de403c21
-89fd
-4f85
-8b87
-64584d063fbc
)] DWORD TfClientId
;
41 typedef [uuid(88a9c478
-f3ec
-4763-8345-cd9250443f8d
)] DWORD TfGuidAtom
;
43 cpp_quote
("#define TF_MOD_ALT 0x0001")
44 cpp_quote
("#define TF_MOD_CONTROL 0x0002")
45 cpp_quote
("#define TF_MOD_SHIFT 0x0004")
46 cpp_quote
("#define TF_MOD_RALT 0x0008")
47 cpp_quote
("#define TF_MOD_RCONTROL 0x0010")
48 cpp_quote
("#define TF_MOD_RSHIFT 0x0020")
49 cpp_quote
("#define TF_MOD_LALT 0x0040")
50 cpp_quote
("#define TF_MOD_LCONTROL 0x0080")
51 cpp_quote
("#define TF_MOD_LSHIFT 0x0100")
52 cpp_quote
("#define TF_MOD_ON_KEYUP 0x0200")
53 cpp_quote
("#define TF_MOD_IGNORE_ALL_MODIFIER 0x0400")
55 interface ITfDocumentMgr
;
57 interface IEnumTfDocumentMgrs
;
58 interface IEnumTfContexts
;
59 interface ITfFunctionProvider
;
60 interface IEnumTfFunctionProviders
;
61 interface ITfCompartmentMgr
;
62 interface ITfEditSession
;
64 interface ITfContextView
;
65 interface IEnumTfContextViews
;
66 interface ITfProperty
;
67 interface ITfReadOnlyProperty
;
68 interface IEnumTfProperties
;
69 interface ITfRangeBackup
;
70 interface IEnumTfLanguageProfiles
;
71 interface ITfEditRecord
;
72 interface ITfCompositionView
;
73 interface ITfKeyEventSink
;
75 typedef [uuid(e1b5808d
-1e46
-4c19
-84dc
-68c5f5978cc8
)] struct TF_LANGUAGEPROFILE
84 typedef [uuid(77c12f95
-b783
-450d
-879f
-1cd2362c6521
)] struct TF_PRESERVEDKEY
92 uuid(aa80e801
-2021-11d2
-93e0
-0060b067b86e
),
93 pointer_default(unique)
95 interface ITfThreadMgr
: IUnknown
98 [out] TfClientId
*ptid
);
100 HRESULT Deactivate
();
102 HRESULT CreateDocumentMgr
(
103 [out] ITfDocumentMgr
**ppdim
);
105 HRESULT EnumDocumentMgrs
(
106 [out] IEnumTfDocumentMgrs
**ppEnum
);
109 [out] ITfDocumentMgr
**ppdimFocus
);
112 [in] ITfDocumentMgr
*pdimFocus
);
114 HRESULT AssociateFocus
(
116 [in, unique] ITfDocumentMgr
*pdimNew
,
117 [out] ITfDocumentMgr
**ppdimPrev
);
119 HRESULT IsThreadFocus
(
120 [out] BOOL
*pfThreadFocus
);
122 HRESULT GetFunctionProvider
(
124 [out] ITfFunctionProvider
**ppFuncProv
);
126 HRESULT EnumFunctionProviders
(
127 [out] IEnumTfFunctionProviders
**ppEnum
);
129 HRESULT GetGlobalCompartment
(
130 [out] ITfCompartmentMgr
**ppCompMgr
);
136 uuid(aa80e7f4
-2021-11d2
-93e0
-0060b067b86e
),
137 pointer_default(unique)
139 interface ITfDocumentMgr
: IUnknown
141 HRESULT CreateContext
(
142 [in] TfClientId tidOwner
,
144 [in, unique] IUnknown
*punk
,
145 [out] ITfContext
**ppic
,
146 [out] TfEditCookie
*pecTextStore
);
149 [in] ITfContext
*pic
);
151 const DWORD TF_POPF_ALL
= 0x0001;
157 [out] ITfContext
**ppic
);
160 [out] ITfContext
**ppic
);
162 HRESULT EnumContexts
(
163 [out] IEnumTfContexts
**ppEnum
);
168 uuid(aa80e7fd
-2021-11d2
-93e0
-0060b067b86e
),
169 pointer_default(unique)
171 interface ITfContext
: IUnknown
173 const DWORD TF_ES_ASYNCDONTCARE
= 0x0;
174 const DWORD TF_ES_SYNC
= 0x1;
175 const DWORD TF_ES_READ
= 0x2;
176 const DWORD TF_ES_READWRITE
= 0x6;
177 const DWORD TF_ES_ASYNC
= 0x8;
179 HRESULT RequestEditSession
(
181 [in] ITfEditSession
*pes
,
183 [out] HRESULT *phrSession
);
185 HRESULT InWriteSession
(
187 [out] BOOL
*pfWriteSession
);
189 typedef [uuid(1690be9b
-d3e9
-49f6
-8d8b
-51b905af4c43
)] enum { TF_AE_NONE
, TF_AE_START
, TF_AE_END
} TfActiveSelEnd
;
191 typedef [uuid(36ae42a4
-6989-4bdc
-b48a
-6137b7bf2e42
)] struct TF_SELECTIONSTYLE
197 typedef [uuid(75eb22f2
-b0bf
-46a8
-8006-975a3b6efcf1
)] struct TF_SELECTION
200 TF_SELECTIONSTYLE style
;
203 const ULONG TF_DEFAULT_SELECTION
= TS_DEFAULT_SELECTION
;
205 HRESULT GetSelection
(
206 [in] TfEditCookie ec
,
209 [out, size_is(ulCount
), length_is(*pcFetched
)] TF_SELECTION
*pSelection
,
210 [out] ULONG
*pcFetched
);
212 HRESULT SetSelection
(
213 [in] TfEditCookie ec
,
215 [in, size_is(ulCount
)] const TF_SELECTION
*pSelection
);
218 [in] TfEditCookie ec
,
219 [out] ITfRange
**ppStart
);
222 [in] TfEditCookie ec
,
223 [out] ITfRange
**ppEnd
);
225 typedef [uuid(bc7d979a
-846a
-444d
-afef
-0a9bfa82b961
)] TS_STATUS TF_STATUS
;
226 const DWORD TF_SD_READONLY
= TS_SD_READONLY
;
227 const DWORD TF_SD_LOADING
= TS_SD_LOADING
;
228 const DWORD TF_SS_DISJOINTSEL
= TS_SS_DISJOINTSEL
;
229 const DWORD TF_SS_REGIONS
= TS_SS_REGIONS
;
230 const DWORD TF_SS_TRANSITORY
= TS_SS_TRANSITORY
;
233 HRESULT GetActiveView
(
234 [out] ITfContextView
**ppView
);
237 [out] IEnumTfContextViews
**ppEnum
);
240 [out] TF_STATUS
*pdcs
);
243 [in] REFGUID guidProp
,
244 [out] ITfProperty
**ppProp
);
246 HRESULT GetAppProperty
(
247 [in] REFGUID guidProp
,
248 [out] ITfReadOnlyProperty
**ppProp
);
250 HRESULT TrackProperties
(
251 [in, size_is(cProp
)] const GUID
**prgProp
,
253 [in, size_is(cAppProp
)] const GUID
**prgAppProp
,
255 [out] ITfReadOnlyProperty
**ppProperty
);
257 HRESULT EnumProperties
(
258 [out] IEnumTfProperties
**ppEnum
);
260 HRESULT GetDocumentMgr
(
261 [out] ITfDocumentMgr
**ppDm
);
263 HRESULT CreateRangeBackup
(
264 [in] TfEditCookie ec
,
265 [in] ITfRange
*pRange
,
266 [out] ITfRangeBackup
**ppBackup
);
272 uuid(4ea48a35
-60ae
-446f
-8fd6
-e6a8d82459f7
),
273 pointer_default(unique)
275 interface ITfSource
: IUnknown
279 [in, iid_is(riid
)] IUnknown
*punk
,
280 [out] DWORD
*pdwCookie
);
282 HRESULT UnadviseSink
(
283 [in] DWORD dwCookie
);
289 uuid(1F02B6C5
-7842-4EE6
-8A0B
-9A24183A95CA
),
290 pointer_default(unique)
292 interface ITfInputProcessorProfiles
: IUnknown
295 [in] REFCLSID rclsid
);
298 [in] REFCLSID rclsid
);
300 HRESULT AddLanguageProfile
(
301 [in] REFCLSID rclsid
,
303 [in] REFGUID guidProfile
,
304 [in, size_is(cchDesc
)] const WCHAR
*pchDesc
,
306 [in, size_is(cchFile
)] const WCHAR
*pchIconFile
,
308 [in] ULONG uIconIndex
);
310 HRESULT RemoveLanguageProfile
(
311 [in] REFCLSID rclsid
,
313 [in] REFGUID guidProfile
);
315 HRESULT EnumInputProcessorInfo
(
316 [out] IEnumGUID
**ppEnum
);
318 HRESULT GetDefaultLanguageProfile
(
322 [out] GUID
*pguidProfile
);
324 HRESULT SetDefaultLanguageProfile
(
326 [in] REFCLSID rclsid
,
327 [in] REFGUID guidProfiles
);
329 HRESULT ActivateLanguageProfile
(
330 [in] REFCLSID rclsid
,
332 [in] REFGUID guidProfiles
);
334 HRESULT GetActiveLanguageProfile
(
335 [in] REFCLSID rclsid
,
336 [out] LANGID
*plangid
,
337 [out] GUID
*pguidProfile
);
339 HRESULT GetLanguageProfileDescription
(
340 [in] REFCLSID rclsid
,
342 [in] REFGUID guidProfile
,
343 [out] BSTR *pbstrProfile
);
345 HRESULT GetCurrentLanguage
(
346 [out] LANGID
*plangid
);
348 HRESULT ChangeCurrentLanguage
(
351 HRESULT GetLanguageList
(
352 [out] LANGID
**ppLangId
,
353 [out] ULONG
*pulCount
);
355 HRESULT EnumLanguageProfiles
(
357 [out] IEnumTfLanguageProfiles
**ppEnum
);
359 HRESULT EnableLanguageProfile
(
360 [in] REFCLSID rclsid
,
362 [in] REFGUID guidProfile
,
365 HRESULT IsEnabledLanguageProfile
(
366 [in] REFCLSID rclsid
,
368 [in] REFGUID guidProfile
,
369 [out] BOOL
*pfEnable
);
371 HRESULT EnableLanguageProfileByDefault
(
372 [in] REFCLSID rclsid
,
374 [in] REFGUID guidProfile
,
377 HRESULT SubstituteKeyboardLayout
(
378 [in] REFCLSID rclsid
,
380 [in] REFGUID guidProfile
,
387 uuid(c3acefb5
-f69d
-4905-938f
-fcadcf4be830
),
388 pointer_default(unique)
390 interface ITfCategoryMgr
: IUnknown
392 HRESULT RegisterCategory
([in] REFCLSID rclsid
,
396 HRESULT UnregisterCategory
([in] REFCLSID rclsid
,
400 HRESULT EnumCategoriesInItem
([in] REFGUID rguid
,
401 [out] IEnumGUID
**ppEnum
);
403 HRESULT EnumItemsInCategory
([in] REFGUID rcatid
,
404 [out] IEnumGUID
**ppEnum
);
406 HRESULT FindClosestCategory
([in] REFGUID rguid
,
408 [in, size_is(ulCount
)] const GUID
**ppcatidList
,
411 HRESULT RegisterGUIDDescription
([in] REFCLSID rclsid
,
413 [in, size_is(cch
)] const WCHAR
*pchDesc
,
416 HRESULT UnregisterGUIDDescription
([in] REFCLSID rclsid
,
419 HRESULT GetGUIDDescription
([in] REFGUID rguid
,
420 [out] BSTR *pbstrDesc
);
422 HRESULT RegisterGUIDDWORD
([in] REFCLSID rclsid
,
426 HRESULT UnregisterGUIDDWORD
([in] REFCLSID rclsid
,
429 HRESULT GetGUIDDWORD
([in] REFGUID rguid
,
432 HRESULT RegisterGUID
([in] REFGUID rguid
,
433 [out] TfGuidAtom
*pguidatom
);
435 HRESULT GetGUID
([in] TfGuidAtom guidatom
,
438 HRESULT IsEqualTfGuidAtom
([in] TfGuidAtom guidatom
,
440 [out] BOOL
*pfEqual
);
445 uuid(8127d409
-ccd3
-4683-967a
-b43d5b482bf7
),
446 pointer_default(unique)
448 interface ITfTextEditSink
: IUnknown
451 [in] ITfContext
*pic
,
452 [in] TfEditCookie ecReadOnly
,
453 [in] ITfEditRecord
*pEditRecord
);
458 uuid(5F20AA40
-B57A
-4F34
-96AB
-3576F377CC79
),
459 pointer_default(unique)
461 interface ITfContextOwnerCompositionSink
: IUnknown
463 HRESULT OnStartComposition
(
464 [in] ITfCompositionView
*pComposition
,
467 HRESULT OnUpdateComposition
(
468 [in] ITfCompositionView
*pComposition
,
469 [in] ITfRange
*pRangeNew
);
471 HRESULT OnEndComposition
(
472 [in] ITfCompositionView
*pComposition
);
477 uuid(3d61bf11
-ac5f
-42c8
-a4cb
-931bcc28c744
),
478 pointer_default(unique)
480 interface IEnumTfLanguageProfiles
: IUnknown
483 [out] IEnumTfLanguageProfiles
**ppEnum
);
487 [out, size_is(ulCount
), length_is(*pcFetch
)] TF_LANGUAGEPROFILE
*pProfile
,
488 [out] ULONG
*pcFetch
);
499 uuid(aa80e7f7
-2021-11d2
-93e0
-0060b067b86e
),
500 pointer_default(unique)
502 interface ITfTextInputProcessor
: IUnknown
505 [in] ITfThreadMgr
*ptim
,
506 [in] TfClientId tid
);
508 HRESULT Deactivate
();
513 uuid(aa80e80e
-2021
-11d2
-93e0
-0060b067b86e
),
514 pointer_default(unique)
516 interface ITfThreadMgrEventSink
: IUnknown
518 HRESULT OnInitDocumentMgr
(
519 [in] ITfDocumentMgr
*pdim
);
521 HRESULT OnUninitDocumentMgr
(
522 [in] ITfDocumentMgr
*pdim
);
525 [in] ITfDocumentMgr
*pdimFocus
,
526 [in] ITfDocumentMgr
*pdimPrevFocus
);
528 HRESULT OnPushContext
(
529 [in] ITfContext
*pic
);
531 HRESULT OnPopContext
(
532 [in] ITfContext
*pic
);
538 uuid(aa80e7f0
-2021-11d2
-93e0
-0060b067b86e
),
539 pointer_default(unique)
541 interface ITfKeystrokeMgr
: IUnknown
543 HRESULT AdviseKeyEventSink
(
545 [in] ITfKeyEventSink
*pSink
,
546 [in] BOOL fForeground
);
548 HRESULT UnadviseKeyEventSink
(
549 [in] TfClientId tid
);
551 HRESULT GetForeground
(
552 [out] CLSID
*pclsid
);
557 [out] BOOL
*pfEaten
);
562 [out] BOOL
*pfEaten
);
567 [out] BOOL
*pfEaten
);
572 [out] BOOL
*pfEaten
);
574 HRESULT GetPreservedKey
(
575 [in] ITfContext
*pic
,
576 [in] const TF_PRESERVEDKEY
*pprekey
,
579 HRESULT IsPreservedKey
(
581 [in] const TF_PRESERVEDKEY
*pprekey
,
582 [out] BOOL
*pfRegistered
);
587 [in] const TF_PRESERVEDKEY
*prekey
,
588 [in, size_is(cchDesc
)] const WCHAR
*pchDesc
,
591 HRESULT UnpreserveKey
(
593 [in] const TF_PRESERVEDKEY
*pprekey
);
595 HRESULT SetPreservedKeyDescription
(
597 [in, size_is(cchDesc
)] const WCHAR
*pchDesc
,
600 HRESULT GetPreservedKeyDescription
(
602 [out] BSTR *pbstrDesc
);
604 HRESULT SimulatePreservedKey
(
605 [in] ITfContext
*pic
,
607 [out] BOOL
*pfEaten
);
613 uuid(aa80e7f5
-2021-11d2
-93e0
-0060b067b86e
),
614 pointer_default(unique)
616 interface ITfKeyEventSink
: IUnknown
619 [in] BOOL fForeground
);
621 HRESULT OnTestKeyDown
(
622 [in] ITfContext
*pic
,
625 [out] BOOL
*pfEaten
);
628 [in] ITfContext
*pic
,
631 [out] BOOL
*pfEaten
);
634 [in] ITfContext
*pic
,
637 [out] BOOL
*pfEaten
);
640 [in] ITfContext
*pic
,
643 [out] BOOL
*pfEaten
);
645 HRESULT OnPreservedKey
(
646 [in] ITfContext
*pic
,
648 [out] BOOL
*pfEaten
);
654 uuid(8f1b8ad8
-0b6b
-4874-90c5
-bd76011e8f7c
),
655 pointer_default(unique)
657 interface ITfMessagePump
: IUnknown
659 HRESULT PeekMessageA
(
662 [in] UINT wMsgFilterMin
,
663 [in] UINT wMsgFilterMax
,
664 [in] UINT wRemoveMsg
,
665 [out] BOOL
*pfResult
);
670 [in] UINT wMsgFilterMin
,
671 [in] UINT wMsgFilterMax
,
672 [out] BOOL
*pfResult
);
674 HRESULT PeekMessageW
(
677 [in] UINT wMsgFilterMin
,
678 [in] UINT wMsgFilterMax
,
679 [in] UINT wRemoveMsg
,
680 [out] BOOL
*pfResult
);
685 [in] UINT wMsgFilterMin
,
686 [in] UINT wMsgFilterMax
,
687 [out] BOOL
*pfResult
);
693 uuid(d60a7b49
-1b9f
-4be2
-b702
-47e9dc05dec3
),
694 pointer_default(unique)
696 interface ITfClientId
: IUnknown
699 [in] REFCLSID rclsid
,
700 [out] TfClientId
*ptid
);