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.

216 lines
6.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusDoc.h
  7. //
  8. // Abstract:
  9. // Definition of the CClusterDoc class.
  10. //
  11. // Implementation File:
  12. // ClusDoc.cpp
  13. //
  14. // Author:
  15. // David Potter (davidp) May 1, 1996
  16. //
  17. // Revision History:
  18. //
  19. // Notes:
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. #ifndef _CLUSDOC_H_
  23. #define _CLUSDOC_H_
  24. /////////////////////////////////////////////////////////////////////////////
  25. // Include Files
  26. /////////////////////////////////////////////////////////////////////////////
  27. #ifndef _NODE_H_
  28. #include "Node.h" // for CNodeList
  29. #endif
  30. #ifndef _GROUP_H_
  31. #include "Group.h" // for CGroupList
  32. #endif
  33. #ifndef _RES_H_
  34. #include "Res.h" // for CResourceList
  35. #endif
  36. #ifndef _RESTYPE_H_
  37. #include "ResType.h" // for CResourceTypeList
  38. #endif
  39. #ifndef _NETWORK_H_
  40. #include "Network.h" // for CNetworkList
  41. #endif
  42. #ifndef _NETIFACE_H_
  43. #include "NetIFace.h" // for CNetInterfaceList
  44. #endif
  45. #ifndef _TREEITEM_H_
  46. #include "TreeItem.h" // for CTreeItem
  47. #endif
  48. #ifndef _NOTIFY_H_
  49. #include "Notify.h" // for CClusterNotifyKeyList
  50. #endif
  51. /////////////////////////////////////////////////////////////////////////////
  52. // Forward Class Declarations
  53. /////////////////////////////////////////////////////////////////////////////
  54. class CClusterDoc;
  55. /////////////////////////////////////////////////////////////////////////////
  56. // External Class Declarations
  57. /////////////////////////////////////////////////////////////////////////////
  58. class CClusterNotify;
  59. /////////////////////////////////////////////////////////////////////////////
  60. // Type Definitions
  61. /////////////////////////////////////////////////////////////////////////////
  62. /////////////////////////////////////////////////////////////////////////////
  63. // class CClusterDoc
  64. /////////////////////////////////////////////////////////////////////////////
  65. class CClusterDoc : public CDocument
  66. {
  67. friend class CCluster;
  68. friend class CClusterTreeView;
  69. friend class CClusterListView;
  70. friend class CCreateResourceWizard;
  71. protected: // create from serialization only
  72. CClusterDoc(void);
  73. DECLARE_DYNCREATE(CClusterDoc)
  74. // Attributes
  75. protected:
  76. CString m_strName;
  77. CString m_strNode;
  78. HCLUSTER m_hcluster;
  79. HKEY m_hkeyCluster;
  80. CCluster * m_pciCluster;
  81. CTreeItem * m_ptiCluster;
  82. CNodeList m_lpciNodes;
  83. CGroupList m_lpciGroups;
  84. CResourceList m_lpciResources;
  85. CResourceTypeList m_lpciResourceTypes;
  86. CNetworkList m_lpciNetworks;
  87. CNetInterfaceList m_lpciNetInterfaces;
  88. CClusterItemList m_lpciToBeDeleted;
  89. BOOL m_bClusterAvailable;
  90. public:
  91. const CString & StrName(void) const { return m_strName; }
  92. const CString & StrNode(void) const { return m_strNode; }
  93. HCLUSTER Hcluster(void) const { return m_hcluster; }
  94. HKEY HkeyCluster(void) const { return m_hkeyCluster; }
  95. CCluster * PciCluster(void) const { return m_pciCluster; }
  96. CTreeItem * PtiCluster(void) const { return m_ptiCluster; }
  97. CNodeList & LpciNodes(void) { return m_lpciNodes; }
  98. CGroupList & LpciGroups(void) { return m_lpciGroups; }
  99. CResourceTypeList & LpciResourceTypes(void) { return m_lpciResourceTypes; }
  100. CResourceList & LpciResources(void) { return m_lpciResources; }
  101. CNetworkList & LpciNetworks(void) { return m_lpciNetworks; }
  102. CNetInterfaceList & LpciNetInterfaces(void) { return m_lpciNetInterfaces; }
  103. CClusterItemList & LpciToBeDeleted(void) { return m_lpciToBeDeleted; }
  104. BOOL BClusterAvailable(void) const { return m_bClusterAvailable; }
  105. // Operations
  106. public:
  107. void UpdateTitle(void);
  108. void Refresh(void) { OnCmdRefresh(); }
  109. // Overrides
  110. public:
  111. // ClassWizard generated virtual function overrides
  112. //{{AFX_VIRTUAL(CClusterDoc)
  113. public:
  114. virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
  115. virtual void SetPathName(LPCTSTR lpszPathName, BOOL bAddToMRU = TRUE);
  116. virtual void DeleteContents();
  117. virtual void OnCloseDocument();
  118. virtual void OnChangedViewList();
  119. //}}AFX_VIRTUAL
  120. void OnSelChanged(IN CClusterItem * pciSelected);
  121. LRESULT OnClusterNotify(IN OUT CClusterNotify * pnotify);
  122. void SaveSettings(void);
  123. // Implementation
  124. public:
  125. virtual ~CClusterDoc(void);
  126. #ifdef _DEBUG
  127. virtual void AssertValid(void) const;
  128. virtual void Dump(CDumpContext& dc) const;
  129. #endif
  130. protected:
  131. void OnOpenDocumentWorker(LPCTSTR lpszPathName);
  132. void BuildBaseHierarchy(void);
  133. void CollectClusterItems(void) ;
  134. ID IdProcessNewObjectError(IN OUT CException * pe);
  135. void AddDefaultColumns(IN OUT CTreeItem * pti);
  136. CClusterNode * PciAddNewNode(IN LPCTSTR pszName);
  137. CGroup * PciAddNewGroup(IN LPCTSTR pszName);
  138. CResource * PciAddNewResource(IN LPCTSTR pszName);
  139. CResourceType * PciAddNewResourceType(IN LPCTSTR pszName);
  140. CNetwork * PciAddNewNetwork(IN LPCTSTR pszName);
  141. CNetInterface * PciAddNewNetInterface(IN LPCTSTR pszName);
  142. void InitNodes(void);
  143. void InitGroups(void);
  144. void InitResources(void);
  145. void InitResourceTypes(void);
  146. void InitNetworks(void);
  147. void InitNetInterfaces(void);
  148. BOOL m_bUpdateFrameNumber;
  149. BOOL m_bInitializing;
  150. BOOL m_bIgnoreErrors;
  151. // This menu stuff allows the menu to change depending on what
  152. // kind of object is currently selected.
  153. HMENU m_hmenuCluster;
  154. HMENU m_hmenuNode;
  155. HMENU m_hmenuGroup;
  156. HMENU m_hmenuResource;
  157. HMENU m_hmenuResType;
  158. HMENU m_hmenuNetwork;
  159. HMENU m_hmenuNetIFace;
  160. HMENU m_hmenuCurrent;
  161. IDM m_idmCurrentMenu;
  162. virtual HMENU GetDefaultMenu(void);
  163. void ProcessRegNotification(IN const CClusterNotify * pnotify);
  164. // Generated message map functions
  165. protected:
  166. //{{AFX_MSG(CClusterDoc)
  167. afx_msg void OnCmdNewGroup();
  168. afx_msg void OnCmdNewResource();
  169. afx_msg void OnCmdNewNode();
  170. afx_msg void OnCmdConfigApp();
  171. afx_msg void OnCmdRefresh();
  172. //}}AFX_MSG
  173. DECLARE_MESSAGE_MAP()
  174. }; //*** class CClusterDoc
  175. /////////////////////////////////////////////////////////////////////////////
  176. #endif // _CLUSDOC_H_