TwainString.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. /***************************************************************************
  2. * Copyright ?2007 TWAIN Working Group:
  3. * Adobe Systems Incorporated, AnyDoc Software Inc., Eastman Kodak Company,
  4. * Fujitsu Computer Products of America, JFL Peripheral Solutions Inc.,
  5. * Ricoh Corporation, and Xerox Corporation.
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions are met:
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * * Neither the name of the TWAIN Working Group nor the
  16. * names of its contributors may be used to endorse or promote products
  17. * derived from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY TWAIN Working Group ``AS IS'' AND ANY
  20. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. * DISCLAIMED. IN NO EVENT SHALL TWAIN Working Group BE LIABLE FOR ANY
  23. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  26. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. ***************************************************************************/
  31. /**
  32. * @file TwainString.h
  33. * Convert TWAIN Constants to Strings
  34. * @author JFL Peripheral Solutions Inc.
  35. * @date Dec 2008
  36. */
  37. #ifndef __TWAINSTRING_H__
  38. #define __TWAINSTRING_H__
  39. #pragma once
  40. #include "CommonTWAIN.h"
  41. typedef const char*(*pfnStringCvrtFuncType)(const TW_UINT16 _unItem);
  42. /**
  43. * converts the integer CAP value into string form
  44. * @param[in] _unCap the cap
  45. * @return the equivalent cap string
  46. */
  47. const char* convertCAP_toString(const TW_UINT16 _unCap);
  48. /**
  49. * converts the integer CAP transfer method into string form
  50. * @param[in] _unCap the cap
  51. * @param[in] _unItem the value
  52. * @param[in] _unType the TWAIN Type of the item
  53. * @return the equivalent string
  54. */
  55. const char* convertCAP_Item_toString(const TW_UINT16 _unCap, const TW_UINT32 _unItem, const TW_UINT16 _unType);
  56. /**
  57. * converts the integer CAP transfer method into string form
  58. * @param[in] _unEI the ExtendedImageInfo
  59. * @param[in] _unItem the value
  60. * @return the equivalent string, or NULL if not found
  61. */
  62. const char* convertEI_Item_toString(const TW_UINT16 _unEI, const TW_UINT32 _unItem);
  63. /**
  64. * converts the integer CAP transfer method into string form
  65. * @param[in] _unItem the value
  66. * @return the equivalent string
  67. */
  68. const char* convertICAP_XFERMECH_toString(const TW_UINT16 _unItem);
  69. /**
  70. * converts the integer CAP unit into string form
  71. * @param[in] _unItem the value
  72. * @return the equivalent string
  73. */
  74. const char* convertICAP_UNITS_toString(const TW_UINT16 _unItem);
  75. /**
  76. * converts the integer CAP Pixel type value into string form
  77. * @param[in] _unItem the value
  78. * @return the equivalent string
  79. */
  80. const char* convertICAP_PIXELTYPE_toString(const TW_UINT16 _unItem);
  81. /**
  82. * converts the integer CAP Pixel flavor value into string form
  83. * @param[in] _unItem the value
  84. * @return the equivalent string
  85. */
  86. const char* convertICAP_PIXELFLAVOR_toString(const TW_UINT16 _unItem);
  87. /**
  88. * converts the integer CAP Image File format type value into string form
  89. * @param[in] _unItem the value
  90. * @return the equivalent string
  91. */
  92. const char* convertICAP_IMAGEFILEFORMAT_toString(const TW_UINT16 _unItem);
  93. /**
  94. * converts the integer CAP Image File format type value into .xxx extention string form
  95. * @param[in] _unItem the value
  96. * @return the equivalent string
  97. */
  98. const char* convertICAP_IMAGEFILEFORMAT_toExt(const TW_UINT16 _unItem);
  99. /**
  100. * converts the integer CAP Compression type value into string form
  101. * @param[in] _unItem the value
  102. * @return the equivalent string
  103. */
  104. const char* convertICAP_COMPRESSION_toString(const TW_UINT16 _unItem);
  105. /**
  106. * converts the integer CAP Alarms type value into string form
  107. * @param[in] _unItem the value
  108. * @return the equivalent string
  109. */
  110. const char* convertCAP_ALARMS_toString(const TW_UINT16 _unItem);
  111. /**
  112. * converts the integer CAP AutoSize type value into string form
  113. * @param[in] _unItem the value
  114. * @return the equivalent string
  115. */
  116. const char* convertICAP_AUTOSIZE_toString(const TW_UINT16 _unItem);
  117. /**
  118. * converts the integer ICAP BarCode Search Mode type value into string form
  119. * @param[in] _unItem the value
  120. * @return the equivalent string
  121. */
  122. const char* convertICAP_BARCODESEARCHMODE_toString(const TW_UINT16 _unItem);
  123. /**
  124. * converts the integer ICAP Bit Order type value into string form
  125. * @param[in] _unItem the value
  126. * @return the equivalent string
  127. */
  128. const char* convertICAP_BITORDER_toString(const TW_UINT16 _unItem);
  129. /**
  130. * converts the integer ICAP Auto discard blank pages type value into string form
  131. * @param[in] _unItem the value
  132. * @return the equivalent string
  133. */
  134. const char* convertICAP_AUTODISCARDBLANKPAGES_toString(const TW_UINT16 _unItem);
  135. /**
  136. * converts the integer ICAP Bitdepth Reduction type value into string form
  137. * @param[in] _unItem the value
  138. * @return the equivalent string
  139. */
  140. const char* convertICAP_BITDEPTHREDUCTION_toString(const TW_UINT16 _unItem);
  141. /**
  142. * converts the integer CAP Supported Barcode Types type value into string form
  143. * @param[in] _unItem the value
  144. * @return the equivalent string
  145. */
  146. const char* convertICAP_SUPPORTEDBARCODETYPES_toString(const TW_UINT16 _unItem);
  147. /**
  148. * converts the integer CAP Cameraside type value into string form
  149. * @param[in] _unItem the value
  150. * @return the equivalent string
  151. */
  152. const char* convertCAP_CAMERASIDE_toString(const TW_UINT16 _unItem);
  153. /**
  154. * converts the integer TWEI Pageside type value into string form
  155. * @param[in] _unItem the value
  156. * @return the equivalent string
  157. */
  158. const char* convertTWEI_PAGESIDE_toString(const TW_UINT16 _unItem);
  159. /**
  160. * converts the integer CAP ClearBuffers type value into string form
  161. * @param[in] _unItem the value
  162. * @return the equivalent string
  163. */
  164. const char* convertCAP_CLEARBUFFERS_toString(const TW_UINT16 _unItem);
  165. /**
  166. * converts the integer CAP Device Event type value into string form
  167. * @param[in] _unItem the value
  168. * @return the equivalent string
  169. */
  170. const char* convertCAP_DEVICEEVENT_toString(const TW_UINT16 _unItem);
  171. /**
  172. * converts the integer CAP Duplex type value into string form
  173. * @param[in] _unItem the value
  174. * @return the equivalent string
  175. */
  176. const char* convertCAP_DUPLEX_toString(const TW_UINT16 _unItem);
  177. /**
  178. * converts the integer CAP Feeder Alignment type value into string form
  179. * @param[in] _unItem the value
  180. * @return the equivalent string
  181. */
  182. const char* convertCAP_FEEDERALIGNMENT_toString(const TW_UINT16 _unItem);
  183. /**
  184. * converts the integer CAP Feeder Type type value into string form
  185. * @param[in] _unItem the value
  186. * @return the equivalent string
  187. */
  188. const char* convertICAP_FEEDERTYPE_toString(const TW_UINT16 _unItem);
  189. /**
  190. * converts the integer CAP Flash used2 type value into string form
  191. * @param[in] _unItem the value
  192. * @return the equivalent string
  193. */
  194. const char* convertICAP_FLASHUSED2_toString(const TW_UINT16 _unItem);
  195. /**
  196. * converts the integer CAP Feeder Order type value into string form
  197. * @param[in] _unItem the value
  198. * @return the equivalent string
  199. */
  200. const char* convertCAP_FEEDERORDER_toString(const TW_UINT16 _unItem);
  201. /**
  202. * converts the integer CAP Feeder Pocket type value into string form
  203. * @param[in] _unItem the value
  204. * @return the equivalent string
  205. */
  206. const char* convertCAP_FEEDERPOCKET_toString(const TW_UINT16 _unItem);
  207. /**
  208. * converts the integer CAP Flip Rotation type value into string form
  209. * @param[in] _unItem the value
  210. * @return the equivalent string
  211. */
  212. const char* convertICAP_FLIPROTATION_toString(const TW_UINT16 _unItem);
  213. /**
  214. * converts the integer CAP Filter type value into string form
  215. * @param[in] _unItem the value
  216. * @return the equivalent string
  217. */
  218. const char* convertICAP_FILTER_toString(const TW_UINT16 _unItem);
  219. /**
  220. * converts the integer CAP ICC Profile type value into string form
  221. * @param[in] _unItem the value
  222. * @return the equivalent string
  223. */
  224. const char* convertICAP_ICCPROFILE_toString(const TW_UINT16 _unItem);
  225. /**
  226. * converts the integer CAP Image Filter type value into string form
  227. * @param[in] _unItem the value
  228. * @return the equivalent string
  229. */
  230. const char* convertICAP_IMAGEFILTER_toString(const TW_UINT16 _unItem);
  231. /**
  232. * converts the integer CAP Image Merge type value into string form
  233. * @param[in] _unItem the value
  234. * @return the equivalent string
  235. */
  236. const char* convertICAP_IMAGEMERGE_toString(const TW_UINT16 _unItem);
  237. /**
  238. * converts the integer CAP Job Control type value into string form
  239. * @param[in] _unItem the value
  240. * @return the equivalent string
  241. */
  242. const char* convertCAP_JOBCONTROL_toString(const TW_UINT16 _unItem);
  243. /**
  244. * converts the integer CAP JPEG Quality type value into string form
  245. * @param[in] _unItem the value
  246. * @return the equivalent string
  247. */
  248. const char* convertICAP_JPEGQUALITY_toString(const TW_UINT16 _unItem);
  249. /**
  250. * converts the integer CAP Light Path type value into string form
  251. * @param[in] _unItem the value
  252. * @return the equivalent string
  253. */
  254. const char* convertICAP_LIGHTPATH_toString(const TW_UINT16 _unItem);
  255. /**
  256. * converts the integer CAP Light Source type value into string form
  257. * @param[in] _unItem the value
  258. * @return the equivalent string
  259. */
  260. const char* convertICAP_LIGHTSOURCE_toString(const TW_UINT16 _unItem);
  261. /**
  262. * converts the integer CAP Noise Filter type value into string form
  263. * @param[in] _unItem the value
  264. * @return the equivalent string
  265. */
  266. const char* convertICAP_NOISEFILTER_toString(const TW_UINT16 _unItem);
  267. /**
  268. * converts the integer CAP Orientation type value into string form
  269. * @param[in] _unItem the value
  270. * @return the equivalent string
  271. */
  272. const char* convertICAP_ORIENTATION_toString(const TW_UINT16 _unItem);
  273. /**
  274. * converts the integer CAP Overscan type value into string form
  275. * @param[in] _unItem the value
  276. * @return the equivalent string
  277. */
  278. const char* convertICAP_OVERSCAN_toString(const TW_UINT16 _unItem);
  279. /**
  280. * converts the integer CAP Planar Chunky type value into string form
  281. * @param[in] _unItem the value
  282. * @return the equivalent string
  283. */
  284. const char* convertICAP_PLANARCHUNKY_toString(const TW_UINT16 _unItem);
  285. /**
  286. * converts the integer CAP Printer Mode type value into string form
  287. * @param[in] _unItem the value
  288. * @return the equivalent string
  289. */
  290. const char* convertCAP_PRINTERMODE_toString(const TW_UINT16 _unItem);
  291. /**
  292. * converts the integer CAP Printer type value into string form
  293. * @param[in] _unItem the value
  294. * @return the equivalent string
  295. */
  296. const char* convertCAP_PRINTER_toString(const TW_UINT16 _unItem);
  297. /**
  298. * converts the integer CAP Power Supply type value into string form
  299. * @param[in] _unItem the value
  300. * @return the equivalent string
  301. */
  302. const char* convertCAP_POWERSUPPLY_toString(const TW_UINT16 _unItem);
  303. /**
  304. * converts the integer CAP Segmented type value into string form
  305. * @param[in] _unItem the value
  306. * @return the equivalent string
  307. */
  308. const char* convertCAP_SEGMENTED_toString(const TW_UINT16 _unItem);
  309. /**
  310. * converts the integer CAP Supported Sizes type value into string form
  311. * @param[in] _unItem the value
  312. * @return the equivalent string
  313. */
  314. const char* convertICAP_SUPPORTEDSIZES_toString(const TW_UINT16 _unItem);
  315. /**
  316. * converts the integer TWEI File System type value into string form
  317. * @param[in] _unItem the value
  318. * @return the equivalent string
  319. */
  320. const char* convertTWEI_FILESYSTEM_toString(const TW_UINT16 _unItem);
  321. /**
  322. * converts the integer TWEI Barcode Rotation type value into string form
  323. * @param[in] _unItem the value
  324. * @return the equivalent string
  325. */
  326. const char* convertTWEI_BARCODEROTATION_toString(const TW_UINT16 _unItem);
  327. /**
  328. * converts the integer TWEI Deskew Status type value into string form
  329. * @param[in] _unItem the value
  330. * @return the equivalent string
  331. */
  332. const char* convertTWEI_DESKEWSTATUS_toString(const TW_UINT16 _unItem);
  333. /**
  334. * converts the integer TWEI MAG Type type value into string form
  335. * @param[in] _unItem the value
  336. * @return the equivalent string
  337. */
  338. const char* convertTWEI_MAGTYPE_toString(const TW_UINT16 _unItem);
  339. /**
  340. * converts the integer TWEI Patch code type value into string form
  341. * @param[in] _unItem the value
  342. * @return the equivalent string
  343. */
  344. const char* convertTWEI_PATCHCODE_toString(const TW_UINT16 _unItem);
  345. /**
  346. * converts the integer TWTY value into string form
  347. * @param[in] _unItem the TWTY value
  348. * @return the equivalent string
  349. */
  350. const char* convertTWTY_toString(const TW_UINT16 _unItem);
  351. /**
  352. * retrieve the extended image info name for a given Info ID for the current image
  353. * @param[in] InfoID the id to retrieve the info of
  354. * @return string of the extended image info
  355. */
  356. const char* convertExtImageInfoName_toString(int InfoID);
  357. /**
  358. * retrieve the extended image info value for a given Info
  359. * @param[in] ImgInfo the TW_INFO to retrieve the extended image info of
  360. * @return string of the extended image info value
  361. */
  362. const char* convertExtImageInfoItem_toString(const TW_INFO &ImgInfo);
  363. /**
  364. * converts the TWAIN Return Code into string form
  365. * @param[in] _unItem the value
  366. * @return the equivalent string
  367. */
  368. const char* convertReturnCode_toString(const TW_UINT16 _unItem);
  369. /**
  370. * converts the TWAIN Condition Code into string form
  371. * @param[in] _unItem the value
  372. * @return the equivalent string
  373. */
  374. const char* convertConditionCode_toString(const TW_UINT16 _unItem);
  375. /**
  376. * converts the TWAIN Message into string form
  377. * @param[in] _unItem the value
  378. * @return the equivalent string
  379. */
  380. const char* convertMessage_toString(const TW_UINT16 _unItem);
  381. /**
  382. * converts the TWAIN Data Group to string form
  383. * @param[in] _unItem the value
  384. * @return the equivalent string
  385. */
  386. const char* convertDataGroup_toString(const TW_UINT16 _unItem);
  387. /**
  388. * converts the TWAIN Data Argument Type to string form
  389. * @param[in] _unItem the value
  390. * @return the equivalent string
  391. */
  392. const char* convertDataArgType_toString(const TW_UINT16 _unItem);
  393. /**
  394. * converts the TWAIN Container Type to string form
  395. * @param[in] _unItem the value
  396. * @return the equivalent string
  397. */
  398. const char* convertContainerType_toString(const TW_UINT16 _unItem);
  399. /**
  400. * converts the TWAIN QuerySupport value to string form
  401. * @param[in] _unItem the value
  402. * @return the equivalent string
  403. */
  404. const char* convertQuerySupport_toString(const TW_UINT32 _unItem);
  405. /**
  406. * converts a TWAIN TWFF_ to the corresponding extension
  407. * @param[in] _unItem the value
  408. * @return the corresponding file extension
  409. */
  410. const char* convertFileFmt_toExtension(const TW_UINT16 _unItem);
  411. /**
  412. * converts a TWAIN Capability Item value to string form
  413. * @param[in] twCapId the Id of the capability to convert
  414. * @param[in] twItemType the type of the capability item
  415. * @param[in] pValue a pointer to the item
  416. * @return the equivalent string
  417. */
  418. const char *CapabilityValueToString(TW_UINT16 twCapId, TW_UINT16 twItemType, const void *pValue);
  419. /**
  420. * converts the TWAIN TWFY_ value to string form
  421. * @param[in] _unItem the value
  422. * @return the equivalent string
  423. */
  424. const char *convertFileType_toString(const TW_UINT16 _unItem);
  425. /**
  426. * converts the TWAIN TWFF_ value to string form
  427. * @param[in] _unItem the value
  428. * @return the equivalent string
  429. */
  430. const char *convertFileFormat_toString(const TW_UINT16 _unItem);
  431. /**
  432. * converts the TWAIN TWEJ_ value to string form
  433. * @param[in] _unItem the value
  434. * @return the equivalent string
  435. */
  436. const char *convertEOJ_toString(const TW_UINT16 _unItem);
  437. #endif // __TWAINSTRING_H__