xref: /haiku/headers/private/shared/ToolBar.h (revision 85892ec52f476b254d75e2bb2e6560e72faa567c)
1 /*
2  * Copyright 2011-2015, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _TOOLBAR_H
6 #define _TOOLBAR_H
7 
8 #include <GroupView.h>
9 
10 
11 class BButton;
12 
13 namespace BPrivate {
14 
15 class BToolBar : public BGroupView {
16 public:
17 								BToolBar(BRect frame,
18 										 orientation ont = B_HORIZONTAL);
19 								BToolBar(orientation ont = B_HORIZONTAL);
20 	virtual						~BToolBar();
21 
22 	virtual	void				Hide();
23 
24 			void				AddAction(uint32 command, BHandler* target,
25 									const BBitmap* icon,
26 									const char* toolTipText = NULL,
27 									bool lockable = false);
28 			void				AddAction(BMessage* message, BHandler* target,
29 									const BBitmap* icon,
30 									const char* toolTipText = NULL,
31 									bool lockable = false);
32 			void				AddSeparator();
33 			void				AddGlue();
34 			void				AddView(BView* view);
35 
36 			void				SetActionEnabled(uint32 command, bool enabled);
37 			void				SetActionPressed(uint32 command, bool pressed);
38 			void				SetActionVisible(uint32 command, bool visible);
39 
40 private:
41 	virtual	void				Pulse();
42 	virtual	void				FrameResized(float width, float height);
43 
44 			void				_Init();
45 			BButton*			_FindButton(uint32 command) const;
46 			void				_HideToolTips() const;
47 
48 			orientation			fOrientation;
49 };
50 
51 } // namespace BPrivate
52 
53 using BPrivate::BToolBar;
54 
55 #endif // _TOOLBAR_H
56