1#ifndef max
2#define max(a,b)					((a)>=(b)?(a):(b))
3#endif
4
5class ListItem : public CLVEasyItem
6{
7	public:
8		ListItem(BView *headerView, const char *text0, const char *text1, const char *text2);
9		~ListItem();
10
11		BView *GetAssociatedHeader()			{ return assocHeaderView; }
12		void SetAssociatedHeader(BView *header)	{ assocHeaderView = header; }
13
14		virtual bool ItemInvoked();
15		virtual void ItemSelected();
16		virtual void ItemDeselected();
17		virtual void ItemDeleted();
18		virtual bool IsDeleteable();
19
20	private:
21		BView *assocHeaderView;
22};
23
24
25class SmartColumnListView : public ColumnListView
26{
27	public:
28		SmartColumnListView(BRect Frame, CLVContainerView** ContainerView,
29			const char* Name = NULL, uint32 ResizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
30			uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE,
31			list_view_type Type = B_SINGLE_SELECTION_LIST,
32			bool hierarchical = false, bool horizontal = true, bool vertical = true,
33			bool scroll_view_corner = true, border_style border = B_NO_BORDER,
34			const BFont* LabelFont = be_plain_font);
35
36		virtual ~SmartColumnListView();
37
38		// Event handlers (what makes it "smart").
39		void MouseDown(BPoint point);
40		void KeyUp(const char *bytes, int32 numBytes);
41
42		// Helper functions.
43		bool DeleteItem(int index, ListItem *item);
44
45	private:
46		CLVContainerView *container;
47};
48
49
50extern const int32 MSG_LIST_DESELECT;
51