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.

234 lines
7.8 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 1998
  4. *
  5. * TITLE: WIAUIEXT.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 5/17/1999
  12. *
  13. * DESCRIPTION:
  14. *
  15. *******************************************************************************/
  16. #ifndef __WIAUIEXT_H_INCLUDED
  17. #define __WIAUIEXT_H_INCLUDED
  18. #include <windows.h>
  19. #include <atlbase.h>
  20. #include <objbase.h>
  21. #include "uicommon.h"
  22. #include "wiaseld.h"
  23. #include "wiadebug.h"
  24. #include "shlobj.h"
  25. #include "itranhlp.h"
  26. #include "isuppfmt.h"
  27. #include "simstr.h"
  28. #include "wia.h"
  29. #include "wiadevd.h"
  30. #include "wiadevdp.h"
  31. #include "simarray.h"
  32. #ifndef StiDeviceTypeStreamingVideo
  33. #define StiDeviceTypeStreamingVideo 3
  34. #endif
  35. class CWiaDefaultUI :
  36. public IWiaUIExtension,
  37. public IWiaTransferHelper,
  38. public IWiaDataCallback,
  39. public IWiaSupportedFormats,
  40. public IShellExtInit,
  41. public IShellPropSheetExt,
  42. public IWiaMiscellaneousHelpers,
  43. public IWiaGetImageDlg,
  44. public IWiaProgressDialog,
  45. public IWiaAnnotationHelpers,
  46. public IWiaScannerPaperSizes
  47. {
  48. class CWiaFormatPair
  49. {
  50. private:
  51. GUID m_guidType;
  52. CSimpleStringWide m_strExtension;
  53. CSimpleStringWide m_strDescription;
  54. public:
  55. CWiaFormatPair(void)
  56. : m_guidType(GUID_NULL)
  57. {
  58. }
  59. CWiaFormatPair( const GUID &cfType, const CSimpleStringWide &strExtension, const CSimpleStringWide &strDescription )
  60. : m_guidType(cfType),
  61. m_strExtension(strExtension),
  62. m_strDescription(strDescription)
  63. {
  64. }
  65. CWiaFormatPair( const CWiaFormatPair &other )
  66. : m_guidType(other.Type()),
  67. m_strExtension(other.Extension()),
  68. m_strDescription(other.Description())
  69. {
  70. }
  71. ~CWiaFormatPair(void)
  72. {
  73. }
  74. CWiaFormatPair &operator=( const CWiaFormatPair &other )
  75. {
  76. if (this != &other)
  77. {
  78. m_guidType = other.Type();
  79. m_strExtension = other.Extension();
  80. m_strDescription = other.Description();
  81. }
  82. return *this;
  83. }
  84. bool operator==( const CWiaFormatPair &other )
  85. {
  86. return ((Type() == other.Type()) != 0);
  87. }
  88. GUID Type(void) const
  89. {
  90. return m_guidType;
  91. }
  92. void Type( const GUID &cfType )
  93. {
  94. m_guidType = cfType;
  95. }
  96. CSimpleStringWide Extension(void) const
  97. {
  98. return m_strExtension;
  99. }
  100. void Extension( const CSimpleStringWide &strExtension )
  101. {
  102. m_strExtension = strExtension;
  103. }
  104. CSimpleStringWide Description(void) const
  105. {
  106. return m_strDescription;
  107. }
  108. void Description( const CSimpleStringWide &strDescription )
  109. {
  110. m_strDescription = strDescription;
  111. }
  112. };
  113. private:
  114. LONG m_cRef;
  115. // for IWiaTransferHelper
  116. IWiaDataCallback *m_pSecondaryCallback;
  117. CComPtr<IWiaProgressDialog> m_pWiaProgressDialog;
  118. // for IWiaSupportedFormats
  119. int m_nDefaultFormat;
  120. CSimpleDynamicArray<CWiaFormatPair> m_WiaFormatPairs;
  121. // for IShellExtInit, IShellPropSheetExt
  122. CComPtr<IWiaItem> m_pItem;
  123. // for IWiaProgressDialog
  124. HWND m_hWndProgress;
  125. public:
  126. const IWiaItem *Item(void) const
  127. {
  128. return m_pItem.p;
  129. }
  130. public:
  131. ~CWiaDefaultUI(void);
  132. CWiaDefaultUI(void);
  133. // IUnknown
  134. STDMETHODIMP QueryInterface( REFIID riid, LPVOID *ppvObject );
  135. STDMETHODIMP_(ULONG) AddRef(void);
  136. STDMETHODIMP_(ULONG) Release(void);
  137. // IWiaUIExtension
  138. STDMETHODIMP DeviceDialog( PDEVICEDIALOGDATA pDeviceDialogData );
  139. STDMETHODIMP GetDeviceIcon( BSTR bstrDeviceId, HICON *phIcon, ULONG nSize );
  140. STDMETHODIMP GetDeviceBitmapLogo( BSTR bstrDeviceId, HBITMAP *phBitmap, ULONG nMaxWidth, ULONG nMaxHeight );
  141. // IWiaTransferHelper
  142. STDMETHODIMP TransferItemFile( IWiaItem *pWiaItem, HWND hwndParent, DWORD dwFlags, GUID cfFormat, LPCWSTR pszFilename, IWiaDataCallback *pSecondaryCallback, LONG nMediaType );
  143. STDMETHODIMP TransferItemBanded( IWiaItem *pWiaItem, HWND hwndParent, DWORD dwFlags, GUID cfFormat, ULONG ulBufferSize, IWiaDataCallback *pSecondaryCallback );
  144. // IWiaDataCallback
  145. STDMETHODIMP BandedDataCallback(LONG,LONG,LONG,LONG,LONG,LONG,LONG,PBYTE);
  146. // IWiaSupportedFormats
  147. STDMETHODIMP Initialize( IWiaItem *pWiaItem, LONG nMediaType );
  148. STDMETHODIMP GetFormatCount( LONG *pnCount );
  149. STDMETHODIMP GetFormatType( LONG nFormat, GUID *pcfClipFormat );
  150. STDMETHODIMP GetFormatExtension( LONG nFormat, LPWSTR pszExtension, int nMaxLen );
  151. STDMETHODIMP GetFormatDescription( LONG nFormat, LPWSTR pszDescription, int nMaxLen );
  152. STDMETHODIMP GetDefaultClipboardFileFormat( GUID *pcfFormat );
  153. STDMETHODIMP GetDefaultClipboardFileFormatIndex( LONG *pnFormat );
  154. STDMETHODIMP GetClipboardFileExtension( GUID cfFormat, LPWSTR pszExt, DWORD nMaxLen );
  155. STDMETHODIMP ChangeClipboardFileExtension(IN GUID cfFormat, LPWSTR pszFilename, DWORD nMaxLen );
  156. STDMETHODIMP ConstructFileOpenDialogStyleString( BSTR *pbstrString );
  157. // IShellExtInit
  158. STDMETHODIMP Initialize( LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID );
  159. // IShellPropSheetExt
  160. STDMETHODIMP AddPages( LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  161. STDMETHODIMP ReplacePage( UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplacePage, LPARAM lParam )
  162. {
  163. return E_NOTIMPL;
  164. }
  165. // *** IWiaMiscellaneousHelper methods ***
  166. STDMETHODIMP GetDeviceIcon( LONG nDeviceType, HICON *phIcon, int nSize );
  167. // *** IWiaGetImageDlg ***
  168. STDMETHODIMP SelectDeviceDlg(
  169. HWND hwndParent,
  170. BSTR bstrInitialDeviceId,
  171. LONG lDeviceType,
  172. LONG lFlags,
  173. BSTR *pbstrDeviceID,
  174. IWiaItem **ppWiaItemRoot );
  175. STDMETHODIMP GetImageDlg(
  176. IWiaDevMgr *pWiaDevMgr,
  177. HWND hwndParent,
  178. LONG lDeviceType,
  179. LONG lFlags,
  180. LONG lIntent,
  181. IWiaItem *pItemRoot,
  182. BSTR bstrFilename,
  183. GUID *pguidFormat );
  184. // *** IWiaProgressDialog methods ***
  185. STDMETHODIMP Create( HWND hwndParent, LONG lFlags );
  186. STDMETHODIMP Show(void);
  187. STDMETHODIMP Hide(void);
  188. STDMETHODIMP Cancelled( BOOL *pbCancelled );
  189. STDMETHODIMP SetTitle( LPCWSTR pszMessage );
  190. STDMETHODIMP SetMessage( LPCWSTR pszTitle );
  191. STDMETHODIMP SetPercentComplete( UINT nPercent );
  192. STDMETHODIMP Destroy(void);
  193. // *** IWiaAnnotationHelpers methods ***
  194. STDMETHODIMP GetAnnotationOverlayIcon( CAnnotationType AnnotationType, HICON *phIcon, int nSize );
  195. STDMETHODIMP GetAnnotationType( IUnknown *pUnknown, CAnnotationType &AnnotationType );
  196. STDMETHODIMP GetAnnotationFormat( IUnknown *pUnknown, GUID &guidFormat );
  197. STDMETHODIMP GetAnnotationSize( IUnknown *pUnknown, LONG &nSize, LONG nMediaType );
  198. STDMETHODIMP TransferAttachmentToMemory( IUnknown *pUnknown, GUID &guidFormat, HWND hWndProgressParent, PBYTE *pBuffer, DWORD *pdwSize );
  199. // *** IWiaScannerPaperSizes ***
  200. STDMETHODIMP GetPaperSizes( CWiaPaperSize **ppPaperSizes, UINT *pnCount );
  201. STDMETHODIMP FreePaperSizes( CWiaPaperSize **ppPaperSizes, UINT *pnCount );
  202. };
  203. // This calls the real SelectDeviceDlg in the device selection static library
  204. HRESULT WINAPI SelectDeviceDialog( PSELECTDEVICEDLG pSelectDeviceDlg );
  205. #endif //__WIAUIEXT_H_INCLUDED