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.

162 lines
4.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 1998-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // BasePage.h
  7. //
  8. // Description:
  9. // Definition of the CBasePropertyPage class. This class provides base
  10. // functionality for extension DLL property pages.
  11. //
  12. // Implementation File:
  13. // BasePage.cpp
  14. //
  15. // Maintained By:
  16. // Galen Barbee (GalenB) Mmmm DD, 1998
  17. //
  18. // Revision History:
  19. //
  20. // Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. #ifndef _BASEPAGE_H_
  24. #define _BASEPAGE_H_
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. /////////////////////////////////////////////////////////////////////////////
  28. #ifndef _cluadmex_h__
  29. #include <CluAdmEx.h>
  30. #endif
  31. #ifndef _EXTOBJ_H_
  32. #include "ExtObj.h" // for CExtObject
  33. #endif
  34. #ifndef _PROPLIST_H_
  35. #include "PropList.h" // for CClusPropList, CObjectProperty
  36. #endif
  37. /////////////////////////////////////////////////////////////////////////////
  38. // Forward Class Declarations
  39. /////////////////////////////////////////////////////////////////////////////
  40. class CBasePropertyPage;
  41. /////////////////////////////////////////////////////////////////////////////
  42. // External Class Declarations
  43. /////////////////////////////////////////////////////////////////////////////
  44. class CExtObject;
  45. interface IWCWizardCallback;
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CBasePropertyPage dialog
  48. /////////////////////////////////////////////////////////////////////////////
  49. class CBasePropertyPage : public CPropertyPage
  50. {
  51. DECLARE_DYNCREATE(CBasePropertyPage)
  52. // Construction
  53. public:
  54. CBasePropertyPage(void);
  55. CBasePropertyPage(IN UINT nIDTemplate, IN UINT nIDCaption = 0);
  56. virtual ~CBasePropertyPage(void) { }
  57. // Second phase construction.
  58. virtual BOOL BInit(IN OUT CExtObject * peo);
  59. BOOL BCreateParamsKey(void);
  60. protected:
  61. void CommonConstruct(void);
  62. // Attributes
  63. protected:
  64. CExtObject * m_peo;
  65. HPROPSHEETPAGE m_hpage;
  66. IDD m_iddPropertyPage;
  67. IDD m_iddWizardPage;
  68. IDS m_idsCaption;
  69. HPROPSHEETPAGE Hpage(void) const { return m_hpage; }
  70. IDD IddPropertyPage(void) const { return m_iddPropertyPage; }
  71. IDD IddWizardPage(void) const { return m_iddWizardPage; }
  72. IDS IdsCaption(void) const { return m_idsCaption; }
  73. public:
  74. CExtObject * Peo(void) const { return m_peo; }
  75. void SetHpage(IN OUT HPROPSHEETPAGE hpage) { m_hpage = hpage; }
  76. CLUADMEX_OBJECT_TYPE Cot(void) const;
  77. // Dialog Data
  78. //{{AFX_DATA(CBasePropertyPage)
  79. enum { IDD = 0 };
  80. //}}AFX_DATA
  81. CStatic m_staticIcon;
  82. CStatic m_staticTitle;
  83. CString m_strTitle;
  84. // Overrides
  85. // ClassWizard generate virtual function overrides
  86. //{{AFX_VIRTUAL(CBasePropertyPage)
  87. public:
  88. virtual BOOL OnSetActive();
  89. virtual BOOL OnApply();
  90. virtual LRESULT OnWizardBack();
  91. virtual LRESULT OnWizardNext();
  92. virtual BOOL OnWizardFinish();
  93. protected:
  94. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  95. //}}AFX_VIRTUAL
  96. virtual DWORD DwParseUnknownProperty(
  97. IN LPCWSTR pwszName,
  98. IN const CLUSPROP_BUFFER_HELPER & rvalue,
  99. IN DWORD cbBuf
  100. ) { return ERROR_SUCCESS; }
  101. virtual BOOL BApplyChanges(void);
  102. virtual void BuildPropList(IN OUT CClusPropList & rcpl);
  103. virtual const CObjectProperty * Pprops(void) const { return NULL; }
  104. virtual DWORD Cprops(void) const { return 0; }
  105. // Implementation
  106. protected:
  107. BOOL m_bBackPressed;
  108. BOOL m_bDoDetach;
  109. BOOL BBackPressed(void) const { return m_bBackPressed; }
  110. IWCWizardCallback * PiWizardCallback(void) const;
  111. BOOL BWizard(void) const;
  112. HCLUSTER Hcluster(void) const;
  113. void EnableNext(IN BOOL bEnable = TRUE);
  114. DWORD DwParseProperties(IN const CClusPropList & rcpl);
  115. BOOL BSetPrivateProps(IN BOOL bValidateOnly = FALSE);
  116. // Generated message map functions
  117. //{{AFX_MSG(CBasePropertyPage)
  118. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  119. afx_msg void OnDestroy();
  120. virtual BOOL OnInitDialog();
  121. //}}AFX_MSG
  122. afx_msg void OnChangeCtrl();
  123. DECLARE_MESSAGE_MAP()
  124. }; //*** class CBasePropertyPage
  125. /////////////////////////////////////////////////////////////////////////////
  126. // CPageList
  127. /////////////////////////////////////////////////////////////////////////////
  128. typedef CList<CBasePropertyPage *, CBasePropertyPage *> CPageList;
  129. /////////////////////////////////////////////////////////////////////////////
  130. #endif // _BASEPAGE_H_