elscore.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef __INC_ELSCORE__
  7. #define __INC_ELSCORE__
  8. #include <objbase.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #ifndef ELSCOREAPI
  13. #define ELSCOREAPI DECLSPEC_IMPORT
  14. #endif
  15. #ifndef CALLBACK
  16. #define CALLBACK WINAPI
  17. #endif
  18. /* MAPPING_ENUM_OPTIONS.ServiceType */
  19. #define ALL_SERVICE_TYPES 0
  20. #define HIGHLEVEL_SERVICE_TYPES 1
  21. #define LOWLEVEL_SERVICE_TYPES 2
  22. /* MAPPING_ENUM_OPTIONS.OnlineService */
  23. #define ALL_SERVICES 0
  24. #define ONLINE_SERVICES 1
  25. #define OFFLINE_SERVICES 2
  26. typedef struct _MAPPING_DATA_RANGE {
  27. DWORD dwStartIndex;
  28. DWORD dwEndIndex;
  29. LPWSTR pszDescription;
  30. DWORD dwDescriptionLength;
  31. LPVOID pData;
  32. DWORD dwDataSize;
  33. LPWSTR pszContentType;
  34. LPWSTR *prgActionIds;
  35. DWORD dwActionsCount;
  36. LPWSTR *prgActionDisplayNames;
  37. } MAPPING_DATA_RANGE, *PMAPPING_DATA_RANGE;
  38. typedef struct _MAPPING_ENUM_OPTIONS {
  39. size_t Size;
  40. LPWSTR pszCategory;
  41. LPWSTR pszInputLanguage;
  42. LPWSTR pszOutputLanguage;
  43. LPWSTR pszInputScript;
  44. LPWSTR pszOutputScript;
  45. LPWSTR pszInputContentType;
  46. LPWSTR pszOutputContentType;
  47. GUID *pGuid;
  48. unsigned OnlineService :2;
  49. unsigned ServiceType :2;
  50. } MAPPING_ENUM_OPTIONS, *PMAPPING_ENUM_OPTIONS;
  51. typedef struct _MAPPING_PROPERTY_BAG {
  52. size_t Size;
  53. PMAPPING_DATA_RANGE prgResultRanges;
  54. DWORD dwRangesCount;
  55. LPVOID pServiceData;
  56. DWORD dwServiceDataSize;
  57. LPVOID pCallerData;
  58. DWORD dwCallerDataSize;
  59. LPVOID pContext;
  60. } MAPPING_PROPERTY_BAG, *PMAPPING_PROPERTY_BAG;
  61. typedef void (CALLBACK *PFN_MAPPINGCALLBACKPROC)(
  62. MAPPING_PROPERTY_BAG *pBag,
  63. LPVOID data,
  64. DWORD dwDataSize,
  65. HRESULT Result
  66. );
  67. typedef struct _MAPPING_OPTIONS {
  68. size_t Size;
  69. LPWSTR pszInputLanguage;
  70. LPWSTR pszOutputLanguage;
  71. LPWSTR pszInputScript;
  72. LPWSTR pszOutputScript;
  73. LPWSTR pszInputContentType;
  74. LPWSTR pszOutputContentType;
  75. LPWSTR pszUILanguage;
  76. PFN_MAPPINGCALLBACKPROC pfnRecognizeCallback;
  77. LPVOID pRecognizeCallerData;
  78. DWORD dwRecognizeCallerDataSize;
  79. PFN_MAPPINGCALLBACKPROC pfnActionCallback;
  80. LPVOID pActionCallerData;
  81. DWORD dwActionCallerDataSize;
  82. DWORD dwServiceFlag;
  83. unsigned GetActionDisplayName :1;
  84. } MAPPING_OPTIONS, *PMAPPING_OPTIONS;
  85. typedef struct _MAPPING_SERVICE_INFO {
  86. size_t Size;
  87. LPWSTR pszCopyright;
  88. WORD wMajorVersion;
  89. WORD wMinorVersion;
  90. WORD wBuildVersion;
  91. WORD wStepVersion;
  92. DWORD dwInputContentTypesCount;
  93. LPWSTR *prgInputContentTypes;
  94. DWORD dwOutputContentTypesCount;
  95. LPWSTR *prgOutputContentTypes;
  96. DWORD dwInputLanguagesCount;
  97. LPWSTR *prgInputLanguages;
  98. DWORD dwOutputLanguagesCount;
  99. LPWSTR *prgOutputLanguages;
  100. DWORD dwInputScriptsCount;
  101. LPWSTR *prgInputScripts;
  102. DWORD dwOutputScriptsCount;
  103. LPWSTR *prgOutputScripts;
  104. GUID guid;
  105. LPWSTR pszCategory;
  106. LPWSTR pszDescription;
  107. DWORD dwPrivateDataSize;
  108. LPVOID pPrivateData;
  109. LPVOID pContext;
  110. unsigned IsOneToOneLanguageMapping :1;
  111. unsigned HasSubservices :1;
  112. unsigned OnlineOnly :1;
  113. unsigned ServiceType :2;
  114. } MAPPING_SERVICE_INFO, *PMAPPING_SERVICE_INFO;
  115. ELSCOREAPI HRESULT WINAPI MappingRecognizeText(
  116. PMAPPING_SERVICE_INFO pServiceInfo,
  117. LPCWSTR pszText,
  118. DWORD dwLength,
  119. DWORD dwIndex,
  120. PMAPPING_OPTIONS pOptions,
  121. PMAPPING_PROPERTY_BAG pBag
  122. );
  123. ELSCOREAPI HRESULT WINAPI MappingDoAction(
  124. PMAPPING_PROPERTY_BAG pBag,
  125. DWORD dwRangeIndex,
  126. LPCWSTR pszActionId
  127. );
  128. ELSCOREAPI HRESULT WINAPI MappingFreePropertyBag(
  129. PMAPPING_PROPERTY_BAG pBag
  130. );
  131. ELSCOREAPI HRESULT WINAPI MappingFreeServices(
  132. PMAPPING_SERVICE_INFO pServiceInfo
  133. );
  134. ELSCOREAPI HRESULT WINAPI MappingGetServices(
  135. PMAPPING_ENUM_OPTIONS pOptions,
  136. PMAPPING_SERVICE_INFO *prgServices,
  137. DWORD *pdwServicesCount
  138. );
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142. #endif /*__INC_ELSCORE__*/