00001 // 00002 // CtrlDownloadTip.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_CTRLDOWNLOADTIP_H__8F881E85_89E4_48CE_81DB_F59065A37A2C__INCLUDED_) 00023 #define AFX_CTRLDOWNLOADTIP_H__8F881E85_89E4_48CE_81DB_F59065A37A2C__INCLUDED_ 00024 00025 #pragma once 00026 00027 #include "CtrlCoolTip.h" 00028 00029 class CDownload; 00030 class CDownloadSource; 00031 class CLineGraph; 00032 class CGraphItem; 00033 00034 00035 class CDownloadTipCtrl : public CCoolTipCtrl 00036 { 00037 // Construction 00038 public: 00039 CDownloadTipCtrl(); 00040 virtual ~CDownloadTipCtrl(); 00041 00042 DECLARE_DYNAMIC(CDownloadTipCtrl) 00043 00044 // Attributes 00045 protected: 00046 CString m_sName; 00047 CString m_sSHA1; 00048 CString m_sTiger; 00049 CString m_sED2K; 00050 CString m_sBTH; 00051 CString m_sURL; 00052 CString m_sSize; 00053 CString m_sType; 00054 int m_nIcon; 00055 protected: 00056 CLineGraph* m_pGraph; 00057 CGraphItem* m_pItem; 00058 protected: 00059 CStringArray m_pHeaderName; 00060 CStringArray m_pHeaderValue; 00061 int m_nHeaderWidth; 00062 int m_nStatWidth; 00063 BOOL m_bDrawGraph; //Draw the download graph? 00064 BOOL m_bDrawError; //Display the tracker error? 00065 00066 // Operations 00067 protected: 00068 virtual BOOL OnPrepare(); 00069 virtual void OnCalcSize(CDC* pDC); 00070 virtual void OnShow(); 00071 virtual void OnHide(); 00072 virtual void OnPaint(CDC* pDC); 00073 protected: 00074 void OnCalcSize(CDC* pDC, CDownload* pDownload); 00075 void OnCalcSize(CDC* pDC, CDownloadSource* pSource); 00076 void OnPaint(CDC* pDC, CDownload* pDownload); 00077 void OnPaint(CDC* pDC, CDownloadSource* pSource); 00078 protected: 00079 void PrepareFileInfo(CDownload* pDownload); 00080 void DrawProgressBar(CDC* pDC, CPoint* pPoint, CDownload* pDownload); 00081 void DrawProgressBar(CDC* pDC, CPoint* pPoint, CDownloadSource* pSource); 00082 00083 // Overrides 00084 public: 00085 //{{AFX_VIRTUAL(CDownloadTipCtrl) 00086 //}}AFX_VIRTUAL 00087 00088 // Implementation 00089 protected: 00090 //{{AFX_MSG(CDownloadTipCtrl) 00091 afx_msg void OnTimer(UINT nIDEvent); 00092 //}}AFX_MSG 00093 DECLARE_MESSAGE_MAP() 00094 00095 }; 00096 00097 //{{AFX_INSERT_LOCATION}} 00098 00099 #endif // !defined(AFX_CTRLDOWNLOADTIP_H__8F881E85_89E4_48CE_81DB_F59065A37A2C__INCLUDED_) 00100