Source code of Windows XP (NT5)
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.

118 lines
5.2 KiB

  1. //--------------------------------------------------------------------------
  2. // This is part of the Microsoft Tablet PC Platform SDK
  3. // Copyright (C) 2002 Microsoft Corporation
  4. // All rights reserved.
  5. //
  6. //
  7. // Module:
  8. // RecApis.h
  9. //
  10. //--------------------------------------------------------------------------
  11. #ifndef __HRECOALT__
  12. #define __HRECOALT__
  13. DECLARE_HANDLE(HRECOALT); // definition of a handle for the alternate
  14. #endif
  15. #ifndef __HRECOCONTEXT__
  16. #define __HRECOCONTEXT__
  17. DECLARE_HANDLE(HRECOCONTEXT); // definition of a handle for the reco context
  18. #endif
  19. #ifndef __HRECOGNIZER__
  20. #define __HRECOGNIZER__
  21. DECLARE_HANDLE(HRECOGNIZER); // definition of a handle for the recognizer
  22. #endif
  23. #ifndef __HRECOLATTICE__
  24. #define __HRECOLATTICE__
  25. DECLARE_HANDLE(HRECOLATTICE); // definition of a handle for the lattice
  26. #endif
  27. #ifndef __HRECOWORDLIST__
  28. #define __HRECOWORDLIST__
  29. DECLARE_HANDLE(HRECOWORDLIST); // definition of a handle for the lattice
  30. #endif
  31. typedef HRESULT (*PfnRecoCallback)(DWORD, LPBYTE, HRECOCONTEXT);
  32. #ifndef __IID_DEFINED__
  33. #define __IID_DEFINED__
  34. typedef struct _IID
  35. {
  36. unsigned long x;
  37. unsigned short s1;
  38. unsigned short s2;
  39. unsigned char c[8];
  40. } IID;
  41. #endif // __IID_DEFINED__
  42. #ifndef CLSID_DEFINED
  43. #define CLSID_DEFINED
  44. typedef IID CLSID;
  45. #endif // CLSID_DEFINED
  46. #include "tpcshrd.h"
  47. #include "RecTypes.h"
  48. ////////////////////////
  49. // IRecognizer
  50. ////////////////////////
  51. HRESULT WINAPI CreateRecognizer(CLSID *pCLSID, HRECOGNIZER *phrec);
  52. HRESULT WINAPI DestroyRecognizer(HRECOGNIZER hrec);
  53. HRESULT WINAPI GetRecoAttributes(HRECOGNIZER hrec, RECO_ATTRS* pRecoAttrs);
  54. HRESULT WINAPI CreateContext(HRECOGNIZER hrec, HRECOCONTEXT *phrc);
  55. HRESULT WINAPI DestroyContext(HRECOCONTEXT hrc);
  56. HRESULT WINAPI GetResultPropertyList(HRECOGNIZER hrec, ULONG* pPropertyCount, GUID*pPropertyGuid);
  57. HRESULT WINAPI GetPreferredPacketDescription(HRECOGNIZER hrec, PACKET_DESCRIPTION* pPacketDescription);
  58. HRESULT WINAPI GetUnicodeRanges(HRECOGNIZER hrec, ULONG *pcRanges, CHARACTER_RANGE *pcr);
  59. ////////////////////////
  60. // IRecoContext
  61. ////////////////////////
  62. HRESULT WINAPI AddStroke(HRECOCONTEXT hrc, const PACKET_DESCRIPTION* pPacketDesc, ULONG cbPacket, const BYTE *pPacket, const XFORM *pXForm);
  63. HRESULT WINAPI GetBestResultString(HRECOCONTEXT hrc, ULONG *pcSize, WCHAR* pwcBestResult);
  64. HRESULT WINAPI GetBestAlternate(HRECOCONTEXT hrc, HRECOALT* pHrcAlt);
  65. HRESULT WINAPI DestroyAlternate(HRECOALT hrcalt);
  66. HRESULT WINAPI SetGuide(HRECOCONTEXT hrc, const RECO_GUIDE* pGuide, ULONG iIndex);
  67. HRESULT WINAPI GetGuide(HRECOCONTEXT hrc, RECO_GUIDE* pGuide, ULONG *piIndex);
  68. HRESULT WINAPI AdviseInkChange(HRECOCONTEXT hrc, BOOL bNewStroke);
  69. HRESULT WINAPI SetCACMode(HRECOCONTEXT hrc, int iMode);
  70. HRESULT WINAPI EndInkInput(HRECOCONTEXT hrc);
  71. HRESULT WINAPI CloneContext(HRECOCONTEXT hrc, HRECOCONTEXT* pCloneHrc);
  72. HRESULT WINAPI ResetContext(HRECOCONTEXT hrc);
  73. HRESULT WINAPI GetAlternateList(HRECOCONTEXT hrc, RECO_RANGE* pRecoRange, ULONG*pcAlt, HRECOALT*phrcalt, ALT_BREAKS iBreak);
  74. HRESULT WINAPI Process(HRECOCONTEXT hrc, BOOL *pbPartialProcessing);
  75. HRESULT WINAPI SetFactoid(HRECOCONTEXT hrc, ULONG cwcFactoid, const WCHAR *pwcFactoid);
  76. HRESULT WINAPI SetFlags(HRECOCONTEXT hrc, DWORD dwFlags);
  77. HRESULT WINAPI GetLatticePtr(HRECOCONTEXT hrc, RECO_LATTICE **ppLattice);
  78. HRESULT WINAPI SetTextContext(HRECOCONTEXT hrc, ULONG cwcBefore, const WCHAR *pwcBefore, ULONG cwcAfter, const WCHAR *pwcAfter);
  79. HRESULT WINAPI GetEnabledUnicodeRanges(HRECOCONTEXT hrc, ULONG *pcRanges, CHARACTER_RANGE *pcr);
  80. HRESULT WINAPI SetEnabledUnicodeRanges(HRECOCONTEXT hrc, ULONG cRanges, CHARACTER_RANGE *pcr);
  81. HRESULT WINAPI GetContextPropertyList(HRECOCONTEXT hrc, ULONG *pcProperties, GUID *pPropertyGUIDS);
  82. HRESULT WINAPI GetContextPropertyValue(HRECOCONTEXT hrc, GUID *pGuid, ULONG *pcbSize, BYTE *pProperty);
  83. HRESULT WINAPI SetContextPropertyValue(HRECOCONTEXT hrc, GUID *pGuid, ULONG cbSize, BYTE *pProperty);
  84. HRESULT WINAPI IsStringSupported(HRECOCONTEXT hrc, ULONG wcString, const WCHAR *pwcString);
  85. HRESULT WINAPI SetWordList(HRECOCONTEXT hrc, HRECOWORDLIST hwl);
  86. ////////////////////////
  87. // IAlternate
  88. ////////////////////////
  89. HRESULT WINAPI GetString(HRECOALT hrcalt, RECO_RANGE *pRecoRange, ULONG* pcSize, WCHAR* pwcString);
  90. HRESULT WINAPI GetStrokeRanges(HRECOALT hrcalt, RECO_RANGE* pRecoRange, ULONG* pcRanges, STROKE_RANGE* pStrokeRange);
  91. HRESULT WINAPI GetSegmentAlternateList(HRECOALT hrcalt, RECO_RANGE* pRecoRange, ULONG *pcAlts, HRECOALT* pAlts);
  92. HRESULT WINAPI GetMetrics(HRECOALT hrcalt, RECO_RANGE* pRecoRange, LINE_METRICS lm, LINE_SEGMENT* pls);
  93. HRESULT WINAPI GetGuideIndex(HRECOALT hrcalt, RECO_RANGE* pRecoRange, ULONG *piIndex);
  94. HRESULT WINAPI GetConfidenceLevel(HRECOALT hrcalt, RECO_RANGE* pRecoRange, CONFIDENCE_LEVEL* pcl);
  95. HRESULT WINAPI GetPropertyRanges(HRECOALT hrcalt, const GUID *pPropertyGuid, ULONG* pcRanges, RECO_RANGE* pRecoRange);
  96. HRESULT WINAPI GetRangePropertyValue(HRECOALT hrcalt, const GUID *pPropertyGuid, RECO_RANGE* pRecoRange, ULONG*cbSize, BYTE* pProperty);
  97. ////////////////////////
  98. // IRecoWordList
  99. ////////////////////////
  100. HRESULT WINAPI DestroyWordList(HRECOWORDLIST hwl);
  101. HRESULT WINAPI AddWordsToWordList(HRECOWORDLIST hwl, WCHAR *pwcWords);
  102. HRESULT WINAPI MakeWordList(HRECOGNIZER hrec, WCHAR *pBuffer, HRECOWORDLIST *phwl);