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

CtrlLibraryAlbumView.h

Go to the documentation of this file.
00001 //
00002 // CtrlLibraryAlbumView.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_CTRLLIBRARYALBUMVIEW_H__19FB3DBB_8526_4E9D_A647_75DF07BAE7E2__INCLUDED_)
00023 #define AFX_CTRLLIBRARYALBUMVIEW_H__19FB3DBB_8526_4E9D_A647_75DF07BAE7E2__INCLUDED_
00024 
00025 #pragma once
00026 
00027 #include "CtrlLibraryFileView.h"
00028 
00029 class CLibraryFile;
00030 class CLibraryAlbumTrack;
00031 
00032 
00033 class CLibraryAlbumView : public CLibraryFileView
00034 {
00035 // Construction
00036 public:
00037         CLibraryAlbumView();
00038         virtual ~CLibraryAlbumView();
00039 
00040         DECLARE_DYNCREATE(CLibraryAlbumView)
00041 
00042 // Attributes
00043 protected:
00044         CSize                                   m_szTrack;
00045         int                                             m_nRows;
00046         LPCTSTR                                 m_pStyle;
00047         static LPCTSTR                  m_pStaticStyle;
00048 protected:
00049         CLibraryAlbumTrack**    m_pList;
00050         int                                             m_nCount;
00051         int                                             m_nBuffer;
00052         int                                             m_nScroll;
00053         CImageList                              m_pStars;
00054 protected:
00055         CPtrList                                m_pSelTrack;
00056         int                                             m_nSelected;
00057         CLibraryAlbumTrack*             m_pFocus;
00058         CLibraryAlbumTrack*             m_pFirst;
00059         CLibraryAlbumTrack*             m_pRating;
00060         BOOL                                    m_bDrag;
00061         CPoint                                  m_ptDrag;
00062 public:
00063         static COLORREF                 m_crRows[2];
00064 
00065 // Operations
00066 public:
00067         virtual void            Update();
00068         virtual BOOL            Select(DWORD nObject);
00069         virtual DWORD           HitTestIndex(const CPoint& point) const;
00070 protected:
00071         void                            Clear();
00072         BOOL                            Select(CLibraryAlbumTrack* pItem, TRISTATE bSelect = TS_TRUE);
00073         BOOL                            DeselectAll(CLibraryAlbumTrack* pItem = NULL);
00074         BOOL                            SelectTo(CLibraryAlbumTrack* pItem);
00075         void                            SelectTo(int nDelta);
00076 protected:
00077         void                            UpdateScroll();
00078         void                            ScrollBy(int nDelta);
00079         void                            ScrollTo(int nDelta);
00080         CLibraryAlbumTrack*     HitTest(const CPoint& point, CRect* pRect = NULL) const;
00081         int                                     GetTrackIndex(CLibraryAlbumTrack* pTrack) const;
00082         BOOL                            GetItemRect(CLibraryAlbumTrack* pTrack, CRect* pRect);
00083         void                            StartDragging(CPoint& ptMouse);
00084         CImageList*                     CreateDragImage(const CPoint& ptMouse);
00085 
00086         static int                      SortList(LPCVOID pA, LPCVOID pB);
00087 
00088 // Overrides
00089 public:
00090         //{{AFX_VIRTUAL(CLibraryAlbumView)
00091         protected:
00092         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00093         //}}AFX_VIRTUAL
00094 
00095 // Implementation
00096 protected:
00097         //{{AFX_MSG(CLibraryAlbumView)
00098         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00099         afx_msg void OnDestroy();
00100         afx_msg void OnSize(UINT nType, int cx, int cy);
00101         afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00102         afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00103         afx_msg void OnPaint();
00104         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00105         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00106         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00107         afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00108         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00109         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00110         //}}AFX_MSG
00111 
00112         DECLARE_MESSAGE_MAP()
00113 
00114         friend class CLibraryAlbumTrack;
00115 };
00116 
00117 class CLibraryAlbumTrack
00118 {
00119 // Construction
00120 public:
00121         CLibraryAlbumTrack(CLibraryFile* pFile);
00122         virtual ~CLibraryAlbumTrack();
00123 
00124 // Attributes
00125 public:
00126         DWORD   m_nIndex;
00127         DWORD   m_nCookie;
00128         BOOL    m_bShared;
00129         BOOL    m_bSelected;
00130 public:
00131         int             m_nShell;
00132         int             m_nTrack;
00133         CString m_sTrack;
00134         CString m_sTitle;
00135         CString m_sArtist;
00136         CString m_sAlbum;
00137         int             m_nLength;
00138         CString m_sLength;
00139         int             m_nBitrate;
00140         CString m_sBitrate;
00141         int             m_nRating;
00142         BOOL    m_bComments;
00143         int             m_nSetRating;
00144 
00145 // Operations
00146 public:
00147         BOOL    Update(CLibraryFile* pFile);
00148         void    Paint(CLibraryAlbumView* pView, CDC* pDC, const CRect& rcBlock, int nCount);
00149         BOOL    HitTestRating(const CRect& rcBlock, const CPoint& point);
00150         BOOL    LockRating();
00151 protected:
00152         void    PaintText(CDC* pDC, const CRect& rcTrack, int nFrom, int nTo, const CString* pstr, BOOL bCenter = FALSE);
00153 
00154 };
00155 
00156 //{{AFX_INSERT_LOCATION}}
00157 
00158 #endif // !defined(AFX_CTRLLIBRARYALBUMVIEW_H__19FB3DBB_8526_4E9D_A647_75DF07BAE7E2__INCLUDED_)

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