Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

DownloadWithExtras.h

Go to the documentation of this file.
00001 //
00002 // DownloadWithExtras.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_DOWNLOADWITHEXTRAS_H__EDD3177D_5313_4C8C_900A_4D5B3DE93BB9__INCLUDED_)
00023 #define AFX_DOWNLOADWITHEXTRAS_H__EDD3177D_5313_4C8C_900A_4D5B3DE93BB9__INCLUDED_
00024 
00025 #pragma once
00026 
00027 #include "DownloadWithSearch.h"
00028 
00029 class CDownloadMonitorDlg;
00030 class CFilePreviewDlg;
00031 
00032 // CDownloadReview stores a review of a download. It can be either a G2 review, copied from the
00033 // search, or an ed2k review recieved during download.
00034 class CDownloadReview
00035 {
00036 // Construction
00037 public:
00038         CDownloadReview();
00039         CDownloadReview(in_addr *pIP, int nUserPicture, int nRating, LPCTSTR pszUserName, LPCTSTR pszComment);
00040         ~CDownloadReview();
00041 
00042 // Attributes
00043 public:
00044         in_addr                         m_pUserIP;                      // To prevent duplicate reviews
00045         int                                     m_nUserPicture;         // Picture to display. 2 = G2, 3 = ED2K
00046         CString                         m_sUserName;            // User who made comments
00047         int                                     m_nFileRating;          // 0 = Unrated, 1 = Fake, 1-6 = Num Stars
00048         CString                         m_sFileComments;        // The review/comments
00049 
00050         CDownloadReview*        m_pNext;                        // Next review in list (or NULL for the last)
00051         CDownloadReview*        m_pPrev;                        // PRevious review in list (or NULL for the first)
00052 
00053 // Operations
00054         void Serialize(CArchive& ar, int nVersion);
00055 
00056         friend class            CDownloadWithExtras;
00057 };
00058 
00059 class CDownloadWithExtras : public CDownloadWithSearch
00060 {
00061 // Construction
00062 public:
00063         CDownloadWithExtras();
00064         virtual ~CDownloadWithExtras();
00065         
00066 // Attributes
00067 protected:
00068         CStringList                             m_pPreviews;
00069         CDownloadMonitorDlg*    m_pMonitorWnd;
00070         CFilePreviewDlg*                m_pPreviewWnd;
00071 
00072 protected:
00073         CDownloadReview*        m_pReviewFirst;
00074         CDownloadReview*        m_pReviewLast;
00075         int                                     m_nReviewCount;
00076         
00077 // Operations
00078 public:
00079         BOOL            Preview(CSingleLock* pLock = NULL);
00080         BOOL            IsPreviewVisible() const;
00081         BOOL            CanPreview();
00082         void            AddPreviewName(LPCTSTR pszFile);
00083         void            DeletePreviews();
00084         BOOL            AddReview(IN_ADDR* pIP, int nUserPicture, int nRating, LPCTSTR pszUserName, LPCTSTR pszComment);
00085         BOOL            AddReview(CDownloadReview* pReview);
00086         void            DeleteReviews();
00087         void            DeleteReview(CDownloadReview* pReview);
00088         inline int      GetReviewCount() const { return m_nReviewCount; }
00089         inline CDownloadReview* GetFirstReview() const { return m_pReviewFirst; }
00090         CDownloadReview* FindReview(IN_ADDR* pIP) const;
00091         CDownloadReview* FindReview(LPCTSTR pszUserName) const;
00092         CDownloadReview* FindReview(int nRating, LPCTSTR pszName, LPCTSTR pszComment) const;
00093         int                     GetReviewAverage() const;
00094 
00095 public:
00096         void            ShowMonitor(CSingleLock* pLock = NULL);
00097         BOOL            IsMonitorVisible() const;
00098 
00099 public:
00100         virtual void Serialize(CArchive& ar, int nVersion);
00101         
00102         friend class CDownloadMonitorDlg;
00103         friend class CFilePreviewDlg;
00104 
00105 };
00106 
00107 #endif // !defined(AFX_DOWNLOADWITHEXTRAS_H__EDD3177D_5313_4C8C_900A_4D5B3DE93BB9__INCLUDED_)

Generated on Thu Dec 15 10:39:41 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2