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); 197d226266SAugustin 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, 2758ee42e9SAugustin Cavalier const char* text = NULL, 2894a4c1c4SAugustin Cavalier bool lockable = false); 2994a4c1c4SAugustin Cavalier void AddAction(BMessage* message, BHandler* target, 3094a4c1c4SAugustin Cavalier const BBitmap* icon, 3194a4c1c4SAugustin Cavalier const char* toolTipText = NULL, 3258ee42e9SAugustin Cavalier const char* text = NULL, 3394a4c1c4SAugustin Cavalier bool lockable = false); 3494a4c1c4SAugustin Cavalier void AddSeparator(); 3594a4c1c4SAugustin Cavalier void AddGlue(); 367d226266SAugustin Cavalier void AddView(BView* view); 3794a4c1c4SAugustin Cavalier 3894a4c1c4SAugustin Cavalier void SetActionEnabled(uint32 command, bool enabled); 3994a4c1c4SAugustin Cavalier void SetActionPressed(uint32 command, bool pressed); 4094a4c1c4SAugustin Cavalier void SetActionVisible(uint32 command, bool visible); 4194a4c1c4SAugustin Cavalier 42*6b871266SAxel Dörfler BButton* FindButton(uint32 command) const; 43*6b871266SAxel Dörfler 4494a4c1c4SAugustin Cavalier private: 4594a4c1c4SAugustin Cavalier virtual void Pulse(); 4694a4c1c4SAugustin Cavalier virtual void FrameResized(float width, float height); 4794a4c1c4SAugustin Cavalier 487d226266SAugustin Cavalier void _Init(); 4994a4c1c4SAugustin Cavalier void _HideToolTips() const; 5094a4c1c4SAugustin Cavalier 5194a4c1c4SAugustin Cavalier orientation fOrientation; 5294a4c1c4SAugustin Cavalier }; 5394a4c1c4SAugustin Cavalier 5494a4c1c4SAugustin Cavalier } // namespace BPrivate 5594a4c1c4SAugustin Cavalier 5694a4c1c4SAugustin Cavalier using BPrivate::BToolBar; 5794a4c1c4SAugustin Cavalier 5894a4c1c4SAugustin Cavalier #endif // _TOOLBAR_H 59