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"; */
26 cpp_quote
("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
27 cpp_quote
("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
28 cpp_quote
("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
29 cpp_quote
("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
31 /* GUIDs for Categories */
32 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
33 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
34 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
35 cpp_quote
("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
37 typedef [uuid(7213778c
-7bb0
-4270-b050
-6189ee594e97
)] DWORD TfEditCookie
;
38 typedef [uuid(de403c21
-89fd
-4f85
-8b87
-64584d063fbc
)] DWORD TfClientId
;
39 typedef [uuid(88a9c478
-f3ec
-4763-8345-cd9250443f8d
)] DWORD TfGuidAtom
;
41 interface ITfDocumentMgr
;
43 interface IEnumTfDocumentMgrs
;
44 interface IEnumTfContexts
;
45 interface ITfFunctionProvider
;
46 interface IEnumTfFunctionProviders
;
47 interface ITfCompartmentMgr
;
48 interface ITfEditSession
;
50 interface ITfContextView
;
51 interface IEnumTfContextViews
;
52 interface ITfProperty
;
53 interface ITfReadOnlyProperty
;
54 interface IEnumTfProperties
;
55 interface ITfRangeBackup
;
56 interface IEnumTfLanguageProfiles
;
57 interface ITfEditRecord
;
58 interface ITfCompositionView
;
60 typedef [uuid(e1b5808d
-1e46
-4c19
-84dc
-68c5f5978cc8
)] struct TF_LANGUAGEPROFILE
71 uuid(aa80e801
-2021-11d2
-93e0
-0060b067b86e
),
72 pointer_default(unique)
74 interface ITfThreadMgr
: IUnknown
77 [out] TfClientId
*ptid
);
81 HRESULT CreateDocumentMgr
(
82 [out] ITfDocumentMgr
**ppdim
);
84 HRESULT EnumDocumentMgrs
(
85 [out] IEnumTfDocumentMgrs
**ppEnum
);
88 [out] ITfDocumentMgr
**ppdimFocus
);
91 [in] ITfDocumentMgr
*pdimFocus
);
93 HRESULT AssociateFocus
(
95 [in, unique] ITfDocumentMgr
*pdimNew
,
96 [out] ITfDocumentMgr
**ppdimPrev
);
98 HRESULT IsThreadFocus
(
99 [out] BOOL
*pfThreadFocus
);
101 HRESULT GetFunctionProvider
(
103 [out] ITfFunctionProvider
**ppFuncProv
);
105 HRESULT EnumFunctionProviders
(
106 [out] IEnumTfFunctionProviders
**ppEnum
);
108 HRESULT GetGlobalCompartment
(
109 [out] ITfCompartmentMgr
**ppCompMgr
);
115 uuid(aa80e7f4
-2021-11d2
-93e0
-0060b067b86e
),
116 pointer_default(unique)
118 interface ITfDocumentMgr
: IUnknown
120 HRESULT CreateContext
(
121 [in] TfClientId tidOwner
,
123 [in, unique] IUnknown
*punk
,
124 [out] ITfContext
**ppic
,
125 [out] TfEditCookie
*pecTextStore
);
128 [in] ITfContext
*pic
);
130 const DWORD TF_POPF_ALL
= 0x0001;
136 [out] ITfContext
**ppic
);
139 [out] ITfContext
**ppic
);
141 HRESULT EnumContexts
(
142 [out] IEnumTfContexts
**ppEnum
);
147 uuid(aa80e7fd
-2021-11d2
-93e0
-0060b067b86e
),
148 pointer_default(unique)
150 interface ITfContext
: IUnknown
152 const DWORD TF_ES_ASYNCDONTCARE
= 0x0;
153 const DWORD TF_ES_SYNC
= 0x1;
154 const DWORD TF_ES_READ
= 0x2;
155 const DWORD TF_ES_READWRITE
= 0x6;
156 const DWORD TF_ES_ASYNC
= 0x8;
158 HRESULT RequestEditSession
(
160 [in] ITfEditSession
*pes
,
162 [out] HRESULT *phrSession
);
164 HRESULT InWriteSession
(
166 [out] BOOL
*pfWriteSession
);
168 typedef [uuid(1690be9b
-d3e9
-49f6
-8d8b
-51b905af4c43
)] enum { TF_AE_NONE
, TF_AE_START
, TF_AE_END
} TfActiveSelEnd
;
170 typedef [uuid(36ae42a4
-6989-4bdc
-b48a
-6137b7bf2e42
)] struct TF_SELECTIONSTYLE
176 typedef [uuid(75eb22f2
-b0bf
-46a8
-8006-975a3b6efcf1
)] struct TF_SELECTION
179 TF_SELECTIONSTYLE style
;
182 const ULONG TF_DEFAULT_SELECTION
= TS_DEFAULT_SELECTION
;
184 HRESULT GetSelection
(
185 [in] TfEditCookie ec
,
188 [out, size_is(ulCount
), length_is(*pcFetched
)] TF_SELECTION
*pSelection
,
189 [out] ULONG
*pcFetched
);
191 HRESULT SetSelection
(
192 [in] TfEditCookie ec
,
194 [in, size_is(ulCount
)] const TF_SELECTION
*pSelection
);
197 [in] TfEditCookie ec
,
198 [out] ITfRange
**ppStart
);
201 [in] TfEditCookie ec
,
202 [out] ITfRange
**ppEnd
);
204 typedef [uuid(bc7d979a
-846a
-444d
-afef
-0a9bfa82b961
)] TS_STATUS TF_STATUS
;
205 const DWORD TF_SD_READONLY
= TS_SD_READONLY
;
206 const DWORD TF_SD_LOADING
= TS_SD_LOADING
;
207 const DWORD TF_SS_DISJOINTSEL
= TS_SS_DISJOINTSEL
;
208 const DWORD TF_SS_REGIONS
= TS_SS_REGIONS
;
209 const DWORD TF_SS_TRANSITORY
= TS_SS_TRANSITORY
;
212 HRESULT GetActiveView
(
213 [out] ITfContextView
**ppView
);
216 [out] IEnumTfContextViews
**ppEnum
);
219 [out] TF_STATUS
*pdcs
);
222 [in] REFGUID guidProp
,
223 [out] ITfProperty
**ppProp
);
225 HRESULT GetAppProperty
(
226 [in] REFGUID guidProp
,
227 [out] ITfReadOnlyProperty
**ppProp
);
229 HRESULT TrackProperties
(
230 [in, size_is(cProp
)] const GUID
**prgProp
,
232 [in, size_is(cAppProp
)] const GUID
**prgAppProp
,
234 [out] ITfReadOnlyProperty
**ppProperty
);
236 HRESULT EnumProperties
(
237 [out] IEnumTfProperties
**ppEnum
);
239 HRESULT GetDocumentMgr
(
240 [out] ITfDocumentMgr
**ppDm
);
242 HRESULT CreateRangeBackup
(
243 [in] TfEditCookie ec
,
244 [in] ITfRange
*pRange
,
245 [out] ITfRangeBackup
**ppBackup
);
251 uuid(4ea48a35
-60ae
-446f
-8fd6
-e6a8d82459f7
),
252 pointer_default(unique)
254 interface ITfSource
: IUnknown
258 [in, iid_is(riid
)] IUnknown
*punk
,
259 [out] DWORD
*pdwCookie
);
261 HRESULT UnadviseSink
(
262 [in] DWORD dwCookie
);
268 uuid(1F02B6C5
-7842-4EE6
-8A0B
-9A24183A95CA
),
269 pointer_default(unique)
271 interface ITfInputProcessorProfiles
: IUnknown
274 [in] REFCLSID rclsid
);
277 [in] REFCLSID rclsid
);
279 HRESULT AddLanguageProfile
(
280 [in] REFCLSID rclsid
,
282 [in] REFGUID guidProfile
,
283 [in, size_is(cchDesc
)] const WCHAR
*pchDesc
,
285 [in, size_is(cchFile
)] const WCHAR
*pchIconFile
,
287 [in] ULONG uIconIndex
);
289 HRESULT RemoveLanguageProfile
(
290 [in] REFCLSID rclsid
,
292 [in] REFGUID guidProfile
);
294 HRESULT EnumInputProcessorInfo
(
295 [out] IEnumGUID
**ppEnum
);
297 HRESULT GetDefaultLanguageProfile
(
301 [out] GUID
*pguidProfile
);
303 HRESULT SetDefaultLanguageProfile
(
305 [in] REFCLSID rclsid
,
306 [in] REFGUID guidProfiles
);
308 HRESULT ActivateLanguageProfile
(
309 [in] REFCLSID rclsid
,
311 [in] REFGUID guidProfiles
);
313 HRESULT GetActiveLanguageProfile
(
314 [in] REFCLSID rclsid
,
315 [out] LANGID
*plangid
,
316 [out] GUID
*pguidProfile
);
318 HRESULT GetLanguageProfileDescription
(
319 [in] REFCLSID rclsid
,
321 [in] REFGUID guidProfile
,
322 [out] BSTR *pbstrProfile
);
324 HRESULT GetCurrentLanguage
(
325 [out] LANGID
*plangid
);
327 HRESULT ChangeCurrentLanguage
(
330 HRESULT GetLanguageList
(
331 [out] LANGID
**ppLangId
,
332 [out] ULONG
*pulCount
);
334 HRESULT EnumLanguageProfiles
(
336 [out] IEnumTfLanguageProfiles
**ppEnum
);
338 HRESULT EnableLanguageProfile
(
339 [in] REFCLSID rclsid
,
341 [in] REFGUID guidProfile
,
344 HRESULT IsEnabledLanguageProfile
(
345 [in] REFCLSID rclsid
,
347 [in] REFGUID guidProfile
,
348 [out] BOOL
*pfEnable
);
350 HRESULT EnableLanguageProfileByDefault
(
351 [in] REFCLSID rclsid
,
353 [in] REFGUID guidProfile
,
356 HRESULT SubstituteKeyboardLayout
(
357 [in] REFCLSID rclsid
,
359 [in] REFGUID guidProfile
,
366 uuid(c3acefb5
-f69d
-4905-938f
-fcadcf4be830
),
367 pointer_default(unique)
369 interface ITfCategoryMgr
: IUnknown
371 HRESULT RegisterCategory
([in] REFCLSID rclsid
,
375 HRESULT UnregisterCategory
([in] REFCLSID rclsid
,
379 HRESULT EnumCategoriesInItem
([in] REFGUID rguid
,
380 [out] IEnumGUID
**ppEnum
);
382 HRESULT EnumItemsInCategory
([in] REFGUID rcatid
,
383 [out] IEnumGUID
**ppEnum
);
385 HRESULT FindClosestCategory
([in] REFGUID rguid
,
387 [in, size_is(ulCount
)] const GUID
**ppcatidList
,
390 HRESULT RegisterGUIDDescription
([in] REFCLSID rclsid
,
392 [in, size_is(cch
)] const WCHAR
*pchDesc
,
395 HRESULT UnregisterGUIDDescription
([in] REFCLSID rclsid
,
398 HRESULT GetGUIDDescription
([in] REFGUID rguid
,
399 [out] BSTR *pbstrDesc
);
401 HRESULT RegisterGUIDDWORD
([in] REFCLSID rclsid
,
405 HRESULT UnregisterGUIDDWORD
([in] REFCLSID rclsid
,
408 HRESULT GetGUIDDWORD
([in] REFGUID rguid
,
411 HRESULT RegisterGUID
([in] REFGUID rguid
,
412 [out] TfGuidAtom
*pguidatom
);
414 HRESULT GetGUID
([in] TfGuidAtom guidatom
,
417 HRESULT IsEqualTfGuidAtom
([in] TfGuidAtom guidatom
,
419 [out] BOOL
*pfEqual
);
424 uuid(8127d409
-ccd3
-4683-967a
-b43d5b482bf7
),
425 pointer_default(unique)
427 interface ITfTextEditSink
: IUnknown
430 [in] ITfContext
*pic
,
431 [in] TfEditCookie ecReadOnly
,
432 [in] ITfEditRecord
*pEditRecord
);
437 uuid(5F20AA40
-B57A
-4F34
-96AB
-3576F377CC79
),
438 pointer_default(unique)
440 interface ITfContextOwnerCompositionSink
: IUnknown
442 HRESULT OnStartComposition
(
443 [in] ITfCompositionView
*pComposition
,
446 HRESULT OnUpdateComposition
(
447 [in] ITfCompositionView
*pComposition
,
448 [in] ITfRange
*pRangeNew
);
450 HRESULT OnEndComposition
(
451 [in] ITfCompositionView
*pComposition
);
456 uuid(3d61bf11
-ac5f
-42c8
-a4cb
-931bcc28c744
),
457 pointer_default(unique)
459 interface IEnumTfLanguageProfiles
: IUnknown
462 [out] IEnumTfLanguageProfiles
**ppEnum
);
466 [out, size_is(ulCount
), length_is(*pcFetch
)] TF_LANGUAGEPROFILE
*pProfile
,
467 [out] ULONG
*pcFetch
);
478 uuid(aa80e7f7
-2021-11d2
-93e0
-0060b067b86e
),
479 pointer_default(unique)
481 interface ITfTextInputProcessor
: IUnknown
484 [in] ITfThreadMgr
*ptim
,
485 [in] TfClientId tid
);
487 HRESULT Deactivate
();
492 uuid(aa80e80e
-2021
-11d2
-93e0
-0060b067b86e
),
493 pointer_default(unique)
495 interface ITfThreadMgrEventSink
: IUnknown
497 HRESULT OnInitDocumentMgr
(
498 [in] ITfDocumentMgr
*pdim
);
500 HRESULT OnUninitDocumentMgr
(
501 [in] ITfDocumentMgr
*pdim
);
504 [in] ITfDocumentMgr
*pdimFocus
,
505 [in] ITfDocumentMgr
*pdimPrevFocus
);
507 HRESULT OnPushContext
(
508 [in] ITfContext
*pic
);
510 HRESULT OnPopContext
(
511 [in] ITfContext
*pic
);