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

CtrlUploads.h

Go to the documentation of this file.
00001 //
00002 // CtrlUploads.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 #include "CtrlUploadTip.h"
00025 
00026 class CUploadFile;
00027 class CUploadQueue;
00028 
00029 
00030 class CUploadsCtrl : public CWnd
00031 {
00032 // Construction
00033 public:
00034         CUploadsCtrl();
00035         virtual ~CUploadsCtrl();
00036 
00037         DECLARE_DYNAMIC(CUploadsCtrl)
00038 
00039 // Operations
00040 public:
00041         BOOL            Create(CWnd* pParentWnd, UINT nID);
00042         BOOL            Update();
00043 protected:
00044         void            InsertColumn(int nColumn, LPCTSTR pszCaption, int nFormat, int nWidth);
00045         void            SaveColumnState();
00046         BOOL            LoadColumnState();
00047         void            SelectTo(int nIndex);
00048     void                DeselectAll(CUploadFile* pExcept = NULL);
00049         BOOL            HitTest(const CPoint& point, CUploadQueue** ppQueue, CUploadFile** ppFile, int* pnIndex, RECT* prcItem);
00050         BOOL            GetAt(int nSelect, CUploadQueue** ppQueue, CUploadFile** ppFile);
00051         void            PaintQueue(CDC& dc, const CRect& rcRow, CUploadQueue* pQueue, BOOL bFocus);
00052         void            PaintFile(CDC& dc, const CRect& rcRow, CUploadQueue* pQueue, CUploadFile* pFile, int nPosition, BOOL bFocus);
00053         int                     GetExpandableColumnX() const;
00054 
00055         friend class CUploadsWnd;
00056 
00057 // Attributes
00058 protected:
00059         CHeaderCtrl                     m_wndHeader;
00060         CUploadTipCtrl          m_wndTip;
00061         CImageList                      m_pProtocols;
00062         int                                     m_nFocus;
00063         CUploadFile*            m_pDeselect;
00064         int                                     m_nScrollWheelLines;
00065 
00066 // Queue/File Abstractation Layer
00067 public:
00068         static POSITION                 GetQueueIterator();
00069         static CUploadQueue*    GetNextQueue(POSITION& pos);
00070         static POSITION                 GetFileIterator(CUploadQueue* pQueue);
00071         static CUploadFile*             GetNextFile(CUploadQueue* pQueue, POSITION& pos, int* pnPosition = NULL);
00072 
00073 // Implementation
00074 protected:
00075         DECLARE_MESSAGE_MAP()
00076 public:
00077         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00078         afx_msg void OnDestroy();
00079         afx_msg void OnSize(UINT nType, int cx, int cy);
00080         afx_msg void OnPaint();
00081         afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00082         afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00083         afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00084         afx_msg void OnChangeHeader(NMHDR* pNotifyStruct, LRESULT* pResult);
00085         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00086         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00087         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00088         afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00089         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00090         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00091         afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00092         afx_msg void OnSetFocus(CWnd* pOldWnd);
00093         afx_msg void OnKillFocus(CWnd* pNewWnd);
00094 };
00095 
00096 #define ULF_ACTIVE              0x01
00097 #define ULF_QUEUED              0x02
00098 #define ULF_HISTORY             0x04
00099 #define ULF_TORRENT             0x08
00100 
00101 #define ULF_ALL                 (ULF_ACTIVE|ULF_QUEUED|ULF_HISTORY|ULF_TORRENT)

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