00001 // 00002 // DownloadGroup.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 #pragma once 00023 00024 class CDownload; 00025 00026 00027 class CDownloadGroup 00028 { 00029 // Construction 00030 public: 00031 CDownloadGroup(); 00032 virtual ~CDownloadGroup(); 00033 00034 // Attributes 00035 protected: 00036 CPtrList m_pDownloads; 00037 public: 00038 CString m_sName; 00039 CString m_sSchemaURI; 00040 CString m_sFolder; 00041 CStringList m_pFilters; 00042 public: 00043 int m_nImage; 00044 BOOL m_bRemoteSelected; 00045 00046 // Operations 00047 public: 00048 void Add(CDownload* pDownload); 00049 void Remove(CDownload* pDownload); 00050 void SetCookie(int nCookie); 00051 void CopyList(CPtrList* pList); 00052 BOOL Link(CDownload* pDownload); 00053 int LinkAll(); 00054 void AddFilter(LPCTSTR pszFilter); 00055 void SetSchema(LPCTSTR pszURI); 00056 void Serialize(CArchive& ar, int nVersion); 00057 00058 // Inlines 00059 public: 00060 inline POSITION GetIterator() const 00061 { 00062 return m_pDownloads.GetHeadPosition(); 00063 } 00064 00065 inline CDownload* GetNext(POSITION& pos) const 00066 { 00067 return (CDownload*)m_pDownloads.GetNext( pos ); 00068 } 00069 00070 inline BOOL Contains(CDownload* pDownload) const 00071 { 00072 return m_pDownloads.Find( pDownload ) != NULL; 00073 } 00074 00075 inline int GetCount() const 00076 { 00077 return m_pDownloads.GetCount(); 00078 } 00079 00080 00081 };