xref: /haiku/src/apps/launchbox/PadView.h (revision f09ba8ea46ba2f4e482d7cd03e8eb77f37a60663)
1 /*
2  * Copyright 2006, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #ifndef PAD_VIEW_H
10 #define PAD_VIEW_H
11 
12 #include <View.h>
13 
14 class BGroupLayout;
15 class LaunchButton;
16 
17 class PadView : public BView {
18  public:
19 								PadView(const char* name);
20 	virtual						~PadView();
21 
22 	// BView interface
23 	virtual	void				Draw(BRect updateRect);
24 	virtual	void				MessageReceived(BMessage* message);
25 	virtual	void				MouseDown(BPoint where);
26 	virtual	void				MouseUp(BPoint where);
27 	virtual	void				MouseMoved(BPoint where, uint32 transit,
28 										   const BMessage* dragMessage);
29 
30 	// PadView
31 			void				AddButton(LaunchButton* button,
32 										  LaunchButton* beforeButton = NULL);
33 			bool				RemoveButton(LaunchButton* button);
34 			LaunchButton*		ButtonAt(int32 index) const;
35 
36 			void				DisplayMenu(BPoint where,
37 											LaunchButton* button = NULL) const;
38 
39 			void				SetOrientation(enum orientation orientation);
40 			enum orientation	Orientation() const;
41 
42  private:
43 			BPoint				fDragOffset;
44 			bool				fDragging;
45 			bigtime_t			fClickTime;
46 			BGroupLayout*		fButtonLayout;
47 };
48 
49 #endif // PAD_VIEW_H
50