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.

330 lines
8.6 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1997 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ResProp.h
  7. //
  8. // Abstract:
  9. // Definition of the resource property sheet and pages.
  10. //
  11. // Author:
  12. // David Potter (davidp) May 16, 1996
  13. //
  14. // Implementation File:
  15. // ResProp.cpp
  16. //
  17. // Revision History:
  18. //
  19. // Notes:
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. #ifndef _RESPROP_H_
  23. #define _RESPROP_H_
  24. /////////////////////////////////////////////////////////////////////////////
  25. // Include Files
  26. /////////////////////////////////////////////////////////////////////////////
  27. #ifndef _BASEPAGE_H_
  28. #include "BasePPag.h" // for CBasePropertyPage
  29. #endif
  30. #ifndef _BASESHT_H_
  31. #include "BasePSht.h" // for CBasePropertySheet
  32. #endif
  33. #ifndef _RES_H_
  34. #include "Res.h" // for CResource, RRA
  35. #endif
  36. #ifndef _NODE_H_
  37. #include "Node.h" // for CNodeList
  38. #endif
  39. #ifndef _LCPRPAGE_H_
  40. #include "LCPrPage.h" // for CListCtrlPairPage
  41. #endif
  42. /////////////////////////////////////////////////////////////////////////////
  43. // Forward Class Declarations
  44. /////////////////////////////////////////////////////////////////////////////
  45. class CResourceGeneralPage;
  46. class CResourceDependsPage;
  47. class CResourceAdvancedPage;
  48. class CResourcePropSheet;
  49. /////////////////////////////////////////////////////////////////////////////
  50. // External Class Declarations
  51. /////////////////////////////////////////////////////////////////////////////
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CResourceGeneralPage dialog
  54. /////////////////////////////////////////////////////////////////////////////
  55. class CResourceGeneralPage : public CBasePropertyPage
  56. {
  57. DECLARE_DYNCREATE(CResourceGeneralPage)
  58. // Construction
  59. public:
  60. CResourceGeneralPage(void);
  61. virtual BOOL BInit(IN OUT CBaseSheet * psht);
  62. // Dialog Data
  63. //{{AFX_DATA(CResourceGeneralPage)
  64. enum { IDD = IDD_PP_RES_GENERAL };
  65. CEdit m_editDesc;
  66. CButton m_ckbSeparateMonitor;
  67. CButton m_pbPossibleOwnersModify;
  68. CListBox m_lbPossibleOwners;
  69. CEdit m_editName;
  70. CString m_strName;
  71. CString m_strDesc;
  72. CString m_strType;
  73. CString m_strGroup;
  74. CString m_strState;
  75. CString m_strNode;
  76. BOOL m_bSeparateMonitor;
  77. //}}AFX_DATA
  78. CNodeList m_lpciPossibleOwners;
  79. const CNodeList & LpciPossibleOwners(void) const { return m_lpciPossibleOwners; }
  80. // Overrides
  81. // ClassWizard generate virtual function overrides
  82. //{{AFX_VIRTUAL(CResourceGeneralPage)
  83. public:
  84. virtual BOOL OnApply();
  85. protected:
  86. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  87. //}}AFX_VIRTUAL
  88. // Implementation
  89. protected:
  90. CResourcePropSheet * PshtResource(void) const { return (CResourcePropSheet *) Psht(); }
  91. CResource * PciRes(void) const { return (CResource *) Pci(); }
  92. void FillPossibleOwners(void);
  93. // Generated message map functions
  94. //{{AFX_MSG(CResourceGeneralPage)
  95. afx_msg void OnModifyPossibleOwners();
  96. virtual BOOL OnInitDialog();
  97. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  98. afx_msg void OnDblClkPossibleOwners();
  99. //}}AFX_MSG
  100. afx_msg void OnProperties();
  101. DECLARE_MESSAGE_MAP()
  102. }; //*** class CResourceGeneralPage
  103. /////////////////////////////////////////////////////////////////////////////
  104. // CResourceDependsPage dialog
  105. /////////////////////////////////////////////////////////////////////////////
  106. class CResourceDependsPage : public CBasePropertyPage
  107. {
  108. DECLARE_DYNCREATE(CResourceDependsPage)
  109. // Construction
  110. public:
  111. CResourceDependsPage(void);
  112. virtual BOOL BInit(IN OUT CBaseSheet * psht);
  113. // Dialog Data
  114. //{{AFX_DATA(CResourceDependsPage)
  115. enum { IDD = IDD_PP_RES_DEPENDS };
  116. CButton m_pbProperties;
  117. CButton m_pbModify;
  118. CListCtrl m_lcDependencies;
  119. //}}AFX_DATA
  120. CResourceList m_lpciresAvailable;
  121. CResourceList m_lpciresDependencies;
  122. CResourceList & LpciresAvailable(void) { return m_lpciresAvailable; }
  123. CResourceList & LpciresDependencies(void) { return m_lpciresDependencies; }
  124. // Overrides
  125. // ClassWizard generate virtual function overrides
  126. //{{AFX_VIRTUAL(CResourceDependsPage)
  127. public:
  128. virtual BOOL OnApply();
  129. protected:
  130. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  131. //}}AFX_VIRTUAL
  132. // Callback Functions
  133. protected:
  134. static int CALLBACK CompareItems(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort);
  135. public:
  136. static BOOL CALLBACK BGetNetworkName(
  137. OUT WCHAR * lpszNetName,
  138. IN OUT DWORD * pcchNetName,
  139. IN OUT PVOID pvContext
  140. );
  141. // Implementation
  142. protected:
  143. BOOL m_bQuorumResource;
  144. BOOL BQuorumResource(void) const { return m_bQuorumResource; }
  145. CResourcePropSheet * PshtResource(void) const { return (CResourcePropSheet *) Psht(); }
  146. CResource * PciRes(void) const { return (CResource *) Pci(); }
  147. void FillDependencies(void);
  148. void DisplayProperties(void);
  149. int m_nSortDirection;
  150. int m_nSortColumn;
  151. // Generated message map functions
  152. //{{AFX_MSG(CResourceDependsPage)
  153. virtual BOOL OnInitDialog();
  154. afx_msg void OnModify();
  155. afx_msg void OnDblClkDependsList(NMHDR* pNMHDR, LRESULT* pResult);
  156. afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
  157. afx_msg void OnProperties();
  158. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  159. afx_msg void OnItemChangedDependsList(NMHDR* pNMHDR, LRESULT* pResult);
  160. //}}AFX_MSG
  161. DECLARE_MESSAGE_MAP()
  162. }; //*** class CResourceDependsPage
  163. /////////////////////////////////////////////////////////////////////////////
  164. // CResourceAdvancedPage dialog
  165. /////////////////////////////////////////////////////////////////////////////
  166. class CResourceAdvancedPage : public CBasePropertyPage
  167. {
  168. DECLARE_DYNCREATE(CResourceAdvancedPage)
  169. // Construction
  170. public:
  171. CResourceAdvancedPage(void);
  172. virtual BOOL BInit(IN OUT CBaseSheet * psht);
  173. // Dialog Data
  174. //{{AFX_DATA(CResourceAdvancedPage)
  175. enum { IDD = IDD_PP_RES_ADVANCED };
  176. CButton m_ckbAffectTheGroup;
  177. CEdit m_editPendingTimeout;
  178. CButton m_rbDefaultLooksAlive;
  179. CButton m_rbSpecifyLooksAlive;
  180. CButton m_rbDefaultIsAlive;
  181. CButton m_rbSpecifyIsAlive;
  182. CEdit m_editLooksAlive;
  183. CEdit m_editIsAlive;
  184. CButton m_rbDontRestart;
  185. CButton m_rbRestart;
  186. CEdit m_editThreshold;
  187. CEdit m_editPeriod;
  188. BOOL m_bAffectTheGroup;
  189. int m_nRestart;
  190. //}}AFX_DATA
  191. CRRA m_crraRestartAction;
  192. DWORD m_nThreshold;
  193. DWORD m_nPeriod;
  194. DWORD m_nLooksAlive;
  195. DWORD m_nIsAlive;
  196. DWORD m_nPendingTimeout;
  197. // Overrides
  198. // ClassWizard generate virtual function overrides
  199. //{{AFX_VIRTUAL(CResourceAdvancedPage)
  200. public:
  201. virtual BOOL OnApply();
  202. protected:
  203. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  204. //}}AFX_VIRTUAL
  205. // Implementation
  206. protected:
  207. CResourcePropSheet * PshtResource(void) const { return (CResourcePropSheet *) Psht(); }
  208. CResource * PciRes(void) const { return (CResource *) Pci(); }
  209. // Generated message map functions
  210. //{{AFX_MSG(CResourceAdvancedPage)
  211. afx_msg void OnClickedDontRestart();
  212. afx_msg void OnClickedRestart();
  213. afx_msg void OnClickedDefaultLooksAlive();
  214. afx_msg void OnClickedDefaultIsAlive();
  215. afx_msg void OnChangeLooksAlive();
  216. afx_msg void OnChangeIsAlive();
  217. virtual BOOL OnInitDialog();
  218. afx_msg void OnClickedSpecifyLooksAlive();
  219. afx_msg void OnClickedSpecifyIsAlive();
  220. //}}AFX_MSG
  221. DECLARE_MESSAGE_MAP()
  222. }; //*** class CResourceAdvancedPage
  223. /////////////////////////////////////////////////////////////////////////////
  224. // CResourcePropSheet
  225. /////////////////////////////////////////////////////////////////////////////
  226. class CResourcePropSheet : public CBasePropertySheet
  227. {
  228. DECLARE_DYNAMIC(CResourcePropSheet)
  229. // Construction
  230. public:
  231. CResourcePropSheet(
  232. IN OUT CWnd * pParentWnd = NULL,
  233. IN UINT iSelectPage = 0
  234. );
  235. virtual BOOL BInit(
  236. IN OUT CClusterItem * pciCluster,
  237. IN IIMG iimgIcon
  238. );
  239. // Attributes
  240. protected:
  241. CBasePropertyPage * m_rgpages[3];
  242. // Pages
  243. CResourceGeneralPage m_pageGeneral;
  244. CResourceDependsPage m_pageDepends;
  245. CResourceAdvancedPage m_pageAdvanced;
  246. CResourceGeneralPage & PageGeneral(void) { return m_pageGeneral; }
  247. CResourceDependsPage & PageDepends(void) { return m_pageDepends; }
  248. CResourceAdvancedPage & PageAdvanced(void) { return m_pageAdvanced; }
  249. public:
  250. CResource * PciRes(void) const { return (CResource *) Pci(); }
  251. // Operations
  252. // Overrides
  253. protected:
  254. virtual CBasePropertyPage ** Ppages(void);
  255. virtual int Cpages(void);
  256. // ClassWizard generated virtual function overrides
  257. //{{AFX_VIRTUAL(CResourcePropSheet)
  258. //}}AFX_VIRTUAL
  259. // Implementation
  260. protected:
  261. // Generated message map functions
  262. //{{AFX_MSG(CResourcePropSheet)
  263. //}}AFX_MSG
  264. DECLARE_MESSAGE_MAP()
  265. }; //*** class CResourcePropSheet
  266. /////////////////////////////////////////////////////////////////////////////
  267. #endif // _RESPROP_H_