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.

549 lines
14 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992-2000.
  5. //
  6. // File: msctfp.idl
  7. //
  8. // Contents: MSCTF private APIs
  9. //
  10. //
  11. //--------------------------------------------------------------------------
  12. cpp_quote("//=--------------------------------------------------------------------------=")
  13. cpp_quote("// msctfp.h")
  14. cpp_quote("//=--------------------------------------------------------------------------=")
  15. cpp_quote("// (C) Copyright 1995-2000 Microsoft Corporation. All Rights Reserved.")
  16. cpp_quote("//")
  17. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  18. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  19. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  20. cpp_quote("// PARTICULAR PURPOSE.")
  21. cpp_quote("//=--------------------------------------------------------------------------=")
  22. cpp_quote("")
  23. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  24. cpp_quote("")
  25. cpp_quote("//--------------------------------------------------------------------------")
  26. cpp_quote("// MSCTF Private Interfaces.")
  27. cpp_quote("")
  28. cpp_quote("#ifndef MSCTFP_DEFINED")
  29. cpp_quote("#define MSCTFP_DEFINED")
  30. cpp_quote("")
  31. cpp_quote("#include <windows.h>")
  32. cpp_quote("")
  33. import "oaidl.idl";
  34. import "msctf.idl";
  35. //
  36. // GUIDs for the Tips category. Each category contains Tips classes.
  37. //
  38. cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_REFERENCE;")
  39. cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_PROOFING;")
  40. cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_SMARTTAG;")
  41. cpp_quote("EXTERN_C const GUID GUID_TFCAT_PROPSTYLE_CUSTOM_COMPACT;")
  42. cpp_quote("EXTERN_C const GUID GUID_SERVICE_TEXTSTORE;")
  43. cpp_quote("EXTERN_C const GUID GUID_SERVICE_TF;")
  44. //
  45. // GUIDs for system predefined compartment for internal use only
  46. //
  47. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_MSCANDIDATEUI_WINDOW;")
  48. interface ITfSysHookSink;
  49. cpp_quote("#define TF_LBU_CAPSKANAKEY 1")
  50. cpp_quote("#define TF_LBU_NTCONSOLELANGCHANGE 2")
  51. //
  52. // GUIDs for system predefined conversion mode bias for internal use only
  53. //
  54. cpp_quote("EXTERN_C const GUID GUID_MODEBIAS_DEFAULT;")
  55. //
  56. // flags for TF_LBU_CAPSKANAKEY
  57. //
  58. cpp_quote("#define TF_LBUF_CAPS 0x0001")
  59. cpp_quote("#define TF_LBUF_KANA 0x0002")
  60. // new RequestEditSession flag, grants write access to properties, read access to text
  61. const DWORD TF_ES_READ_PROPERTY_WRITE = 0x12;
  62. //
  63. // flags for PreservedKeyEx
  64. //
  65. cpp_quote("#define TF_PKEX_SYSHOTKEY 0x0001")
  66. cpp_quote("#define TF_PKEX_NONEEDDIM 0x0002")
  67. //
  68. // flags for ActivateEx
  69. //
  70. cpp_quote("#define TF_TMAE_NOACTIVATETIP 0x0001")
  71. //
  72. // flags for KeyDownUpEx
  73. //
  74. cpp_quote("#define TF_KEY_MSCTFIME 0x0001")
  75. cpp_quote("#define TF_KEY_TEST 0x0002")
  76. cpp_quote("#define TF_KEY_INTERNAL 0x0004")
  77. //
  78. // ITfThreadMgr_P
  79. //
  80. // implemented by Cicero
  81. //
  82. // This is a private Interface of ITFThreadMgr.
  83. //
  84. //
  85. //
  86. [
  87. object,
  88. uuid(f65567a7-34a1-46f4-b5dd-8804aeb06ff7),
  89. pointer_default(unique)
  90. ]
  91. interface ITfThreadMgr_P_old : ITfThreadMgr
  92. {
  93. //
  94. // AIMM1.2 want to know if the window is cicero aware or not.
  95. // Because AIMM1.2 is filtering a window by wndclass,
  96. // but both AIMM1.2 and Cicero aware Richedit can exist on same thread.
  97. //
  98. HRESULT GetAssociated([in] HWND hWnd,
  99. [out] ITfDocumentMgr **ppdim);
  100. HRESULT SetSysHookSink([in] ITfSysHookSink *pSink);
  101. HRESULT RequestPostponedLock([in] ITfContext *pic);
  102. HRESULT IsKeystrokeFeedEnabled([out] BOOL *pfEnabled);
  103. };
  104. //
  105. // ITfThreadMgr_P
  106. //
  107. // implemented by Cicero
  108. //
  109. // This is a private Interface of ITFThreadMgr.
  110. //
  111. [
  112. object,
  113. uuid(7c6247a1-2884-4b7c-af24-f198047aa728),
  114. pointer_default(unique)
  115. ]
  116. interface ITfThreadMgr_P : ITfThreadMgr_P_old
  117. {
  118. HRESULT CallImm32HotkeyHanlder([in] WPARAM wParam, [in] LPARAM lParam, [out] BOOL *pbHandled);
  119. HRESULT ActivateEx([out] TfClientId *ptid, [in] DWORD dwFlags);
  120. }
  121. //
  122. // ITfKeystrokeMgr_P
  123. //
  124. [
  125. object,
  126. local,
  127. uuid(53fa1bec-5be1-458e-ae70-a9f1dc843e81),
  128. pointer_default(unique)
  129. ]
  130. interface ITfKeystrokeMgr_P : ITfKeystrokeMgr
  131. {
  132. HRESULT PreserveKeyEx([in] TfClientId tid,
  133. [in] REFGUID rguid,
  134. [in] const TF_PRESERVEDKEY *prekey,
  135. [in, size_is(cchDesc)] const WCHAR *pchDesc,
  136. [in] ULONG cchDesc,
  137. [in] DWORD dwFlags);
  138. HRESULT KeyDownUpEx([in] WPARAM wParam,
  139. [in] LPARAM lParam,
  140. [in] DWORD dwFlags,
  141. [out] BOOL *pfEaten);
  142. };
  143. //
  144. // ITfSysHookSink
  145. //
  146. // implemented by AIMM layer
  147. //
  148. // This is a private Interface of ITFThreadMgr.
  149. //
  150. [
  151. object,
  152. uuid(495388DA-21A5-4852-8BB1-ED2F29DA8D60),
  153. pointer_default(unique)
  154. ]
  155. interface ITfSysHookSink : IUnknown
  156. {
  157. HRESULT OnPreFocusDIM([in] HWND hWnd);
  158. HRESULT OnSysKeyboardProc([in] WPARAM wParam,
  159. [in] LPARAM lParam);
  160. HRESULT OnSysShellProc([in] int nCode,
  161. [in] WPARAM wParam,
  162. [in] LPARAM lParam);
  163. };
  164. //
  165. // ITfStartReconversionNotifySink
  166. //
  167. // implemented by AIMM layer
  168. //
  169. [
  170. object,
  171. uuid(b9cd19cb-2919-4935-8768-ef30bae9a0cc),
  172. pointer_default(unique)
  173. ]
  174. interface ITfStartReconversionNotifySink : IUnknown
  175. {
  176. HRESULT StartReconversion();
  177. HRESULT EndReconversion();
  178. }
  179. //
  180. // ITfLangBarEventSink_P
  181. //
  182. // Implemented by Unified Tip bars.
  183. // Callback for ITfLangBarMgr.
  184. //
  185. [
  186. object,
  187. uuid(7a460360-da21-4b09-a8a0-8a69e728d893),
  188. pointer_default(unique)
  189. ]
  190. interface ITfLangBarEventSink_P: IUnknown
  191. {
  192. HRESULT OnLangBarUpdate([in] UINT uPdate, [in] LPARAM lParam);
  193. }
  194. //
  195. // ITfLangBarMgr_P
  196. //
  197. // Implemented by Unified Tip bars.
  198. // Callback for ITfLangBarMgr.
  199. //
  200. [
  201. object,
  202. uuid(d72c0fa9-add5-4af0-8706-4fa9ae3e2eff),
  203. pointer_default(unique)
  204. ]
  205. interface ITfLangBarMgr_P: ITfLangBarMgr
  206. {
  207. HRESULT GetPrevShowFloatingStatus([out] DWORD *pdwFlags);
  208. }
  209. //
  210. // ITfContext_P
  211. //
  212. // implemented by Cicero
  213. //
  214. // This is a private Interface of ITFContext.
  215. //
  216. [
  217. object,
  218. uuid(2dee47c8-704d-42a0-9983-ffeed659b64d),
  219. pointer_default(unique)
  220. ]
  221. interface ITfContext_P : ITfContext
  222. {
  223. HRESULT MapAppProperty([in] REFGUID guidAppProp,
  224. [in] REFGUID guidProp);
  225. HRESULT EnableLockRequestPosting([in] BOOL fEnable);
  226. };
  227. //
  228. // ITfRangeChangeSink
  229. //
  230. // Implemented by an application/control.
  231. //
  232. // This is an interface we pulled from Cicero 1.0 because no one
  233. // was using it.
  234. [
  235. object,
  236. uuid(c1a0e6af-0d60-4800-9796-1fe8e85c0cca),
  237. pointer_default(unique)
  238. ]
  239. interface ITfRangeChangeSink : IUnknown
  240. {
  241. HRESULT OnChange([in] ITfRange *pRange);
  242. };
  243. //
  244. // ITfFnAbort
  245. //
  246. [
  247. object,
  248. uuid(17f2317f-addb-49df-870e-66227bc51d1a),
  249. pointer_default(unique)
  250. ]
  251. interface ITfFnAbort : ITfFunction
  252. {
  253. HRESULT Abort([in] ITfContext *pic);
  254. }
  255. //
  256. // ITfMouseTrackerAnchor
  257. //
  258. [
  259. object,
  260. uuid(f9f4e0f2-d600-4a4c-b144-77e201ebd1b0),
  261. pointer_default(unique)
  262. ]
  263. interface ITfMouseTrackerAnchor : IUnknown
  264. {
  265. HRESULT AdviseMouseSink([in] IAnchor *paStart,
  266. [in] IAnchor *paEnd,
  267. [in] ITfMouseSink *pSink,
  268. [out] DWORD *pdwCookie);
  269. HRESULT UnadviseMouseSink([in] DWORD dwCookie);
  270. };
  271. //
  272. // ITfRangeAnchor
  273. //
  274. [
  275. object,
  276. uuid(8b99712b-5815-4bcc-b9a9-53db1c8d6755),
  277. pointer_default(unique)
  278. ]
  279. interface ITfRangeAnchor : ITfRange
  280. {
  281. HRESULT GetExtent([out] IAnchor **ppaStart,
  282. [out] IAnchor **ppaEnd);
  283. HRESULT SetExtent([in] IAnchor *paStart,
  284. [in] IAnchor *paEnd);
  285. }
  286. typedef [uuid(af9f076f-4937-4285-8600-81dca5c31eb6)] struct TF_PERSISTENT_PROPERTY_HEADER_ANCHOR
  287. {
  288. GUID guidType; // property type
  289. IAnchor *paStart; // range information of this property data
  290. IAnchor *paEnd; // range information of this property data
  291. ULONG cb; // the data size of pStream in BYTE count
  292. DWORD dwPrivate; // private data
  293. CLSID clsidTIP; // the original owner of the property data
  294. } TF_PERSISTENT_PROPERTY_HEADER_ANCHOR;
  295. //
  296. // ITfPersistentPropertyLoaderAnchor
  297. //
  298. [
  299. object,
  300. uuid(2133f790-34c2-11d3-a745-0050040ab407),
  301. pointer_default(unique)
  302. ]
  303. interface ITfPersistentPropertyLoaderAnchor : IUnknown
  304. {
  305. HRESULT LoadProperty([in] const TF_PERSISTENT_PROPERTY_HEADER_ANCHOR *pHdr,
  306. [out] IStream **ppStream);
  307. }
  308. //
  309. // ITextStoreAnchorServices
  310. //
  311. [
  312. object,
  313. uuid(aa80e9fe-2021-11d2-93e0-0060b067b86e),
  314. pointer_default(unique)
  315. ]
  316. interface ITextStoreAnchorServices : IUnknown
  317. {
  318. HRESULT Serialize([in] ITfProperty *pProp,
  319. [in] ITfRange *pRange,
  320. [out] TF_PERSISTENT_PROPERTY_HEADER_ANCHOR *pHdr,
  321. [in] IStream *pStream);
  322. HRESULT Unserialize([in] ITfProperty *pProp,
  323. [in] const TF_PERSISTENT_PROPERTY_HEADER_ANCHOR *pHdr,
  324. [in] IStream *pStream,
  325. [in] ITfPersistentPropertyLoaderAnchor *pLoader);
  326. HRESULT ForceLoadProperty([in] ITfProperty *pProp);
  327. HRESULT CreateRange([in] IAnchor *paStart,
  328. [in] IAnchor *paEnd,
  329. [out] ITfRangeAnchor **ppRange);
  330. };
  331. //
  332. // ITfProperty2
  333. //
  334. [
  335. object,
  336. uuid(db261faa-2142-486a-b5c6-d2101bc03d2e),
  337. pointer_default(unique)
  338. ]
  339. interface ITfProperty2 : ITfProperty
  340. {
  341. const DWORD TF_FNV_BACKWARD = 0x1;
  342. const DWORD TF_FNV_NO_CONTAINED = 0x2;
  343. HRESULT FindNextValue([in] TfEditCookie ec,
  344. [in] ITfRange *pRangeQuery,
  345. [in] TfAnchor tfAnchorQuery,
  346. [in] DWORD dwFlags,
  347. [out] BOOL *pfContained,
  348. [out] ITfRange **ppRangeNextValue);
  349. // Issue: should be FindNextValues, takes multiple properties
  350. };
  351. const ULONG TF_DA_PRIORITY_HIGHEST = 0;
  352. const ULONG TF_DA_PRIORITY_DEFAULT_SPELLING = 8;
  353. const ULONG TF_DA_PRIORITY_DEFAULT_GRAMMAR = 16;
  354. const ULONG TF_DA_PRIORITY_DEFAULT = 24;
  355. const ULONG TF_DA_PRIORITY_LOWEST = 31;
  356. typedef struct
  357. {
  358. ULONG uPriority;
  359. GUID guidProperty;
  360. } TF_DA_PROPERTY;
  361. //
  362. // IEnumTfCollection
  363. //
  364. [
  365. object,
  366. uuid(1c760b20-ed66-4dbd-9ff1-68fc21c02922),
  367. pointer_default(unique)
  368. ]
  369. interface IEnumTfCollection : IUnknown
  370. {
  371. HRESULT Clone([out] IEnumTfCollection **ppClone);
  372. HRESULT Next([in] ULONG ulCount,
  373. [out, size_is(ulCount), length_is(*pcFetched)] TF_DA_PROPERTY *rgCollection,
  374. [out] ULONG *pcFetched);
  375. HRESULT Reset();
  376. HRESULT Skip([in] ULONG ulCount);
  377. };
  378. //
  379. // ITfDisplayAttributeCollectionMgr
  380. //
  381. [
  382. object,
  383. uuid(4e3d2d48-3c17-457d-84a1-f209476de897),
  384. pointer_default(unique)
  385. ]
  386. interface ITfDisplayAttributeCollectionMgr : IUnknown
  387. {
  388. HRESULT EnumCollections([out] IEnumTfCollection **ppEnum);
  389. };
  390. //
  391. // ITfDisplayAttributeCollectionProvider
  392. //
  393. [
  394. object,
  395. uuid(3977526d-1a0a-435a-8d06-ecc9516b484f),
  396. pointer_default(unique)
  397. ]
  398. interface ITfDisplayAttributeCollectionProvider : IUnknown
  399. {
  400. HRESULT GetCollectionCount([out] ULONG *puCount);
  401. HRESULT GetCollection([in] ULONG uCount,
  402. [out, size_is(uCount), length_is(*pcGUIDsOut)] TF_DA_PROPERTY *prgProperty,
  403. [out] ULONG *pcGUIDsOut);
  404. };
  405. typedef struct
  406. {
  407. ITfRange *pRange;
  408. TF_DISPLAYATTRIBUTE tfDisplayAttr;
  409. } TF_RENDERINGMARKUP;
  410. //
  411. // IEnumTfRenderingMarkup
  412. //
  413. [
  414. object,
  415. uuid(8c03d21b-95a7-4ba0-ae1b-7fce12a72930),
  416. pointer_default(unique)
  417. ]
  418. interface IEnumTfRenderingMarkup : IUnknown
  419. {
  420. HRESULT Clone([out] IEnumTfRenderingMarkup **ppClone);
  421. HRESULT Next([in] ULONG ulCount,
  422. [out, size_is(ulCount), length_is(*pcFetched)] TF_RENDERINGMARKUP *rgMarkup,
  423. [out] ULONG *pcFetched);
  424. HRESULT Reset();
  425. HRESULT Skip([in] ULONG ulCount);
  426. };
  427. //
  428. // ITfContextRenderingMarkup
  429. //
  430. [
  431. object,
  432. uuid(a305b1c0-c776-4523-bda0-7c5a2e0fef10),
  433. pointer_default(unique)
  434. ]
  435. interface ITfContextRenderingMarkup : IUnknown
  436. {
  437. const DWORD TF_GRM_INCLUDE_PROPERTY = 0x1;
  438. HRESULT GetRenderingMarkup([in] TfEditCookie ec,
  439. [in] DWORD dwFlags,
  440. [in] ITfRange *pRangeCover,
  441. [out] IEnumTfRenderingMarkup **ppEnum);
  442. const DWORD TF_FRM_INCLUDE_PROPERTY = 0x1;
  443. const DWORD TF_FRM_BACKWARD = 0x2;
  444. const DWORD TF_FRM_NO_CONTAINED = 0x4;
  445. const DWORD TF_FRM_NO_RANGE = 0x8;
  446. HRESULT FindNextRenderingMarkup([in] TfEditCookie ec,
  447. [in] DWORD dwFlags,
  448. [in] ITfRange *pRangeQuery,
  449. [in] TfAnchor tfAnchorQuery,
  450. [out] ITfRange **ppRangeFound,
  451. [out] TF_RENDERINGMARKUP *ptfRenderingMarkup);
  452. };
  453. //
  454. // ITfBackgroundThreadMgr
  455. //
  456. [
  457. object,
  458. local,
  459. uuid(38462b47-6127-4464-bd2f-46957c31ad0e),
  460. pointer_default(unique)
  461. ]
  462. interface ITfBackgroundThreadMgr : IUnknown
  463. {
  464. typedef BOOL (*TfBackgroundThreadCallback)([in] BOOL fCleanup, [in] void *pvPrivate);
  465. typedef BOOL (*TfWakeAppBackgroundThreadProc)(void);
  466. HRESULT AppInitBackgroundThread([in] TfWakeAppBackgroundThreadProc pfnWakeThread,
  467. [out] TfBackgroundThreadCallback *ppfnCallback,
  468. [out] void **ppvPrivate);
  469. HRESULT AppUninitBackgroundThread();
  470. HRESULT AdviseBackgroundCallback([in] TfBackgroundThreadCallback pfnCallback,
  471. [in] void *pvPrivate,
  472. [out] DWORD *pdwCookie);
  473. HRESULT UnadviseBackgroundCallback([in] DWORD dwCookie);
  474. HRESULT WakeBackgroundThread();
  475. };
  476. cpp_quote("#endif // MSCTFP_DEFINED")