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.

78 lines
2.3 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 1998
  4. *
  5. * TITLE: SCANITEM.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 10/7/1999
  12. *
  13. * DESCRIPTION: WIA Item wrapper for scanner items
  14. *
  15. *******************************************************************************/
  16. #ifndef __SCANITEM_H_INCLUDED
  17. #define __SCANITEM_H_INCLUDED
  18. #include "simevent.h"
  19. #include "propstrm.h"
  20. class CScannerItem
  21. {
  22. private:
  23. CComPtr<IWiaItem> m_pIWiaItem; // Item COM pointer
  24. SIZE m_AspectRatio;
  25. DWORD m_dwIWiaItemCookie; // Global interface table entry
  26. CSimpleEvent m_CancelEvent;
  27. CPropertyStream m_SavedPropertyStream;
  28. CPropertyStream m_CustomPropertyStream;
  29. public:
  30. CScannerItem( IWiaItem *pIWiaItem );
  31. CScannerItem( void );
  32. CScannerItem(const CScannerItem &other);
  33. ~CScannerItem(void);
  34. CComPtr<IWiaItem> Item(void) const;
  35. SIZE AspectRatio(void) const;
  36. DWORD Cookie(void) const;
  37. CScannerItem &Assign( const CScannerItem &other );
  38. bool operator==( const CScannerItem & );
  39. CScannerItem &operator=( const CScannerItem &other );
  40. HRESULT Destroy(void);
  41. HRESULT Initialize( IWiaItem *pIWiaItem );
  42. bool GetInitialBedSize( SIZE &sizeBed );
  43. bool GetAspectRatio( SIZE &sizeAspectRatio );
  44. bool ApplyCurrentPreviewWindowSettings( HWND hWndPreview );
  45. bool GetFullResolution( const SIZE &sizeResultionPerInch, SIZE &sizeRes );
  46. void Cancel(void);
  47. bool CalculatePreviewResolution( SIZE &sizeResolution );
  48. HANDLE Scan( HWND hWndNotify, HWND hWndPreview );
  49. HANDLE Scan( HWND hWndNotify, GUID guidFormat, const CSimpleStringWide &strFilename );
  50. bool SetIntent( int nIntent );
  51. CSimpleEvent CancelEvent(void) const;
  52. CPropertyStream &SavedPropertyStream(void)
  53. {
  54. return m_SavedPropertyStream;
  55. }
  56. const CPropertyStream &SavedPropertyStream(void) const
  57. {
  58. return m_SavedPropertyStream;
  59. }
  60. CPropertyStream &CustomPropertyStream(void)
  61. {
  62. return m_CustomPropertyStream;
  63. }
  64. const CPropertyStream &CustomPropertyStream(void) const
  65. {
  66. return m_CustomPropertyStream;
  67. }
  68. };
  69. #endif