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

LiveList.h

Go to the documentation of this file.
00001 //
00002 // LiveList.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_LIVELIST_H__D1A833C9_1477_43C7_9644_DB0C85370511__INCLUDED_)
00023 #define AFX_LIVELIST_H__D1A833C9_1477_43C7_9644_DB0C85370511__INCLUDED_
00024 
00025 #pragma once
00026 
00027 class CLiveItem;
00028 
00029 
00030 class CLiveList
00031 {
00032 // Construction
00033 public:
00034         CLiveList(int nColumns);
00035         virtual ~CLiveList();
00036 
00037 // Attributes
00038 protected:
00039         int                     m_nColumns;
00040         CMap<DWORD, DWORD, CLiveItem*, CLiveItem*&>     m_pItems;
00041 protected:
00042         static CBitmap m_bmSortAsc;
00043         static CBitmap m_bmSortDesc;
00044 
00045 // Operations
00046 public:
00047         CLiveItem*      Add(DWORD nParam);
00048         CLiveItem*      Add(LPVOID pParam);
00049         void            Apply(CListCtrl* pCtrl, BOOL bSort = FALSE);
00050 protected:
00051         void            Clear();
00052 
00053 // Sort Helpers
00054 public:
00055         static void Sort(CListCtrl* pCtrl, int nColumn = -1, BOOL bGraphic = TRUE);
00056         static int CALLBACK SortCallback(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
00057         static int SortProc(LPCTSTR sA, LPCTSTR sB, BOOL bNumeric = FALSE);
00058         static inline BOOL IsNumber(LPCTSTR pszString);
00059 
00060 // Drag Helpers
00061 public:
00062         static CImageList* CreateDragImage(CListCtrl* pList, const CPoint& ptMouse);
00063         static COLORREF crDrag;
00064 
00065 };
00066 
00067 
00068 class CLiveItem
00069 {
00070 // Construction
00071 public:
00072         CLiveItem(int nColumns, DWORD nParam);
00073         virtual ~CLiveItem();
00074 
00075 // Attributes
00076 public:
00077         DWORD           m_nParam;
00078         int                     m_nImage;
00079         UINT            m_nMaskOverlay;
00080         UINT            m_nMaskState;
00081 public:
00082         CString*        m_pColumn;
00083 
00084 // Operations
00085 public:
00086         void    Set(int nColumn, LPCTSTR pszText);
00087         void    Format(int nColumn, LPCTSTR pszFormat, ...);
00088 public:
00089         int             Add(CListCtrl* pCtrl, int nItem, int nColumns);
00090         BOOL    Update(CListCtrl* pCtrl, int nItem, int nColumns);
00091 
00092 };
00093 
00094 #ifndef CDRF_NOTIFYSUBITEMDRAW
00095 
00096 #define LVS_EX_NOHSCROLL        0x10000000
00097 #define LVS_EX_FLATSB                   0x00000100
00098 #define LVS_EX_REGIONAL                 0x00000200
00099 #define LVS_EX_INFOTIP                  0x00000400
00100 #define LVS_EX_LABELTIP                 0x00004000
00101 #define LVS_EX_UNDERLINEHOT             0x00000800
00102 #define LVS_EX_UNDERLINECOLD    0x00001000
00103 #define LVS_EX_MULTIWORKAREAS   0x00002000
00104 
00105 #define CDRF_NOTIFYSUBITEMDRAW  0x00000020
00106 #define CDDS_SUBITEM            0x00020000
00107 
00108 #define LVM_GETSUBITEMRECT      (LVM_FIRST + 56)
00109 #define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
00110         (BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
00111                 ((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
00112 
00113 /*
00114 typedef struct tagLVHITTESTINFOEX
00115 {
00116     POINT pt;
00117     UINT flags;
00118     int iItem;
00119     int iSubItem;
00120 } LVHITTESTINFOEX, FAR* LPLVHITTESTINFOEX;
00121 
00122 #define LVM_SUBITEMHITTEST      (LVM_FIRST + 57)
00123 #define ListView_SubItemHitTest(hwnd, plvhti) \
00124         (int)SNDMSG((hwnd), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFOEX)(plvhti))
00125 */
00126 
00127 #endif
00128 
00129 #endif // !defined(AFX_LIVELIST_H__D1A833C9_1477_43C7_9644_DB0C85370511__INCLUDED_)

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