MiddleWares_YiHe 郑州颐和医院随访系统中间件

eci.h 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. /*=========================================================================*/
  2. /* */
  3. /* eci.h */
  4. /* */
  5. /* Licensed Materials - Property of IBM */
  6. /* (C) Copyright IBM Corp. 1998, 2002 All Rights Reserved. */
  7. /* US Government Users Restricted Rights - Use, duplication or disclosure */
  8. /* restricted by GSA ADP Schedule Contract with IBM Corp. */
  9. /* */
  10. /* The following IBM source code is provided to assist you in your */
  11. /* development. You may use this code only in accordance with the */
  12. /* IBM License Agreement. */
  13. /* */
  14. /* This copyright statement may not be removed. */
  15. /* */
  16. /*=========================================================================*/
  17. #ifndef __ECI_H
  18. #define __ECI_H
  19. #ifndef MOTIF
  20. typedef int Boolean;
  21. #endif
  22. #define ECITrue 1
  23. #define ECIFalse 0
  24. #ifndef ECIFNDECLARE
  25. typedef signed long ECIint32;
  26. #ifdef _MSC_VER
  27. #ifdef _WIN32_WCE
  28. typedef char ECIsystemChar;
  29. #define ECIFNDECLARE __stdcall
  30. #elif defined _WIN32
  31. #include <tchar.h>
  32. typedef _TCHAR ECIsystemChar;
  33. #define ECIFNDECLARE __stdcall
  34. #endif
  35. #elif defined __TURBOC__
  36. #ifdef __WIN32__
  37. #include <tchar.h>
  38. #define ECIFNDECLARE __stdcall
  39. typedef _TCHAR ECIsystemChar;
  40. #endif
  41. #else
  42. #define ECIFNDECLARE
  43. typedef char ECIsystemChar;
  44. #endif
  45. #endif
  46. #ifndef NULL_ECI_HAND
  47. #define NULL_ECI_HAND 0
  48. #endif
  49. #define ECI_PRESET_VOICES 8
  50. #define ECI_USER_DEFINED_VOICES 8
  51. #define ECI_VOICE_NAME_LENGTH 30
  52. #define ECI_NOERROR 0x00000000
  53. #define ECI_SYSTEMERROR 0x00000001
  54. #define ECI_MEMORYERROR 0x00000002
  55. #define ECI_MODULELOADERROR 0x00000004
  56. #define ECI_DELTAERROR 0x00000008
  57. #define ECI_SYNTHERROR 0x00000010
  58. #define ECI_DEVICEERROR 0x00000020
  59. #define ECI_DICTERROR 0x00000040
  60. #define ECI_PARAMETERERROR 0x00000080
  61. #define ECI_SYNTHESIZINGERROR 0x00000100
  62. #define ECI_DEVICEBUSY 0x00000200
  63. #define ECI_SYNTHESISPAUSED 0x00000400
  64. #define ECI_REENTRANTCALL 0x00000800
  65. #define ECI_ROMANIZERERROR 0x00001000
  66. #define ECI_SYNTHESIZING 0x00002000
  67. #define eciPhonemeLength (4)
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. typedef void* ECIHand;
  72. typedef const void* ECIInputText;
  73. enum ECIParam {
  74. eciSynthMode,
  75. eciInputType,
  76. eciTextMode,
  77. eciDictionary,
  78. eciSampleRate = 5,
  79. eciWantPhonemeIndices = 7,
  80. eciRealWorldUnits,
  81. eciLanguageDialect,
  82. eciNumberMode,
  83. eciWantWordIndex = 12,
  84. eciNumDeviceBlocks,
  85. eciSizeDeviceBlocks,
  86. eciNumPrerollDeviceBlocks,
  87. eciSizePrerollDeviceBlocks,
  88. eciNumParams
  89. };
  90. enum ECIVoiceParam {
  91. eciGender,
  92. eciHeadSize,
  93. eciPitchBaseline,
  94. eciPitchFluctuation,
  95. eciRoughness,
  96. eciBreathiness,
  97. eciSpeed,
  98. eciVolume,
  99. eciNumVoiceParams
  100. };
  101. enum ECIDictError {
  102. DictNoError,
  103. DictFileNotFound,
  104. DictOutOfMemory,
  105. DictInternalError,
  106. DictNoEntry,
  107. DictErrLookUpKey,
  108. DictAccessError,
  109. DictInvalidVolume
  110. };
  111. typedef void* ECIDictHand;
  112. #define NULL_DICT_HAND 0
  113. enum ECIDictVolume {
  114. eciMainDict = 0,
  115. eciRootDict = 1,
  116. eciAbbvDict = 2,
  117. eciMainDictExt = 3
  118. };
  119. enum ECILanguageDialect {
  120. NODEFINEDCODESET = 0x00000000,
  121. eciGeneralAmericanEnglish = 0x00010000,
  122. eciBritishEnglish = 0x00010001,
  123. eciCastilianSpanish = 0x00020000,
  124. eciMexicanSpanish = 0x00020001,
  125. eciStandardFrench = 0x00030000,
  126. eciCanadianFrench = 0x00030001,
  127. eciStandardGerman = 0x00040000,
  128. eciStandardItalian = 0x00050000,
  129. eciMandarinChinese = 0x00060000,
  130. eciMandarinChineseGB = eciMandarinChinese,
  131. eciMandarinChinesePinYin = 0x00060100,
  132. eciMandarinChineseUCS = 0x00060800,
  133. eciTaiwaneseMandarin = 0x00060001,
  134. eciTaiwaneseMandarinBig5 = eciTaiwaneseMandarin,
  135. eciTaiwaneseMandarinZhuYin = 0x00060101,
  136. eciTaiwaneseMandarinPinYin = 0x00060201,
  137. eciTaiwaneseMandarinUCS = 0x00060801,
  138. eciBrazilianPortuguese = 0x00070000,
  139. eciStandardJapanese = 0x00080000,
  140. eciStandardJapaneseSJIS = eciStandardJapanese,
  141. eciStandardJapaneseUCS = 0x00080800,
  142. eciStandardFinnish = 0x00090000,
  143. eciStandardKorean = 0x000A0000,
  144. eciStandardKoreanUHC = eciStandardKorean,
  145. eciStandardKoreanUCS = 0x000A0800,
  146. eciStandardCantonese = 0x000B0000,
  147. eciStandardCantoneseGB = eciStandardCantonese,
  148. eciStandardCantoneseUCS = 0x000B0800,
  149. eciHongKongCantonese = 0x000B0001,
  150. eciHongKongCantoneseBig5 = eciHongKongCantonese,
  151. eciHongKongCantoneseUCS = 0x000B0801,
  152. eciStandardDutch = 0x000C0000,
  153. eciStandardNorwegian = 0x000D0000,
  154. eciStandardSwedish = 0x000E0000,
  155. eciStandardDanish = 0x000F0000
  156. };
  157. enum ECIPartOfSpeech {
  158. eciUndefinedPOS = 0,
  159. eciFutsuuMeishi = 1,
  160. eciKoyuuMeishi,
  161. eciSahenMeishi,
  162. eciMingCi
  163. };
  164. #if defined(WIN32)
  165. #pragma pack(push, 1)
  166. #elif defined(UNDER_CE) && (defined(MIPS) || defined(SH3))
  167. #pragma pack(push, 4)
  168. #endif
  169. typedef struct {
  170. union {
  171. unsigned char sz[eciPhonemeLength+1];
  172. unsigned short wsz[eciPhonemeLength+1];
  173. } phoneme;
  174. enum ECILanguageDialect eciLanguageDialect;
  175. unsigned char mouthHeight;
  176. unsigned char mouthWidth;
  177. unsigned char mouthUpturn;
  178. unsigned char jawOpen;
  179. unsigned char teethUpperVisible;
  180. unsigned char teethLowerVisible;
  181. unsigned char tonguePosn;
  182. unsigned char lipTension;
  183. } ECIMouthData;
  184. #if defined(WIN32) || ( defined(UNDER_CE) && (defined(MIPS) || defined(SH3)) )
  185. #pragma pack(pop)
  186. #endif
  187. enum ECIMessage {
  188. eciWaveformBuffer, eciPhonemeBuffer, eciIndexReply, eciPhonemeIndexReply, eciWordIndexReply
  189. };
  190. enum ECICallbackReturn {
  191. eciDataNotProcessed, eciDataProcessed, eciDataAbort
  192. };
  193. typedef enum ECICallbackReturn (*ECICallback)(ECIHand hEngine, enum ECIMessage Msg, long lParam, void *pData);
  194. #if defined(_WIN32) || defined(_Windows)
  195. enum ECIDialogBox {
  196. eciGeneralDB,
  197. eciAboutDB,
  198. eciVoicesDB,
  199. eciReadingDB,
  200. eciMainDictionaryDB,
  201. eciRootDictionaryDB,
  202. eciNumDialogBoxes
  203. };
  204. #endif
  205. #ifdef __cplusplus
  206. }
  207. #endif
  208. #ifdef __cplusplus
  209. extern "C" {
  210. #endif
  211. ECIHand ECIFNDECLARE eciNew(void);
  212. ECIHand ECIFNDECLARE eciNewEx(enum ECILanguageDialect Value);
  213. int ECIFNDECLARE eciGetAvailableLanguages(enum ECILanguageDialect *aLanguages, int *nLanguages);
  214. ECIHand ECIFNDECLARE eciDelete(ECIHand hEngine);
  215. Boolean ECIFNDECLARE eciReset(ECIHand hEngine);
  216. Boolean ECIFNDECLARE eciIsBeingReentered(ECIHand hEngine);
  217. void ECIFNDECLARE eciVersion(char *pBuffer);
  218. int ECIFNDECLARE eciProgStatus(ECIHand hEngine);
  219. void ECIFNDECLARE eciErrorMessage(ECIHand hEngine, void* buffer);
  220. void ECIFNDECLARE eciClearErrors(ECIHand hEngine);
  221. Boolean ECIFNDECLARE eciTestPhrase(ECIHand hEngine);
  222. Boolean ECIFNDECLARE eciSpeakText(ECIInputText pText, Boolean bAnnotationsInTextPhrase);
  223. Boolean ECIFNDECLARE eciSpeakTextEx(ECIInputText pText, Boolean bAnnotationsInTextPhrase, enum ECILanguageDialect Value);
  224. int ECIFNDECLARE eciGetParam(ECIHand hEngine, enum ECIParam Param);
  225. int ECIFNDECLARE eciSetParam(ECIHand hEngine, enum ECIParam Param, int iValue);
  226. int ECIFNDECLARE eciGetDefaultParam(enum ECIParam parameter);
  227. int ECIFNDECLARE eciSetDefaultParam(enum ECIParam parameter, int value);
  228. Boolean ECIFNDECLARE eciCopyVoice(ECIHand hEngine, int iVoiceFrom, int iVoiceTo);
  229. Boolean ECIFNDECLARE eciGetVoiceName(ECIHand hEngine, int iVoice, void *pBuffer);
  230. Boolean ECIFNDECLARE eciSetVoiceName(ECIHand hEngine, int iVoice, const void *pBuffer);
  231. int ECIFNDECLARE eciGetVoiceParam(ECIHand hEngine, int iVoice, enum ECIVoiceParam Param);
  232. int ECIFNDECLARE eciSetVoiceParam(ECIHand hEngine, int iVoice,
  233. enum ECIVoiceParam Param, int iValue);
  234. Boolean ECIFNDECLARE eciAddText(ECIHand hEngine, ECIInputText pText);
  235. Boolean ECIFNDECLARE eciInsertIndex(ECIHand hEngine, int iIndex);
  236. Boolean ECIFNDECLARE eciSynthesize(ECIHand hEngine);
  237. Boolean ECIFNDECLARE eciSynthesizeFile(ECIHand hEngine, const void *pFilename);
  238. Boolean ECIFNDECLARE eciClearInput(ECIHand hEngine);
  239. Boolean ECIFNDECLARE eciGeneratePhonemes(ECIHand hEngine, int iSize, void *pBuffer);
  240. int ECIFNDECLARE eciGetIndex(ECIHand hEngine);
  241. Boolean ECIFNDECLARE eciStop(ECIHand hEngine);
  242. Boolean ECIFNDECLARE eciSpeaking(ECIHand hEngine);
  243. Boolean ECIFNDECLARE eciSynchronize(ECIHand hEngine);
  244. Boolean ECIFNDECLARE eciSetOutputBuffer(ECIHand hEngine, int iSize, short *psBuffer);
  245. Boolean ECIFNDECLARE eciSetOutputFilename(ECIHand hEngine, const void *pFilename);
  246. Boolean ECIFNDECLARE eciSetOutputDevice(ECIHand hEngine, int iDevNum);
  247. Boolean ECIFNDECLARE eciPause(ECIHand hEngine, Boolean On);
  248. void ECIFNDECLARE eciRegisterCallback(ECIHand hEngine, ECICallback Callback, void *pData);
  249. ECIDictHand ECIFNDECLARE eciNewDict(ECIHand hEngine);
  250. ECIDictHand ECIFNDECLARE eciGetDict(ECIHand hEngine);
  251. enum ECIDictError ECIFNDECLARE eciSetDict(ECIHand hEngine, ECIDictHand hDict);
  252. ECIDictHand ECIFNDECLARE eciDeleteDict(ECIHand hEngine, ECIDictHand hDict);
  253. enum ECIDictError ECIFNDECLARE eciLoadDict(ECIHand hEngine, ECIDictHand hDict, enum ECIDictVolume DictVol, ECIInputText pFilename);
  254. enum ECIDictError ECIFNDECLARE eciSaveDict(ECIHand hEngine, ECIDictHand hDict, enum ECIDictVolume DictVol, ECIInputText pFilename);
  255. enum ECIDictError ECIFNDECLARE eciUpdateDict(ECIHand hEngine, ECIDictHand hDict,
  256. enum ECIDictVolume DictVol, ECIInputText pKey, ECIInputText pTranslationValue);
  257. enum ECIDictError ECIFNDECLARE eciDictFindFirst(ECIHand hEngine,
  258. ECIDictHand hDict, enum ECIDictVolume DictVol,
  259. ECIInputText *ppKey, ECIInputText *ppTranslationValue);
  260. enum ECIDictError ECIFNDECLARE eciDictFindNext(ECIHand hEngine,
  261. ECIDictHand hDict, enum ECIDictVolume DictVol,
  262. ECIInputText *ppKey, ECIInputText *ppTranslationValue);
  263. const char *ECIFNDECLARE eciDictLookup(ECIHand hEngine,
  264. ECIDictHand hDict, enum ECIDictVolume DictVol,
  265. ECIInputText pKey);
  266. enum ECIDictError ECIFNDECLARE eciUpdateDictA(ECIHand hEngine,
  267. ECIDictHand hDict, enum ECIDictVolume DictVol,
  268. ECIInputText pKey, ECIInputText pTranslationValue, enum ECIPartOfSpeech PartOfSpeech);
  269. enum ECIDictError ECIFNDECLARE eciDictFindFirstA(ECIHand hEngine,
  270. ECIDictHand hDict, enum ECIDictVolume DictVol,
  271. ECIInputText *ppKey, ECIInputText *ppTranslationValue, enum ECIPartOfSpeech *pPartOfSpeech);
  272. enum ECIDictError ECIFNDECLARE eciDictFindNextA(ECIHand hEngine,
  273. ECIDictHand hDict, enum ECIDictVolume DictVol,
  274. ECIInputText *ppKey, ECIInputText *ppTranslationValue, enum ECIPartOfSpeech *pPartOfSpeech);
  275. enum ECIDictError ECIFNDECLARE eciDictLookupA(ECIHand hEngine,
  276. ECIDictHand hDict, enum ECIDictVolume DictVol,
  277. ECIInputText pKey, ECIInputText *ppTranslationValue, enum ECIPartOfSpeech *pPartOfSpeech);
  278. #define eciDictFindFirst(eciHandle, dictHandle, dictVolume, ppkey, pptranslation) \
  279. eciDictFindFirst((eciHandle), (dictHandle), (dictVolume), (ECIInputText *) (ppkey), (ECIInputText *) (pptranslation))
  280. #define eciDictFindNext(eciHandle, dictHandle, dictVolume, ppkey, pptranslation) \
  281. eciDictFindNext((eciHandle), (dictHandle), (dictVolume), (ECIInputText *) (ppkey), (ECIInputText *) (pptranslation))
  282. #ifndef __ECIFILTER_H
  283. #define __ECIFILTER_H
  284. typedef void *ECIFilterHand;
  285. #define NULL_FILTER_HAND 0
  286. typedef enum ECIFilterError {
  287. FilterNoError,
  288. FilterFileNotFound,
  289. FilterOutOfMemory,
  290. FilterInternalError,
  291. FilterAccessError
  292. };
  293. ECIFilterError ECIFNDECLARE eciDeactivateFilter(ECIHand eciHandle, ECIFilterHand pFilter);
  294. ECIFilterHand ECIFNDECLARE eciNewFilter(ECIHand eciHandle, unsigned int filterNum = 0);
  295. ECIFilterError ECIFNDECLARE eciActivateFilter(ECIHand eciHandle, ECIFilterHand whichFilterHand);
  296. ECIFilterHand ECIFNDECLARE eciDeleteFilter(ECIHand eciHandle, ECIFilterHand whichFilterHand);
  297. ECIFilterError ECIFNDECLARE eciUpdateFilter(ECIHand eciHandle, ECIFilterHand whichFilterHand,
  298. ECIInputText key, ECIInputText translation);
  299. ECIFilterError ECIFNDECLARE eciGetFilteredText(ECIHand eciHandle, ECIFilterHand whichFilterHand,
  300. ECIInputText input, ECIInputText *filteredText);
  301. #endif
  302. #ifdef __cplusplus
  303. }
  304. #endif
  305. #endif