Source code of Windows XP (NT5)
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.

127 lines
4.7 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 1998
  4. *
  5. * TITLE: SCANPROC.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 10/7/1999
  12. *
  13. * DESCRIPTION: Scan threads
  14. *
  15. *******************************************************************************/
  16. #ifndef __SCANPROC_H_INCLUDED
  17. #define __SCANPROC_H_INCLUDED
  18. #include "scanntfy.h" // Registered windows messages names
  19. #include "memdib.h"
  20. #include "simevent.h"
  21. #include "itranhlp.h"
  22. #include "wiadevdp.h"
  23. class CScanPreviewThread : public IWiaDataCallback
  24. {
  25. private:
  26. DWORD m_dwIWiaItemCookie;
  27. HWND m_hwndPreview;
  28. HWND m_hwndNotify;
  29. POINT m_ptOrigin;
  30. SIZE m_sizeResolution;
  31. SIZE m_sizeExtent;
  32. UINT m_nMsgBegin;
  33. UINT m_nMsgEnd;
  34. UINT m_nMsgProgress;
  35. CMemoryDib m_sImageData;
  36. CSimpleEvent m_sCancelEvent;
  37. bool m_bFirstTransfer;
  38. UINT m_nImageSize;
  39. private:
  40. // No implementation
  41. CScanPreviewThread( const CScanPreviewThread & );
  42. CScanPreviewThread(void);
  43. CScanPreviewThread &operator=( const CScanPreviewThread & );
  44. private:
  45. // These interfaces are all private to make sure that nobody tries to instantiate this class directly
  46. // Constructor
  47. CScanPreviewThread(
  48. DWORD dwIWiaItemCookie, // specifies the entry in the global interface table
  49. HWND hwndPreview, // handle to the preview window
  50. HWND hwndNotify, // handle to the window that receives notifications
  51. const POINT &ptOrigin, // Origin
  52. const SIZE &sizeResolution, // Resolution
  53. const SIZE &sizeExtent, // Extent
  54. const CSimpleEvent &CancelEvent // Cancel event
  55. );
  56. // Destructor
  57. ~CScanPreviewThread(void);
  58. static DWORD ThreadProc( LPVOID pParam );
  59. bool Scan(void);
  60. HRESULT ScanBandedTransfer( IWiaItem *pIWiaItem );
  61. public:
  62. static HANDLE Scan(
  63. DWORD dwIWiaItemCookie, // specifies the entry in the global interface table
  64. HWND hwndPreview, // handle to the preview window
  65. HWND hwndNotify, // handle to the window that receives notifications
  66. const POINT &ptOrigin, // Origin
  67. const SIZE &sizeResolution, // Resolution
  68. const SIZE &sizeExtent, // Extent
  69. const CSimpleEvent &CancelEvent // Cancel event name
  70. );
  71. public:
  72. // IUnknown
  73. STDMETHODIMP QueryInterface( REFIID riid, LPVOID *ppvObject );
  74. STDMETHODIMP_(ULONG) AddRef(void);
  75. STDMETHODIMP_(ULONG) Release(void);
  76. // IWiaDataCallback
  77. STDMETHODIMP BandedDataCallback( LONG, LONG, LONG, LONG, LONG, LONG, LONG, PBYTE );
  78. };
  79. class CScanToFileThread
  80. {
  81. private:
  82. DWORD m_dwIWiaItemCookie;
  83. HWND m_hwndNotify;
  84. UINT m_nMsgBegin, m_nMsgEnd, m_nMsgProgress;
  85. GUID m_guidFormat;
  86. CSimpleStringWide m_strFilename;
  87. private:
  88. // No implementation
  89. CScanToFileThread( const CScanToFileThread & );
  90. CScanToFileThread(void);
  91. CScanToFileThread &operator=( const CScanToFileThread & );
  92. private:
  93. // These interfaces are all private to make sure that nobody tries to instantiate this class directly
  94. CScanToFileThread(
  95. DWORD dwIWiaItemCookie, // specifies the entry in the global interface table
  96. HWND hwndNotify, // handle to the window that receives notifications
  97. GUID guidFormat, // Image format
  98. const CSimpleStringWide &strFilename // Filename to save to
  99. );
  100. ~CScanToFileThread(void);
  101. static DWORD ThreadProc( LPVOID pParam );
  102. bool Scan(void);
  103. public:
  104. static HANDLE Scan(
  105. DWORD dwIWiaItemCookie, // specifies the entry in the global interface table
  106. HWND hwndNotify, // handle to the window that receives notifications
  107. GUID guidFormat, // Image format
  108. const CSimpleStringWide &strFilename // Filename to save to
  109. );
  110. };
  111. #endif