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.

246 lines
6.8 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. CPropSht.h
  5. Abstract:
  6. Implementation of Property-Sheet-Like container object
  7. for property sheet pages.
  8. Author:
  9. Art Bragg 10/8/97
  10. Revision History:
  11. --*/
  12. #ifndef _CSAKPROPSHT_H
  13. #define _CSAKPROPSHT_H
  14. class CSakPropertyPage;
  15. class CSakPropertySheet
  16. {
  17. public:
  18. CSakPropertySheet() :
  19. m_pEnumObjectIdStream( 0 ),
  20. m_pHsmObjStream( 0 ),
  21. m_pSakSnapAskStream( 0 ),
  22. m_pSakNode( 0 ),
  23. m_Handle( 0 ),
  24. m_nPageCount( 0 )
  25. { };
  26. HRESULT InitSheet(
  27. RS_NOTIFY_HANDLE Handle,
  28. IUnknown* pUnkPropSheetCallback,
  29. CSakNode* pSakNode,
  30. ISakSnapAsk* pSakSnapAsk,
  31. IEnumGUID* pEnumObjectId,
  32. IEnumUnknown* pEnumUnkNode );
  33. HRESULT SetNode( CSakNode* pSakNode );
  34. ~CSakPropertySheet();
  35. virtual void AddPageRef();
  36. virtual void ReleasePageRef();
  37. protected:
  38. LPSTREAM m_pEnumObjectIdStream;
  39. LPSTREAM m_pHsmObjStream;
  40. LPSTREAM m_pSakSnapAskStream;
  41. public:
  42. HRESULT AddPropertyPages( );
  43. HRESULT IsMultiSelect( );
  44. HRESULT GetSakSnapAsk( ISakSnapAsk **ppAsk );
  45. HRESULT GetHsmObj( IUnknown **ppHsmObj );
  46. HRESULT GetHsmServer( IHsmServer **ppHsmServer );
  47. HRESULT GetFsaServer( IFsaServer **ppHsmServer );
  48. HRESULT GetFsaFilter( IFsaFilter **ppFsaFilter );
  49. HRESULT GetRmsServer( IRmsServer **ppHsmServer );
  50. HRESULT GetNextObjectId( INT *pBookMark, GUID *pObjectId );
  51. HRESULT GetNextNode( INT *pBookMark, ISakNode **ppNode );
  52. HRESULT OnPropertyChange( RS_NOTIFY_HANDLE notifyHandle, ISakNode* pNode = 0 );
  53. HRESULT AddPage( CSakPropertyPage* pPage );
  54. public:
  55. CSakNode *m_pSakNode;
  56. protected:
  57. RS_NOTIFY_HANDLE m_Handle;
  58. CComPtr<IPropertySheetCallback> m_pPropSheetCallback;
  59. CComPtr<ISakSnapAsk> m_pSakSnapAsk;
  60. CComPtr<IUnknown> m_pHsmObj;
  61. BOOL m_bMultiSelect;
  62. INT m_nPageCount;
  63. CArray<GUID, GUID&> m_ObjectIdList;
  64. CRsNodeArray m_UnkNodeList;
  65. };
  66. class CSakPropertyPage : public CRsPropertyPage
  67. {
  68. public:
  69. CSakPropertyPage( UINT nIDTemplate, UINT nIDCaption = 0 );
  70. public:
  71. HRESULT SetMMCCallBack( );
  72. CSakPropertySheet * m_pParent;
  73. RS_NOTIFY_HANDLE m_hConsoleHandle; // Handle given to the snap-in by the console
  74. // Overrides
  75. // ClassWizard generate virtual function overrides
  76. //{{AFX_VIRTUAL(CSakWizardPage)
  77. public:
  78. //}}AFX_VIRTUAL
  79. protected:
  80. virtual void OnPageRelease( );
  81. };
  82. class CSakVolPropPage;
  83. class CSakVolPropSheet:public CSakPropertySheet
  84. {
  85. public:
  86. CSakVolPropSheet() { };
  87. ~CSakVolPropSheet() { };
  88. public:
  89. virtual HRESULT GetNextFsaResource( INT *pBookMark, IFsaResource ** ppFsaResource ) = 0;
  90. HRESULT GetFsaResource( IFsaResource ** ppFsaResource );
  91. HRESULT AddPage( CSakVolPropPage* pPage );
  92. };
  93. class CSakVolPropPage : public CSakPropertyPage
  94. {
  95. public:
  96. CSakVolPropPage( UINT nIDTemplate, UINT nIDCaption = 0 );
  97. public:
  98. CSakVolPropSheet * m_pVolParent;
  99. // Overrides
  100. // ClassWizard generate virtual function overrides
  101. //{{AFX_VIRTUAL(CSakWizardPage)
  102. public:
  103. //}}AFX_VIRTUAL
  104. };
  105. class CSakWizardPage;
  106. class CSakWizardSheet :
  107. public CSakPropertySheet,
  108. public CComObjectRoot,
  109. public IDataObject,
  110. public ISakWizard
  111. {
  112. public:
  113. CSakWizardSheet( );
  114. virtual void AddPageRef();
  115. virtual void ReleasePageRef();
  116. BEGIN_COM_MAP(CSakWizardSheet)
  117. COM_INTERFACE_ENTRY(IDataObject)
  118. COM_INTERFACE_ENTRY(ISakWizard)
  119. END_COM_MAP()
  120. public:
  121. //
  122. // IDataObject
  123. STDMETHOD( SetData ) ( LPFORMATETC /*lpFormatetc*/, LPSTGMEDIUM /*lpMedium*/, BOOL /*bRelease*/ )
  124. { return( DV_E_CLIPFORMAT ); };
  125. STDMETHOD( GetData ) ( LPFORMATETC /*lpFormatetc*/, LPSTGMEDIUM /*lpMedium*/ )
  126. { return( DV_E_CLIPFORMAT ); };
  127. STDMETHOD( GetDataHere ) ( LPFORMATETC /*lpFormatetc*/, LPSTGMEDIUM /*lpMedium*/ )
  128. { return( DV_E_CLIPFORMAT ); };
  129. STDMETHOD( EnumFormatEtc ) ( DWORD /*dwDirection*/, LPENUMFORMATETC* /*ppEnumFormatEtc*/ )
  130. { return( E_NOTIMPL ); };
  131. STDMETHOD( QueryGetData ) ( LPFORMATETC /*lpFormatetc*/ )
  132. { return( E_NOTIMPL ); };
  133. STDMETHOD( GetCanonicalFormatEtc ) ( LPFORMATETC /*lpFormatetcIn*/, LPFORMATETC /*lpFormatetcOut*/ )
  134. { return( E_NOTIMPL ); };
  135. STDMETHOD( DAdvise ) ( LPFORMATETC /*lpFormatetc*/, DWORD /*advf*/, LPADVISESINK /*pAdvSink*/, LPDWORD /*pdwConnection*/ )
  136. { return( E_NOTIMPL ); };
  137. STDMETHOD( DUnadvise ) ( DWORD /*dwConnection*/ )
  138. { return( E_NOTIMPL ); };
  139. STDMETHOD( EnumDAdvise ) ( LPENUMSTATDATA* /*ppEnumAdvise*/ )
  140. { return( E_NOTIMPL ); };
  141. //
  142. // ISakWizard
  143. //
  144. //STDMETHOD( AddWizardPages ) ( IN RS_PCREATE_HANDLE Handle, IN IUnknown* pPropSheetCallback, IN ISakSnapAsk* pSakSnapAsk );
  145. STDMETHOD( GetWatermarks ) ( OUT HBITMAP* lphWatermark, OUT HBITMAP* lphHeader, OUT HPALETTE* lphPalette, OUT BOOL* bStretch );
  146. STDMETHOD( GetTitle ) ( OUT OLECHAR** pTitle );
  147. public:
  148. //
  149. // Used by pages
  150. //
  151. void SetWizardButtons( DWORD Flags );
  152. BOOL PressButton( INT Button );
  153. virtual HRESULT OnFinish( ) { m_HrFinish = S_OK; return( m_HrFinish ); };
  154. virtual HRESULT OnCancel( ) { return( m_HrFinish ); };
  155. //
  156. // Used to check finish status of wizard
  157. //
  158. HRESULT m_HrFinish;
  159. protected:
  160. HRESULT AddPage( CSakWizardPage* pPage );
  161. UINT m_TitleId;
  162. CString m_Title;
  163. INT m_HeaderId,
  164. m_WatermarkId;
  165. CBitmap m_Header,
  166. m_Watermark;
  167. CSakWizardPage* m_pFirstPage;
  168. private:
  169. HRESULT AddPage( CSakPropertyPage* ) { return( E_NOTIMPL ); }
  170. };
  171. class CSakWizardPage : public CRsWizardPage
  172. {
  173. public:
  174. CSakWizardPage( UINT nIDTemplate, BOOL bExterior = FALSE, UINT nIdTitle = 0, UINT nIdSubtitle = 0 );
  175. public:
  176. CSakWizardSheet * m_pSheet;
  177. HRESULT SetMMCCallBack( );
  178. // Overrides
  179. // ClassWizard generate virtual function overrides
  180. //{{AFX_VIRTUAL(CSakWizardPage)
  181. public:
  182. virtual BOOL OnWizardFinish();
  183. virtual void OnCancel();
  184. //}}AFX_VIRTUAL
  185. protected:
  186. virtual void OnPageRelease( );
  187. };
  188. #define CSakWizardPage_InitBaseInt( DlgId ) CSakWizardPage( IDD_##DlgId, FALSE, IDS_##DlgId##_TITLE, IDS_##DlgId##_SUBTITLE )
  189. #define CSakWizardPage_InitBaseExt( DlgId ) CSakWizardPage( IDD_##DlgId, TRUE )
  190. #endif