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