Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2116 lines
61 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992-2001.
  5. //
  6. // File: msctf.idl
  7. //
  8. // Contents: Text Framework declarations.
  9. //
  10. //
  11. //--------------------------------------------------------------------------
  12. cpp_quote("//=--------------------------------------------------------------------------=")
  13. cpp_quote("// msctf.h")
  14. cpp_quote("")
  15. cpp_quote("")
  16. cpp_quote("// Text Framework declarations.")
  17. cpp_quote("")
  18. cpp_quote("//=--------------------------------------------------------------------------=")
  19. cpp_quote("// (C) Copyright 1995-2001 Microsoft Corporation. All Rights Reserved.")
  20. cpp_quote("//")
  21. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  22. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  23. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  24. cpp_quote("// PARTICULAR PURPOSE.")
  25. cpp_quote("//=--------------------------------------------------------------------------=")
  26. cpp_quote("")
  27. cpp_quote("#ifndef MSCTF_DEFINED")
  28. cpp_quote("#define MSCTF_DEFINED")
  29. cpp_quote("")
  30. cpp_quote("#include <windows.h>")
  31. cpp_quote("")
  32. cpp_quote("#ifdef __cplusplus")
  33. cpp_quote("extern \"C\" {")
  34. cpp_quote("#endif /* __cplusplus */")
  35. cpp_quote("")
  36. //
  37. // error codes
  38. //
  39. cpp_quote("#define TF_E_LOCKED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0500)")
  40. cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
  41. cpp_quote("#define TF_E_NOTOWNEDRANGE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0502)")
  42. cpp_quote("#define TF_E_NOPROVIDER MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0503)")
  43. cpp_quote("#define TF_E_DISCONNECTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0504)")
  44. cpp_quote("#define TF_E_INVALIDVIEW MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0505)")
  45. cpp_quote("#define TF_E_ALREADY_EXISTS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0506)")
  46. cpp_quote("#define TF_E_RANGE_NOT_COVERED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0507)")
  47. cpp_quote("#define TF_E_COMPOSITION_REJECTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0508)")
  48. cpp_quote("#define TF_E_EMPTYCONTEXT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0509)")
  49. // the following must match their TS_E_ counter parts!
  50. cpp_quote("#define TF_E_INVALIDPOS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0200)")
  51. cpp_quote("#define TF_E_NOLOCK MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0201)")
  52. cpp_quote("#define TF_E_NOOBJECT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0202)")
  53. cpp_quote("#define TF_E_NOSERVICE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0203)")
  54. cpp_quote("#define TF_E_NOINTERFACE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0204)")
  55. cpp_quote("#define TF_E_NOSELECTION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0205)")
  56. cpp_quote("#define TF_E_NOLAYOUT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0206)")
  57. cpp_quote("#define TF_E_INVALIDPOINT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0207)")
  58. cpp_quote("#define TF_E_SYNCHRONOUS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0208)")
  59. cpp_quote("#define TF_E_READONLY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0209)")
  60. cpp_quote("#define TF_E_FORMAT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x020a)")
  61. // TF_S_ASYNC is only used as an [out] param for RequestEditSession
  62. cpp_quote("#define TF_S_ASYNC MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x0300)")
  63. cpp_quote("")
  64. cpp_quote("HRESULT WINAPI TF_CreateThreadMgr(ITfThreadMgr **pptim);")
  65. cpp_quote("HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim);")
  66. cpp_quote("HRESULT WINAPI TF_CreateInputProcessorProfiles(ITfInputProcessorProfiles **ppipr);")
  67. cpp_quote("HRESULT WINAPI TF_CreateDisplayAttributeMgr(ITfDisplayAttributeMgr **ppdam);")
  68. cpp_quote("HRESULT WINAPI TF_CreateLangBarMgr(ITfLangBarMgr **pppbm);")
  69. cpp_quote("HRESULT WINAPI TF_CreateLangBarItemMgr(ITfLangBarItemMgr **pplbim);")
  70. cpp_quote("")
  71. cpp_quote("EXTERN_C const GUID GUID_PROP_TEXTOWNER;")
  72. cpp_quote("EXTERN_C const GUID GUID_PROP_ATTRIBUTE;")
  73. cpp_quote("EXTERN_C const GUID GUID_PROP_LANGID;")
  74. cpp_quote("EXTERN_C const GUID GUID_PROP_READING;")
  75. cpp_quote("EXTERN_C const GUID GUID_PROP_COMPOSING;")
  76. cpp_quote("")
  77. cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
  78. cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
  79. cpp_quote("EXTERN_C const CLSID CLSID_TF_LangBarMgr;")
  80. cpp_quote("EXTERN_C const CLSID CLSID_TF_DisplayAttributeMgr;")
  81. cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
  82. cpp_quote("EXTERN_C const CLSID CLSID_TF_LangBarItemMgr;")
  83. cpp_quote("EXTERN_C const GUID GUID_SYSTEM_FUNCTIONPROVIDER;")
  84. cpp_quote("EXTERN_C const GUID GUID_APP_FUNCTIONPROVIDER;")
  85. cpp_quote("")
  86. cpp_quote("")
  87. //
  88. // GUIDs for system predefined compartment
  89. //
  90. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_KEYBOARD_DISABLED;")
  91. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_KEYBOARD_OPENCLOSE;")
  92. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_HANDWRITING_OPENCLOSE;")
  93. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_DISABLED;")
  94. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_OPENCLOSE;")
  95. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_GLOBALSTATE;")
  96. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_PERSISTMENUENABLED;")
  97. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_EMPTYCONTEXT;")
  98. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_TIPUISTATUS;")
  99. cpp_quote("")
  100. //
  101. // Conversion Mode Bias Compartment
  102. //
  103. cpp_quote("EXTERN_C const GUID GUID_PROP_MODEBIAS;")
  104. cpp_quote("")
  105. //
  106. // GUIDs for system predefined conversion mode bias
  107. //
  108. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_NONE;")
  109. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_URLHISTORY;")
  110. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_FILENAME;")
  111. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_READING;")
  112. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_DATETIME;")
  113. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_NAME;")
  114. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_CONVERSATION;")
  115. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_NUMERIC;")
  116. //
  117. // These are FE language specific mode bias.
  118. //
  119. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_HIRAGANA;")
  120. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_KATAKANA;")
  121. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_HANGUL;")
  122. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_CHINESE;")
  123. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_HALFWIDTHKATAKANA;")
  124. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_FULLWIDTHALPHANUMERIC;")
  125. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_HALFWIDTHALPHANUMERIC;")
  126. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_FULLWIDTHHANGUL;")
  127. //
  128. // GUID_TFCAT_CATEGORY_OF_TIP categrorize the types of tips.
  129. // by default, this category contains the following guids.
  130. // GUID_TFCAT_TIP_KEYBOARD
  131. // GUID_TFCAT_TIP_SPEECH
  132. // GUID_TFCAT_TIP_HANDWRITING
  133. //
  134. cpp_quote("EXTERN_C const GUID GUID_TFCAT_CATEGORY_OF_TIP;")
  135. //
  136. // GUIDs for the Tips category. Each category contains Tips classes.
  137. //
  138. cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD;")
  139. cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH;")
  140. cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING;")
  141. //
  142. // GUIDs for the property category. Each category contains Property GUID.
  143. //
  144. cpp_quote("EXTERN_C const GUID GUID_TFCAT_PROP_AUDIODATA;")
  145. cpp_quote("EXTERN_C const GUID GUID_TFCAT_PROP_INKDATA;")
  146. cpp_quote("")
  147. //
  148. // GUIDs for the property style.
  149. //
  150. cpp_quote("EXTERN_C const GUID GUID_TFCAT_PROPSTYLE_CUSTOM;")
  151. cpp_quote("EXTERN_C const GUID GUID_TFCAT_PROPSTYLE_STATIC;")
  152. cpp_quote("EXTERN_C const GUID GUID_TFCAT_PROPSTYLE_STATICCOMPACT;")
  153. cpp_quote("")
  154. //
  155. // GUIDs for the display attribute provider category.
  156. //
  157. cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER;")
  158. cpp_quote("EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROPERTY;")
  159. cpp_quote("")
  160. cpp_quote("#define TF_INVALID_GUIDATOM ((TfGuidAtom)0)")
  161. cpp_quote("#define TF_CLIENTID_NULL ((TfClientId)0)")
  162. cpp_quote("")
  163. cpp_quote("#define TF_MOD_ALT 0x0001")
  164. cpp_quote("#define TF_MOD_CONTROL 0x0002")
  165. cpp_quote("#define TF_MOD_SHIFT 0x0004")
  166. cpp_quote("#define TF_MOD_RALT 0x0008")
  167. cpp_quote("#define TF_MOD_RCONTROL 0x0010")
  168. cpp_quote("#define TF_MOD_RSHIFT 0x0020")
  169. cpp_quote("#define TF_MOD_LALT 0x0040")
  170. cpp_quote("#define TF_MOD_LCONTROL 0x0080")
  171. cpp_quote("#define TF_MOD_LSHIFT 0x0100")
  172. cpp_quote("#define TF_MOD_ON_KEYUP 0x0200")
  173. cpp_quote("#define TF_MOD_IGNORE_ALL_MODIFIER 0x0400")
  174. cpp_quote("")
  175. //
  176. // flags for GUID_COMPARTMENT_TIPUISTATUS
  177. //
  178. cpp_quote("#define TF_US_HIDETIPUI 0x00000001")
  179. cpp_quote("")
  180. //
  181. // flags for GUID GUID_COMPARTMENT_SPEECH_DISABLED
  182. //
  183. cpp_quote("#define TF_DISABLE_SPEECH 0x00000001")
  184. cpp_quote("#define TF_DISABLE_DICTATION 0x00000002")
  185. cpp_quote("#define TF_DISABLE_COMMANDING 0x00000004")
  186. cpp_quote("")
  187. cpp_quote("#define TF_PROCESS_ATOM TEXT(\"_CTF_PROCESS_ATOM_\")")
  188. cpp_quote("#define TF_ENABLE_PROCESS_ATOM TEXT(\"_CTF_ENABLE_PROCESS_ATOM_\")")
  189. cpp_quote("#ifdef __cplusplus")
  190. cpp_quote("}")
  191. cpp_quote("#endif /* __cplusplus */")
  192. import "oaidl.idl";
  193. import "comcat.idl";
  194. import "textstor.idl";
  195. import "ctfutb.idl";
  196. cpp_quote("")
  197. cpp_quote("#if 0")
  198. typedef [uuid(4f5d560f-5ab5-4dde-8c4d-404592857ab0)] UINT_PTR HKL;
  199. cpp_quote("#endif")
  200. cpp_quote("")
  201. interface ITfThreadMgrEventSink;
  202. interface ITfTextInputProcessor;
  203. interface ITfRange;
  204. interface ITfRangeACP;
  205. interface ITfDocumentMgr;
  206. interface ITfContext;
  207. interface ITfKeyFocusNotifySink;
  208. interface ITfEditSession;
  209. interface ITfProperty;
  210. interface ITfPersistentPropertyLoaderACP;
  211. interface IEnumTfProperties;
  212. interface ITfKeyEventSink;
  213. interface IEnumTfTextDeltas;
  214. interface ITfFunctionProvider;
  215. interface IEnumTfFunctionProviders;
  216. interface IEnumTfDocumentMgrs;
  217. interface IEnumTfContexts;
  218. interface ITfSource;
  219. interface ITfCompartmentMgr;
  220. interface ITfRangeBackup;
  221. interface IEnumTfRanges;
  222. interface ITfMouseSink;
  223. interface ITfReadOnlyProperty;
  224. interface IEnumTfLanguageProfiles;
  225. typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie;
  226. const TfEditCookie TF_INVALID_EDIT_COOKIE = 0;
  227. typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
  228. typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
  229. typedef [uuid(e26d9e1d-691e-4f29-90d7-338dcf1f8cef)] struct TF_PERSISTENT_PROPERTY_HEADER_ACP
  230. {
  231. GUID guidType; // property type
  232. LONG ichStart; // range information of this property data
  233. LONG cch; // range information of this property data
  234. ULONG cb; // the data size of pStream in BYTE count
  235. DWORD dwPrivate; // private data
  236. CLSID clsidTIP; // the original owner of the property data
  237. } TF_PERSISTENT_PROPERTY_HEADER_ACP;
  238. typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
  239. {
  240. CLSID clsid; // CLSID of tip
  241. LANGID langid; // language id
  242. GUID catid; // category of tip
  243. BOOL fActive; // activated profile
  244. GUID guidProfile; // profile description
  245. } TF_LANGUAGEPROFILE;
  246. typedef [uuid(5a886226-ae9a-489b-b991-2b1e25ee59a9)] enum { TF_ANCHOR_START = 0, TF_ANCHOR_END = 1 } TfAnchor;
  247. //
  248. // ITfThreadMgr
  249. //
  250. [
  251. object,
  252. local,
  253. uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
  254. pointer_default(unique)
  255. ]
  256. interface ITfThreadMgr : IUnknown
  257. {
  258. HRESULT Activate([out] TfClientId *ptid);
  259. HRESULT Deactivate();
  260. HRESULT CreateDocumentMgr([out] ITfDocumentMgr **ppdim);
  261. HRESULT EnumDocumentMgrs([out] IEnumTfDocumentMgrs **ppEnum);
  262. HRESULT GetFocus([out] ITfDocumentMgr **ppdimFocus);
  263. HRESULT SetFocus([in] ITfDocumentMgr *pdimFocus);
  264. HRESULT AssociateFocus([in] HWND hwnd,
  265. [in, unique] ITfDocumentMgr *pdimNew,
  266. [out] ITfDocumentMgr **ppdimPrev);
  267. HRESULT IsThreadFocus([out] BOOL *pfThreadFocus);
  268. HRESULT GetFunctionProvider([in] REFCLSID clsid,
  269. [out] ITfFunctionProvider **ppFuncProv);
  270. HRESULT EnumFunctionProviders([out] IEnumTfFunctionProviders **ppEnum);
  271. HRESULT GetGlobalCompartment([out] ITfCompartmentMgr **ppCompMgr);
  272. };
  273. //
  274. // ITfThreadMgrEventSink
  275. //
  276. [
  277. object,
  278. uuid(aa80e80e-2021-11d2-93e0-0060b067b86e),
  279. pointer_default(unique)
  280. ]
  281. interface ITfThreadMgrEventSink : IUnknown
  282. {
  283. HRESULT OnInitDocumentMgr([in] ITfDocumentMgr *pdim);
  284. HRESULT OnUninitDocumentMgr([in] ITfDocumentMgr *pdim);
  285. HRESULT OnSetFocus([in] ITfDocumentMgr *pdimFocus, [in] ITfDocumentMgr *pdimPrevFocus);
  286. HRESULT OnPushContext([in] ITfContext *pic);
  287. HRESULT OnPopContext([in] ITfContext *pic);
  288. };
  289. //
  290. // ITfConfigureSystemKeystrokeFeed
  291. //
  292. [
  293. object,
  294. local,
  295. uuid(0d2c969a-bc9c-437c-84ee-951c49b1a764),
  296. pointer_default(unique)
  297. ]
  298. interface ITfConfigureSystemKeystrokeFeed : IUnknown
  299. {
  300. HRESULT DisableSystemKeystrokeFeed();
  301. HRESULT EnableSystemKeystrokeFeed();
  302. };
  303. //
  304. // IEnumTfDocumentMgrs
  305. //
  306. [
  307. object,
  308. uuid(aa80e808-2021-11d2-93e0-0060b067b86e),
  309. pointer_default(unique)
  310. ]
  311. interface IEnumTfDocumentMgrs : IUnknown
  312. {
  313. HRESULT Clone([out] IEnumTfDocumentMgrs **ppEnum);
  314. HRESULT Next([in] ULONG ulCount,
  315. [out, size_is(ulCount), length_is(*pcFetched)] ITfDocumentMgr **rgDocumentMgr,
  316. [out] ULONG *pcFetched);
  317. HRESULT Reset();
  318. HRESULT Skip([in] ULONG ulCount);
  319. };
  320. //
  321. // ITfDocumentMgr
  322. //
  323. [
  324. object,
  325. uuid(aa80e7f4-2021-11d2-93e0-0060b067b86e),
  326. pointer_default(unique)
  327. ]
  328. interface ITfDocumentMgr : IUnknown
  329. {
  330. HRESULT CreateContext([in] TfClientId tidOwner,
  331. [in] DWORD dwFlags,
  332. [in, unique] IUnknown *punk,
  333. [out] ITfContext **ppic,
  334. [out] TfEditCookie *pecTextStore);
  335. HRESULT Push([in] ITfContext *pic);
  336. const DWORD TF_POPF_ALL = 0x0001;
  337. HRESULT Pop([in] DWORD dwFlags);
  338. HRESULT GetTop([out] ITfContext **ppic);
  339. HRESULT GetBase([out] ITfContext **ppic);
  340. HRESULT EnumContexts([out] IEnumTfContexts **ppEnum);
  341. };
  342. //
  343. // IEnumTfContexts
  344. //
  345. [
  346. object,
  347. uuid(8f1a7ea6-1654-4502-a86e-b2902344d507),
  348. pointer_default(unique)
  349. ]
  350. interface IEnumTfContexts : IUnknown
  351. {
  352. HRESULT Clone([out] IEnumTfContexts **ppEnum);
  353. HRESULT Next([in] ULONG ulCount,
  354. [out, size_is(ulCount), length_is(*pcFetched)] ITfContext **rgContext,
  355. [out] ULONG *pcFetched);
  356. HRESULT Reset();
  357. HRESULT Skip([in] ULONG ulCount);
  358. };
  359. //
  360. // ITfCompositionView
  361. //
  362. [
  363. object,
  364. uuid(D7540241-F9A1-4364-BEFC-DBCD2C4395B7),
  365. pointer_default(unique)
  366. ]
  367. interface ITfCompositionView : IUnknown
  368. {
  369. HRESULT GetOwnerClsid([out] CLSID *pclsid);
  370. HRESULT GetRange([out] ITfRange **ppRange);
  371. };
  372. //
  373. // IEnumITfCompositionView
  374. //
  375. [
  376. object,
  377. uuid(5EFD22BA-7838-46CB-88E2-CADB14124F8F),
  378. pointer_default(unique)
  379. ]
  380. interface IEnumITfCompositionView : IUnknown
  381. {
  382. HRESULT Clone([out] IEnumITfCompositionView **ppEnum);
  383. HRESULT Next([in] ULONG ulCount,
  384. [out, size_is(ulCount), length_is(*pcFetched)] ITfCompositionView **rgCompositionView,
  385. [out] ULONG *pcFetched);
  386. HRESULT Reset();
  387. HRESULT Skip([in] ULONG ulCount);
  388. };
  389. //
  390. // ITfComposition
  391. //
  392. [
  393. object,
  394. uuid(20168D64-5A8F-4A5A-B7BD-CFA29F4D0FD9),
  395. pointer_default(unique)
  396. ]
  397. interface ITfComposition : IUnknown
  398. {
  399. HRESULT GetRange([out] ITfRange **ppRange);
  400. HRESULT ShiftStart([in] TfEditCookie ecWrite,
  401. [in] ITfRange *pNewStart);
  402. HRESULT ShiftEnd([in] TfEditCookie ecWrite,
  403. [in] ITfRange *pNewEnd);
  404. HRESULT EndComposition([in] TfEditCookie ecWrite);
  405. };
  406. //
  407. // ITfCompositionSink
  408. //
  409. [
  410. object,
  411. uuid(A781718C-579A-4B15-A280-32B8577ACC5E),
  412. pointer_default(unique)
  413. ]
  414. interface ITfCompositionSink : IUnknown
  415. {
  416. HRESULT OnCompositionTerminated([in] TfEditCookie ecWrite, [in] ITfComposition *pComposition);
  417. };
  418. //
  419. // ITfContextComposition
  420. //
  421. [
  422. object,
  423. uuid(D40C8AAE-AC92-4FC7-9A11-0EE0E23AA39B),
  424. pointer_default(unique)
  425. ]
  426. interface ITfContextComposition : IUnknown
  427. {
  428. HRESULT StartComposition([in] TfEditCookie ecWrite,
  429. [in] ITfRange *pCompositionRange,
  430. [in] ITfCompositionSink *pSink,
  431. [out] ITfComposition **ppComposition);
  432. HRESULT EnumCompositions([out] IEnumITfCompositionView **ppEnum);
  433. HRESULT FindComposition([in] TfEditCookie ecRead,
  434. [in] ITfRange *pTestRange,
  435. [out] IEnumITfCompositionView **ppEnum);
  436. HRESULT TakeOwnership([in] TfEditCookie ecWrite,
  437. [in] ITfCompositionView *pComposition,
  438. [in] ITfCompositionSink *pSink,
  439. [out] ITfComposition **ppComposition);
  440. };
  441. //
  442. // ITfContextOwnerCompositionServices
  443. //
  444. [
  445. object,
  446. uuid(86462810-593B-4916-9764-19C08E9CE110),
  447. pointer_default(unique)
  448. ]
  449. interface ITfContextOwnerCompositionServices : ITfContextComposition
  450. {
  451. HRESULT TerminateComposition([in] ITfCompositionView *pComposition);
  452. };
  453. //
  454. // ITfContextOwnerCompositionSink
  455. //
  456. [
  457. object,
  458. uuid(5F20AA40-B57A-4F34-96AB-3576F377CC79),
  459. pointer_default(unique)
  460. ]
  461. interface ITfContextOwnerCompositionSink : IUnknown
  462. {
  463. HRESULT OnStartComposition([in] ITfCompositionView *pComposition,
  464. [out] BOOL *pfOk);
  465. HRESULT OnUpdateComposition([in] ITfCompositionView *pComposition,
  466. [in] ITfRange *pRangeNew);
  467. HRESULT OnEndComposition([in] ITfCompositionView *pComposition);
  468. };
  469. //
  470. // ITfContextView
  471. //
  472. [
  473. object,
  474. uuid(2433bf8e-0f9b-435c-ba2c-180611978c30),
  475. pointer_default(unique)
  476. ]
  477. interface ITfContextView : IUnknown
  478. {
  479. HRESULT GetRangeFromPoint([in] TfEditCookie ec,
  480. [in] const POINT *ppt,
  481. [in] DWORD dwFlags,
  482. [out] ITfRange **ppRange);
  483. HRESULT GetTextExt([in] TfEditCookie ec,
  484. [in] ITfRange *pRange,
  485. [out] RECT *prc,
  486. [out] BOOL *pfClipped);
  487. HRESULT GetScreenExt([out] RECT *prc);
  488. HRESULT GetWnd([out] HWND *phwnd);
  489. };
  490. //
  491. // IEnumTfContextView
  492. //
  493. [
  494. object,
  495. uuid(F0C0F8DD-CF38-44E1-BB0F-68CF0D551C78),
  496. pointer_default(unique)
  497. ]
  498. interface IEnumTfContextViews : IUnknown
  499. {
  500. HRESULT Clone([out] IEnumTfContextViews **ppEnum);
  501. HRESULT Next([in] ULONG ulCount,
  502. [out, size_is(ulCount), length_is(*pcFetched)] ITfContextView **rgViews,
  503. [out] ULONG *pcFetched);
  504. HRESULT Reset();
  505. HRESULT Skip([in] ULONG ulCount);
  506. };
  507. //
  508. // ITfContext
  509. //
  510. [
  511. object,
  512. uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
  513. pointer_default(unique)
  514. ]
  515. interface ITfContext : IUnknown
  516. {
  517. const DWORD TF_ES_ASYNCDONTCARE = 0x0;
  518. const DWORD TF_ES_SYNC = 0x1;
  519. const DWORD TF_ES_READ = 0x2;
  520. const DWORD TF_ES_READWRITE = 0x6;
  521. const DWORD TF_ES_ASYNC = 0x8;
  522. HRESULT RequestEditSession([in] TfClientId tid,
  523. [in] ITfEditSession *pes,
  524. [in] DWORD dwFlags,
  525. [out] HRESULT *phrSession);
  526. HRESULT InWriteSession([in] TfClientId tid,
  527. [out] BOOL *pfWriteSession);
  528. typedef [uuid(1690be9b-d3e9-49f6-8d8b-51b905af4c43)] enum { TF_AE_NONE = 0, TF_AE_START = 1, TF_AE_END = 2 } TfActiveSelEnd;
  529. typedef [uuid(36ae42a4-6989-4bdc-b48a-6137b7bf2e42)] struct TF_SELECTIONSTYLE
  530. {
  531. TfActiveSelEnd ase;
  532. BOOL fInterimChar;
  533. } TF_SELECTIONSTYLE;
  534. typedef [uuid(75eb22f2-b0bf-46a8-8006-975a3b6efcf1)] struct TF_SELECTION
  535. {
  536. ITfRange *range;
  537. TF_SELECTIONSTYLE style;
  538. } TF_SELECTION;
  539. const ULONG TF_DEFAULT_SELECTION = TS_DEFAULT_SELECTION;
  540. HRESULT GetSelection([in] TfEditCookie ec,
  541. [in] ULONG ulIndex,
  542. [in] ULONG ulCount,
  543. [out, size_is(ulCount), length_is(*pcFetched)] TF_SELECTION *pSelection,
  544. [out] ULONG *pcFetched);
  545. HRESULT SetSelection([in] TfEditCookie ec,
  546. [in] ULONG ulCount,
  547. [in, size_is(ulCount)] const TF_SELECTION *pSelection);
  548. HRESULT GetStart([in] TfEditCookie ec,
  549. [out] ITfRange **ppStart);
  550. HRESULT GetEnd([in] TfEditCookie ec,
  551. [out] ITfRange **ppEnd);
  552. // bit values for TF_STATUS's dwDynamicFlags field
  553. const DWORD TF_SD_READONLY = TS_SD_READONLY; // if set, document is read only; writes will fail
  554. const DWORD TF_SD_LOADING = TS_SD_LOADING; // if set, document is loading, expect additional inserts
  555. // bit values for TF_STATUS's dwStaticFlags field
  556. const DWORD TF_SS_DISJOINTSEL = TS_SS_DISJOINTSEL; // if set, the document supports multiple selections
  557. const DWORD TF_SS_REGIONS = TS_SS_REGIONS; // if clear, the document will never contain multiple regions
  558. const DWORD TF_SS_TRANSITORY = TS_SS_TRANSITORY; // if set, the document is expected to have a short lifespan
  559. typedef [uuid(bc7d979a-846a-444d-afef-0a9bfa82b961)] TS_STATUS TF_STATUS;
  560. HRESULT GetActiveView([out] ITfContextView **ppView);
  561. HRESULT EnumViews([out] IEnumTfContextViews **ppEnum);
  562. HRESULT GetStatus([out] TF_STATUS *pdcs);
  563. HRESULT GetProperty([in] REFGUID guidProp,
  564. [out] ITfProperty **ppProp);
  565. HRESULT GetAppProperty([in] REFGUID guidProp,
  566. [out] ITfReadOnlyProperty **ppProp);
  567. HRESULT TrackProperties([in, size_is(cProp)] const GUID **prgProp,
  568. [in] ULONG cProp,
  569. [in, size_is(cAppProp)] const GUID **prgAppProp,
  570. [in] ULONG cAppProp,
  571. [out] ITfReadOnlyProperty **ppProperty);
  572. HRESULT EnumProperties([out] IEnumTfProperties **ppEnum);
  573. HRESULT GetDocumentMgr([out] ITfDocumentMgr **ppDm);
  574. HRESULT CreateRangeBackup([in] TfEditCookie ec,
  575. [in] ITfRange *pRange,
  576. [out] ITfRangeBackup **ppBackup);
  577. };
  578. [
  579. object,
  580. uuid(0fab9bdb-d250-4169-84e5-6be118fdd7a8),
  581. pointer_default(unique)
  582. ]
  583. interface ITfQueryEmbedded : IUnknown
  584. {
  585. HRESULT QueryInsertEmbedded([in] const GUID *pguidService,
  586. [in] const FORMATETC *pFormatEtc,
  587. [out] BOOL *pfInsertable);
  588. };
  589. //
  590. // ITfInsertAtSelection
  591. //
  592. [
  593. object,
  594. uuid(55ce16ba-3014-41c1-9ceb-fade1446ac6c),
  595. pointer_default(unique)
  596. ]
  597. interface ITfInsertAtSelection : IUnknown
  598. {
  599. const DWORD TF_IAS_NOQUERY = 0x1; // ppRange will be NULL at exit.
  600. const DWORD TF_IAS_QUERYONLY = 0x2; // Don't do the actual insert, caller only interested in ppRange. Exclusive with TF_IAS_NOQUERY.
  601. const DWORD TF_IAS_NO_DEFAULT_COMPOSITION = 0x80000000; // caller takes responsibility for starting a composition over the range
  602. HRESULT InsertTextAtSelection([in] TfEditCookie ec,
  603. [in] DWORD dwFlags,
  604. [in, size_is(cch)] const WCHAR *pchText,
  605. [in] LONG cch,
  606. [out] ITfRange **ppRange);
  607. HRESULT InsertEmbeddedAtSelection([in] TfEditCookie ec,
  608. [in] DWORD dwFlags,
  609. [in] IDataObject *pDataObject,
  610. [out] ITfRange **ppRange);
  611. };
  612. //
  613. // ITfCleanupContextSink
  614. //
  615. [
  616. object,
  617. uuid(01689689-7acb-4e9b-ab7c-7ea46b12b522),
  618. pointer_default(unique)
  619. ]
  620. interface ITfCleanupContextSink : IUnknown
  621. {
  622. HRESULT OnCleanupContext([in] TfEditCookie ecWrite, [in] ITfContext *pic);
  623. };
  624. //
  625. // ITfCleanupContextDurationSink
  626. //
  627. [
  628. object,
  629. uuid(45c35144-154e-4797-bed8-d33ae7bf8794),
  630. pointer_default(unique)
  631. ]
  632. interface ITfCleanupContextDurationSink : IUnknown
  633. {
  634. HRESULT OnStartCleanupContext();
  635. HRESULT OnEndCleanupContext();
  636. };
  637. //
  638. // ITfReadOnlyProperty
  639. //
  640. [
  641. object,
  642. uuid(17d49a3d-f8b8-4b2f-b254-52319dd64c53),
  643. pointer_default(unique)
  644. ]
  645. interface ITfReadOnlyProperty : IUnknown
  646. {
  647. HRESULT GetType([out] GUID *pguid);
  648. HRESULT EnumRanges([in] TfEditCookie ec,
  649. [out] IEnumTfRanges **ppEnum,
  650. [in] ITfRange *pTargetRange);
  651. HRESULT GetValue([in] TfEditCookie ec,
  652. [in] ITfRange *pRange,
  653. [out] VARIANT *pvarValue);
  654. HRESULT GetContext([out] ITfContext **ppContext);
  655. };
  656. typedef [uuid(d678c645-eb6a-45c9-b4ee-0f3e3a991348)] struct TF_PROPERTYVAL
  657. {
  658. GUID guidId;
  659. VARIANT varValue;
  660. } TF_PROPERTYVAL;
  661. //
  662. // IEnumTfPropertyValue
  663. //
  664. [
  665. object,
  666. uuid(8ed8981b-7c10-4d7d-9fb3-ab72e9c75f72),
  667. pointer_default(unique)
  668. ]
  669. interface IEnumTfPropertyValue : IUnknown
  670. {
  671. HRESULT Clone([out] IEnumTfPropertyValue **ppEnum);
  672. HRESULT Next([in] ULONG ulCount,
  673. [out, size_is(ulCount), length_is(*pcFetched)] TF_PROPERTYVAL *rgValues,
  674. [out] ULONG *pcFetched);
  675. HRESULT Reset();
  676. HRESULT Skip([in] ULONG ulCount);
  677. };
  678. //
  679. // ITfMouseTracker
  680. //
  681. [
  682. object,
  683. uuid(09d146cd-a544-4132-925b-7afa8ef322d0),
  684. pointer_default(unique)
  685. ]
  686. interface ITfMouseTracker : IUnknown
  687. {
  688. HRESULT AdviseMouseSink([in] ITfRange *range,
  689. [in] ITfMouseSink *pSink,
  690. [out] DWORD *pdwCookie);
  691. HRESULT UnadviseMouseSink([in] DWORD dwCookie);
  692. };
  693. //
  694. // ITfMouseTracker
  695. //
  696. [
  697. object,
  698. uuid(3bdd78e2-c16e-47fd-b883-ce6facc1a208),
  699. pointer_default(unique)
  700. ]
  701. interface ITfMouseTrackerACP : IUnknown
  702. {
  703. HRESULT AdviseMouseSink([in] ITfRangeACP *range,
  704. [in] ITfMouseSink *pSink,
  705. [out] DWORD *pdwCookie);
  706. HRESULT UnadviseMouseSink([in] DWORD dwCookie);
  707. };
  708. //
  709. // ITfMouseSink
  710. //
  711. [
  712. object,
  713. local,
  714. uuid(a1adaaa2-3a24-449d-ac96-5183e7f5c217),
  715. pointer_default(unique)
  716. ]
  717. interface ITfMouseSink : IUnknown
  718. {
  719. HRESULT OnMouseEvent([in] ULONG uEdge,
  720. [in] ULONG uQuadrant,
  721. [in] DWORD dwBtnStatus,
  722. [out] BOOL *pfEaten);
  723. };
  724. //
  725. // ITfEditRecord
  726. //
  727. [
  728. object,
  729. uuid(42d4d099-7c1a-4a89-b836-6c6f22160df0),
  730. pointer_default(unique)
  731. ]
  732. interface ITfEditRecord : IUnknown
  733. {
  734. const DWORD TF_GTP_INCL_TEXT = 0x1;
  735. HRESULT GetSelectionStatus([out] BOOL *pfChanged);
  736. HRESULT GetTextAndPropertyUpdates([in] DWORD dwFlags,
  737. [in, size_is(cProperties)] const GUID **prgProperties,
  738. [in] ULONG cProperties,
  739. [out] IEnumTfRanges **ppEnum);
  740. };
  741. //
  742. // ITfTextEditSink
  743. //
  744. [
  745. object,
  746. uuid(8127d409-ccd3-4683-967a-b43d5b482bf7),
  747. pointer_default(unique)
  748. ]
  749. interface ITfTextEditSink : IUnknown
  750. {
  751. HRESULT OnEndEdit([in] ITfContext *pic, [in] TfEditCookie ecReadOnly, [in] ITfEditRecord *pEditRecord);
  752. };
  753. //
  754. // ITfTextLayoutSink
  755. //
  756. [
  757. object,
  758. uuid(2af2d06a-dd5b-4927-a0b4-54f19c91fade),
  759. pointer_default(unique)
  760. ]
  761. interface ITfTextLayoutSink : IUnknown
  762. {
  763. typedef [uuid(603553cf-9edd-4cc1-9ecc-069e4a427734)] enum { TF_LC_CREATE = 0, TF_LC_CHANGE = 1, TF_LC_DESTROY = 2, } TfLayoutCode;
  764. HRESULT OnLayoutChange([in] ITfContext *pic, [in] TfLayoutCode lcode, [in] ITfContextView *pView);
  765. };
  766. //
  767. // ITfStatusSink
  768. //
  769. [
  770. object,
  771. uuid(6b7d8d73-b267-4f69-b32e-1ca321ce4f45),
  772. pointer_default(unique)
  773. ]
  774. interface ITfStatusSink : IUnknown
  775. {
  776. HRESULT OnStatusChange([in] ITfContext *pic, [in] DWORD dwFlags);
  777. };
  778. //
  779. // ITfEditTransactionSink
  780. //
  781. [
  782. object,
  783. uuid(708fbf70-b520-416b-b06c-2c41ab44f8ba),
  784. pointer_default(unique)
  785. ]
  786. interface ITfEditTransactionSink : IUnknown
  787. {
  788. HRESULT OnStartEditTransaction([in] ITfContext *pic);
  789. HRESULT OnEndEditTransaction([in] ITfContext *pic);
  790. };
  791. //
  792. // ITfContextOwner
  793. //
  794. [
  795. object,
  796. uuid(aa80e80c-2021-11d2-93e0-0060b067b86e),
  797. pointer_default(unique)
  798. ]
  799. interface ITfContextOwner : IUnknown
  800. {
  801. HRESULT GetACPFromPoint([in] const POINT *ptScreen,
  802. [in] DWORD dwFlags,
  803. [out] LONG *pacp);
  804. HRESULT GetTextExt([in] LONG acpStart,
  805. [in] LONG acpEnd,
  806. [out] RECT *prc,
  807. [out] BOOL *pfClipped);
  808. HRESULT GetScreenExt([out] RECT *prc);
  809. HRESULT GetStatus([out] TF_STATUS *pdcs);
  810. HRESULT GetWnd([out] HWND *phwnd);
  811. HRESULT GetAttribute([in] REFGUID rguidAttribute, [out] VARIANT *pvarValue);
  812. };
  813. //
  814. // ITfContextOwnerServices
  815. //
  816. [
  817. object,
  818. uuid(b23eb630-3e1c-11d3-a745-0050040ab407),
  819. pointer_default(unique)
  820. ]
  821. interface ITfContextOwnerServices : IUnknown
  822. {
  823. HRESULT OnLayoutChange();
  824. HRESULT OnStatusChange([in] DWORD dwFlags);
  825. HRESULT OnAttributeChange([in] REFGUID rguidAttribute);
  826. HRESULT Serialize([in] ITfProperty *pProp,
  827. [in] ITfRange *pRange,
  828. [out] TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr,
  829. [in] IStream *pStream);
  830. HRESULT Unserialize([in] ITfProperty *pProp,
  831. [in] const TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr,
  832. [in] IStream *pStream,
  833. [in] ITfPersistentPropertyLoaderACP *pLoader);
  834. HRESULT ForceLoadProperty([in] ITfProperty *pProp);
  835. HRESULT CreateRange([in] LONG acpStart,
  836. [in] LONG acpEnd,
  837. [out] ITfRangeACP **ppRange);
  838. }
  839. //
  840. // ITfContextKeyEventSink
  841. //
  842. [
  843. object,
  844. local,
  845. uuid(0552ba5d-c835-4934-bf50-846aaa67432f),
  846. pointer_default(unique)
  847. ]
  848. interface ITfContextKeyEventSink : IUnknown
  849. {
  850. HRESULT OnKeyDown([in] WPARAM wParam,
  851. [in] LPARAM lParam,
  852. [out] BOOL *pfEaten);
  853. HRESULT OnKeyUp([in] WPARAM wParam,
  854. [in] LPARAM lParam,
  855. [out] BOOL *pfEaten);
  856. HRESULT OnTestKeyDown([in] WPARAM wParam,
  857. [in] LPARAM lParam,
  858. [out] BOOL *pfEaten);
  859. HRESULT OnTestKeyUp([in] WPARAM wParam,
  860. [in] LPARAM lParam,
  861. [out] BOOL *pfEaten);
  862. };
  863. //
  864. // ITfEditSession
  865. //
  866. [
  867. object,
  868. uuid(aa80e803-2021-11d2-93e0-0060b067b86e),
  869. pointer_default(unique)
  870. ]
  871. interface ITfEditSession : IUnknown
  872. {
  873. HRESULT DoEditSession([in] TfEditCookie ec);
  874. }
  875. //
  876. // ITfRange
  877. //
  878. [
  879. object,
  880. uuid(aa80e7ff-2021-11d2-93e0-0060b067b86e),
  881. pointer_default(unique)
  882. ]
  883. interface ITfRange : IUnknown
  884. {
  885. const WCHAR TF_CHAR_EMBEDDED = TS_CHAR_EMBEDDED; // unicode 2.1 object replacement character
  886. typedef [uuid(cf610f06-2882-46f6-abe5-298568b664c4)] enum { TF_GRAVITY_BACKWARD = 0, TF_GRAVITY_FORWARD = 1 } TfGravity;
  887. typedef [uuid(1e512533-bbdc-4530-9a8e-a1dc0af67468)] enum { TF_SD_BACKWARD = 0, TF_SD_FORWARD = 1 } TfShiftDir;
  888. const DWORD TF_HF_OBJECT = 1; // halt shift for TF_CHAR_EMBEDDED
  889. const DWORD TF_TF_MOVESTART = 1; // update start anchor
  890. const DWORD TF_TF_IGNOREEND = 2; // ignore the end anchor
  891. const DWORD TF_ST_CORRECTION = 1; // the replacement is a transform of existing content (correction), not new content
  892. const DWORD TF_IE_CORRECTION = 1;
  893. typedef [uuid(49930d51-7d93-448c-a48c-fea5dac192b1)] struct TF_HALTCOND
  894. {
  895. ITfRange *pHaltRange; // halt shift if anchor encountered
  896. TfAnchor aHaltPos; // ignored if pHaltRange == NULL
  897. DWORD dwFlags; // TF_HF_*
  898. } TF_HALTCOND;
  899. HRESULT GetText([in] TfEditCookie ec,
  900. [in] DWORD dwFlags,
  901. [out, size_is(cchMax), length_is(*pcch)] WCHAR *pchText,
  902. [in] ULONG cchMax,
  903. [out] ULONG *pcch);
  904. HRESULT SetText([in] TfEditCookie ec,
  905. [in] DWORD dwFlags,
  906. [in, size_is(cch), unique] const WCHAR *pchText,
  907. [in] LONG cch);
  908. HRESULT GetFormattedText([in] TfEditCookie ec,
  909. [out] IDataObject **ppDataObject);
  910. HRESULT GetEmbedded([in] TfEditCookie ec,
  911. [in] REFGUID rguidService,
  912. [in] REFIID riid,
  913. [out, iid_is(riid)] IUnknown **ppunk);
  914. HRESULT InsertEmbedded([in] TfEditCookie ec,
  915. [in] DWORD dwFlags,
  916. [in] IDataObject *pDataObject);
  917. HRESULT ShiftStart([in] TfEditCookie ec,
  918. [in] LONG cchReq,
  919. [out] LONG *pcch,
  920. [in, unique] const TF_HALTCOND *pHalt);
  921. HRESULT ShiftEnd([in] TfEditCookie ec,
  922. [in] LONG cchReq,
  923. [out] LONG *pcch,
  924. [in, unique] const TF_HALTCOND *pHalt);
  925. HRESULT ShiftStartToRange([in] TfEditCookie ec,
  926. [in] ITfRange *pRange,
  927. [in] TfAnchor aPos);
  928. HRESULT ShiftEndToRange([in] TfEditCookie ec,
  929. [in] ITfRange *pRange,
  930. [in] TfAnchor aPos);
  931. HRESULT ShiftStartRegion([in] TfEditCookie ec,
  932. [in] TfShiftDir dir,
  933. [out] BOOL *pfNoRegion);
  934. HRESULT ShiftEndRegion([in] TfEditCookie ec,
  935. [in] TfShiftDir dir,
  936. [out] BOOL *pfNoRegion);
  937. HRESULT IsEmpty([in] TfEditCookie ec,
  938. [out] BOOL *pfEmpty);
  939. HRESULT Collapse([in] TfEditCookie ec,
  940. [in] TfAnchor aPos);
  941. HRESULT IsEqualStart([in] TfEditCookie ec,
  942. [in] ITfRange *pWith,
  943. [in] TfAnchor aPos,
  944. [out] BOOL *pfEqual);
  945. HRESULT IsEqualEnd([in] TfEditCookie ec,
  946. [in] ITfRange *pWith,
  947. [in] TfAnchor aPos,
  948. [out] BOOL *pfEqual);
  949. HRESULT CompareStart([in] TfEditCookie ec,
  950. [in] ITfRange *pWith,
  951. [in] TfAnchor aPos,
  952. [out] LONG *plResult);
  953. HRESULT CompareEnd([in] TfEditCookie ec,
  954. [in] ITfRange *pWith,
  955. [in] TfAnchor aPos,
  956. [out] LONG *plResult);
  957. HRESULT AdjustForInsert([in] TfEditCookie ec,
  958. [in] ULONG cchInsert,
  959. [out] BOOL *pfInsertOk);
  960. HRESULT GetGravity([out] TfGravity *pgStart,
  961. [out] TfGravity *pgEnd);
  962. HRESULT SetGravity([in] TfEditCookie ec,
  963. [in] TfGravity gStart,
  964. [in] TfGravity gEnd);
  965. HRESULT Clone([out] ITfRange **ppClone);
  966. HRESULT GetContext([out] ITfContext **ppContext);
  967. };
  968. //
  969. // ITfRangeACP
  970. //
  971. [
  972. object,
  973. uuid(057a6296-029b-4154-b79a-0d461d4ea94c),
  974. pointer_default(unique)
  975. ]
  976. interface ITfRangeACP : ITfRange
  977. {
  978. HRESULT GetExtent([out] LONG *pacpAnchor,
  979. [out] LONG *pcch);
  980. HRESULT SetExtent([in] LONG acpAnchor,
  981. [in] LONG cch);
  982. }
  983. //
  984. // ITextStoreACPServices
  985. //
  986. [
  987. object,
  988. uuid(aa80e901-2021-11d2-93e0-0060b067b86e),
  989. pointer_default(unique)
  990. ]
  991. interface ITextStoreACPServices : IUnknown
  992. {
  993. HRESULT Serialize([in] ITfProperty *pProp,
  994. [in] ITfRange *pRange,
  995. [out] TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr,
  996. [in] IStream *pStream);
  997. HRESULT Unserialize([in] ITfProperty *pProp,
  998. [in] const TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr,
  999. [in] IStream *pStream,
  1000. [in] ITfPersistentPropertyLoaderACP *pLoader);
  1001. HRESULT ForceLoadProperty([in] ITfProperty *pProp);
  1002. HRESULT CreateRange([in] LONG acpStart,
  1003. [in] LONG acpEnd,
  1004. [out] ITfRangeACP **ppRange);
  1005. };
  1006. //
  1007. // ITfRangeBackup
  1008. //
  1009. [
  1010. object,
  1011. uuid(463a506d-6992-49d2-9b88-93d55e70bb16),
  1012. pointer_default(unique)
  1013. ]
  1014. interface ITfRangeBackup : IUnknown
  1015. {
  1016. HRESULT Restore([in] TfEditCookie ec,
  1017. [in] ITfRange *pRange);
  1018. };
  1019. //
  1020. // ITfPropertyStore
  1021. //
  1022. [
  1023. object,
  1024. uuid(6834b120-88cb-11d2-bf45-00105a2799b5),
  1025. pointer_default(unique)
  1026. ]
  1027. interface ITfPropertyStore : IUnknown
  1028. {
  1029. // OnTextUpdated flags
  1030. const DWORD TF_TU_CORRECTION = 0x1;
  1031. HRESULT GetType([out] GUID *pguid);
  1032. HRESULT GetDataType([out] DWORD *pdwReserved);
  1033. HRESULT GetData([out] VARIANT *pvarValue);
  1034. HRESULT OnTextUpdated([in] DWORD dwFlags,
  1035. [in] ITfRange *pRangeNew,
  1036. [out] BOOL *pfAccept);
  1037. HRESULT Shrink([in] ITfRange *pRangeNew,
  1038. [out] BOOL *pfFree);
  1039. HRESULT Divide([in] ITfRange *pRangeThis,
  1040. [in] ITfRange *pRangeNew,
  1041. [out] ITfPropertyStore **ppPropStore);
  1042. HRESULT Clone([out] ITfPropertyStore **pPropStore);
  1043. HRESULT GetPropertyRangeCreator([out] CLSID *pclsid);
  1044. HRESULT Serialize([in] IStream *pStream,
  1045. [out] ULONG *pcb);
  1046. }
  1047. //
  1048. // IEnumTfRanges
  1049. //
  1050. [
  1051. object,
  1052. uuid(f99d3f40-8e32-11d2-bf46-00105a2799b5),
  1053. pointer_default(unique)
  1054. ]
  1055. interface IEnumTfRanges : IUnknown
  1056. {
  1057. HRESULT Clone([out] IEnumTfRanges **ppEnum);
  1058. HRESULT Next([in] ULONG ulCount,
  1059. [out, size_is(ulCount), length_is(*pcFetched)] ITfRange **ppRange,
  1060. [out] ULONG *pcFetched);
  1061. HRESULT Reset();
  1062. HRESULT Skip(ULONG ulCount);
  1063. };
  1064. //
  1065. // ITfCreatePropertyStore
  1066. //
  1067. [
  1068. object,
  1069. uuid(2463fbf0-b0af-11d2-afc5-00105a2799b5),
  1070. pointer_default(unique)
  1071. ]
  1072. interface ITfCreatePropertyStore : IUnknown
  1073. {
  1074. HRESULT IsStoreSerializable([in] REFGUID guidProp,
  1075. [in] ITfRange *pRange,
  1076. [in] ITfPropertyStore *pPropStore,
  1077. [out] BOOL *pfSerializable);
  1078. HRESULT CreatePropertyStore([in] REFGUID guidProp,
  1079. [in] ITfRange *pRange,
  1080. [in] ULONG cb,
  1081. [in] IStream *pStream,
  1082. [out] ITfPropertyStore **ppStore);
  1083. }
  1084. //
  1085. // ITfPersistentPropertyLoaderACP
  1086. //
  1087. [
  1088. object,
  1089. uuid(4ef89150-0807-11d3-8df0-00105a2799b5),
  1090. pointer_default(unique)
  1091. ]
  1092. interface ITfPersistentPropertyLoaderACP : IUnknown
  1093. {
  1094. HRESULT LoadProperty([in] const TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr,
  1095. [out] IStream **ppStream);
  1096. }
  1097. //
  1098. // ITfProperty
  1099. //
  1100. [
  1101. object,
  1102. uuid(e2449660-9542-11d2-bf46-00105a2799b5),
  1103. pointer_default(unique)
  1104. ]
  1105. interface ITfProperty : ITfReadOnlyProperty
  1106. {
  1107. HRESULT FindRange([in] TfEditCookie ec,
  1108. [in] ITfRange *pRange,
  1109. [out] ITfRange **ppRange,
  1110. [in] TfAnchor aPos);
  1111. HRESULT SetValueStore([in] TfEditCookie ec,
  1112. [in] ITfRange *pRange,
  1113. [in] ITfPropertyStore *pPropStore);
  1114. HRESULT SetValue([in] TfEditCookie ec,
  1115. [in] ITfRange *pRange,
  1116. [in] const VARIANT *pvarValue);
  1117. HRESULT Clear([in] TfEditCookie ec,
  1118. [in] ITfRange *pRange);
  1119. }
  1120. //
  1121. // IEnumTfProperties
  1122. //
  1123. [
  1124. object,
  1125. uuid(19188cb0-aca9-11d2-afc5-00105a2799b5),
  1126. pointer_default(unique)
  1127. ]
  1128. interface IEnumTfProperties : IUnknown
  1129. {
  1130. HRESULT Clone([out] IEnumTfProperties **ppEnum);
  1131. HRESULT Next([in] ULONG ulCount,
  1132. [out, size_is(ulCount), length_is(*pcFetched)] ITfProperty **ppProp,
  1133. [out] ULONG *pcFetched);
  1134. HRESULT Reset();
  1135. HRESULT Skip([in] ULONG ulCount);
  1136. }
  1137. //
  1138. // ITfCompartment
  1139. //
  1140. [
  1141. object,
  1142. uuid(bb08f7a9-607a-4384-8623-056892b64371),
  1143. pointer_default(unique)
  1144. ]
  1145. interface ITfCompartment : IUnknown
  1146. {
  1147. HRESULT SetValue([in] TfClientId tid,
  1148. [in] const VARIANT *pvarValue);
  1149. HRESULT GetValue([out] VARIANT *pvarValue);
  1150. }
  1151. //
  1152. // ITfCompartmentEventSink
  1153. //
  1154. [
  1155. object,
  1156. uuid(743abd5f-f26d-48df-8cc5-238492419b64),
  1157. pointer_default(unique)
  1158. ]
  1159. interface ITfCompartmentEventSink : IUnknown
  1160. {
  1161. HRESULT OnChange([in] REFGUID rguid);
  1162. }
  1163. //
  1164. // ITfCompartmentMgr
  1165. //
  1166. [
  1167. object,
  1168. uuid(7dcf57ac-18ad-438b-824d-979bffb74b7c),
  1169. pointer_default(unique)
  1170. ]
  1171. interface ITfCompartmentMgr : IUnknown
  1172. {
  1173. HRESULT GetCompartment([in] REFGUID rguid,
  1174. [out] ITfCompartment **ppcomp);
  1175. HRESULT ClearCompartment([in] TfClientId tid,
  1176. [in] REFGUID rguid);
  1177. HRESULT EnumCompartments([out] IEnumGUID **ppEnum);
  1178. }
  1179. //
  1180. // ITfFunction
  1181. //
  1182. [
  1183. object,
  1184. uuid(db593490-098f-11d3-8df0-00105a2799b5),
  1185. pointer_default(unique)
  1186. ]
  1187. interface ITfFunction : IUnknown
  1188. {
  1189. HRESULT GetDisplayName([out] BSTR *pbstrName);
  1190. }
  1191. //
  1192. // ITfFunctionProvider
  1193. //
  1194. [
  1195. object,
  1196. uuid(101d6610-0990-11d3-8df0-00105a2799b5),
  1197. pointer_default(unique)
  1198. ]
  1199. interface ITfFunctionProvider : IUnknown
  1200. {
  1201. HRESULT GetType([out] GUID *pguid);
  1202. HRESULT GetDescription([out] BSTR *pbstrDesc);
  1203. HRESULT GetFunction([in] REFGUID rguid,
  1204. [in] REFIID riid,
  1205. [out, iid_is(riid)] IUnknown **ppunk);
  1206. }
  1207. //
  1208. // IEnumTfFunctionProviders
  1209. //
  1210. [
  1211. object,
  1212. uuid(e4b24db0-0990-11d3-8df0-00105a2799b5),
  1213. pointer_default(unique)
  1214. ]
  1215. interface IEnumTfFunctionProviders : IUnknown
  1216. {
  1217. HRESULT Clone([out] IEnumTfFunctionProviders **ppEnum);
  1218. HRESULT Next([in] ULONG ulCount,
  1219. [out, size_is(ulCount), length_is(*pcFetch)] ITfFunctionProvider **ppCmdobj,
  1220. [out] ULONG *pcFetch);
  1221. HRESULT Reset();
  1222. HRESULT Skip([in] ULONG ulCount);
  1223. };
  1224. //
  1225. // ITfInputProcessorProfiles
  1226. //
  1227. [
  1228. object,
  1229. local,
  1230. uuid(1F02B6C5-7842-4EE6-8A0B-9A24183A95CA),
  1231. pointer_default(unique)
  1232. ]
  1233. interface ITfInputProcessorProfiles : IUnknown
  1234. {
  1235. HRESULT Register([in] REFCLSID rclsid);
  1236. HRESULT Unregister([in] REFCLSID rclsid);
  1237. HRESULT AddLanguageProfile([in] REFCLSID rclsid,
  1238. [in] LANGID langid,
  1239. [in] REFGUID guidProfile,
  1240. [in, size_is(cchDesc)] const WCHAR *pchDesc,
  1241. [in] ULONG cchDesc,
  1242. [in, size_is(cchFile)] const WCHAR *pchIconFile,
  1243. [in] ULONG cchFile,
  1244. [in] ULONG uIconIndex);
  1245. HRESULT RemoveLanguageProfile([in] REFCLSID rclsid,
  1246. [in] LANGID langid,
  1247. [in] REFGUID guidProfile);
  1248. HRESULT EnumInputProcessorInfo([out] IEnumGUID **ppEnum);
  1249. HRESULT GetDefaultLanguageProfile([in] LANGID langid,
  1250. [in] REFGUID catid,
  1251. [out] CLSID *pclsid,
  1252. [out] GUID *pguidProfile);
  1253. HRESULT SetDefaultLanguageProfile([in] LANGID langid,
  1254. [in] REFCLSID rclsid,
  1255. [in] REFGUID guidProfiles);
  1256. HRESULT ActivateLanguageProfile([in] REFCLSID rclsid,
  1257. [in] LANGID langid,
  1258. [in] REFGUID guidProfiles);
  1259. HRESULT GetActiveLanguageProfile([in] REFCLSID rclsid,
  1260. [out] LANGID *plangid,
  1261. [out] GUID *pguidProfile);
  1262. HRESULT GetLanguageProfileDescription([in] REFCLSID rclsid,
  1263. [in] LANGID langid,
  1264. [in] REFGUID guidProfile,
  1265. [out] BSTR *pbstrProfile);
  1266. HRESULT GetCurrentLanguage([out] LANGID *plangid);
  1267. HRESULT ChangeCurrentLanguage([in] LANGID langid);
  1268. HRESULT GetLanguageList([out] LANGID **ppLangId,
  1269. [out] ULONG *pulCount);
  1270. HRESULT EnumLanguageProfiles([in] LANGID langid,
  1271. [out] IEnumTfLanguageProfiles **ppEnum);
  1272. HRESULT EnableLanguageProfile([in] REFCLSID rclsid,
  1273. [in] LANGID langid,
  1274. [in] REFGUID guidProfile,
  1275. [in] BOOL fEnable);
  1276. HRESULT IsEnabledLanguageProfile([in] REFCLSID rclsid,
  1277. [in] LANGID langid,
  1278. [in] REFGUID guidProfile,
  1279. [out] BOOL *pfEnable);
  1280. HRESULT EnableLanguageProfileByDefault([in] REFCLSID rclsid,
  1281. [in] LANGID langid,
  1282. [in] REFGUID guidProfile,
  1283. [in] BOOL fEnable);
  1284. HRESULT SubstituteKeyboardLayout([in] REFCLSID rclsid,
  1285. [in] LANGID langid,
  1286. [in] REFGUID guidProfile,
  1287. [in] HKL hKL);
  1288. }
  1289. //
  1290. // ITfInputProcessorProfilesEx
  1291. //
  1292. // Implemented by Cicero
  1293. //
  1294. [
  1295. object,
  1296. uuid(892f230f-fe00-4a41-a98e-fcd6de0d35ef),
  1297. pointer_default(unique)
  1298. ]
  1299. interface ITfInputProcessorProfilesEx : ITfInputProcessorProfiles
  1300. {
  1301. HRESULT SetLanguageProfileDisplayName([in] REFCLSID rclsid,
  1302. [in] LANGID langid,
  1303. [in] REFGUID guidProfile,
  1304. [in, size_is(cchFile)] const WCHAR *pchFile,
  1305. [in] ULONG cchFile,
  1306. [in] ULONG uResId);
  1307. };
  1308. //
  1309. // ITfInputProcessorProfileSubstituteLayout
  1310. //
  1311. // Implemented by Cicero
  1312. //
  1313. [
  1314. object,
  1315. uuid(4fd67194-1002-4513-bff2-c0ddf6258552),
  1316. pointer_default(unique)
  1317. ]
  1318. interface ITfInputProcessorProfileSubstituteLayout : IUnknown
  1319. {
  1320. HRESULT GetSubstituteKeyboardLayout([in] REFCLSID rclsid,
  1321. [in] LANGID langid,
  1322. [in] REFGUID guidProfile,
  1323. [out] HKL *phKL);
  1324. };
  1325. //
  1326. // ITfActiveLanguageProfileNotifySink
  1327. //
  1328. [
  1329. object,
  1330. uuid(b246cb75-a93e-4652-bf8c-b3fe0cfd7e57),
  1331. pointer_default(unique)
  1332. ]
  1333. interface ITfActiveLanguageProfileNotifySink : IUnknown
  1334. {
  1335. HRESULT OnActivated([in] REFCLSID clsid,
  1336. [in] REFGUID guidProfile,
  1337. [in] BOOL fActivated);
  1338. }
  1339. //
  1340. // IEnumTfLanguageProfiles
  1341. //
  1342. [
  1343. object,
  1344. uuid(3d61bf11-ac5f-42c8-a4cb-931bcc28c744),
  1345. pointer_default(unique)
  1346. ]
  1347. interface IEnumTfLanguageProfiles : IUnknown
  1348. {
  1349. HRESULT Clone([out] IEnumTfLanguageProfiles **ppEnum);
  1350. HRESULT Next([in] ULONG ulCount,
  1351. [out, size_is(ulCount), length_is(*pcFetch)] TF_LANGUAGEPROFILE *pProfile,
  1352. [out] ULONG *pcFetch);
  1353. HRESULT Reset();
  1354. HRESULT Skip([in] ULONG ulCount);
  1355. };
  1356. //
  1357. // ITfLanguageProfileNotifySink
  1358. //
  1359. [
  1360. object,
  1361. uuid(43c9fe15-f494-4c17-9de2-b8a4ac350aa8),
  1362. pointer_default(unique)
  1363. ]
  1364. interface ITfLanguageProfileNotifySink : IUnknown
  1365. {
  1366. HRESULT OnLanguageChange([in] LANGID langid,
  1367. [out] BOOL *pfAccept);
  1368. HRESULT OnLanguageChanged();
  1369. }
  1370. typedef [uuid(77c12f95-b783-450d-879f-1cd2362c6521)] struct TF_PRESERVEDKEY
  1371. {
  1372. UINT uVKey;
  1373. UINT uModifiers;
  1374. } TF_PRESERVEDKEY;
  1375. //
  1376. // ITfKeystrokeMgr
  1377. //
  1378. [
  1379. object,
  1380. local,
  1381. uuid(aa80e7f0-2021-11d2-93e0-0060b067b86e),
  1382. pointer_default(unique)
  1383. ]
  1384. interface ITfKeystrokeMgr : IUnknown
  1385. {
  1386. HRESULT AdviseKeyEventSink([in] TfClientId tid,
  1387. [in] ITfKeyEventSink *pSink,
  1388. [in] BOOL fForeground);
  1389. HRESULT UnadviseKeyEventSink([in] TfClientId tid);
  1390. HRESULT GetForeground([out] CLSID *pclsid);
  1391. HRESULT TestKeyDown([in] WPARAM wParam,
  1392. [in] LPARAM lParam,
  1393. [out] BOOL *pfEaten);
  1394. HRESULT TestKeyUp([in] WPARAM wParam,
  1395. [in] LPARAM lParam,
  1396. [out] BOOL *pfEaten);
  1397. HRESULT KeyDown([in] WPARAM wParam,
  1398. [in] LPARAM lParam,
  1399. [out] BOOL *pfEaten);
  1400. HRESULT KeyUp([in] WPARAM wParam,
  1401. [in] LPARAM lParam,
  1402. [out] BOOL *pfEaten);
  1403. HRESULT GetPreservedKey([in] ITfContext *pic,
  1404. [in] const TF_PRESERVEDKEY *pprekey,
  1405. [out] GUID *pguid);
  1406. HRESULT IsPreservedKey([in] REFGUID rguid,
  1407. [in] const TF_PRESERVEDKEY *pprekey,
  1408. [out] BOOL *pfRegistered);
  1409. HRESULT PreserveKey([in] TfClientId tid,
  1410. [in] REFGUID rguid,
  1411. [in] const TF_PRESERVEDKEY *prekey,
  1412. [in, size_is(cchDesc)] const WCHAR *pchDesc,
  1413. [in] ULONG cchDesc);
  1414. HRESULT UnpreserveKey([in] REFGUID rguid,
  1415. [in] const TF_PRESERVEDKEY *pprekey);
  1416. HRESULT SetPreservedKeyDescription([in] REFGUID rguid,
  1417. [in, size_is(cchDesc)] const WCHAR *pchDesc,
  1418. [in] ULONG cchDesc);
  1419. HRESULT GetPreservedKeyDescription([in] REFGUID rguid,
  1420. [out] BSTR *pbstrDesc);
  1421. HRESULT SimulatePreservedKey([in] ITfContext *pic,
  1422. [in] REFGUID rguid,
  1423. [out] BOOL *pfEaten);
  1424. };
  1425. //
  1426. // ITfKeyEventSink
  1427. //
  1428. [
  1429. object,
  1430. local,
  1431. uuid(aa80e7f5-2021-11d2-93e0-0060b067b86e),
  1432. pointer_default(unique)
  1433. ]
  1434. interface ITfKeyEventSink : IUnknown
  1435. {
  1436. HRESULT OnSetFocus([in] BOOL fForeground);
  1437. HRESULT OnTestKeyDown([in] ITfContext *pic,
  1438. [in] WPARAM wParam,
  1439. [in] LPARAM lParam,
  1440. [out] BOOL *pfEaten);
  1441. HRESULT OnTestKeyUp([in] ITfContext *pic,
  1442. [in] WPARAM wParam,
  1443. [in] LPARAM lParam,
  1444. [out] BOOL *pfEaten);
  1445. HRESULT OnKeyDown([in] ITfContext *pic,
  1446. [in] WPARAM wParam,
  1447. [in] LPARAM lParam,
  1448. [out] BOOL *pfEaten);
  1449. HRESULT OnKeyUp([in] ITfContext *pic,
  1450. [in] WPARAM wParam,
  1451. [in] LPARAM lParam,
  1452. [out] BOOL *pfEaten);
  1453. HRESULT OnPreservedKey([in] ITfContext *pic,
  1454. [in] REFGUID rguid,
  1455. [out] BOOL *pfEaten);
  1456. };
  1457. //
  1458. // ITfKeyTraceEventSink
  1459. //
  1460. [
  1461. object,
  1462. local,
  1463. uuid(1cd4c13b-1c36-4191-a70a-7f3e611f367d),
  1464. pointer_default(unique)
  1465. ]
  1466. interface ITfKeyTraceEventSink : IUnknown
  1467. {
  1468. HRESULT OnKeyTraceDown([in] WPARAM wParam,
  1469. [in] LPARAM lParam);
  1470. HRESULT OnKeyTraceUp([in] WPARAM wParam,
  1471. [in] LPARAM lParam);
  1472. };
  1473. //
  1474. // ITfPreservedKeyNotifySink
  1475. //
  1476. [
  1477. object,
  1478. uuid(6f77c993-d2b1-446e-853e-5912efc8a286),
  1479. pointer_default(unique)
  1480. ]
  1481. interface ITfPreservedKeyNotifySink : IUnknown
  1482. {
  1483. HRESULT OnUpdated([in] const TF_PRESERVEDKEY *pprekey);
  1484. }
  1485. //
  1486. // ITfMessagePump
  1487. //
  1488. [
  1489. object,
  1490. local,
  1491. uuid(8f1b8ad8-0b6b-4874-90c5-bd76011e8f7c),
  1492. pointer_default(unique)
  1493. ]
  1494. interface ITfMessagePump : IUnknown
  1495. {
  1496. HRESULT PeekMessageA([out] LPMSG pMsg,
  1497. [in] HWND hwnd,
  1498. [in] UINT wMsgFilterMin,
  1499. [in] UINT wMsgFilterMax,
  1500. [in] UINT wRemoveMsg,
  1501. [out] BOOL *pfResult);
  1502. HRESULT GetMessageA([out] LPMSG pMsg,
  1503. [in] HWND hwnd,
  1504. [in] UINT wMsgFilterMin,
  1505. [in] UINT wMsgFilterMax,
  1506. [out] BOOL *pfResult);
  1507. HRESULT PeekMessageW([out] LPMSG pMsg,
  1508. [in] HWND hwnd,
  1509. [in] UINT wMsgFilterMin,
  1510. [in] UINT wMsgFilterMax,
  1511. [in] UINT wRemoveMsg,
  1512. [out] BOOL *pfResult);
  1513. HRESULT GetMessageW([out] LPMSG pMsg,
  1514. [in] HWND hwnd,
  1515. [in] UINT wMsgFilterMin,
  1516. [in] UINT wMsgFilterMax,
  1517. [out] BOOL *pfResult);
  1518. };
  1519. //
  1520. // ITfUIFocusSink
  1521. //
  1522. [
  1523. object,
  1524. local,
  1525. uuid(c0f1db0c-3a20-405c-a303-96b6010a885f),
  1526. pointer_default(unique)
  1527. ]
  1528. interface ITfThreadFocusSink : IUnknown
  1529. {
  1530. HRESULT OnSetThreadFocus();
  1531. HRESULT OnKillThreadFocus();
  1532. };
  1533. //
  1534. // ITfTextInputProcessor
  1535. //
  1536. [
  1537. object,
  1538. local,
  1539. uuid(aa80e7f7-2021-11d2-93e0-0060b067b86e),
  1540. pointer_default(unique)
  1541. ]
  1542. interface ITfTextInputProcessor : IUnknown
  1543. {
  1544. HRESULT Activate([in] ITfThreadMgr *ptim,
  1545. [in] TfClientId tid);
  1546. HRESULT Deactivate();
  1547. };
  1548. //
  1549. // ITfClientId
  1550. //
  1551. [
  1552. object,
  1553. local,
  1554. uuid(d60a7b49-1b9f-4be2-b702-47e9dc05dec3),
  1555. pointer_default(unique)
  1556. ]
  1557. interface ITfClientId : IUnknown
  1558. {
  1559. HRESULT GetClientId([in] REFCLSID rclsid,
  1560. [out] TfClientId *ptid);
  1561. };
  1562. typedef [uuid(c4cc07f1-80cc-4a7b-bc54-98512782cbe3)] enum {
  1563. TF_LS_NONE = 0,
  1564. TF_LS_SOLID = 1,
  1565. TF_LS_DOT = 2,
  1566. TF_LS_DASH = 3,
  1567. TF_LS_SQUIGGLE = 4
  1568. } TF_DA_LINESTYLE;
  1569. typedef [uuid(d9b92e21-084a-401b-9c64-1e6dad91a1ab)] enum {
  1570. TF_CT_NONE = 0,
  1571. TF_CT_SYSCOLOR = 1,
  1572. TF_CT_COLORREF = 2
  1573. } TF_DA_COLORTYPE;
  1574. typedef [uuid(90d0cb5e-6520-4a0f-b47c-c39bd955f0d6)] struct TF_DA_COLOR
  1575. {
  1576. TF_DA_COLORTYPE type;
  1577. [switch_type(TF_DA_COLORTYPE), switch_is(type)] union {
  1578. [case(TF_CT_SYSCOLOR)] int nIndex;
  1579. [case(TF_CT_COLORREF)] COLORREF cr;
  1580. };
  1581. } TF_DA_COLOR;
  1582. typedef [uuid(33d2fe4b-6c24-4f67-8d75-3bc1819e4126)] enum {
  1583. TF_ATTR_INPUT = 0,
  1584. TF_ATTR_TARGET_CONVERTED = 1,
  1585. TF_ATTR_CONVERTED = 2,
  1586. TF_ATTR_TARGET_NOTCONVERTED = 3,
  1587. TF_ATTR_INPUT_ERROR = 4,
  1588. TF_ATTR_FIXEDCONVERTED = 5,
  1589. TF_ATTR_OTHER = -1
  1590. } TF_DA_ATTR_INFO;
  1591. typedef [uuid(1bf1c305-419b-4182-a4d2-9bfadc3f021f)] struct TF_DISPLAYATTRIBUTE
  1592. {
  1593. TF_DA_COLOR crText;
  1594. TF_DA_COLOR crBk;
  1595. TF_DA_LINESTYLE lsStyle;
  1596. BOOL fBoldLine;
  1597. TF_DA_COLOR crLine;
  1598. TF_DA_ATTR_INFO bAttr;
  1599. } TF_DISPLAYATTRIBUTE;
  1600. //
  1601. // ITfDisplayAttributeInfo
  1602. //
  1603. [
  1604. object,
  1605. uuid(70528852-2f26-4aea-8c96-215150578932),
  1606. pointer_default(unique)
  1607. ]
  1608. interface ITfDisplayAttributeInfo : IUnknown
  1609. {
  1610. HRESULT GetGUID([out] GUID *pguid);
  1611. HRESULT GetDescription([out] BSTR *pbstrDesc);
  1612. HRESULT GetAttributeInfo([out] TF_DISPLAYATTRIBUTE *pda);
  1613. HRESULT SetAttributeInfo([in] const TF_DISPLAYATTRIBUTE *pda);
  1614. HRESULT Reset();
  1615. }
  1616. //
  1617. // IEnumTfDisplayAttributeInfo interface
  1618. //
  1619. [
  1620. object,
  1621. uuid(7cef04d7-cb75-4e80-a7ab-5f5bc7d332de),
  1622. pointer_default(unique)
  1623. ]
  1624. interface IEnumTfDisplayAttributeInfo : IUnknown
  1625. {
  1626. HRESULT Clone([out] IEnumTfDisplayAttributeInfo **ppEnum);
  1627. HRESULT Next([in] ULONG ulCount,
  1628. [out, size_is(ulCount), length_is(*pcFetched)] ITfDisplayAttributeInfo **rgInfo,
  1629. [out] ULONG *pcFetched);
  1630. HRESULT Reset();
  1631. HRESULT Skip([in] ULONG ulCount);
  1632. }
  1633. //
  1634. // ITfDisplayAttributeProvider interface
  1635. //
  1636. [
  1637. object,
  1638. uuid(fee47777-163c-4769-996a-6e9c50ad8f54),
  1639. pointer_default(unique)
  1640. ]
  1641. interface ITfDisplayAttributeProvider : IUnknown
  1642. {
  1643. HRESULT EnumDisplayAttributeInfo([out] IEnumTfDisplayAttributeInfo **ppEnum);
  1644. HRESULT GetDisplayAttributeInfo([in] REFGUID guid,
  1645. [out] ITfDisplayAttributeInfo **ppInfo);
  1646. }
  1647. //
  1648. // ITfDisplayAttributeMgr interface
  1649. //
  1650. [
  1651. object,
  1652. local,
  1653. uuid(8ded7393-5db1-475c-9e71-a39111b0ff67),
  1654. pointer_default(unique)
  1655. ]
  1656. interface ITfDisplayAttributeMgr : IUnknown
  1657. {
  1658. HRESULT OnUpdateInfo();
  1659. HRESULT EnumDisplayAttributeInfo([out] IEnumTfDisplayAttributeInfo **ppEnum);
  1660. HRESULT GetDisplayAttributeInfo([in] REFGUID guid,
  1661. [out] ITfDisplayAttributeInfo **ppInfo,
  1662. [out] CLSID *pclsidOwner);
  1663. }
  1664. //
  1665. // ITfDisplayAttributeNotifySink interface
  1666. //
  1667. [
  1668. object,
  1669. uuid(ad56f402-e162-4f25-908f-7d577cf9bda9),
  1670. pointer_default(unique)
  1671. ]
  1672. interface ITfDisplayAttributeNotifySink : IUnknown
  1673. {
  1674. HRESULT OnUpdateInfo();
  1675. }
  1676. //
  1677. // ITfCategoryMgr interface
  1678. //
  1679. [
  1680. object,
  1681. local,
  1682. uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
  1683. pointer_default(unique)
  1684. ]
  1685. interface ITfCategoryMgr : IUnknown
  1686. {
  1687. HRESULT RegisterCategory([in] REFCLSID rclsid,
  1688. [in] REFGUID rcatid,
  1689. [in] REFGUID rguid);
  1690. HRESULT UnregisterCategory([in] REFCLSID rclsid,
  1691. [in] REFGUID rcatid,
  1692. [in] REFGUID rguid);
  1693. HRESULT EnumCategoriesInItem([in] REFGUID rguid,
  1694. [out] IEnumGUID **ppEnum);
  1695. HRESULT EnumItemsInCategory([in] REFGUID rcatid,
  1696. [out] IEnumGUID **ppEnum);
  1697. HRESULT FindClosestCategory([in] REFGUID rguid,
  1698. [out] GUID *pcatid,
  1699. [in, size_is(ulCount)] const GUID **ppcatidList,
  1700. [in] ULONG ulCount);
  1701. HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
  1702. [in] REFGUID rguid,
  1703. [in, size_is(cch)] const WCHAR *pchDesc,
  1704. [in] ULONG cch);
  1705. HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
  1706. [in] REFGUID rguid);
  1707. HRESULT GetGUIDDescription([in] REFGUID rguid,
  1708. [out] BSTR *pbstrDesc);
  1709. HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
  1710. [in] REFGUID rguid,
  1711. [in] DWORD dw);
  1712. HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
  1713. [in] REFGUID rguid);
  1714. HRESULT GetGUIDDWORD([in] REFGUID rguid,
  1715. [out] DWORD *pdw);
  1716. HRESULT RegisterGUID([in] REFGUID rguid,
  1717. [out] TfGuidAtom *pguidatom);
  1718. HRESULT GetGUID([in] TfGuidAtom guidatom,
  1719. [out] GUID *pguid);
  1720. HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
  1721. [in] REFGUID rguid,
  1722. [out] BOOL *pfEqual);
  1723. }
  1724. // value guarenteed never to be returned by ITfSource/Single::AdviseSink
  1725. const DWORD TF_INVALID_COOKIE = 0xffffffff;
  1726. //
  1727. // ITfSource
  1728. //
  1729. [
  1730. object,
  1731. uuid(4ea48a35-60ae-446f-8fd6-e6a8d82459f7),
  1732. pointer_default(unique)
  1733. ]
  1734. interface ITfSource : IUnknown
  1735. {
  1736. HRESULT AdviseSink([in] REFIID riid,
  1737. [in, iid_is(riid)] IUnknown *punk,
  1738. [out] DWORD *pdwCookie);
  1739. HRESULT UnadviseSink([in] DWORD dwCookie);
  1740. };
  1741. //
  1742. // ITfSourceSingle
  1743. //
  1744. [
  1745. object,
  1746. uuid(73131f9c-56a9-49dd-b0ee-d046633f7528),
  1747. pointer_default(unique)
  1748. ]
  1749. interface ITfSourceSingle : IUnknown
  1750. {
  1751. HRESULT AdviseSingleSink([in] TfClientId tid,
  1752. [in] REFIID riid,
  1753. [in, iid_is(riid)] IUnknown *punk);
  1754. HRESULT UnadviseSingleSink([in] TfClientId tid,
  1755. [in] REFIID riid);
  1756. };
  1757. cpp_quote("#endif // MSCTF_DEFINED")