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
90 typedef [uuid(5a886226
-ae9a
-489b
-b991
-2b1e25ee59a9
)] enum { TF_ANCHOR_START
= 0, TF_ANCHOR_END
= 1 } TfAnchor
;
94 uuid(aa80e801
-2021-11d2
-93e0
-0060b067b86e
),
95 pointer_default(unique)
97 interface ITfThreadMgr
: IUnknown
100 [out] TfClientId
*ptid
);
102 HRESULT Deactivate
();
104 HRESULT CreateDocumentMgr
(
105 [out] ITfDocumentMgr
**ppdim
);
107 HRESULT EnumDocumentMgrs
(
108 [out] IEnumTfDocumentMgrs
**ppEnum
);
111 [out] ITfDocumentMgr
**ppdimFocus
);
114 [in] ITfDocumentMgr
*pdimFocus
);
116 HRESULT AssociateFocus
(
118 [in, unique] ITfDocumentMgr
*pdimNew
,
119 [out] ITfDocumentMgr
**ppdimPrev
);
121 HRESULT IsThreadFocus
(
122 [out] BOOL
*pfThreadFocus
);
124 HRESULT GetFunctionProvider
(
126 [out] ITfFunctionProvider
**ppFuncProv
);
128 HRESULT EnumFunctionProviders
(
129 [out] IEnumTfFunctionProviders
**ppEnum
);
131 HRESULT GetGlobalCompartment
(
132 [out] ITfCompartmentMgr
**ppCompMgr
);
138 uuid(aa80e7f4
-2021-11d2
-93e0
-0060b067b86e
),
139 pointer_default(unique)
141 interface ITfDocumentMgr
: IUnknown
143 HRESULT CreateContext
(
144 [in] TfClientId tidOwner
,
146 [in, unique] IUnknown
*punk
,
147 [out] ITfContext
**ppic
,
148 [out] TfEditCookie
*pecTextStore
);
151 [in] ITfContext
*pic
);
153 const DWORD TF_POPF_ALL
= 0x0001;
159 [out] ITfContext
**ppic
);
162 [out] ITfContext
**ppic
);
164 HRESULT EnumContexts
(
165 [out] IEnumTfContexts
**ppEnum
);
170 uuid(aa80e7fd
-2021-11d2
-93e0
-0060b067b86e
),
171 pointer_default(unique)
173 interface ITfContext
: IUnknown
175 const DWORD TF_ES_ASYNCDONTCARE
= 0x0;
176 const DWORD TF_ES_SYNC
= 0x1;
177 const DWORD TF_ES_READ
= 0x2;
178 const DWORD TF_ES_READWRITE
= 0x6;
179 const DWORD TF_ES_ASYNC
= 0x8;
181 HRESULT RequestEditSession
(
183 [in] ITfEditSession
*pes
,
185 [out] HRESULT *phrSession
);
187 HRESULT InWriteSession
(
189 [out] BOOL
*pfWriteSession
);
191 typedef [uuid(1690be9b
-d3e9
-49f6
-8d8b
-51b905af4c43
)] enum { TF_AE_NONE
, TF_AE_START
, TF_AE_END
} TfActiveSelEnd
;
193 typedef [uuid(36ae42a4
-6989-4bdc
-b48a
-6137b7bf2e42
)] struct TF_SELECTIONSTYLE
199 typedef [uuid(75eb22f2
-b0bf
-46a8
-8006-975a3b6efcf1
)] struct TF_SELECTION
202 TF_SELECTIONSTYLE style
;
205 const ULONG TF_DEFAULT_SELECTION
= TS_DEFAULT_SELECTION
;
207 HRESULT GetSelection
(
208 [in] TfEditCookie ec
,
211 [out, size_is(ulCount
), length_is(*pcFetched
)] TF_SELECTION
*pSelection
,
212 [out] ULONG
*pcFetched
);
214 HRESULT SetSelection
(
215 [in] TfEditCookie ec
,
217 [in, size_is(ulCount
)] const TF_SELECTION
*pSelection
);
220 [in] TfEditCookie ec
,
221 [out] ITfRange
**ppStart
);
224 [in] TfEditCookie ec
,
225 [out] ITfRange
**ppEnd
);
227 typedef [uuid(bc7d979a
-846a
-444d
-afef
-0a9bfa82b961
)] TS_STATUS TF_STATUS
;
228 const DWORD TF_SD_READONLY
= TS_SD_READONLY
;
229 const DWORD TF_SD_LOADING
= TS_SD_LOADING
;
230 const DWORD TF_SS_DISJOINTSEL
= TS_SS_DISJOINTSEL
;
231 const DWORD TF_SS_REGIONS
= TS_SS_REGIONS
;
232 const DWORD TF_SS_TRANSITORY
= TS_SS_TRANSITORY
;
235 HRESULT GetActiveView
(
236 [out] ITfContextView
**ppView
);
239 [out] IEnumTfContextViews
**ppEnum
);
242 [out] TF_STATUS
*pdcs
);
245 [in] REFGUID guidProp
,
246 [out] ITfProperty
**ppProp
);
248 HRESULT GetAppProperty
(
249 [in] REFGUID guidProp
,
250 [out] ITfReadOnlyProperty
**ppProp
);
252 HRESULT TrackProperties
(
253 [in, size_is(cProp
)] const GUID
**prgProp
,
255 [in, size_is(cAppProp
)] const GUID
**prgAppProp
,
257 [out] ITfReadOnlyProperty
**ppProperty
);
259 HRESULT EnumProperties
(
260 [out] IEnumTfProperties
**ppEnum
);
262 HRESULT GetDocumentMgr
(
263 [out] ITfDocumentMgr
**ppDm
);
265 HRESULT CreateRangeBackup
(
266 [in] TfEditCookie ec
,
267 [in] ITfRange
*pRange
,
268 [out] ITfRangeBackup
**ppBackup
);
274 uuid(4ea48a35
-60ae
-446f
-8fd6
-e6a8d82459f7
),
275 pointer_default(unique)
277 interface ITfSource
: IUnknown
281 [in, iid_is(riid
)] IUnknown
*punk
,
282 [out] DWORD
*pdwCookie
);
284 HRESULT UnadviseSink
(
285 [in] DWORD dwCookie
);
291 uuid(1F02B6C5
-7842-4EE6
-8A0B
-9A24183A95CA
),
292 pointer_default(unique)
294 interface ITfInputProcessorProfiles
: IUnknown
297 [in] REFCLSID rclsid
);
300 [in] REFCLSID rclsid
);
302 HRESULT AddLanguageProfile
(
303 [in] REFCLSID rclsid
,
305 [in] REFGUID guidProfile
,
306 [in, size_is(cchDesc
)] const WCHAR
*pchDesc
,
308 [in, size_is(cchFile
)] const WCHAR
*pchIconFile
,
310 [in] ULONG uIconIndex
);
312 HRESULT RemoveLanguageProfile
(
313 [in] REFCLSID rclsid
,
315 [in] REFGUID guidProfile
);
317 HRESULT EnumInputProcessorInfo
(
318 [out] IEnumGUID
**ppEnum
);
320 HRESULT GetDefaultLanguageProfile
(
324 [out] GUID
*pguidProfile
);
326 HRESULT SetDefaultLanguageProfile
(
328 [in] REFCLSID rclsid
,
329 [in] REFGUID guidProfiles
);
331 HRESULT ActivateLanguageProfile
(
332 [in] REFCLSID rclsid
,
334 [in] REFGUID guidProfiles
);
336 HRESULT GetActiveLanguageProfile
(
337 [in] REFCLSID rclsid
,
338 [out] LANGID
*plangid
,
339 [out] GUID
*pguidProfile
);
341 HRESULT GetLanguageProfileDescription
(
342 [in] REFCLSID rclsid
,
344 [in] REFGUID guidProfile
,
345 [out] BSTR *pbstrProfile
);
347 HRESULT GetCurrentLanguage
(
348 [out] LANGID
*plangid
);
350 HRESULT ChangeCurrentLanguage
(
353 HRESULT GetLanguageList
(
354 [out] LANGID
**ppLangId
,
355 [out] ULONG
*pulCount
);
357 HRESULT EnumLanguageProfiles
(
359 [out] IEnumTfLanguageProfiles
**ppEnum
);
361 HRESULT EnableLanguageProfile
(
362 [in] REFCLSID rclsid
,
364 [in] REFGUID guidProfile
,
367 HRESULT IsEnabledLanguageProfile
(
368 [in] REFCLSID rclsid
,
370 [in] REFGUID guidProfile
,
371 [out] BOOL
*pfEnable
);
373 HRESULT EnableLanguageProfileByDefault
(
374 [in] REFCLSID rclsid
,
376 [in] REFGUID guidProfile
,
379 HRESULT SubstituteKeyboardLayout
(
380 [in] REFCLSID rclsid
,
382 [in] REFGUID guidProfile
,
389 uuid(c3acefb5
-f69d
-4905-938f
-fcadcf4be830
),
390 pointer_default(unique)
392 interface ITfCategoryMgr
: IUnknown
394 HRESULT RegisterCategory
([in] REFCLSID rclsid
,
398 HRESULT UnregisterCategory
([in] REFCLSID rclsid
,
402 HRESULT EnumCategoriesInItem
([in] REFGUID rguid
,
403 [out] IEnumGUID
**ppEnum
);
405 HRESULT EnumItemsInCategory
([in] REFGUID rcatid
,
406 [out] IEnumGUID
**ppEnum
);
408 HRESULT FindClosestCategory
([in] REFGUID rguid
,
410 [in, size_is(ulCount
)] const GUID
**ppcatidList
,
413 HRESULT RegisterGUIDDescription
([in] REFCLSID rclsid
,
415 [in, size_is(cch
)] const WCHAR
*pchDesc
,
418 HRESULT UnregisterGUIDDescription
([in] REFCLSID rclsid
,
421 HRESULT GetGUIDDescription
([in] REFGUID rguid
,
422 [out] BSTR *pbstrDesc
);
424 HRESULT RegisterGUIDDWORD
([in] REFCLSID rclsid
,
428 HRESULT UnregisterGUIDDWORD
([in] REFCLSID rclsid
,
431 HRESULT GetGUIDDWORD
([in] REFGUID rguid
,
434 HRESULT RegisterGUID
([in] REFGUID rguid
,
435 [out] TfGuidAtom
*pguidatom
);
437 HRESULT GetGUID
([in] TfGuidAtom guidatom
,
440 HRESULT IsEqualTfGuidAtom
([in] TfGuidAtom guidatom
,
442 [out] BOOL
*pfEqual
);
447 uuid(8127d409
-ccd3
-4683-967a
-b43d5b482bf7
),
448 pointer_default(unique)
450 interface ITfTextEditSink
: IUnknown
453 [in] ITfContext
*pic
,
454 [in] TfEditCookie ecReadOnly
,
455 [in] ITfEditRecord
*pEditRecord
);
460 uuid(5F20AA40
-B57A
-4F34
-96AB
-3576F377CC79
),
461 pointer_default(unique)
463 interface ITfContextOwnerCompositionSink
: IUnknown
465 HRESULT OnStartComposition
(
466 [in] ITfCompositionView
*pComposition
,
469 HRESULT OnUpdateComposition
(
470 [in] ITfCompositionView
*pComposition
,
471 [in] ITfRange
*pRangeNew
);
473 HRESULT OnEndComposition
(
474 [in] ITfCompositionView
*pComposition
);
479 uuid(3d61bf11
-ac5f
-42c8
-a4cb
-931bcc28c744
),
480 pointer_default(unique)
482 interface IEnumTfLanguageProfiles
: IUnknown
485 [out] IEnumTfLanguageProfiles
**ppEnum
);
489 [out, size_is(ulCount
), length_is(*pcFetch
)] TF_LANGUAGEPROFILE
*pProfile
,
490 [out] ULONG
*pcFetch
);
501 uuid(aa80e7f7
-2021-11d2
-93e0
-0060b067b86e
),
502 pointer_default(unique)
504 interface ITfTextInputProcessor
: IUnknown
507 [in] ITfThreadMgr
*ptim
,
508 [in] TfClientId tid
);
510 HRESULT Deactivate
();
515 uuid(aa80e80e
-2021
-11d2
-93e0
-0060b067b86e
),
516 pointer_default(unique)
518 interface ITfThreadMgrEventSink
: IUnknown
520 HRESULT OnInitDocumentMgr
(
521 [in] ITfDocumentMgr
*pdim
);
523 HRESULT OnUninitDocumentMgr
(
524 [in] ITfDocumentMgr
*pdim
);
527 [in] ITfDocumentMgr
*pdimFocus
,
528 [in] ITfDocumentMgr
*pdimPrevFocus
);
530 HRESULT OnPushContext
(
531 [in] ITfContext
*pic
);
533 HRESULT OnPopContext
(
534 [in] ITfContext
*pic
);
540 uuid(aa80e7f0
-2021-11d2
-93e0
-0060b067b86e
),
541 pointer_default(unique)
543 interface ITfKeystrokeMgr
: IUnknown
545 HRESULT AdviseKeyEventSink
(
547 [in] ITfKeyEventSink
*pSink
,
548 [in] BOOL fForeground
);
550 HRESULT UnadviseKeyEventSink
(
551 [in] TfClientId tid
);
553 HRESULT GetForeground
(
554 [out] CLSID
*pclsid
);
559 [out] BOOL
*pfEaten
);
564 [out] BOOL
*pfEaten
);
569 [out] BOOL
*pfEaten
);
574 [out] BOOL
*pfEaten
);
576 HRESULT GetPreservedKey
(
577 [in] ITfContext
*pic
,
578 [in] const TF_PRESERVEDKEY
*pprekey
,
581 HRESULT IsPreservedKey
(
583 [in] const TF_PRESERVEDKEY
*pprekey
,
584 [out] BOOL
*pfRegistered
);
589 [in] const TF_PRESERVEDKEY
*prekey
,
590 [in, size_is(cchDesc
)] const WCHAR
*pchDesc
,
593 HRESULT UnpreserveKey
(
595 [in] const TF_PRESERVEDKEY
*pprekey
);
597 HRESULT SetPreservedKeyDescription
(
599 [in, size_is(cchDesc
)] const WCHAR
*pchDesc
,
602 HRESULT GetPreservedKeyDescription
(
604 [out] BSTR *pbstrDesc
);
606 HRESULT SimulatePreservedKey
(
607 [in] ITfContext
*pic
,
609 [out] BOOL
*pfEaten
);
615 uuid(aa80e7f5
-2021-11d2
-93e0
-0060b067b86e
),
616 pointer_default(unique)
618 interface ITfKeyEventSink
: IUnknown
621 [in] BOOL fForeground
);
623 HRESULT OnTestKeyDown
(
624 [in] ITfContext
*pic
,
627 [out] BOOL
*pfEaten
);
630 [in] ITfContext
*pic
,
633 [out] BOOL
*pfEaten
);
636 [in] ITfContext
*pic
,
639 [out] BOOL
*pfEaten
);
642 [in] ITfContext
*pic
,
645 [out] BOOL
*pfEaten
);
647 HRESULT OnPreservedKey
(
648 [in] ITfContext
*pic
,
650 [out] BOOL
*pfEaten
);
656 uuid(8f1b8ad8
-0b6b
-4874-90c5
-bd76011e8f7c
),
657 pointer_default(unique)
659 interface ITfMessagePump
: IUnknown
661 HRESULT PeekMessageA
(
664 [in] UINT wMsgFilterMin
,
665 [in] UINT wMsgFilterMax
,
666 [in] UINT wRemoveMsg
,
667 [out] BOOL
*pfResult
);
672 [in] UINT wMsgFilterMin
,
673 [in] UINT wMsgFilterMax
,
674 [out] BOOL
*pfResult
);
676 HRESULT PeekMessageW
(
679 [in] UINT wMsgFilterMin
,
680 [in] UINT wMsgFilterMax
,
681 [in] UINT wRemoveMsg
,
682 [out] BOOL
*pfResult
);
687 [in] UINT wMsgFilterMin
,
688 [in] UINT wMsgFilterMax
,
689 [out] BOOL
*pfResult
);
695 uuid(d60a7b49
-1b9f
-4be2
-b702
-47e9dc05dec3
),
696 pointer_default(unique)
698 interface ITfClientId
: IUnknown
701 [in] REFCLSID rclsid
,
702 [out] TfClientId
*ptid
);
707 uuid(43c9fe15
-f494
-4c17
-9de2
-b8a4ac350aa8
),
708 pointer_default(unique)
710 interface ITfLanguageProfileNotifySink
: IUnknown
712 HRESULT OnLanguageChange
(
714 [out] BOOL
*pfAccept
);
716 HRESULT OnLanguageChanged
();
721 uuid(aa80e803
-2021-11d2
-93e0
-0060b067b86e
),
722 pointer_default(unique)
724 interface ITfEditSession
: IUnknown
726 HRESULT DoEditSession
(
727 [in] TfEditCookie ec
);
732 uuid(aa80e7ff
-2021-11d2
-93e0
-0060b067b86e
),
733 pointer_default(unique)
735 interface ITfRange
: IUnknown
737 const WCHAR TF_CHAR_EMBEDDED
= TS_CHAR_EMBEDDED
;
739 typedef [uuid(cf610f06
-2882-46f6
-abe5
-298568b664c4
)] enum { TF_GRAVITY_BACKWARD
= 0, TF_GRAVITY_FORWARD
= 1 } TfGravity
;
741 typedef [uuid(1e512533
-bbdc
-4530-9a8e
-a1dc0af67468
)] enum { TF_SD_BACKWARD
= 0, TF_SD_FORWARD
= 1 } TfShiftDir
;
743 const DWORD TF_HF_OBJECT
= 1;
744 const DWORD TF_TF_MOVESTART
= 1;
745 const DWORD TF_TF_IGNOREEND
= 2;
746 const DWORD TF_ST_CORRECTION
= 1;
747 const DWORD TF_IE_CORRECTION
= 1;
749 typedef [uuid(49930d51
-7d93
-448c
-a48c
-fea5dac192b1
)] struct TF_HALTCOND
751 ITfRange
*pHaltRange
;
757 [in] TfEditCookie ec
,
759 [out, size_is(cchMax
), length_is(*pcch
)] WCHAR
*pchText
,
764 [in] TfEditCookie ec
,
766 [in, size_is(cch
), unique] const WCHAR
*pchText
,
769 HRESULT GetFormattedText
(
770 [in] TfEditCookie ec
,
771 [out] IDataObject
**ppDataObject
);
774 [in] TfEditCookie ec
,
775 [in] REFGUID rguidService
,
777 [out, iid_is(riid
)] IUnknown
**ppunk
);
779 HRESULT InsertEmbedded
(
780 [in] TfEditCookie ec
,
782 [in] IDataObject
*pDataObject
);
785 [in] TfEditCookie ec
,
788 [in, unique] const TF_HALTCOND
*pHalt
);
791 [in] TfEditCookie ec
,
794 [in, unique] const TF_HALTCOND
*pHalt
);
796 HRESULT ShiftStartToRange
(
797 [in] TfEditCookie ec
,
798 [in] ITfRange
*pRange
,
801 HRESULT ShiftEndToRange
(
802 [in] TfEditCookie ec
,
803 [in] ITfRange
*pRange
,
806 HRESULT ShiftStartRegion
(
807 [in] TfEditCookie ec
,
809 [out] BOOL
*pfNoRegion
);
811 HRESULT ShiftEndRegion
(
812 [in] TfEditCookie ec
,
814 [out] BOOL
*pfNoRegion
);
817 [in] TfEditCookie ec
,
818 [out] BOOL
*pfEmpty
);
821 [in] TfEditCookie ec
,
824 HRESULT IsEqualStart
(
825 [in] TfEditCookie ec
,
826 [in] ITfRange
*pWith
,
828 [out] BOOL
*pfEqual
);
831 [in] TfEditCookie ec
,
832 [in] ITfRange
*pWith
,
834 [out] BOOL
*pfEqual
);
836 HRESULT CompareStart
(
837 [in] TfEditCookie ec
,
838 [in] ITfRange
*pWith
,
840 [out] LONG *plResult
);
843 [in] TfEditCookie ec
,
844 [in] ITfRange
*pWith
,
846 [out] LONG *plResult
);
848 HRESULT AdjustForInsert
(
849 [in] TfEditCookie ec
,
850 [in] ULONG cchInsert
,
851 [out] BOOL
*pfInsertOk
);
854 [out] TfGravity
*pgStart
,
855 [out] TfGravity
*pgEnd
);
858 [in] TfEditCookie ec
,
859 [in] TfGravity gStart
,
860 [in] TfGravity gEnd
);
863 [out] ITfRange
**ppClone
);
866 [out] ITfContext
**ppContext
);