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