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.

447 lines
11 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992-2001.
  5. //
  6. // File: ctffunc.idl
  7. //
  8. // Contents: Text Framework function interfaces.
  9. //
  10. //
  11. //--------------------------------------------------------------------------
  12. cpp_quote("//=--------------------------------------------------------------------------=")
  13. cpp_quote("// ctffunc.h")
  14. cpp_quote("")
  15. cpp_quote("")
  16. cpp_quote("// Text Framework function interfaces.")
  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 CTFFUNC_DEFINED")
  28. cpp_quote("#define CTFFUNC_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. cpp_quote("#ifdef __cplusplus")
  37. cpp_quote("}")
  38. cpp_quote("#endif /* __cplusplus */")
  39. import "oaidl.idl";
  40. import "msctf.idl";
  41. cpp_quote("#define TF_E_NOCONVERSION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0600)")
  42. //
  43. // exported CLSID
  44. //
  45. cpp_quote("EXTERN_C const CLSID CLSID_SapiLayr;")
  46. //
  47. // ITfCandidateString
  48. //
  49. [
  50. object,
  51. uuid(581f317e-fd9d-443f-b972-ed00467c5d40),
  52. pointer_default(unique)
  53. ]
  54. interface ITfCandidateString : IUnknown
  55. {
  56. HRESULT GetString([out] BSTR *pbstr);
  57. HRESULT GetIndex([out] ULONG *pnIndex);
  58. }
  59. //
  60. // IEnumTfCandidates
  61. //
  62. [
  63. object,
  64. uuid(defb1926-6c80-4ce8-87d4-d6b72b812bde),
  65. pointer_default(unique)
  66. ]
  67. interface IEnumTfCandidates : IUnknown
  68. {
  69. HRESULT Clone([out] IEnumTfCandidates **ppEnum);
  70. HRESULT Next([in] ULONG ulCount,
  71. [out, size_is(ulCount), length_is(*pcFetched)] ITfCandidateString **ppCand,
  72. [out] ULONG *pcFetched);
  73. HRESULT Reset();
  74. HRESULT Skip([in] ULONG ulCount);
  75. }
  76. //
  77. // ITfCandidateList
  78. //
  79. [
  80. object,
  81. uuid(a3ad50fb-9bdb-49e3-a843-6c76520fbf5d),
  82. pointer_default(unique)
  83. ]
  84. interface ITfCandidateList : IUnknown
  85. {
  86. HRESULT EnumCandidates([out] IEnumTfCandidates **ppEnum);
  87. HRESULT GetCandidate([in] ULONG nIndex,
  88. [out] ITfCandidateString **ppCand);
  89. HRESULT GetCandidateNum([out] ULONG *pnCnt);
  90. typedef [uuid(baa898f2-0207-4643-92ca-f3f7b0cf6f80)] enum
  91. {
  92. CAND_FINALIZED = 0x0,
  93. CAND_SELECTED = 0x1,
  94. CAND_CANCELED = 0x2,
  95. } TfCandidateResult;
  96. HRESULT SetResult([in] ULONG nIndex,
  97. [in] TfCandidateResult imcr);
  98. }
  99. //
  100. // ITfFnReconversion
  101. //
  102. [
  103. object,
  104. uuid(4cea93c0-0a58-11d3-8df0-00105a2799b5),
  105. pointer_default(unique)
  106. ]
  107. interface ITfFnReconversion : ITfFunction
  108. {
  109. HRESULT QueryRange([in] ITfRange *pRange,
  110. [in, out, unique] ITfRange **ppNewRange,
  111. [out] BOOL *pfConvertable);
  112. HRESULT GetReconversion([in] ITfRange *pRange,
  113. [out] ITfCandidateList **ppCandList);
  114. HRESULT Reconvert([in] ITfRange *pRange);
  115. }
  116. // --- Data formats
  117. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SAPI_AUDIO;")
  118. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_DICTATIONSTAT;")
  119. cpp_quote("#define TF_DICTATION_ON 0x00000001")
  120. cpp_quote("#define TF_DICTATION_ENABLED 0x00000002")
  121. cpp_quote("#define TF_COMMANDING_ENABLED 0x00000004")
  122. cpp_quote("#define TF_COMMANDING_ON 0x00000008")
  123. cpp_quote("#define TF_SPEECHUI_SHOWN 0x00000010")
  124. cpp_quote("")
  125. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_UI_STATUS;")
  126. cpp_quote("#define TF_SHOW_BALLOON 0x00000001")
  127. cpp_quote("#define TF_DISABLE_BALLOON 0x00000002")
  128. cpp_quote("EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_CFGMENU;")
  129. cpp_quote("#define TF_MENUREADY 0x00000001")
  130. cpp_quote("EXTERN_C const GUID GUID_LBI_SAPILAYR_CFGMENUBUTTON;")
  131. cpp_quote("")
  132. //
  133. // ITfFnPlayBack
  134. //
  135. [
  136. object,
  137. uuid(a3a416a4-0f64-11d3-b5b7-00c04fc324a1),
  138. pointer_default(unique)
  139. ]
  140. interface ITfFnPlayBack : ITfFunction
  141. {
  142. HRESULT QueryRange([in] ITfRange *pRange,
  143. [out] ITfRange **ppNewRange,
  144. [out] BOOL *pfPlayable);
  145. HRESULT Play([in] ITfRange *pRange);
  146. }
  147. //
  148. // ITfLangProfileUtil
  149. //
  150. [
  151. object,
  152. uuid(A87A8574-A6C1-4E15-99F0-3D3965F548EB),
  153. pointer_default(unique)
  154. ]
  155. interface ITfFnLangProfileUtil : ITfFunction
  156. {
  157. HRESULT RegisterActiveProfiles();
  158. HRESULT IsProfileAvailableForLang([in] LANGID langid,
  159. [out] BOOL *pfAvailable);
  160. }
  161. //
  162. // ITfFnConfigure
  163. //
  164. [
  165. object,
  166. uuid(88f567c6-1757-49f8-a1b2-89234c1eeff9),
  167. pointer_default(unique)
  168. ]
  169. interface ITfFnConfigure : ITfFunction
  170. {
  171. //
  172. // Show()
  173. //
  174. HRESULT Show([in] HWND hwndParent,
  175. [in] LANGID langid,
  176. [in] REFGUID rguidProfile);
  177. }
  178. //
  179. // ITfFnConfigureRegisterWord
  180. //
  181. [
  182. object,
  183. uuid(bb95808a-6d8f-4bca-8400-5390b586aedf),
  184. pointer_default(unique)
  185. ]
  186. interface ITfFnConfigureRegisterWord : ITfFunction
  187. {
  188. //
  189. // Show()
  190. //
  191. HRESULT Show([in] HWND hwndParent,
  192. [in] LANGID langid,
  193. [in] REFGUID rguidProfile,
  194. [in, unique] BSTR bstrRegistered);
  195. }
  196. //
  197. // ITfFnShowHelp
  198. //
  199. [
  200. object,
  201. uuid(5AB1D30C-094D-4C29-8EA5-0BF59BE87BF3),
  202. pointer_default(unique)
  203. ]
  204. interface ITfFnShowHelp : ITfFunction
  205. {
  206. HRESULT Show([in] HWND hwndParent);
  207. }
  208. //
  209. // ITfFnBalloon
  210. //
  211. [
  212. object,
  213. uuid(3BAB89E4-5FBE-45F4-A5BC-DCA36AD225A8),
  214. pointer_default(unique)
  215. ]
  216. interface ITfFnBalloon : IUnknown
  217. {
  218. HRESULT UpdateBalloon([in] TfLBBalloonStyle style,
  219. [in, size_is(cch)] const WCHAR *pch,
  220. [in] ULONG cch);
  221. }
  222. //
  223. // ITfFnGetSAPIObject
  224. //
  225. typedef [uuid(36adb6d9-da1f-45d8-a499-86167e0f936b)] enum
  226. {
  227. GETIF_RESMGR = 0x0,
  228. GETIF_RECOCONTEXT = 0x1,
  229. GETIF_RECOGNIZER = 0x2,
  230. GETIF_VOICE = 0x3,
  231. GETIF_DICTGRAM = 0x4 ,
  232. GETIF_RECOGNIZERNOINIT = 0x5 , // for candidate UI
  233. } TfSapiObject;
  234. [
  235. object,
  236. uuid(5c0ab7ea-167d-4f59-bfb5-4693755e90ca),
  237. pointer_default(unique)
  238. ]
  239. interface ITfFnGetSAPIObject : ITfFunction
  240. {
  241. HRESULT Get([in] TfSapiObject sObj,
  242. [out] IUnknown **ppunk);
  243. }
  244. //
  245. // ITfFnPropertyUIStatus
  246. //
  247. [
  248. object,
  249. uuid(2338AC6E-2B9D-44C0-A75E-EE64F256B3BD),
  250. pointer_default(unique)
  251. ]
  252. interface ITfFnPropertyUIStatus : ITfFunction
  253. {
  254. HRESULT GetStatus([in] REFGUID refguidProp, [out] DWORD *pdw);
  255. HRESULT SetStatus([in] REFGUID refguidProp, [in] DWORD dw);
  256. }
  257. // --- bit flag for ITfFnPropertyUIStatus
  258. cpp_quote("")
  259. cpp_quote("#define TF_PROPUI_STATUS_SAVETOFILE 0x00000001")
  260. cpp_quote("")
  261. //
  262. // LM sharing interface definitions
  263. //
  264. cpp_quote("EXTERN_C const GUID GUID_TFCAT_TIP_MASTERLM;")
  265. cpp_quote("EXTERN_C const GUID GUID_MASTERLM_FUNCTIONPROVIDER;")
  266. cpp_quote("EXTERN_C const GUID GUID_LMLATTICE_VER1_0;")
  267. cpp_quote("EXTERN_C const GUID GUID_PROP_LMLATTICE;")
  268. //
  269. // ITfFnLMProcessor
  270. //
  271. [
  272. object,
  273. uuid(7AFBF8E7-AC4B-4082-B058-890899D3A010),
  274. pointer_default(unique)
  275. ]
  276. interface ITfFnLMProcessor : ITfFunction
  277. {
  278. HRESULT QueryRange([in] ITfRange *pRange,
  279. [out] ITfRange **ppNewRange,
  280. [out] BOOL *pfAccepted);
  281. HRESULT QueryLangID([in] LANGID langid,
  282. [out] BOOL *pfAccepted);
  283. HRESULT GetReconversion([in] ITfRange *pRange,
  284. [out] ITfCandidateList **ppCandList);
  285. HRESULT Reconvert([in] ITfRange *pRange);
  286. HRESULT QueryKey ([in] BOOL fUp,
  287. [in] WPARAM vKey,
  288. [in] LPARAM lparamKeydata,
  289. [out] BOOL *pfInterested);
  290. HRESULT InvokeKey([in] BOOL fUp,
  291. [in] WPARAM vKey,
  292. [in] LPARAM lparamKeyData);
  293. HRESULT InvokeFunc([in] ITfContext *pic,
  294. [in] REFGUID refguidFunc);
  295. }
  296. //
  297. // ITfFnLMInternal
  298. //
  299. [
  300. object,
  301. uuid(04B825B1-AC9A-4F7B-B5AD-C7168F1EE445),
  302. pointer_default(unique)
  303. ]//
  304. interface ITfFnLMInternal : ITfFnLMProcessor
  305. {
  306. HRESULT ProcessLattice([in] ITfRange *pRange);
  307. }
  308. //
  309. // TFLMLATTELEMENT
  310. //
  311. //
  312. typedef [uuid(1b646efe-3ce3-4ce2-b41f-35b93fe5552f)] struct TF_LMLATTELEMENT
  313. {
  314. DWORD dwFrameStart;
  315. DWORD dwFrameLen;
  316. DWORD dwFlags;
  317. [switch_type(DWORD), switch_is(dwFlags)] union
  318. {
  319. [case(0)] INT iCost;
  320. };
  321. BSTR bstrText;
  322. } TF_LMLATTELEMENT;
  323. //
  324. // IEnumTfLatticeElements
  325. //
  326. //
  327. [
  328. object,
  329. uuid(56988052-47DA-4A05-911A-E3D941F17145),
  330. pointer_default(unique)
  331. ]
  332. interface IEnumTfLatticeElements : IUnknown
  333. {
  334. HRESULT Clone([out] IEnumTfLatticeElements **ppEnum);
  335. HRESULT Next([in] ULONG ulCount,
  336. [out, size_is(ulCount), length_is(*pcFetched)] TF_LMLATTELEMENT *rgsElements,
  337. [out] ULONG *pcFetched);
  338. HRESULT Reset();
  339. HRESULT Skip([in] ULONG ulCount);
  340. }
  341. //
  342. // ITfLMLattice
  343. //
  344. //
  345. [
  346. object,
  347. uuid(D4236675-A5BF-4570-9D42-5D6D7B02D59B),
  348. pointer_default(unique)
  349. ]
  350. interface ITfLMLattice : IUnknown
  351. {
  352. HRESULT QueryType([in] REFGUID rguidType, [out] BOOL *pfSupported);
  353. HRESULT EnumLatticeElements([in] DWORD dwFrameStart,
  354. [in] REFGUID rguidType,
  355. [out] IEnumTfLatticeElements **ppEnum);
  356. }
  357. //
  358. // ITfFnAdviseText
  359. //
  360. [
  361. object,
  362. uuid(3527268B-7D53-4DD9-92B7-7296AE461249),
  363. pointer_default(unique)
  364. ]
  365. interface ITfFnAdviseText : ITfFunction
  366. {
  367. HRESULT OnTextUpdate([in] ITfRange *pRange,
  368. [in, size_is(cch)] const WCHAR *pchText,
  369. [in] LONG cch);
  370. HRESULT OnLatticeUpdate([in] ITfRange *pRange,
  371. [in] ITfLMLattice *pLattice);
  372. }
  373. cpp_quote("#endif // CTFFUNC_DEFINED")