genericinternetview.h
资源名称:warftpd.zip [点击查看]
上传用户:surprise9
上传日期:2007-01-04
资源大小:426k
文件大小:5k
源码类别:
Ftp客户端
开发平台:
Visual C++
- // GenericInternetView.h : header file
- //
- class CCaptionBar;
- class CDaemonInfo;
- class CFileProperties;
- class CGenericInternetView;
- class CGenericRemote;
- enum // FTP States
- {
- FTPS_NOT_CONNECTED,
- FTPS_DISCONNECTED,
- FTPS_CONNECTING,
- FTPS_POLL_CONNECT,
- FTPS_CONNECTED,
- FTPS_CWD,
- FTPS_PWD,
- FTPS_LIST,
- FTPS_IDLE,
- FTPS_STOR,
- FTPS_RECV,
- FTPS_DELETE,
- FTPS_VIEW,
- FTPS_HOLD, // General one-step command
- FTPS_INDEX,
- FTPS_INVALID
- };
- /////////////////////////////////////////////////////////////////////////////
- // CGenericInternetView view
- class DLL_WAR_CLIENT_ CGenericInternetView : public CListViewEx
- {
- protected:
- CGenericInternetView(); // protected constructor used by dynamic creation
- public:
- void SetListMode(int Mode);
- void SortItems(int iMode);
- static int CALLBACK LocalViewListCmp(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
- void UpdateUrl();
- BOOL Connect();
- CDaemonInfo *GetDaemonInfo();
- BOOL ListDir();
- BOOL ListLocalDir();
- static CString MkDOSPathWithPattern(LPCSTR Path, LPCSTR Pattern);
- BOOL UpdateDirList(CLinkedList& DirList);
- CString GetFlags(CFileProperties *pInfo);
- int GetImageIndex(CFileProperties *pInfo);
- BOOL ChDir(LPCSTR Path);
- void OnFailedToConnect(int nErrorCode = -1);
- void LogConnMsg(int LogType, int msgID, ...);
- void OnDisconnect(BOOL DoPoll = FALSE, BOOL AlsoOtherSide = FALSE);
- void OnConnect();
- void Process();
- void ProcessFTP();
- LONG OnProcess(WPARAM WParam, LPARAM LParam);
- LONG OnWmuCommand(WPARAM WParam, LPARAM LParam);
- BOOL CdUp();
- void ResetFileList();
- void OnDnsResolved(int nErrorCode, CDNSLookup *pDNS);
- BOOL OnInetLogin(long IPnum);
- BOOL MkValidPath(CString& cPath, CGenericInternetView *pTellHim = NULL);
- BOOL SendFiles(CFileProperties **ppFP, BOOL DoSend = FALSE, CGenericInternetView *FromPane = NULL);
- BOOL IsReady();
- CFileProperties **GetSelectedFiles(BOOL TestOnly = FALSE);
- BOOL GetFileSize(CGenericRemote *pRI);
- BOOL IsOnline();
- void Disconnect(BOOL DoPoll = FALSE);
- BOOL DoConnect();
- void OnAbort();
- BOOL PrepereForNewCommand();
- CString GetPath();
- void AddPathToHistory(LPCSTR Path);
- void ProcessLocal();
- void CreateDirectory(LPCSTR Path);
- void UpdateImage(BOOL DoOtherSideToo = TRUE);
- void OnIdle();
- BOOL AddToFileXmits(CGenericRemote *pRemote);
- DECLARE_DYNCREATE(CGenericInternetView)
- // Attributes
- public:
- CImageList *m_ImgSmall, *m_ImgLarge;
- int m_LocalSortMode;
- int m_LocalListMode;
- int m_TimerID;
- CString m_RemoteIP;
- CLogView *m_LogWin, *m_OtherSideLogWin;
- CGenericRemote *m_Server;
- CString m_URL;
- CEdit *m_URLcaption;
- int m_ViewNum; // 0 = left, 1 = right
- CString m_Path;
- CLinkedList m_DirList;
- int m_State;
- BOOL m_Virgin;
- CGenericInternetView *m_OtherSide;
- BOOL m_IsLocal;
- CString m_TimeFmt; // Time format mask
- HICON m_SvrIcon;
- HCURSOR m_WaitCursor;
- HCURSOR m_OfflineCursor;
- HCURSOR m_ConnectingCursor;
- CLinkedList m_PathHistory;
- CFileProperties **m_pFP;
- int m_pFPIndex;
- CBitmap m_StateImage[FTPS_INVALID];
- CWarTimer m_PollTimer;
- int m_PollRetryNum;
- BOOL m_HasPollDisconnected;
- BOOL m_UseFirewall;
- CString m_RealFTPAddress;
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CGenericInternetView)
- public:
- virtual void OnInitialUpdate();
- protected:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- virtual ~CGenericInternetView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- // Generated message map functions
- protected:
- //{{AFX_MSG(CGenericInternetView)
- afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnViewSortAscending();
- afx_msg void OnViewSortBydate();
- afx_msg void OnViewSortByname();
- afx_msg void OnViewSortBysize();
- afx_msg void OnViewSortBytype();
- afx_msg void OnViewSortDescending();
- afx_msg void OnMenuModeLargeicons();
- afx_msg void OnMenuModeList();
- afx_msg void OnMenuModeSmallicons();
- afx_msg void OnMenuModeWide();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnMenuDownload();
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg void OnMenuRefresh();
- afx_msg void OnUpdateMenuRefresh(CCmdUI* pCmdUI);
- afx_msg void OnMenuPaneproperties();
- afx_msg void OnCdup();
- afx_msg void OnUpdateCdup(CCmdUI* pCmdUI);
- afx_msg void OnUpdateMenuDownload(CCmdUI* pCmdUI);
- afx_msg void OnMenuAbort();
- afx_msg void OnUpdateMenuAbort(CCmdUI* pCmdUI);
- afx_msg void OnMenuDelete();
- afx_msg void OnUpdateMenuDelete(CCmdUI* pCmdUI);
- afx_msg void OnMenuMakedirectorymkdir();
- afx_msg void OnUpdateMenuMakedirectorymkdir(CCmdUI* pCmdUI);
- afx_msg void OnDestroy();
- afx_msg void OnDropFiles(HDROP hDropInfo);
- afx_msg void OnShowindex();
- afx_msg void OnUpdateShowindex(CCmdUI* pCmdUI);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- #define LVM_STORE 0x10000000 // Final message from an operation.
- #define LVM_PING 0x20000000 // Ping