Leaked source code of windows server 2003
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.

126 lines
3.7 KiB

  1. // LeftView.h : interface of the CLeftView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_LEFTVIEW_H__8D2F8964_7AE2_4CB2_9FFB_03CF78C2C869__INCLUDED_)
  5. #define AFX_LEFTVIEW_H__8D2F8964_7AE2_4CB2_9FFB_03CF78C2C869__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. //
  10. // List of icon indices, used in the tree control
  11. //
  12. typedef enum
  13. {
  14. TREE_IMAGE_ROOT, // Client console tree root
  15. TREE_IMAGE_SERVER_ONLINE, // Online server
  16. TREE_IMAGE_SERVER_OFFLINE, // Offline server
  17. TREE_IMAGE_INCOMING, // Incoming folder
  18. TREE_IMAGE_INBOX, // Inbox folder
  19. TREE_IMAGE_OUTBOX_PAUSED, // The server's outgoing queue is paused
  20. TREE_IMAGE_OUTBOX_BLOCKED, // The server's outgoing queue is blocked
  21. TREE_IMAGE_OUTBOX, // Outbox folder
  22. TREE_IMAGE_SERVER_REFRESHING, // Refreshing server (connecting...)
  23. TREE_IMAGE_MAX
  24. } TreeIconType;
  25. class CLeftView : public CTreeView
  26. {
  27. protected: // create from serialization only
  28. CLeftView();
  29. DECLARE_DYNCREATE(CLeftView)
  30. // Attributes
  31. public:
  32. virtual ~CLeftView();
  33. CClientConsoleDoc* GetDocument();
  34. CFolderListView* GetCurrentView() { return m_pCurrentView; }
  35. BOOL CanRefreshFolder();
  36. DWORD RefreshCurrentFolder();
  37. DWORD OpenSelectColumnsDlg();
  38. BOOL CanOpenSelectColumnsDlg() { return m_pCurrentView ? TRUE : FALSE; }
  39. int GetDataCount();
  40. BOOL GetActivity(CString& cstr, HICON& hIcon);
  41. BOOL IsRemoteServerSelected();
  42. DWORD RemoveTreeItem(HTREEITEM hItem);
  43. DWORD SelectRoot();
  44. DWORD OpenHelpTopic();
  45. VOID SelectFolder (FolderType);
  46. DWORD RefreshImageList ();
  47. static CImageList m_ImageList; // Image list of tree icons
  48. #ifdef _DEBUG
  49. virtual void AssertValid() const;
  50. virtual void Dump(CDumpContext& dc) const;
  51. #endif
  52. // Overrides
  53. // ClassWizard generated virtual function overrides
  54. //{{AFX_VIRTUAL(CLeftView)
  55. public:
  56. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  57. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  58. protected:
  59. virtual void OnInitialUpdate(); // called first time after construct
  60. //}}AFX_VIRTUAL
  61. // Generated message map functions
  62. protected:
  63. //{{AFX_MSG(CLeftView)
  64. afx_msg void OnTreeSelChanged(NMHDR* pNMHDR, LRESULT* pResult);
  65. afx_msg void OnRightClick(NMHDR* pNMHDR, LRESULT* pResult);
  66. afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  67. //}}AFX_MSG
  68. DECLARE_MESSAGE_MAP()
  69. private:
  70. void GetServerState(BOOL& bRefreshing, DWORD& dwOffLineCount);
  71. DWORD
  72. SyncFolderNode (
  73. HTREEITEM hParent,
  74. BOOL bVisible,
  75. int iNodeStringResource,
  76. HTREEITEM hInsertAfter,
  77. TreeIconType iconNormal,
  78. TreeIconType iconSelected,
  79. LPARAM lparamNodeData,
  80. HTREEITEM &hNode
  81. );
  82. HTREEITEM FindNode (HTREEITEM hRoot, CString &cstrNodeString);
  83. HTREEITEM m_treeitemRoot; // Root fo tree
  84. CFolderListView* m_pCurrentView;
  85. int m_iLastActivityStringId;
  86. };
  87. #ifndef _DEBUG // debug version in LeftView.cpp
  88. inline CClientConsoleDoc* CLeftView::GetDocument()
  89. { return (CClientConsoleDoc*)m_pDocument; }
  90. #endif
  91. /////////////////////////////////////////////////////////////////////////////
  92. //{{AFX_INSERT_LOCATION}}
  93. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  94. #endif // !defined(AFX_LEFTVIEW_H__8D2F8964_7AE2_4CB2_9FFB_03CF78C2C869__INCLUDED_)