CategoryDownload.h
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:3k
源码类别:

P2P编程

开发平台:

Visual C++

  1. #if !defined(AFX_CATEGORYDOWNLOAD1_H__AF6C036C_6396_4F82_A69B_6C8A790B43C5__INCLUDED_)
  2. #define AFX_CATEGORYDOWNLOAD1_H__AF6C036C_6396_4F82_A69B_6C8A790B43C5__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // CategoryDownload1.h : header file
  7. //
  8. #include "FileDB.h"
  9. #include "DownloadEngine.h"
  10. #include "CategoryFileDB.h"
  11. class CFilesListCtrl;
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CCategoryDownload window
  14. class CCategoryDownload : public CCategoryFileDB
  15. {
  16. // Construction
  17. public:
  18. CCategoryDownload();
  19. // Attributes
  20. public:
  21. bool IsDownloading();
  22. bool IsMovingFiles();
  23. void SetFilesListCtrl(CFilesListCtrl* pFilesListCtrl);
  24. void GetRateTotals(long& lUpRate, long& lDownRate);
  25. // Operations
  26. public:
  27. void PauseDBFiles(CFileDBItem* pFileDBItem);
  28. void StopAllCompleteds();
  29. void StopDBFiles(vector<CFileDBItem*> vToStopFileDBItems);
  30. bool StopDBFilesMoveComplete(CFileDBItem* pFileDBItem);
  31. bool Download(CTreeCursor curItem, CFileDBItem* pFileDBItem);
  32. bool FileDBItemRestore(CFileDBItem* pFileDBItem);
  33. bool FileDBItemMovetoArray(CTreeCursor curSrc, CTreeCursor curTarget, vector<CFileDBItem*>& vFileDBItem);
  34. bool FileDBItemMoveto(CTreeCursor curSrc, CTreeCursor curTarget, CFileDBItem* pFileDBItem, bool bMoveFile, bool bMoveCategory);
  35. bool DeleteDBFile(CTreeCursor curCategory, CFileDBItem* pFileDBItem, bool bForceDelete, bool bDelUncompleted, bool bDelCompleted);
  36. // Overrides
  37. // ClassWizard generated virtual function overrides
  38. //{{AFX_VIRTUAL(CCategoryDownload)
  39. //}}AFX_VIRTUAL
  40. // Implementation
  41. public:
  42. virtual ~CCategoryDownload();
  43. // Generated message map functions
  44. protected:
  45. //{{AFX_MSG(CCategoryDownload)
  46. afx_msg void OnDestroy();
  47. //}}AFX_MSG
  48. afx_msg void OnDownloadTerminated(long wParam, long lParam);
  49. afx_msg void OnStorageCheckComplete(long wParam, long lParam);
  50. DECLARE_MESSAGE_MAP()
  51. int OnCreate(LPCREATESTRUCT lpCreateStruct);
  52. void ContinueTheUncloseds();
  53. protected:
  54. virtual void DeleteAllData(CTreeCursor& curDel);
  55. CFilesListCtrl* m_pFilesListCtrl;
  56. CDownloadEngine m_DownloadEngine;
  57. private:
  58. bool _MoveItemFromto(CTreeCursor curSrc, CTreeCursor curTarget, CFileDBItem* pFileDBItem);
  59. void _StopDBFileItem(CFileDBItem* pFileDBItem);
  60. bool DeleteFileDBItemFiles(CFileDBItem* pFileDBItem, bool bDelDownloaded) const;
  61. static bool findDownloading(CTreeCursor curItem);
  62. CFileDBItem* findCursorByDownloadPointer(CTreeCursor curItem, CDownload* pDownload);
  63. vector<CDownload*> m_vDeleteings;
  64. vector<CFileDBItem*> m_vRuninings;
  65. };
  66. /////////////////////////////////////////////////////////////////////////////
  67. //{{AFX_INSERT_LOCATION}}
  68. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  69. #endif // !defined(AFX_CATEGORYDOWNLOAD1_H__AF6C036C_6396_4F82_A69B_6C8A790B43C5__INCLUDED_)