xref: /haiku/headers/private/shared/ToolBar.h (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
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 									const char* text = NULL,
28 									bool lockable = false);
29 			void				AddAction(BMessage* message, BHandler* target,
30 									const BBitmap* icon,
31 									const char* toolTipText = NULL,
32 									const char* text = NULL,
33 									bool lockable = false);
34 			void				AddSeparator();
35 			void				AddGlue();
36 			void				AddView(BView* view);
37 
38 			void				SetActionEnabled(uint32 command, bool enabled);
39 			void				SetActionPressed(uint32 command, bool pressed);
40 			void				SetActionVisible(uint32 command, bool visible);
41 
42 			BButton*			FindButton(uint32 command) const;
43 
44 private:
45 	virtual	void				Pulse();
46 	virtual	void				FrameResized(float width, float height);
47 
48 			void				_Init();
49 			void				_HideToolTips() const;
50 
51 			orientation			fOrientation;
52 };
53 
54 } // namespace BPrivate
55 
56 using BPrivate::BToolBar;
57 
58 #endif // _TOOLBAR_H
59