Leaked source code of windows server 2003
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.

169 lines
5.3 KiB

  1. /**************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORP., 2000
  4. *
  5. * TITLE: fscanapi.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * DATE: 18 July, 2000
  10. *
  11. * DESCRIPTION:
  12. * Fake Scanner device library
  13. *
  14. ***************************************************************************/
  15. #ifndef _FSCANAPI_H
  16. #define _FSCANAPI_H
  17. //
  18. // ID mappings to events
  19. //
  20. #define ID_FAKE_NOEVENT 0
  21. #define ID_FAKE_SCANBUTTON 100
  22. #define ID_FAKE_COPYBUTTON 200
  23. #define ID_FAKE_FAXBUTTON 300
  24. #define ID_FAKE_ADFEVENT 400
  25. //
  26. // Scanner library modes
  27. //
  28. #define FLATBED_SCANNER_MODE 100
  29. #define SCROLLFED_SCANNER_MODE 200
  30. #define MULTIFUNCTION_DEVICE_MODE 300
  31. //
  32. // Scanning states
  33. //
  34. #define SCAN_START 0
  35. #define SCAN_CONTINUE 1
  36. #define SCAN_END 3
  37. //
  38. // Root Item information (for property initialization)
  39. //
  40. typedef struct _ROOT_ITEM_INFORMATION {
  41. LONG ScanBedWidth; // 1/1000ths of an inch
  42. LONG ScanBedHeight; // 1/1000ths of an inch
  43. LONG OpticalXResolution; // Optical X Resolution of device
  44. LONG OpticalYResolution; // Optical X Resolution of device
  45. LONG MaxScanTime; // Milliseconds (total scan time)
  46. LONG DocumentFeederWidth; // 1/1000ths of an inch
  47. LONG DocumentFeederHeight; // 1/1000ths of an inch
  48. LONG DocumentFeederCaps; // Capabilites of the device with feeder
  49. LONG DocumentFeederStatus; // Status of document feeder
  50. LONG MaxPageCapacity; // Maximum page capacity of feeder
  51. LONG DocumentFeederReg; // document feeder alignment
  52. LONG DocumentFeederHReg; // document feeder justification alignment (HORIZONTAL)
  53. LONG DocumentFeederVReg; // document feeder justification alignment (VERTICAL)
  54. WCHAR FirmwareVersion[25]; // Firmware version of device
  55. }ROOT_ITEM_INFORMATION, *PROOT_ITEM_INFORMATION;
  56. //
  57. // Range data type helper structure (used below)
  58. //
  59. typedef struct _RANGEPROPERTY {
  60. LONG lMin; // minimum value
  61. LONG lMax; // maximum value
  62. LONG lNom; // numinal value
  63. LONG lInc; // increment/step value
  64. } RANGEPROPERTY,*PRANGEPROPERTY;
  65. //
  66. // Top Item information (for property initialization)
  67. //
  68. typedef struct _TOP_ITEM_INFORMATION {
  69. BOOL bUseResolutionList; // TRUE - use default Resolution list,
  70. // FALSE - use RANGEPROPERTY values
  71. RANGEPROPERTY Contrast; // valid values for contrast
  72. RANGEPROPERTY Brightness; // valid values for brightness
  73. RANGEPROPERTY Threshold; // valid values for threshold
  74. RANGEPROPERTY XResolution; // valid values for x resolution
  75. RANGEPROPERTY YResolution; // valid values for y resolution
  76. LONG lMinimumBufferSize; // minimum buffer size
  77. LONG lMaxLampWarmupTime; // maximum lamp warmup time
  78. } TOP_ITEM_INFORMATION, *PTOP_ITEM_INFORMATION;
  79. class CFakeScanAPI {
  80. public:
  81. //
  82. // constructor/destructor
  83. //
  84. CFakeScanAPI()
  85. {
  86. }
  87. ~CFakeScanAPI()
  88. {
  89. }
  90. //
  91. // device initialization function
  92. //
  93. virtual HRESULT FakeScanner_Initialize() = 0;
  94. //
  95. // device setting functions
  96. //
  97. virtual HRESULT FakeScanner_GetRootPropertyInfo(PROOT_ITEM_INFORMATION pRootItemInfo) = 0;
  98. virtual HRESULT FakeScanner_GetTopPropertyInfo(PTOP_ITEM_INFORMATION pTopItemInfo) = 0;
  99. virtual HRESULT FakeScanner_GetBedWidthAndHeight(PLONG pWidth, PLONG pHeight) = 0;
  100. //
  101. // device event functions
  102. //
  103. virtual HRESULT FakeScanner_GetDeviceEvent(LONG *pEvent) = 0;
  104. virtual VOID FakeScanner_SetInterruptEventHandle(HANDLE hEvent) = 0;
  105. virtual HRESULT DoEventProcessing() = 0;
  106. //
  107. // data acquisition functions
  108. //
  109. virtual HRESULT FakeScanner_Scan(LONG lState, PBYTE pData, DWORD dwBytesToRead, PDWORD pdwBytesWritten) = 0;
  110. virtual HRESULT FakeScanner_SetDataType(LONG lDataType) = 0;
  111. virtual HRESULT FakeScanner_SetXYResolution(LONG lXResolution, LONG lYResolution) = 0;
  112. virtual HRESULT FakeScanner_SetSelectionArea(LONG lXPos, LONG lYPos, LONG lXExt, LONG lYExt) = 0;
  113. virtual HRESULT FakeScanner_SetContrast(LONG lContrast) = 0;
  114. virtual HRESULT FakeScanner_SetIntensity(LONG lIntensity) = 0;
  115. //
  116. // standard device operations
  117. //
  118. virtual HRESULT FakeScanner_ResetDevice() = 0;
  119. virtual HRESULT FakeScanner_SetEmulationMode(LONG lDeviceMode) = 0;
  120. virtual HRESULT FakeScanner_DisableDevice() = 0;
  121. virtual HRESULT FakeScanner_EnableDevice() = 0;
  122. virtual HRESULT FakeScanner_DeviceOnline() = 0;
  123. virtual HRESULT FakeScanner_Diagnostic() = 0;
  124. //
  125. // Automatic document feeder functions
  126. //
  127. virtual HRESULT FakeScanner_ADFAttached() = 0;
  128. virtual HRESULT FakeScanner_ADFHasPaper() = 0;
  129. virtual HRESULT FakeScanner_ADFAvailable() = 0;
  130. virtual HRESULT FakeScanner_ADFFeedPage() = 0;
  131. virtual HRESULT FakeScanner_ADFUnFeedPage() = 0;
  132. virtual HRESULT FakeScanner_ADFStatus() = 0;
  133. };
  134. HRESULT CreateInstance(CFakeScanAPI **ppFakeScanAPI, LONG lMode);
  135. #endif