00001
00002
00003
00004
00005
00006 #if !defined(AFX_DOWNLOADS_TASKS_H__510D187D_8CB0_40F0_BE64_6B11DF08C7F9__INCLUDED_)
00007 #define AFX_DOWNLOADS_TASKS_H__510D187D_8CB0_40F0_BE64_6B11DF08C7F9__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif
00012
00013 #include "ListCtrlEx.h"
00014 #include "fsODMenu.h"
00015 #include "FloatingWndDropTarget.h"
00016 #include "fsMutex.h"
00017
00018 enum vmsMoveType
00019 {
00020 MT_TOP,
00021 MT_BOTTOM,
00022 MT_UP,
00023 MT_DOWN,
00024 };
00025
00026 #define DOWNLOADTEXT_FILENAME 0
00027 #define DOWNLOADTEXT_SIZE 1
00028 #define DOWNLOADTEXT_PROGRESS 2
00029 #define DOWNLOADTEXT_TIMELEFT 3
00030 #define DOWNLOADTEXT_SECTIONS 4
00031 #define DOWNLOADTEXT_SPEED 5
00032
00033 class CDownloads_Tasks : public CListCtrlEx
00034 {
00035 friend class CDownloadsWnd;
00036 friend class CDownloaderProperties_ListPage;
00037
00038 public:
00039 CDownloads_Tasks();
00040
00041 public:
00042
00043 public:
00044
00045
00046 protected:
00047
00048
00049 public:
00050
00051 void BeginAddDownloads();
00052 void EndAddDownloads();
00053
00054 vmsDownloadSmartPtr GetItemData (int nItem);
00055 void DeleteAllItems();
00056
00057 void UnlockList();
00058 void LockList();
00059
00060 void SelectDownload (vmsDownloadSmartPtr dld);
00061
00062 void CallSelectedDownload();
00063 static void GetFileName (vmsDownloadSmartPtr dld, LPSTR pszFile);
00064
00065 BOOL m_bSizesInBytes;
00066
00067 void ApplyLanguage();
00068 void ApplyLanguageToMenu (CMenu *menu);
00069
00070 int OnUpdateToolBar (UINT nID);
00071
00072 void UnscheduleDownload (UINT nID);
00073
00074 void UpdateAllDownloads();
00075 void DeleteDownload (vmsDownloadSmartPtr dld);
00076
00077 void AddDownload (vmsDownloadSmartPtr dld, BOOL bSelThisDld = FALSE);
00078
00079 void UpdateMenu (CMenu *pMenu);
00080
00081 void WillBeDeleted (vmsDownloadSmartPtr dld);
00082 vmsDownloadSmartPtr GetActiveDownload();
00083 class CDownloadsWnd* m_pDownloadsWnd;
00084
00085 void UpdateDownload (vmsDownloadSmartPtr dld, BOOL bRedraw = TRUE);
00086
00087 void AddDownloadToList (vmsDownloadSmartPtr dld, BOOL bSelThisDld = FALSE, bool bPlaceToTop = false);
00088
00089 static int GetDownloadImage (vmsDownloadSmartPtr dld);
00090
00091 int FindItem (vmsDownloadSmartPtr dld);
00092 static CString GetDownloadText (vmsDownloadSmartPtr dld, int nSubItem);
00093 BOOL Create (CWnd* pParent);
00094 virtual ~CDownloads_Tasks();
00095
00096 protected:
00097 bool m_bHasEnableSeedingDlds;
00098 void ScheduleProcessDownloads ();
00099 void UpdateDownload (size_t nIndex, BOOL bRedraw);
00100
00101 bool m_bAddingDownloads;
00102
00103 void ScheduleSelectedDlds (BOOL bStart);
00104 void Sort();
00105 void MoveSelectedDownloads (vmsMoveType);
00106 virtual void OnItemChanged(NM_LISTVIEW* pLV);
00107
00108 static void _downloadsQuickSort (vmsDownloadSmartPtr *a, int N, int nCol);
00109 void SortDownloads();
00110
00111 static int _compareDownloads (vmsDownloadSmartPtr dld1, vmsDownloadSmartPtr dld2, int nColumn);
00112 afx_msg void OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
00113 fsMutex m_mxAddDel;
00114
00115 CFloatingWndDropTarget m_drop;
00116
00117 void OnSortModeChanged();
00118
00119 DLDS_LIST m_vDownloads;
00120 CImageList m_selimages;
00121
00122 void CalcCoordsForCurSel ();
00123 fsODMenu m_odmenu;
00124
00125 void OnForceUpdate();
00126 CPoint m_rbPt;
00127 struct _sRecordInfo
00128 {
00129 vmsDownloadSmartPtr dld;
00130 size_t iIndex;
00131 };
00132
00133 void DeleteSelected(BOOL bDontConfirmFileDeleting = FALSE);
00134 void UpdateActiveDownload (int adjSelected);
00135 void OnKeyDown (WORD wVK);
00136 vmsDownloadSmartPtr m_pActiveDownload;
00137
00138 void OnDeleteAllItems ();
00139
00140 void OnDeleteItem (NM_LISTVIEW *pNM);
00141 void OnRClick ();
00142 void OnClick();
00143
00144 CImageList m_images;
00145
00146 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00147 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00148 afx_msg void OnDldcreate();
00149 afx_msg void OnDlddelete();
00150 afx_msg void OnDldproperties();
00151 afx_msg void OnDldstart();
00152 afx_msg void OnDldstop();
00153 afx_msg void OnDldlaunch();
00154 afx_msg void OnDldopenfolder();
00155 afx_msg void OnDldschedule();
00156 afx_msg void OnDldautostart();
00157 afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00158 afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00159 afx_msg void OnDldaddsection();
00160 afx_msg void OnDlddelsection();
00161 afx_msg void OnDldrestart();
00162 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00163 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00164 afx_msg void OnDldqsize();
00165 afx_msg void OnDldcreatebatch();
00166 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00167 afx_msg void OnDldcheckvir();
00168 afx_msg void OnDldfind();
00169 afx_msg void OnDldfindnext();
00170 afx_msg void OnDldunpack();
00171 afx_msg void OnDldmovedown();
00172 afx_msg void OnDldmoveup();
00173 afx_msg void OnDldcheckintegrity();
00174 afx_msg void OnDldmovetofolder();
00175 afx_msg void OnDldmovebottom();
00176 afx_msg void OnDldmovetop();
00177 afx_msg void OnDldschedulestop();
00178 afx_msg void OnDldgrantbandwidthfordld();
00179 afx_msg void OnDldshowprogressdlg();
00180 afx_msg void OnDldconvert();
00181 afx_msg void OnTimer(UINT nIDEvent);
00182 afx_msg void OnDldenableseeding();
00183
00184
00185 DECLARE_MESSAGE_MAP()
00186 private:
00187 BOOL m_bAutoStart;
00188 };
00189
00190
00191
00192 #endif