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.

171 lines
5.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. FTMan
  5. File Name:
  6. FTTreeVw.h
  7. Abstract:
  8. The definition of class CFTTreeView. It is a tree view displaying:
  9. - all logical volumes
  10. - all physical partitions that are not logical volumes
  11. existing in the system
  12. Author:
  13. Cristian Teodorescu October 20, 1998
  14. Notes:
  15. Revision History:
  16. --*/
  17. /////////////////////////////////////////////////////////////////////////////
  18. #if !defined(AFX_FTTREEVW_H__B83E0005_6873_11D2_A297_00A0C9063765__INCLUDED_)
  19. #define AFX_FTTREEVW_H__B83E0005_6873_11D2_A297_00A0C9063765__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "FTManDef.h"
  24. class CFTDocument;
  25. class CItemData;
  26. class CFTTreeView : public CTreeView
  27. {
  28. protected: // create from serialization only
  29. CFTTreeView();
  30. DECLARE_DYNCREATE(CFTTreeView)
  31. // Attributes
  32. public:
  33. CFTDocument* GetDocument();
  34. // Operations
  35. public:
  36. // Get the current snapshot of the tree ( what items are expanded, what items are selected )
  37. void GetSnapshot( TREE_SNAPSHOT& snaphshot );
  38. // Refresh the content of the tree given a certain snapshot ( items expanded, items selected )
  39. BOOL Refresh( TREE_SNAPSHOT& snapshot);
  40. // Refresh the content of the tree based on the current snapshot ( items expanded, items selected )
  41. BOOL Refresh();
  42. // Performs some minor refreshment for the tree items. This should be called every TIMER_ELAPSE milliseconds.
  43. void RefreshOnTimer();
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(CFTTreeView)
  47. public:
  48. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  49. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  50. protected:
  51. virtual void OnInitialUpdate(); // called first time after construct
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. public:
  55. virtual ~CFTTreeView();
  56. #ifdef _DEBUG
  57. virtual void AssertValid() const;
  58. virtual void Dump(CDumpContext& dc) const;
  59. #endif
  60. protected:
  61. // Insert item
  62. HTREEITEM InsertItem(CItemData* pData, HTREEITEM hParent, HTREEITEM hInsertAfter );
  63. // Refresh item ( redisplay the item according with the information contained by its lParam which is a CItemData* )
  64. BOOL RefreshItem( HTREEITEM hItem );
  65. // Query for the members of an item and add them to the tree
  66. BOOL AddItemMembers(HTREEITEM hItem);
  67. // Delete a subtree ( with or wihout its root )
  68. BOOL DeleteItemSubtree(HTREEITEM hItem, BOOL bDeleteSubtreeRoot=TRUE);
  69. // Delete all items of the tree
  70. BOOL DeleteAllItems();
  71. // Add the subtree current status ( items expanded and selected ) to the tree current status
  72. void AddSubtreeSnapshot( HTREEITEM hSubtreeRoot, TREE_SNAPSHOT& snapshot );
  73. // Expand and select items in a subtree given a pattern
  74. BOOL RefreshSubtree( HTREEITEM hSubtreeRoot, TREE_SNAPSHOT& snapshot );
  75. // Scan a subtree for:
  76. // 1. Initializing stripe sets with parity that are not initializing anymore
  77. // 2. Regenerating mirror sets or stripe sets with parity that are not regenerating anymore
  78. // 3. Root volumes whose drive letter and volume name were eventually found
  79. void ScanSubtreeOnTimer( HTREEITEM hSubtreeRoot, CObArray& arrRefreshedItems, CWordArray& arrRefreshFlags);
  80. // Get all selected items in the given array ( array of CItemData ). Usually is only one item selected in a tree ctrl
  81. void GetSelectedItems( CObArray& arrSelectedItems );
  82. protected:
  83. // The popup menu that appears when the user clicks the mouse right button is the first popup
  84. // of the following menu
  85. CMenu m_menuPopup;
  86. // Generated message map functions
  87. protected:
  88. //{{AFX_MSG(CFTTreeView)
  89. afx_msg void OnDestroy();
  90. afx_msg void OnItemExpanding(NMHDR* pNMHDR, LRESULT* pResult);
  91. afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
  92. afx_msg void OnItemExpand();
  93. afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
  94. afx_msg void OnViewUp();
  95. afx_msg void OnUpdateViewUp(CCmdUI* pCmdUI);
  96. afx_msg void OnActionAssign();
  97. afx_msg void OnUpdateActionAssign(CCmdUI* pCmdUI);
  98. afx_msg void OnActionFtbreak();
  99. afx_msg void OnUpdateActionFtbreak(CCmdUI* pCmdUI);
  100. afx_msg void OnActionCreateExtendedPartition();
  101. afx_msg void OnUpdateActionCreateExtendedPartition(CCmdUI* pCmdUI);
  102. afx_msg void OnActionCreatePartition();
  103. afx_msg void OnUpdateActionCreatePartition(CCmdUI* pCmdUI);
  104. afx_msg void OnActionDelete();
  105. afx_msg void OnUpdateActionDelete(CCmdUI* pCmdUI);
  106. afx_msg void OnActionFtinit();
  107. afx_msg void OnUpdateActionFtinit(CCmdUI* pCmdUI);
  108. afx_msg void OnActionFtswap();
  109. afx_msg void OnUpdateActionFtswap(CCmdUI* pCmdUI);
  110. //}}AFX_MSG
  111. // Status bar indicators handlers
  112. afx_msg void OnUpdateIndicatorName(CCmdUI* pCmdUI);
  113. afx_msg void OnUpdateIndicatorType(CCmdUI* pCmdUI);
  114. afx_msg void OnUpdateIndicatorDisks(CCmdUI* pCmdUI);
  115. afx_msg void OnUpdateIndicatorSize(CCmdUI* pCmdUI);
  116. afx_msg void OnUpdateIndicatorNothing(CCmdUI* pCmdUI);
  117. DECLARE_MESSAGE_MAP()
  118. // MainFrame must have access to method OnCmdMsg which is still protected in MFC 4.2
  119. friend class CMainFrame;
  120. // Retrieves the set of disks whose volumes cannot be used as replacements for a
  121. // certain volume in a logical volume set ( stripe, mirror, stripe with parity, volume set )
  122. // The function uses the volume hierarchy of the ( left pane )tree view
  123. friend void GetVolumeReplacementForbiddenDisksSet( CFTTreeView* pTreeView, CItemData* pVolumeData,
  124. CULONGSet& setDisks );
  125. };
  126. #ifndef _DEBUG // debug version in FTTreeVw.cpp
  127. inline CFTDocument* CFTTreeView::GetDocument()
  128. { return (CFTDocument*)m_pDocument; }
  129. #endif
  130. /////////////////////////////////////////////////////////////////////////////
  131. //{{AFX_INSERT_LOCATION}}
  132. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  133. #endif // !defined(AFX_FTTREEVW_H__B83E0005_6873_11D2_A297_00A0C9063765__INCLUDED_)