xref: /haiku/headers/private/interface/BMCPrivate.h (revision 9642f7705b27e5c270c15fa526d14e1848c2c27d)
1 /*
2  * Copyright 2001-2013 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus, superstippi@gmx.de
7  *		Marc Flerackers, mflerackers@androme.be
8  *		John Scipione, jscipione@gmail.com
9  */
10 #ifndef _BMC_PRIVATE_H
11 #define _BMC_PRIVATE_H
12 
13 
14 #include <BeBuild.h>
15 #include <MenuBar.h>
16 #include <MessageFilter.h>
17 
18 
19 static const float kVMargin = 2.0f;
20 
21 
22 class _BMCFilter_ : public BMessageFilter {
23 public:
24 								_BMCFilter_(BMenuField* menuField, uint32 what);
25 	virtual						~_BMCFilter_();
26 
27 	virtual	filter_result		Filter(BMessage* message, BHandler** handler);
28 
29 private:
30 			_BMCFilter_&		operator=(const _BMCFilter_&);
31 
32 			BMenuField*			fMenuField;
33 };
34 
35 
36 class _BMCMenuBar_ : public BMenuBar {
37 public:
38 								_BMCMenuBar_(BRect frame, bool fixedSize,
39 									BMenuField* menuField);
40 								_BMCMenuBar_(BMenuField* menuField);
41 								_BMCMenuBar_(BMessage* data);
42 	virtual						~_BMCMenuBar_();
43 
44 	static	BArchivable*		Instantiate(BMessage* data);
45 
46 	virtual	void				AttachedToWindow();
47 	virtual	void				Draw(BRect updateRect);
48 	virtual	void				FrameResized(float width, float height);
49 	virtual	void				MakeFocus(bool focused = true);
50 	virtual	void				MessageReceived(BMessage* message);
51 	virtual	void				SetMaxContentWidth(float width);
52 	virtual	void				SetEnabled(bool enabled);
53 
54 			void				TogglePopUpMarker(bool show)
55 									{ fShowPopUpMarker = show; }
56 			bool				IsPopUpMarkerShown() const
57 									{ return fShowPopUpMarker; }
58 
59 	virtual	BSize				MinSize();
60 	virtual	BSize				MaxSize();
61 
62 private:
63 								_BMCMenuBar_&operator=(const _BMCMenuBar_&);
64 
65 			void				_Init();
66 
67 			BMenuField*			fMenuField;
68 			bool				fFixedSize;
69 			bool				fShowPopUpMarker;
70 			float				fPreviousWidth;
71 };
72 
73 
74 #endif // _BMC_PRIVATE_H
75