00001 // 00002 // DownloadBase.h 00003 // 00004 // Copyright (c) Shareaza Development Team, 2002-2005. 00005 // This file is part of SHAREAZA (www.shareaza.com) 00006 // 00007 // Shareaza is free software; you can redistribute it 00008 // and/or modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // Shareaza is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with Shareaza; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 00022 #if !defined(AFX_DOWNLOADBASE_H__71956CAE_7D13_4809_837B_5F17DE46856E__INCLUDED_) 00023 #define AFX_DOWNLOADBASE_H__71956CAE_7D13_4809_837B_5F17DE46856E__INCLUDED_ 00024 00025 #pragma once 00026 00027 class CDownloadTask; 00028 00029 00030 class CDownloadBase 00031 { 00032 // Construction 00033 public: 00034 CDownloadBase(); 00035 virtual ~CDownloadBase(); 00036 00037 // Attributes 00038 public: 00039 int m_nCookie; 00040 public: 00041 CString m_sRemoteName; 00042 CString m_sLocalName; 00043 QWORD m_nSize; 00044 public: 00045 BOOL m_bSHA1; 00046 SHA1 m_pSHA1; 00047 BOOL m_bSHA1Trusted; 00048 BOOL m_bTiger; 00049 TIGEROOT m_pTiger; 00050 BOOL m_bTigerTrusted; 00051 BOOL m_bMD5; 00052 MD5 m_pMD5; 00053 BOOL m_bMD5Trusted; 00054 BOOL m_bED2K; 00055 MD4 m_pED2K; 00056 BOOL m_bED2KTrusted; 00057 BOOL m_bBTH; 00058 SHA1 m_pBTH; 00059 BOOL m_bBTHTrusted; 00060 protected: 00061 CDownloadTask* m_pTask; 00062 00063 // Operations 00064 public: 00065 virtual void Pause() = 0; 00066 virtual void Resume() = 0; 00067 virtual void Remove(BOOL bDelete = FALSE) = 0; 00068 virtual void Boost() = 0; 00069 virtual BOOL IsPaused() const = 0; 00070 virtual BOOL IsMoving() const = 0; 00071 virtual BOOL IsCompleted() const = 0; 00072 virtual BOOL IsTasking() { return m_pTask != NULL; } 00073 virtual BOOL IsTrying() const = 0; 00074 public: 00075 void SetModified(); 00076 protected: 00077 void GenerateLocalName(); 00078 virtual void Serialize(CArchive& ar, int nVersion); 00079 00080 }; 00081 00082 #endif // !defined(AFX_DOWNLOADBASE_H__71956CAE_7D13_4809_837B_5F17DE46856E__INCLUDED_)