aswang
1.0
|
00001 /* 00002 Copyright 2003 Joseph Alvis 00003 00004 This file is part of Aswang. 00005 00006 Aswang is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 Aswang is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with Aswang. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #pragma once 00021 #include "window.h" 00022 00023 namespace aswang { 00024 class ListView : public window { 00025 public: 00026 enum ListViewStyles { 00027 lvs_icon = LVS_ICON, 00028 lvs_smallIcon = LVS_SMALLICON, 00029 lvs_list = LVS_LIST, 00030 lvs_report = LVS_REPORT, 00031 lvs_sortAscending = LVS_SORTASCENDING, 00032 lvs_sortDescending = LVS_SORTDESCENDING, 00033 lvs_ownerData = LVS_OWNERDATA, 00034 }; 00035 enum ListViewItemStates { 00036 lvis_focused = LVIS_FOCUSED, 00037 lvis_selected = LVIS_SELECTED, 00038 lvis_cut = LVIS_CUT, 00039 lvis_dropHilited = LVIS_DROPHILITED, 00040 lvis_glow = LVIS_GLOW, 00041 lvis_activating = LVIS_ACTIVATING, 00042 lvis_overlayMask = LVIS_OVERLAYMASK, 00043 lvis_stateImageMask = LVIS_STATEIMAGEMASK, 00044 }; 00045 enum ListViewNIFlags { 00046 lvni_all = LVNI_ALL, 00047 lvni_focused = LVNI_FOCUSED, 00048 lvni_selected = LVNI_SELECTED, 00049 lvni_cut = LVNI_CUT, 00050 lvni_dropHilited = LVNI_DROPHILITED, 00051 lvni_above = LVNI_ABOVE, 00052 lvni_below = LVNI_BELOW, 00053 lvni_left = LVNI_TOLEFT, 00054 lvni_right = LVNI_TORIGHT, 00055 }; 00056 enum ListViewItemCountFlags { 00057 lvsicf_noInvalidateAll = LVSICF_NOINVALIDATEALL, 00058 lvsicf_noScroll = LVSICF_NOSCROLL, 00059 }; 00060 typedef int(CompareFunc)(long,long,long); 00061 public: 00062 ListView(HWND h,window *p=NULL) : window(h,p) {} 00063 ListView(window *p,unsigned long newstyle=WS_CHILD|lvs_report) : window(p,newstyle) {} 00064 virtual ~ListView() {} 00065 00066 virtual const _TCHAR *GetClassName() const {return WC_LISTVIEW;} 00067 00068 virtual bool Arrange(long code=LVA_DEFAULT); 00069 virtual bool DeleteAllItems(); 00070 virtual bool DeleteItem(long id); 00071 virtual long GetItemState(long index,ListViewItemStates mask); 00072 virtual long GetNextItem(long index,ListViewNIFlags flags); 00073 virtual long InsertItem(LVITEM *item); 00074 virtual bool SetItem(LVITEM *item); 00075 virtual long GetItemCount(); 00076 virtual bool SetItemCount(long count,ListViewItemCountFlags flags=(ListViewItemCountFlags)0); 00077 virtual bool SetItemPosition(long index,int x,int y); 00078 virtual bool SetItemState(long index,LVITEM *item); 00079 virtual bool SetItemText(long index,const AswangStr &str,long subIndex=0); 00080 virtual bool SortItems(long arg,CompareFunc *cf); 00081 virtual bool SetColumn(long index,LVCOLUMN *column); 00082 virtual long InsertColumn(long index,LVCOLUMN *column); 00083 }; 00084 }