xref: /haiku/src/apps/cortex/DormantNodeView/DormantNodeView.h (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
1 // DormantNodeView.h
2 // c.lenz 22oct99
3 //
4 // RESPONSIBILITIES
5 // - simple extension of BListView to support
6 //	 drag & drop
7 //
8 // HISTORY
9 //   c.lenz		22oct99		Begun
10 //   c.lenz     27oct99		Added ToolTip support
11 
12 #ifndef __DormantNodeView_H__
13 #define __DormantNodeView_H__
14 
15 // Interface Kit
16 #include <ListView.h>
17 
18 #include "cortex_defs.h"
19 __BEGIN_CORTEX_NAMESPACE
20 
21 class DormantNodeView :
22 	public	BListView {
23 	typedef	BListView _inherited;
24 
25 public:					// *** messages
26 
27 	enum message_t {
28 		// OUTBOUND:
29 		// B_RAW_TYPE "which" dormant_node_info
30 		M_INSTANTIATE_NODE				= 'dNV0'
31 	};
32 
33 public:					// *** ctor/dtor
34 
35 						DormantNodeView(
36 							BRect frame,
37 							const char *name,
38 							uint32 resizeMode);
39 
40 	virtual				~DormantNodeView();
41 
42 public:					// *** BListView impl.
43 
44 	virtual void		AttachedToWindow();
45 
46 	virtual void		DetachedFromWindow();
47 
48 	virtual void		GetPreferredSize(
49 							float* width,
50 							float* height);
51 
52 	virtual void		MessageReceived(
53 							BMessage *message);
54 
55 	virtual void		MouseDown(
56 							BPoint point);
57 
58 	virtual void		MouseMoved(
59 							BPoint point,
60 							uint32 transit,
61 							const BMessage *message);
62 
63 	virtual bool		InitiateDrag(
64 							BPoint point,
65 							int32 index,
66 							bool wasSelected);
67 
68 private:				// *** internal operations
69 
70 	void				_populateList();
71 
72 	void				_freeList();
73 
74 	void				_updateList(
75 							int32 addOnID);
76 
77 private:				// *** data
78 
79 	BListItem		   *m_lastItemUnder;
80 };
81 
82 __END_CORTEX_NAMESPACE
83 #endif /*__DormantNodeView_H__*/
84