194a4c1c4SAugustin Cavalier /* 294a4c1c4SAugustin Cavalier * Copyright 2011-2015, Haiku, Inc. All rights reserved. 394a4c1c4SAugustin Cavalier * Distributed under the terms of the MIT License. 494a4c1c4SAugustin Cavalier */ 594a4c1c4SAugustin Cavalier #ifndef _TOOLBAR_H 694a4c1c4SAugustin Cavalier #define _TOOLBAR_H 794a4c1c4SAugustin Cavalier 894a4c1c4SAugustin Cavalier #include <GroupView.h> 994a4c1c4SAugustin Cavalier 1094a4c1c4SAugustin Cavalier 1194a4c1c4SAugustin Cavalier class BButton; 1294a4c1c4SAugustin Cavalier 1394a4c1c4SAugustin Cavalier namespace BPrivate { 1494a4c1c4SAugustin Cavalier 1594a4c1c4SAugustin Cavalier class BToolBar : public BGroupView { 1694a4c1c4SAugustin Cavalier public: 1794a4c1c4SAugustin Cavalier BToolBar(BRect frame, 1894a4c1c4SAugustin Cavalier orientation ont = B_HORIZONTAL); 19*7d226266SAugustin Cavalier BToolBar(orientation ont = B_HORIZONTAL); 2094a4c1c4SAugustin Cavalier virtual ~BToolBar(); 2194a4c1c4SAugustin Cavalier 2294a4c1c4SAugustin Cavalier virtual void Hide(); 2394a4c1c4SAugustin Cavalier 2494a4c1c4SAugustin Cavalier void AddAction(uint32 command, BHandler* target, 2594a4c1c4SAugustin Cavalier const BBitmap* icon, 2694a4c1c4SAugustin Cavalier const char* toolTipText = NULL, 2794a4c1c4SAugustin Cavalier bool lockable = false); 2894a4c1c4SAugustin Cavalier void AddAction(BMessage* message, BHandler* target, 2994a4c1c4SAugustin Cavalier const BBitmap* icon, 3094a4c1c4SAugustin Cavalier const char* toolTipText = NULL, 3194a4c1c4SAugustin Cavalier bool lockable = false); 3294a4c1c4SAugustin Cavalier void AddSeparator(); 3394a4c1c4SAugustin Cavalier void AddGlue(); 34*7d226266SAugustin Cavalier void AddView(BView* view); 3594a4c1c4SAugustin Cavalier 3694a4c1c4SAugustin Cavalier void SetActionEnabled(uint32 command, bool enabled); 3794a4c1c4SAugustin Cavalier void SetActionPressed(uint32 command, bool pressed); 3894a4c1c4SAugustin Cavalier void SetActionVisible(uint32 command, bool visible); 3994a4c1c4SAugustin Cavalier 4094a4c1c4SAugustin Cavalier private: 4194a4c1c4SAugustin Cavalier virtual void Pulse(); 4294a4c1c4SAugustin Cavalier virtual void FrameResized(float width, float height); 4394a4c1c4SAugustin Cavalier 44*7d226266SAugustin Cavalier void _Init(); 4594a4c1c4SAugustin Cavalier BButton* _FindButton(uint32 command) const; 4694a4c1c4SAugustin Cavalier void _HideToolTips() const; 4794a4c1c4SAugustin Cavalier 4894a4c1c4SAugustin Cavalier orientation fOrientation; 4994a4c1c4SAugustin Cavalier }; 5094a4c1c4SAugustin Cavalier 5194a4c1c4SAugustin Cavalier } // namespace BPrivate 5294a4c1c4SAugustin Cavalier 5394a4c1c4SAugustin Cavalier using BPrivate::BToolBar; 5494a4c1c4SAugustin Cavalier 5594a4c1c4SAugustin Cavalier #endif // _TOOLBAR_H 56