repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / launchbox / PadView.h
blobf19a1c323995ad85ad50a5399eb8a3d57f079be7
1 /*
2 * Copyright 2006-2009, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef PAD_VIEW_H
6 #define PAD_VIEW_H
8 #include <View.h>
10 class BGroupLayout;
11 class LaunchButton;
13 #define DEFAULT_ICON_SIZE 32
15 class PadView : public BView {
16 public:
17 PadView(const char* name);
18 virtual ~PadView();
20 // BView interface
21 virtual void Draw(BRect updateRect);
22 virtual void MessageReceived(BMessage* message);
23 virtual void MouseDown(BPoint where);
24 virtual void MouseUp(BPoint where);
25 virtual void MouseMoved(BPoint where, uint32 transit,
26 const BMessage* dragMessage);
28 // PadView
29 void AddButton(LaunchButton* button,
30 LaunchButton* beforeButton = NULL);
31 bool RemoveButton(LaunchButton* button);
32 LaunchButton* ButtonAt(int32 index) const;
34 void DisplayMenu(BPoint where,
35 LaunchButton* button = NULL) const;
37 void SetOrientation(enum orientation orientation);
38 enum orientation Orientation() const;
40 void SetIconSize(uint32 size);
41 uint32 IconSize() const;
43 void SetIgnoreDoubleClick(bool refuse);
44 bool IgnoreDoubleClick() const;
46 private:
47 void _NotifySettingsChanged();
49 BPoint fDragOffset;
50 bool fDragging;
51 bigtime_t fClickTime;
52 BGroupLayout* fButtonLayout;
53 uint32 fIconSize;
56 #endif // PAD_VIEW_H