blob: c81c0dae9b8906ead59d0280048133aa6393b90c [file] [log] [blame]
Aric Stewartb8416b92009-01-27 14:15:23 -06001/*
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
20import "oaidl.idl";
21import "comcat.idl";
Aric Stewartb712f392009-02-02 10:24:59 -060022import "textstor.idl";
Aric Stewartb8416b92009-01-27 14:15:23 -060023/* import "ctfutb.idl"; */
24#endif
25
Aric Stewartfd8c2a12009-02-02 10:25:06 -060026cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
Aric Stewartb8416b92009-01-27 14:15:23 -060027cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
Aric Stewart6c842a82009-02-03 13:17:04 -060028cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
Aric Stewart2fe3b642009-02-03 13:18:02 -060029cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
Aric Stewart43db8472009-01-27 14:15:30 -060030
Aric Stewartda8cdac2009-02-20 08:00:50 -060031/* GUIDs for Categories */
32cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
33cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
34cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
35cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
36
Aric Stewartfdbe3d12009-01-30 14:27:06 -060037typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie;
Aric Stewart43db8472009-01-27 14:15:30 -060038typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
Aric Stewart2fe3b642009-02-03 13:18:02 -060039typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
Aric Stewart43db8472009-01-27 14:15:30 -060040
41interface ITfDocumentMgr;
Aric Stewartfdbe3d12009-01-30 14:27:06 -060042interface ITfContext;
Aric Stewart43db8472009-01-27 14:15:30 -060043interface IEnumTfDocumentMgrs;
Aric Stewartfdbe3d12009-01-30 14:27:06 -060044interface IEnumTfContexts;
Aric Stewart43db8472009-01-27 14:15:30 -060045interface ITfFunctionProvider;
46interface IEnumTfFunctionProviders;
47interface ITfCompartmentMgr;
Aric Stewartb712f392009-02-02 10:24:59 -060048interface ITfEditSession;
49interface ITfRange;
50interface ITfContextView;
51interface IEnumTfContextViews;
52interface ITfProperty;
53interface ITfReadOnlyProperty;
54interface IEnumTfProperties;
55interface ITfRangeBackup;
Aric Stewart6c842a82009-02-03 13:17:04 -060056interface IEnumTfLanguageProfiles;
Aric Stewart17666002009-02-04 14:48:36 -060057interface ITfEditRecord;
Aric Stewart1adb1d82009-02-05 14:17:50 -060058interface ITfCompositionView;
Aric Stewart43db8472009-01-27 14:15:30 -060059
Aric Stewart606d0872009-02-20 13:52:37 -060060typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
61{
62 CLSID clsid;
63 LANGID langid;
64 GUID catid;
65 BOOL fActive;
66 GUID guidProfile;
67} TF_LANGUAGEPROFILE;
68
Aric Stewart43db8472009-01-27 14:15:30 -060069[
70 object,
71 uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
72 pointer_default(unique)
73]
74interface ITfThreadMgr: IUnknown
75{
76 HRESULT Activate(
77 [out] TfClientId *ptid);
78
79 HRESULT Deactivate();
80
81 HRESULT CreateDocumentMgr(
82 [out] ITfDocumentMgr **ppdim);
83
84 HRESULT EnumDocumentMgrs(
85 [out] IEnumTfDocumentMgrs **ppEnum);
86
87 HRESULT GetFocus(
88 [out] ITfDocumentMgr **ppdimFocus);
89
90 HRESULT SetFocus(
91 [in] ITfDocumentMgr *pdimFocus);
92
93 HRESULT AssociateFocus(
94 [in] HWND hwnd,
95 [in, unique] ITfDocumentMgr *pdimNew,
96 [out] ITfDocumentMgr **ppdimPrev);
97
98 HRESULT IsThreadFocus(
99 [out] BOOL *pfThreadFocus);
100
101 HRESULT GetFunctionProvider(
102 [in] REFCLSID clsid,
103 [out] ITfFunctionProvider **ppFuncProv);
104
105 HRESULT EnumFunctionProviders(
106 [out] IEnumTfFunctionProviders **ppEnum);
107
108 HRESULT GetGlobalCompartment(
109 [out] ITfCompartmentMgr **ppCompMgr);
110};
Aric Stewartfdbe3d12009-01-30 14:27:06 -0600111
112
113[
114 object,
115 uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
116 pointer_default(unique)
117]
118interface ITfDocumentMgr: IUnknown
119{
120 HRESULT CreateContext(
121 [in] TfClientId tidOwner,
122 [in] DWORD dwFlags,
123 [in, unique] IUnknown *punk,
124 [out] ITfContext **ppic,
125 [out] TfEditCookie *pecTextStore);
126
127 HRESULT Push(
128 [in] ITfContext *pic);
129
130 const DWORD TF_POPF_ALL = 0x0001;
131
132 HRESULT Pop(
133 [in] DWORD dwFlags);
134
135 HRESULT GetTop(
136 [out] ITfContext **ppic);
137
138 HRESULT GetBase(
139 [out] ITfContext **ppic);
140
141 HRESULT EnumContexts(
142 [out] IEnumTfContexts **ppEnum);
143};
Aric Stewartb712f392009-02-02 10:24:59 -0600144
145[
146 object,
147 uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
148 pointer_default(unique)
149]
150interface ITfContext : IUnknown
151{
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;
157
158 HRESULT RequestEditSession(
159 [in] TfClientId tid,
160 [in] ITfEditSession *pes,
161 [in] DWORD dwFlags,
162 [out] HRESULT *phrSession);
163
164 HRESULT InWriteSession(
165 [in] TfClientId tid,
166 [out] BOOL *pfWriteSession);
167
168 typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE, TF_AE_START, TF_AE_END } TfActiveSelEnd;
169
170 typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
171 {
172 TfActiveSelEnd ase;
173 BOOL fInterimChar;
174 } TF_SELECTIONSTYLE;
175
176 typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
177 {
178 ITfRange *range;
179 TF_SELECTIONSTYLE style;
180 } TF_SELECTION;
181
182 const ULONG TF_DEFAULT_SELECTION = TS_DEFAULT_SELECTION;
183
184 HRESULT GetSelection(
185 [in] TfEditCookie ec,
186 [in] ULONG ulIndex,
187 [in] ULONG ulCount,
188 [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
189 [out] ULONG *pcFetched);
190
191 HRESULT SetSelection(
192 [in] TfEditCookie ec,
193 [in] ULONG ulCount,
194 [in, size_is(ulCount)] const TF_SELECTION *pSelection);
195
196 HRESULT GetStart(
197 [in] TfEditCookie ec,
198 [out] ITfRange **ppStart);
199
200 HRESULT GetEnd(
201 [in] TfEditCookie ec,
202 [out] ITfRange **ppEnd);
203
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;
210
211
212 HRESULT GetActiveView(
213 [out] ITfContextView **ppView);
214
215 HRESULT EnumViews(
216 [out] IEnumTfContextViews **ppEnum);
217
218 HRESULT GetStatus(
219 [out] TF_STATUS *pdcs);
220
221 HRESULT GetProperty(
222 [in] REFGUID guidProp,
223 [out] ITfProperty **ppProp);
224
225 HRESULT GetAppProperty(
226 [in] REFGUID guidProp,
227 [out] ITfReadOnlyProperty **ppProp);
228
229 HRESULT TrackProperties(
230 [in, size_is(cProp)] const GUID **prgProp,
231 [in] ULONG cProp,
232 [in, size_is(cAppProp)] const GUID **prgAppProp,
233 [in] ULONG cAppProp,
234 [out] ITfReadOnlyProperty **ppProperty);
235
236 HRESULT EnumProperties(
237 [out] IEnumTfProperties **ppEnum);
238
239 HRESULT GetDocumentMgr(
240 [out] ITfDocumentMgr **ppDm);
241
242 HRESULT CreateRangeBackup(
243 [in] TfEditCookie ec,
244 [in] ITfRange *pRange,
245 [out] ITfRangeBackup **ppBackup);
246
247};
Aric Stewartd09f4c02009-02-02 10:25:36 -0600248
249[
250 object,
251 uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
252 pointer_default(unique)
253]
254interface ITfSource : IUnknown
255{
256 HRESULT AdviseSink(
257 [in] REFIID riid,
258 [in, iid_is(riid)] IUnknown *punk,
259 [out] DWORD *pdwCookie);
260
261 HRESULT UnadviseSink(
262 [in] DWORD dwCookie);
263};
Aric Stewart6c842a82009-02-03 13:17:04 -0600264
265[
266 object,
267 local,
268 uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
269 pointer_default(unique)
270]
271interface ITfInputProcessorProfiles : IUnknown
272{
273 HRESULT Register(
274 [in] REFCLSID rclsid);
275
276 HRESULT Unregister(
277 [in] REFCLSID rclsid);
278
279 HRESULT AddLanguageProfile(
280 [in] REFCLSID rclsid,
281 [in] LANGID langid,
282 [in] REFGUID guidProfile,
283 [in, size_is(cchDesc)] const WCHAR *pchDesc,
284 [in] ULONG cchDesc,
285 [in, size_is(cchFile)] const WCHAR *pchIconFile,
286 [in] ULONG cchFile,
287 [in] ULONG uIconIndex);
288
289 HRESULT RemoveLanguageProfile(
290 [in] REFCLSID rclsid,
291 [in] LANGID langid,
292 [in] REFGUID guidProfile);
293
294 HRESULT EnumInputProcessorInfo(
295 [out] IEnumGUID **ppEnum);
296
297 HRESULT GetDefaultLanguageProfile(
298 [in] LANGID langid,
299 [in] REFGUID catid,
300 [out] CLSID *pclsid,
301 [out] GUID *pguidProfile);
302
303 HRESULT SetDefaultLanguageProfile(
304 [in] LANGID langid,
305 [in] REFCLSID rclsid,
306 [in] REFGUID guidProfiles);
307
308 HRESULT ActivateLanguageProfile(
309 [in] REFCLSID rclsid,
310 [in] LANGID langid,
311 [in] REFGUID guidProfiles);
312
313 HRESULT GetActiveLanguageProfile(
314 [in] REFCLSID rclsid,
315 [out] LANGID *plangid,
316 [out] GUID *pguidProfile);
317
318 HRESULT GetLanguageProfileDescription(
319 [in] REFCLSID rclsid,
320 [in] LANGID langid,
321 [in] REFGUID guidProfile,
322 [out] BSTR *pbstrProfile);
323
324 HRESULT GetCurrentLanguage(
325 [out] LANGID *plangid);
326
327 HRESULT ChangeCurrentLanguage(
328 [in] LANGID langid);
329
330 HRESULT GetLanguageList(
331 [out] LANGID **ppLangId,
332 [out] ULONG *pulCount);
333
334 HRESULT EnumLanguageProfiles(
335 [in] LANGID langid,
336 [out] IEnumTfLanguageProfiles **ppEnum);
337
338 HRESULT EnableLanguageProfile(
339 [in] REFCLSID rclsid,
340 [in] LANGID langid,
341 [in] REFGUID guidProfile,
342 [in] BOOL fEnable);
343
344 HRESULT IsEnabledLanguageProfile(
345 [in] REFCLSID rclsid,
346 [in] LANGID langid,
347 [in] REFGUID guidProfile,
348 [out] BOOL *pfEnable);
349
350 HRESULT EnableLanguageProfileByDefault(
351 [in] REFCLSID rclsid,
352 [in] LANGID langid,
353 [in] REFGUID guidProfile,
354 [in] BOOL fEnable);
355
356 HRESULT SubstituteKeyboardLayout(
357 [in] REFCLSID rclsid,
358 [in] LANGID langid,
359 [in] REFGUID guidProfile,
360 [in] HKL hKL);
361};
Aric Stewart2fe3b642009-02-03 13:18:02 -0600362
363[
364 object,
365 local,
366 uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
367 pointer_default(unique)
368]
369interface ITfCategoryMgr : IUnknown
370{
371 HRESULT RegisterCategory([in] REFCLSID rclsid,
372 [in] REFGUID rcatid,
373 [in] REFGUID rguid);
374
375 HRESULT UnregisterCategory([in] REFCLSID rclsid,
376 [in] REFGUID rcatid,
377 [in] REFGUID rguid);
378
379 HRESULT EnumCategoriesInItem([in] REFGUID rguid,
380 [out] IEnumGUID **ppEnum);
381
382 HRESULT EnumItemsInCategory([in] REFGUID rcatid,
383 [out] IEnumGUID **ppEnum);
384
385 HRESULT FindClosestCategory([in] REFGUID rguid,
386 [out] GUID *pcatid,
387 [in, size_is(ulCount)] const GUID **ppcatidList,
388 [in] ULONG ulCount);
389
390 HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
391 [in] REFGUID rguid,
392 [in, size_is(cch)] const WCHAR *pchDesc,
393 [in] ULONG cch);
394
395 HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
396 [in] REFGUID rguid);
397
398 HRESULT GetGUIDDescription([in] REFGUID rguid,
399 [out] BSTR *pbstrDesc);
400
401 HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
402 [in] REFGUID rguid,
403 [in] DWORD dw);
404
405 HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
406 [in] REFGUID rguid);
407
408 HRESULT GetGUIDDWORD([in] REFGUID rguid,
409 [out] DWORD *pdw);
410
411 HRESULT RegisterGUID([in] REFGUID rguid,
412 [out] TfGuidAtom *pguidatom);
413
414 HRESULT GetGUID([in] TfGuidAtom guidatom,
415 [out] GUID *pguid);
416
417 HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
418 [in] REFGUID rguid,
419 [out] BOOL *pfEqual);
420};
Aric Stewart17666002009-02-04 14:48:36 -0600421
422[
423 object,
424 uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
425 pointer_default(unique)
426]
427interface ITfTextEditSink : IUnknown
428{
429 HRESULT OnEndEdit(
430 [in] ITfContext *pic,
431 [in] TfEditCookie ecReadOnly,
432 [in] ITfEditRecord *pEditRecord);
433};
Aric Stewart1adb1d82009-02-05 14:17:50 -0600434
435[
436 object,
437 uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
438 pointer_default(unique)
439]
440interface ITfContextOwnerCompositionSink : IUnknown
441{
442 HRESULT OnStartComposition(
443 [in] ITfCompositionView *pComposition,
444 [out] BOOL *pfOk);
445
446 HRESULT OnUpdateComposition(
447 [in] ITfCompositionView *pComposition,
448 [in] ITfRange *pRangeNew);
449
450 HRESULT OnEndComposition(
451 [in] ITfCompositionView *pComposition);
452};
Aric Stewart7d1952b2009-02-20 13:53:06 -0600453
454[
455 object,
456 uuid(3d61bf11-ac5f-42c8-a4cb-931bcc28c744),
457 pointer_default(unique)
458]
459interface IEnumTfLanguageProfiles : IUnknown
460{
461 HRESULT Clone(
462 [out] IEnumTfLanguageProfiles **ppEnum);
463
464 HRESULT Next(
465 [in] ULONG ulCount,
466 [out, size_is(ulCount), length_is(*pcFetch)] TF_LANGUAGEPROFILE *pProfile,
467 [out] ULONG *pcFetch);
468
469 HRESULT Reset();
470
471 HRESULT Skip(
472 [in] ULONG ulCount);
473};
Aric Stewart3cf42842009-03-24 08:45:06 -0500474
475[
476 object,
477 local,
478 uuid(aa80e7f7-2021-11d2-93e0-0060b067b86e),
479 pointer_default(unique)
480]
481interface ITfTextInputProcessor : IUnknown
482{
483 HRESULT Activate(
484 [in] ITfThreadMgr *ptim,
485 [in] TfClientId tid);
486
487 HRESULT Deactivate();
488};
Aric Stewart1f217952009-03-24 08:21:39 -0500489
490[
491 object,
492 uuid(aa80e80e-2021-11d2-93e0-0060b067b86e),
493 pointer_default(unique)
494]
495interface ITfThreadMgrEventSink : IUnknown
496{
497 HRESULT OnInitDocumentMgr(
498 [in] ITfDocumentMgr *pdim);
499
500 HRESULT OnUninitDocumentMgr(
501 [in] ITfDocumentMgr *pdim);
502
503 HRESULT OnSetFocus(
504 [in] ITfDocumentMgr *pdimFocus,
505 [in] ITfDocumentMgr *pdimPrevFocus);
506
507 HRESULT OnPushContext(
508 [in] ITfContext *pic);
509
510 HRESULT OnPopContext(
511 [in] ITfContext *pic);
512};