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.

157 lines
5.4 KiB

  1. // wiatestView.h : interface of the CWiatestView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_WIATESTVIEW_H__B547F708_A160_4238_9D68_CC9C7B8511D4__INCLUDED_)
  5. #define AFX_WIATESTVIEW_H__B547F708_A160_4238_9D68_CC9C7B8511D4__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "wiaitemlistctrl.h"
  10. #include "wiaacquiredlg.h"
  11. #include "wiaeventcallback.h"
  12. #define MIN_BUFFER_FACTOR 4
  13. #define BMPFILE_HEADER_MARKER ((WORD) ('M' << 8) | 'B')
  14. #define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4)
  15. #define NUMSYSTEMTIME_COLONS 7
  16. #define MIN_CLIENT_WINDOW_WIDTH 580
  17. ////////////////////////////////////////////////////////////
  18. // from sti.h
  19. #define GET_STIDEVICE_TYPE(dwDevType) HIWORD(dwDevType)
  20. #define GET_STIDEVICE_SUBTYPE(dwDevType) LOWORD(dwDevType)
  21. #define StiDeviceTypeDefault 0
  22. #define StiDeviceTypeScanner 1
  23. #define StiDeviceTypeDigitalCamera 2
  24. #define StiDeviceTypeStreamingVideo 3
  25. //
  26. ////////////////////////////////////////////////////////////
  27. class CWiatestView : public CFormView
  28. {
  29. protected: // create from serialization only
  30. CWiatestView();
  31. DECLARE_DYNCREATE(CWiatestView)
  32. public:
  33. //{{AFX_DATA(CWiatestView)
  34. enum { IDD = IDD_WIATEST_FORM };
  35. CListBox m_SupportedTymedAndFormatsListBox;
  36. CStatic m_ThumbnailPreviewWindow;
  37. CWiaitemListCtrl m_ItemPropertiesListCtrl;
  38. CTreeCtrl m_ItemTreeCtrl;
  39. //}}AFX_DATA
  40. // Attributes
  41. public:
  42. CWiatestDoc* GetDocument();
  43. // Operations
  44. public:
  45. // Overrides
  46. // ClassWizard generated virtual function overrides
  47. //{{AFX_VIRTUAL(CWiatestView)
  48. public:
  49. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  50. protected:
  51. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  52. virtual void OnInitialUpdate(); // called first time after construct
  53. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  54. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  55. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  56. virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  57. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  58. //}}AFX_VIRTUAL
  59. // Implementation
  60. public:
  61. BOOL m_bHasDocumentFeeder;
  62. LONG m_lDeviceType;
  63. // Event helpers
  64. void RegisterForEvents();
  65. CWiaEventCallback m_WiaEventCallback;
  66. // Thumbnailing helpers
  67. HBITMAP m_hThumbNailBitmap;
  68. void DisplayThumbnail(IWiaItem *pIWiaItem);
  69. void DisplayMissingThumbnail();
  70. // User interface
  71. void AdjustViewForDeviceType();
  72. void SetCurrentSelectionForTYMEDAndFormat();
  73. void AddSupportedTYMEDAndFormatsToListBox(IWiaItem *pIWiaItem);
  74. void AddWiaItemPropertiesToListControl(IWiaItem *pIWiaItem);
  75. void AddWiaItemsToTreeControl(HTREEITEM hParent, IWiaItem *pIWiaItem);
  76. // converison helpers
  77. void FORMAT2TSTR(GUID guidFormat, TCHAR* pszFormat);
  78. void VT2TSTR(TCHAR *pszText,ULONG VarType);
  79. void AccessFlags2TSTR(TCHAR *pszText,ULONG AccessFlags);
  80. void PROPVAR2TSTR(PROPVARIANT *pPropVar,TCHAR *szValue);
  81. void TSTR2PROPVAR(TCHAR *szValue, PROPVARIANT *pPropVar);
  82. // data acquisition helpers
  83. void RenameTempDataTransferFilesAndLaunchViewer(TCHAR *szFileName, GUID guidFormat, LONG lTymed);
  84. void RenameTempDataTransferFilesAndLaunchViewer(GUID guidFormat, LONG lTymed);
  85. void DeleteTempDataTransferFiles();
  86. ULONG ReadMinBufferSizeProperty(IWiaItem *pIWiaItem);
  87. HRESULT TransferToMemory(TCHAR *szFileName, IWiaItem *pIWiaItem);
  88. HRESULT TransferToFile(TCHAR *szFileName, IWiaItem *pIWiaItem);
  89. LONG CalculateWidthBytes(LONG lWidthPixels, LONG lbpp);
  90. // debugging helpers
  91. BOOL m_bOutputToDebuggerON;
  92. virtual ~CWiatestView();
  93. #ifdef _DEBUG
  94. virtual void AssertValid() const;
  95. virtual void Dump(CDumpContext& dc) const;
  96. #endif
  97. protected:
  98. // Generated message map functions
  99. protected:
  100. //{{AFX_MSG(CWiatestView)
  101. afx_msg void OnSelchangedItemTreectrl(NMHDR* pNMHDR, LRESULT* pResult);
  102. afx_msg void OnSize(UINT nType, int cx, int cy);
  103. afx_msg void OnDblclkItempropertiesListctrl(NMHDR* pNMHDR, LRESULT* pResult);
  104. afx_msg void OnAcquireimage();
  105. afx_msg void OnLoadWiapropertystream();
  106. afx_msg void OnSaveWiapropertystream();
  107. afx_msg void OnRclickItempropertiesListctrl(NMHDR* pNMHDR, LRESULT* pResult);
  108. afx_msg void OnPropertyeditpopupmenuEditpropertyvalue();
  109. afx_msg void OnViewCapabilities();
  110. afx_msg void OnRclickItemTreectrl(NMHDR* pNMHDR, LRESULT* pResult);
  111. afx_msg void OnDeleteItem();
  112. afx_msg void OnAcquireimageCommonui();
  113. afx_msg void OnEditDebugout();
  114. afx_msg void OnUpdateEditDebugout(CCmdUI* pCmdUI);
  115. afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
  116. afx_msg void OnDocumentAcquisitionSettings();
  117. afx_msg void OnUpdateDocumentAcquisitionSettings(CCmdUI* pCmdUI);
  118. afx_msg void OnSelchangeSupportedTymedAndFormatListbox();
  119. afx_msg void OnThumbnailPreview();
  120. //}}AFX_MSG
  121. DECLARE_MESSAGE_MAP()
  122. };
  123. #ifndef _DEBUG // debug version in wiatestView.cpp
  124. inline CWiatestDoc* CWiatestView::GetDocument()
  125. { return (CWiatestDoc*)m_pDocument; }
  126. #endif
  127. /////////////////////////////////////////////////////////////////////////////
  128. //{{AFX_INSERT_LOCATION}}
  129. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  130. #endif // !defined(AFX_WIATESTVIEW_H__B547F708_A160_4238_9D68_CC9C7B8511D4__INCLUDED_)