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.

195 lines
5.3 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999 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 DWORD cbBuf
  114. )
  115. {
  116. return ERROR_SUCCESS;
  117. } //*** ScParseUnknownProperty()
  118. virtual BOOL BApplyChanges( void );
  119. virtual BOOL BBuildPropList( IN OUT CClusPropList & rcpl, IN BOOL bNoNewProps = FALSE );
  120. virtual void DisplaySetPropsError( IN DWORD sc, IN UINT idsOper ) const;
  121. virtual const CObjectProperty * Pprops( void ) const { return NULL; }
  122. virtual DWORD Cprops( void ) const { return 0; }
  123. // Implementation
  124. protected:
  125. BOOL m_bBackPressed;
  126. BOOL m_bSaved;
  127. const DWORD * m_pdwWizardHelpMap;
  128. BOOL m_bDoDetach;
  129. BOOL BBackPressed( void ) const { return m_bBackPressed; }
  130. BOOL BSaved( void ) const { return m_bSaved; }
  131. IWCWizardCallback * PiWizardCallback( void ) const;
  132. BOOL BWizard( void ) const;
  133. HCLUSTER Hcluster( void ) const;
  134. void EnableNext( IN BOOL bEnable = TRUE );
  135. DWORD ScParseProperties( IN CClusPropList & rcpl );
  136. BOOL BSetPrivateProps(
  137. IN BOOL bValidateOnly = FALSE,
  138. IN BOOL bNoNewProps = FALSE
  139. );
  140. void SetHelpMask( IN DWORD dwMask ) { m_dlghelp.SetHelpMask( dwMask ); }
  141. CDialogHelp m_dlghelp;
  142. // Generated message map functions
  143. //{{AFX_MSG(CBasePropertyPage)
  144. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  145. afx_msg void OnDestroy();
  146. virtual BOOL OnInitDialog();
  147. afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  148. afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);
  149. //}}AFX_MSG
  150. virtual afx_msg void OnContextMenu( CWnd * pWnd, CPoint point );
  151. afx_msg void OnChangeCtrl();
  152. DECLARE_MESSAGE_MAP()
  153. }; //*** class CBasePropertyPage
  154. /////////////////////////////////////////////////////////////////////////////
  155. // CPageList
  156. /////////////////////////////////////////////////////////////////////////////
  157. typedef CList< CBasePropertyPage *, CBasePropertyPage * > CPageList;
  158. /////////////////////////////////////////////////////////////////////////////
  159. #endif // __BASEPAGE_H__