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.

198 lines
6.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // BasePage.h
  7. //
  8. // Implementation File:
  9. // BasePage.cpp
  10. // BasePage.inl
  11. //
  12. // Description:
  13. // Definition of the CBasePropertyPage class. This class provides base
  14. // functionality for extension DLL property pages.
  15. //
  16. // Author:
  17. // David Potter (DavidP) March 24, 1999
  18. //
  19. // Revision History:
  20. //
  21. // Notes:
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef __BASEPAGE_H__
  25. #define __BASEPAGE_H__
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. /////////////////////////////////////////////////////////////////////////////
  29. #ifndef __cluadmex_h__
  30. #include <CluAdmEx.h>
  31. #endif
  32. #ifndef __DLGHELP_H__
  33. #include "DlgHelp.h" // for CDialogHelp
  34. #endif
  35. #ifndef _EXTOBJ_H_
  36. #include "ExtObj.h" // for CExtObject
  37. #endif
  38. #ifndef _PROPLIST_H_
  39. #include "PropList.h" // for CClusPropList, CObjectProperty
  40. #endif
  41. /////////////////////////////////////////////////////////////////////////////
  42. // Forward Class Declarations
  43. /////////////////////////////////////////////////////////////////////////////
  44. class CBasePropertyPage;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // External Class Declarations
  47. /////////////////////////////////////////////////////////////////////////////
  48. class CExtObject;
  49. interface IWCWizardCallback;
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CBasePropertyPage dialog
  52. /////////////////////////////////////////////////////////////////////////////
  53. class CBasePropertyPage : public CPropertyPage
  54. {
  55. DECLARE_DYNCREATE( CBasePropertyPage )
  56. // Construction
  57. public:
  58. CBasePropertyPage( void );
  59. CBasePropertyPage(
  60. IN const DWORD * pdwHelpMap,
  61. IN const DWORD * pdwWizardHelpMap
  62. );
  63. CBasePropertyPage(
  64. IN UINT idd,
  65. IN const DWORD * pdwHelpMap,
  66. IN const DWORD * pdwWizardHelpMap,
  67. IN UINT nIDCaption = 0
  68. );
  69. virtual ~CBasePropertyPage( void )
  70. {
  71. } //*** ~CBasePropertyPage
  72. // Second phase construction.
  73. virtual HRESULT HrInit( IN OUT CExtObject * peo );
  74. HRESULT HrCreatePage( void );
  75. protected:
  76. void CommonConstruct( void );
  77. // Attributes
  78. protected:
  79. CExtObject * m_peo;
  80. HPROPSHEETPAGE m_hpage;
  81. IDD m_iddPropertyPage;
  82. IDD m_iddWizardPage;
  83. IDS m_idsCaption;
  84. CExtObject * Peo( void ) const { return m_peo; }
  85. IDD IddPropertyPage( void ) const { return m_iddPropertyPage; }
  86. IDD IddWizardPage( void ) const { return m_iddWizardPage; }
  87. IDS IdsCaption( void ) const { return m_idsCaption; }
  88. public:
  89. HPROPSHEETPAGE Hpage( void ) const { return m_hpage; }
  90. CLUADMEX_OBJECT_TYPE Cot( void ) const;
  91. // Dialog Data
  92. //{{AFX_DATA(CBasePropertyPage)
  93. enum { IDD = 0 };
  94. //}}AFX_DATA
  95. CStatic m_staticIcon;
  96. CStatic m_staticTitle;
  97. CString m_strTitle;
  98. // Overrides
  99. // ClassWizard generate virtual function overrides
  100. //{{AFX_VIRTUAL(CBasePropertyPage)
  101. public:
  102. virtual BOOL OnSetActive();
  103. virtual BOOL OnApply();
  104. virtual LRESULT OnWizardBack();
  105. virtual LRESULT OnWizardNext();
  106. virtual BOOL OnWizardFinish();
  107. protected:
  108. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  109. //}}AFX_VIRTUAL
  110. virtual DWORD ScParseUnknownProperty(
  111. IN LPCWSTR pwszName,
  112. IN const CLUSPROP_BUFFER_HELPER & rvalue,
  113. IN size_t cbBuf
  114. )
  115. {
  116. UNREFERENCED_PARAMETER( pwszName );
  117. UNREFERENCED_PARAMETER( rvalue );
  118. UNREFERENCED_PARAMETER( cbBuf );
  119. return ERROR_SUCCESS;
  120. } //*** ScParseUnknownProperty
  121. virtual BOOL BApplyChanges( void );
  122. virtual BOOL BBuildPropList( IN OUT CClusPropList & rcpl, IN BOOL bNoNewProps = FALSE );
  123. virtual void DisplaySetPropsError( IN DWORD sc, IN UINT idsOper ) const;
  124. virtual const CObjectProperty * Pprops( void ) const { return NULL; }
  125. virtual DWORD Cprops( void ) const { return 0; }
  126. // Implementation
  127. protected:
  128. BOOL m_bBackPressed;
  129. BOOL m_bSaved;
  130. const DWORD * m_pdwWizardHelpMap;
  131. BOOL m_bDoDetach;
  132. BOOL BBackPressed( void ) const { return m_bBackPressed; }
  133. BOOL BSaved( void ) const { return m_bSaved; }
  134. IWCWizardCallback * PiWizardCallback( void ) const;
  135. BOOL BWizard( void ) const;
  136. HCLUSTER Hcluster( void ) const;
  137. void EnableNext( IN BOOL bEnable = TRUE );
  138. DWORD ScParseProperties( IN CClusPropList & rcpl );
  139. BOOL BSetPrivateProps(
  140. IN BOOL bValidateOnly = FALSE,
  141. IN BOOL bNoNewProps = FALSE
  142. );
  143. void SetHelpMask( IN DWORD dwMask ) { m_dlghelp.SetHelpMask( dwMask ); }
  144. CDialogHelp m_dlghelp;
  145. // Generated message map functions
  146. //{{AFX_MSG(CBasePropertyPage)
  147. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  148. afx_msg void OnDestroy();
  149. virtual BOOL OnInitDialog();
  150. afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  151. afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);
  152. //}}AFX_MSG
  153. virtual afx_msg void OnContextMenu( CWnd * pWnd, CPoint point );
  154. afx_msg void OnChangeCtrl();
  155. DECLARE_MESSAGE_MAP()
  156. }; //*** class CBasePropertyPage
  157. /////////////////////////////////////////////////////////////////////////////
  158. // CPageList
  159. /////////////////////////////////////////////////////////////////////////////
  160. typedef CList< CBasePropertyPage *, CBasePropertyPage * > CPageList;
  161. /////////////////////////////////////////////////////////////////////////////
  162. #endif // __BASEPAGE_H__