TreeForFtp.h
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:2k
源码类别:

网格计算

开发平台:

Visual C++

  1. // TreeForFtp.h : header file
  2. #ifndef _TREE_FOR_FTPVIEW_H
  3. #define _TREE_FOR_FTPVIEW_H
  4. #include "FtpPublic.h"
  5. #include "FtpWorker.h"
  6. class CTreeForFtp : public CTreeCtrl
  7. {
  8. // Construction
  9. public:
  10. CTreeForFtp();
  11. // Attributes
  12. public:
  13. // Operations
  14. public:
  15. BOOL ExistsConnection(void);
  16. BOOL IsConnectingState(void);
  17. BOOL RefreshContents(void);
  18. CString GetNodeFTPDir(HTREEITEM hNode);
  19. void GetCurOpendFtpSite(CFtpSite &oFtpSite);
  20. CString MakeLocalFileName(LPCSTR lpszFtpDir, LPCSTR lpszFtpFileName);
  21. BOOL DownloadFile(LPREMOTEFILEINFO lpRemoteFile,
  22.  LPCSTR lpszLocalFileName);
  23. static DWORD CALLBACK Routine_ConnectFtpSvr(LPVOID lpParameters);
  24. // Overrides
  25. // ClassWizard generated virtual function overrides
  26. //{{AFX_VIRTUAL(CTreeForFtp)
  27. //}}AFX_VIRTUAL
  28. // Implementation
  29. public:
  30. virtual ~CTreeForFtp();
  31. // Generated message map functions
  32. protected:
  33. //{{AFX_MSG(CTreeForFtp)
  34. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  35. afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
  36. //}}AFX_MSG
  37. afx_msg void OnRefreshView();
  38. afx_msg void OnConnectFtpSvr();
  39. afx_msg void OnDisConnectFtpSvr();
  40. DECLARE_MESSAGE_MAP()
  41. protected:
  42. //get current clicked tree node's ftp-site info.
  43. //if nothing selected then return false.
  44. BOOL GetCurClickedFtpNodeInfo(CFtpSite &oFtpSite, HTREEITEM &hnode);
  45. //disconnect with remote ftp-server event.
  46. void OnDisconnectFtp(void);
  47. protected:
  48. CImageList m_imgTree; //tree's image list object.
  49. CFtpWorker m_oFtpWorker; //ftp-worker object.
  50. BOOL m_bIsConnecting;//flag that ftp worker is in connecting state.
  51. };
  52. #endif // !_TREE_FOR_FTPVIEW_H