libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / apps / launchbox / LaunchButton.h
blobe1d095339e5e66127f208e447407a98dd17764fa
1 /*
2 * Copyright 2006-2011, Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef LAUNCH_BUTTON_H
6 #define LAUNCH_BUTTON_H
9 #include <IconButton.h>
10 #include <List.h>
11 #include <String.h>
14 enum {
15 MSG_ADD_SLOT = 'adsl',
16 MSG_CLEAR_SLOT = 'clsl',
17 MSG_REMOVE_SLOT = 'rmsl',
18 MSG_LAUNCH = 'lnch',
19 MSG_OPEN_CONTAINING_FOLDER = 'opcf',
23 class LaunchButton : public BIconButton {
24 public:
25 LaunchButton(const char* name,
26 const char* label = NULL,
27 BMessage* message = NULL,
28 BHandler* target = NULL);
29 virtual ~LaunchButton();
31 // BIconButton interface
32 virtual void AttachedToWindow();
33 virtual void Draw(BRect updateRect);
34 virtual void MessageReceived(BMessage* message);
35 virtual void MouseDown(BPoint where);
36 virtual void MouseUp(BPoint where);
37 virtual void MouseMoved(BPoint where, uint32 transit,
38 const BMessage* dragMessage);
40 virtual BSize MinSize();
41 virtual BSize PreferredSize();
42 virtual BSize MaxSize();
44 // LaunchButton
45 void SetTo(const entry_ref* ref);
46 entry_ref* Ref() const;
48 void SetTo(const char* appSig, bool updateIcon);
49 const char* AppSignature() const
50 { return fAppSig; }
52 void SetDescription(const char* text);
53 const char* Description() const
54 { return fDescription.String(); }
56 void SetIconSize(uint32 size);
57 uint32 IconSize() const
58 { return fIconSize; }
60 static void SetIgnoreDoubleClick(bool refuse);
61 static bool IgnoreDoubleClick()
62 { return sIgnoreDoubleClick; }
64 private:
65 void _UpdateToolTip();
66 void _UpdateIcon(const entry_ref* ref);
68 void _NotifySettingsChanged();
70 void _DrawFrame(BRect frame,
71 rgb_color left, rgb_color top,
72 rgb_color right, rgb_color bottom);
74 private:
75 entry_ref* fRef;
76 char* fAppSig;
77 BString fDescription;
79 bool fAnticipatingDrop;
80 bigtime_t fLastClickTime;
81 BPoint fDragStart;
83 uint32 fIconSize;
85 static bigtime_t sClickSpeed;
86 static bool sIgnoreDoubleClick;
89 #endif // LAUNCH_BUTTON_H