00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 Open Download Manager Copyright (c) 2008-2010 OpenDownloadManager.ORG 00004 */ 00005 00006 #ifndef __FS_DOWNLOAD_ 00007 #define __FS_DOWNLOAD_ 00008 00009 #include "vmsObjectSmartPtr.h" 00010 #include "vmsDownloadMgrEx.h" 00011 #include "vmsDownloadsGroupsMgr.h" 00012 00013 struct fsDownload; 00014 00015 struct fsDownloadEvents 00016 { 00017 CString strEvent; 00018 COLORREF clrBg; 00019 COLORREF clrText; 00020 FILETIME timeEvent; 00021 int iImage; 00022 }; 00023 00024 typedef DWORD (*fntDownloadsMgrEventFunc)(struct fsDownload* dld, enum fsDownloadsMgrEvent ev, LPVOID); 00025 00026 #define DLD_CHANGENOTRECOMMENDED (1 << 0) 00027 00028 #define DLD_DELETEFILEALWAYS (1 << 1) 00029 00030 #define DLD_DONTUSEMIRRORS (1 << 2) 00031 00032 #define DLD_CTREQ_HTML (1 << 3) 00033 00034 #define DLD_NOTIFYBEFOREDOWNLOAD (1 << 4) 00035 00036 #define DLD_DELETEWHENDONE (1 << 5) 00037 00038 #define DLD_DONTPUTTOHISTORY (1 << 6) 00039 00040 #define DLD_DONTPUTTORECYCLE (1 << 7) 00041 00042 #define DLD_NOTIFICATIONS_LL (1 << 8) 00043 00044 #define DLD_NOAUTOLAUNCH (1 << 9) 00045 00046 #define DLD_DELETEFILEATRESTART (1 << 10) 00047 00048 #define DLD_DONTSHOWDIALOG (1 << 11) 00049 00050 #define DLD_USEDBYHTMLSPIDER (1 << 12) 00051 00052 #define DLD_NOAUTOCHANGECURGRPFILTER (1 << 13) 00053 00054 #define DLD_MALICIOUS_YES (1 << 14) 00055 #define DLD_MALICIOUS_NO (1 << 15) 00056 #define DLD_HASOPINIONS_YES (1 << 16) 00057 #define DLD_HASOPINIONS_NO (1 << 17) 00058 00059 #define DLD_BATCH (1 << 18) 00060 00061 #define DLD_MALICIOUS_DISABLE_CHECK (1 << 19) 00062 00063 #define DLD_FLASH_VIDEO (1 << 20) 00064 00065 #define DLD_MF_AUTO_CONVERT (1 << 21) 00066 00067 #define DLD_NEED_ONDONE_FOR_FLASH_VIDEO (1 << 22) 00068 00069 struct fsDownload : public vmsObject 00070 { 00071 vmsDownloadMgrSmartPtr pMgr; 00072 BOOL bAutoStart; 00073 vmsDownloadsGroupSmartPtr pGroup; 00074 CString strComment; 00075 fs::list <fsDownloadEvents> vEvents; 00076 UINT nID; 00077 DWORD dwFlags; 00078 DWORD dwReserved; 00079 FILETIME dateAdded; 00080 00081 fntDownloadsMgrEventFunc pfnDownloadEventsFunc; 00082 LPVOID lpEventsParam; 00083 00084 #ifndef FDM_DLDR__RAWCODEONLY 00085 class CDlg_Download *pdlg; 00086 #endif 00087 00088 fsDownload (fsDownload& dld) 00089 { 00090 *this = dld; 00091 #ifndef FDM_DLDR__RAWCODEONLY 00092 pdlg = NULL; 00093 #endif 00094 } 00095 00096 fsDownload& operator= (fsDownload& dld) 00097 { 00098 pMgr = dld.pMgr; 00099 bAutoStart = dld.bAutoStart; 00100 pGroup = dld.pGroup; 00101 strComment = dld.strComment; 00102 vEvents = dld.vEvents; 00103 nID = dld.nID; 00104 dwFlags = dld.dwFlags; 00105 dwReserved = 0; 00106 dateAdded = dld.dateAdded; 00107 00108 pfnDownloadEventsFunc = dld.pfnDownloadEventsFunc; 00109 lpEventsParam = dld.lpEventsParam; 00110 00111 return *this; 00112 } 00113 00114 fsDownload () { 00115 pfnDownloadEventsFunc = NULL; dwFlags = 0; 00116 pGroup = NULL; 00117 dwReserved = 0; 00118 #ifndef FDM_DLDR__RAWCODEONLY 00119 pdlg = NULL; 00120 #endif 00121 } 00122 }; 00123 00124 typedef vmsObjectSmartPtr <fsDownload> vmsDownloadSmartPtr; 00125 00126 #include "fsDownloadMgr.h" 00127 #include "vmsBtDownloadManager.h" 00128 00129 inline void Download_CreateInstance (vmsDownloadSmartPtr &ptr, bool bBittorrent = false) 00130 { 00131 ptr.CreateInstance (); 00132 ptr->pMgr.CreateInstance (); 00133 00134 if (bBittorrent == false) 00135 ptr->pMgr->Attach (new fsDownloadMgr (ptr)); 00136 else 00137 ptr->pMgr->Attach (new vmsBtDownloadManager); 00138 } 00139 00140 typedef std::vector <vmsDownloadSmartPtr> DLDS_LIST, &DLDS_LIST_REF; 00141 00142 #endif
1.5.6