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.

169 lines
4.9 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. FTMan
  5. File Name:
  6. FTListVw.h
  7. Abstract:
  8. The definition of class CFTListView. It is a list view displaying all members of a volume
  9. Author:
  10. Cristian Teodorescu October 20, 1998
  11. Notes:
  12. Revision History:
  13. --*/
  14. /////////////////////////////////////////////////////////////////////////////
  15. #if !defined(AFX_FTLISTVW_H__B83E0003_6873_11D2_A297_00A0C9063765__INCLUDED_)
  16. #define AFX_FTLISTVW_H__B83E0003_6873_11D2_A297_00A0C9063765__INCLUDED_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif // _MSC_VER > 1000
  20. #include "FTManDef.h"
  21. class CItemData;
  22. class CFTDocument;
  23. class CFTListView : public CListView
  24. {
  25. protected: // create from serialization only
  26. CFTListView();
  27. DECLARE_DYNCREATE(CFTListView)
  28. // Attributes
  29. public:
  30. CFTDocument* GetDocument();
  31. // Operations
  32. public:
  33. // Overrides
  34. // ClassWizard generated virtual function overrides
  35. //{{AFX_VIRTUAL(CFTListView)
  36. public:
  37. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  38. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  39. protected:
  40. virtual void OnInitialUpdate(); // called first time after construct
  41. //}}AFX_VIRTUAL
  42. // Implementation
  43. public:
  44. virtual ~CFTListView();
  45. // Get the current status of the list ( what items are selected )
  46. void GetSnapshot( LIST_SNAPSHOT& snaphshot );
  47. // Set the snapshot of the list ( what items must be selected )
  48. void SetSnapshot( LIST_SNAPSHOT& snapshot );
  49. // Fill the list view with all children of the given item. Take this children from the tree view
  50. BOOL SynchronizeMembersWithTree( CItemData* pParentData );
  51. // Refresh item ( redisplay the item according with the information contained by its lParam which is a CItemData* )
  52. // WARNING: Now it only redisplays the name of the item !!!!
  53. BOOL RefreshItem( int iItem );
  54. // Display the names of items in extended format ( name + type ) when bExtended is TRUE
  55. // Otherwise display the names in reduced format
  56. void DisplayItemsExtendedNames( BOOL bExtended = TRUE );
  57. #ifdef _DEBUG
  58. virtual void AssertValid() const;
  59. virtual void Dump(CDumpContext& dc) const;
  60. #endif
  61. protected:
  62. // Get focused item
  63. int GetFocusedItem() const;
  64. // Set focused item
  65. BOOL SetFocusedItem( int iItem );
  66. // Select / Deselect a given item
  67. BOOL SelectItem( int iItem, BOOL bSelect=TRUE );
  68. // Retrieve the data structure associated with the item
  69. CItemData* GetItemData( int iItem );
  70. // Add a new item at the end of the list given a CItemData instance
  71. BOOL AddItem( CItemData* pData );
  72. // Repopulate the list by adding all members of m_pParentData from the tree
  73. BOOL AddMembersFromTree();
  74. // Fill the list view with all members of the given item
  75. // It causes also the expandation of the parent item in the tree view ( if it is not expanded )
  76. // and the selection of the given item in the tree view
  77. BOOL ExpandItem(int iItem);
  78. // Get all selected items in the given array ( array of CItemData )
  79. void GetSelectedItems( CObArray& arrSelectedItems );
  80. protected:
  81. // Structure containing info related to the parent of the members displayed by the list view
  82. CItemData* m_pParentData;
  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(CFTListView)
  89. afx_msg void OnDestroy();
  90. afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
  91. afx_msg void OnItemExpand();
  92. afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
  93. afx_msg void OnActionAssign();
  94. afx_msg void OnUpdateActionAssign(CCmdUI* pCmdUI);
  95. afx_msg void OnActionFtbreak();
  96. afx_msg void OnUpdateActionFtbreak(CCmdUI* pCmdUI);
  97. afx_msg void OnActionCreateExtendedPartition();
  98. afx_msg void OnUpdateActionCreateExtendedPartition(CCmdUI* pCmdUI);
  99. afx_msg void OnActionCreatePartition();
  100. afx_msg void OnUpdateActionCreatePartition(CCmdUI* pCmdUI);
  101. afx_msg void OnActionDelete();
  102. afx_msg void OnUpdateActionDelete(CCmdUI* pCmdUI);
  103. afx_msg void OnActionFtinit();
  104. afx_msg void OnUpdateActionFtinit(CCmdUI* pCmdUI);
  105. afx_msg void OnActionFtmirror();
  106. afx_msg void OnUpdateActionFtmirror(CCmdUI* pCmdUI);
  107. afx_msg void OnActionFtstripe();
  108. afx_msg void OnUpdateActionFtstripe(CCmdUI* pCmdUI);
  109. afx_msg void OnActionFtswap();
  110. afx_msg void OnUpdateActionFtswap(CCmdUI* pCmdUI);
  111. afx_msg void OnActionFtswp();
  112. afx_msg void OnUpdateActionFtswp(CCmdUI* pCmdUI);
  113. afx_msg void OnActionFtvolset();
  114. afx_msg void OnUpdateActionFtvolset(CCmdUI* pCmdUI);
  115. //}}AFX_MSG
  116. afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
  117. DECLARE_MESSAGE_MAP()
  118. };
  119. #ifndef _DEBUG // debug version in FTListVw.cpp
  120. inline CFTDocument* CFTListView::GetDocument()
  121. { return (CFTDocument*)m_pDocument; }
  122. #endif
  123. /////////////////////////////////////////////////////////////////////////////
  124. //{{AFX_INSERT_LOCATION}}
  125. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  126. #endif // !defined(AFX_FTLISTVW_H__B83E0003_6873_11D2_A297_00A0C9063765__INCLUDED_)