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.

184 lines
6.1 KiB

  1. /*******************************************************************************
  2. *
  3. * treeview.h
  4. *
  5. * - declarations for the CAdminTreeView class
  6. * - the CAdminTreeView class lives in the left pane of the mainframe's splitter
  7. * - derived from CTreeView
  8. *
  9. * copyright notice: Copyright 1997, Citrix Systems Inc.
  10. * Copyright (c) 1998 - 1999 Microsoft Corporation
  11. *
  12. * $Author: donm $ Don Messerli
  13. *
  14. * $Log: N:\nt\private\utils\citrix\winutils\tsadmin\VCS\treeview.h $
  15. *
  16. * Rev 1.6 19 Feb 1998 17:42:36 donm
  17. * removed latest extension DLL support
  18. *
  19. * Rev 1.4 19 Jan 1998 16:49:24 donm
  20. * new ui behavior for domains and servers
  21. *
  22. * Rev 1.3 03 Nov 1997 15:21:42 donm
  23. * added Domains
  24. *
  25. * Rev 1.2 13 Oct 1997 18:42:02 donm
  26. * update
  27. *
  28. * Rev 1.9 29 Jul 1997 10:11:48 butchd
  29. * update
  30. *
  31. * Rev 1.8 14 Mar 1997 17:13:24 donm
  32. * update
  33. *
  34. * Rev 1.7 11 Mar 1997 17:26:10 donm
  35. * update
  36. *
  37. * Rev 1.6 26 Feb 1997 15:29:34 donm
  38. * update
  39. *
  40. * Rev 1.5 14 Feb 1997 08:57:46 donm
  41. * update
  42. *
  43. * Rev 1.4 04 Feb 1997 18:13:58 donm
  44. * update
  45. *
  46. * Rev 1.3 03 Feb 1997 16:35:40 donm
  47. * update
  48. *
  49. * Rev 1.2 29 Jan 1997 18:39:02 donm
  50. * update
  51. *******************************************************************************/
  52. #ifndef _TREEVIEW_H
  53. #define _TREEVIEW_H
  54. #include "afxcview.h"
  55. #include "basetree.h"
  56. ///////////////////////
  57. // CLASS: CAdminTreeView
  58. //
  59. class CAdminTreeView : public CBaseTreeView
  60. {
  61. friend class CTreeTabCtrl;
  62. friend class CLeftPane;
  63. protected:
  64. CAdminTreeView(); // protected constructor used by dynamic creation
  65. DECLARE_DYNCREATE(CAdminTreeView)
  66. // Attributes
  67. protected:
  68. int m_idxBlank; // index of Blank icon image
  69. int m_idxCitrix; // index of Citrix icon image
  70. int m_idxServer; // index of Server icon image
  71. int m_idxConsole; // index of Console icon image
  72. int m_idxNet; // index of Net icon image
  73. int m_idxNotSign; // index of Not Sign overlay (for non-sane servers)
  74. int m_idxQuestion; // index of Question Mark overlay (for non-opened servers)
  75. int m_idxUser; // index of User icon image
  76. int m_idxAsync; // index of Async icon image (modem)
  77. int m_idxCurrentServer; // index of Current Server image
  78. int m_idxCurrentNet; // index of Current Net image
  79. int m_idxCurrentConsole;// index of Current Console image
  80. int m_idxCurrentAsync; // index of Current Async image
  81. int m_idxDirectAsync; // index of Direct Async image
  82. int m_idxCurrentDirectAsync; // index of Current Direct Async image
  83. int m_idxDomain; // index of Domain image
  84. int m_idxCurrentDomain; // index of Current Domain image
  85. int m_idxDomainNotConnected; // index of Domain Not Connected image
  86. int m_idxServerNotConnected; // index of Server Not Connected image
  87. CImageList *m_pimgDragList;
  88. HTREEITEM m_hDragItem;
  89. UINT_PTR m_nTimer;
  90. // Operations
  91. public:
  92. protected:
  93. private:
  94. // Builds the image list
  95. virtual void BuildImageList();
  96. // Add the WinStations attached to a particular Server
  97. void AddServerChildren(HTREEITEM hServer, CServer *pServer , NODETYPE );
  98. // Add a Domain to the tree
  99. HTREEITEM AddDomainToTree(CDomain *pDomain);
  100. // Determines what text to use for a WinStation in the tree
  101. void DetermineWinStationText(CWinStation *pWinStation, TCHAR *text);
  102. // Determines which icon to use for a WinStation in the tree
  103. int DetermineWinStationIcon(CWinStation *pWinStation);
  104. // Determine which icon to use for a Domain in the tree
  105. int DetermineDomainIcon(CDomain *pDomain);
  106. // Determine which icon to use for a Server in the tree
  107. int DetermineServerIcon(CServer *pServer);
  108. BOOL ConnectToServer(CTreeCtrl* tree, HTREEITEM* hItem);
  109. // Overrides
  110. // ClassWizard generated virtual function overrides
  111. //{{AFX_VIRTUAL(CAdminTreeView)
  112. public:
  113. // virtual void OnInitialUpdate();
  114. protected:
  115. // virtual void OnDraw(CDC* pDC); // overridden to draw this view
  116. // virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  117. //}}AFX_VIRTUAL
  118. // Implementation
  119. protected:
  120. virtual ~CAdminTreeView();
  121. #ifdef _DEBUG
  122. virtual void AssertValid() const;
  123. virtual void Dump(CDumpContext& dc) const;
  124. #endif
  125. LRESULT UpdateServerTreeNodeState( HTREEITEM , CServer * , NODETYPE );
  126. LRESULT RemoveWinstation( HTREEITEM , CWinStation * );
  127. LRESULT UpdateWinStation( HTREEITEM , CWinStation * );
  128. LRESULT AddWinStation( CWinStation * , HTREEITEM , BOOL , NODETYPE );
  129. // Generated message map functions
  130. protected:
  131. //{{AFX_MSG(CAdminTreeView)
  132. afx_msg LRESULT OnAdminAddServer(WPARAM wParam, LPARAM lParam);
  133. afx_msg LRESULT OnAdminRemoveServer(WPARAM wParam, LPARAM lParam);
  134. afx_msg LRESULT OnAdminUpdateServer(WPARAM wParam, LPARAM lParam);
  135. afx_msg LRESULT OnAdminAddWinStation(WPARAM wParam, LPARAM lParam);
  136. afx_msg LRESULT OnAdminUpdateWinStation(WPARAM wParam, LPARAM lParam);
  137. afx_msg LRESULT OnAdminRemoveWinStation(WPARAM wParam, LPARAM lParam);
  138. afx_msg LRESULT OnAdminUpdateDomain(WPARAM wParam, LPARAM lParam);
  139. afx_msg LRESULT OnAdminAddDomain(WPARAM wParam, LPARAM lParam);
  140. afx_msg LRESULT OnAdminViewsReady(WPARAM wParam, LPARAM lParam);
  141. afx_msg LRESULT OnAdminAddServerToFavs( WPARAM , LPARAM );
  142. afx_msg LRESULT OnAdminRemoveServerFromFavs( WPARAM , LPARAM );
  143. afx_msg LRESULT OnAdminGotoServer( WPARAM , LPARAM );
  144. afx_msg LRESULT OnAdminDelFavServer( WPARAM wp , LPARAM lp );
  145. afx_msg LRESULT OnGetTVStates( WPARAM , LPARAM );
  146. afx_msg LRESULT OnUpdateTVState( WPARAM , LPARAM );
  147. afx_msg LRESULT OnEmptyFavorites( WPARAM , LPARAM );
  148. afx_msg LRESULT OnIsFavListEmpty( WPARAM , LPARAM );
  149. afx_msg LRESULT OnAdminConnectToServer( WPARAM , LPARAM );
  150. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  151. afx_msg void OnRClick(NMHDR* pNMHDR, LRESULT* pResult);
  152. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  153. afx_msg void OnEnterKey( );
  154. afx_msg void OnSetFocus( CWnd *pOld );
  155. afx_msg void OnBeginDrag( NMHDR * , LRESULT * );
  156. afx_msg void OnLButtonUp( UINT , CPoint );
  157. afx_msg void OnMouseMove( UINT , CPoint );
  158. afx_msg void OnTimer( UINT nIDEvent );
  159. //}}AFX_MSG
  160. DECLARE_MESSAGE_MAP()
  161. }; // end class CAdminTreeView
  162. #endif // _TREEVIEW_H