xref: /haiku/headers/private/interface/BMCPrivate.h (revision 893988af824e65e49e55f517b157db8386e8002b)
1 /*
2  * Copyright 2001-2009 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Marc Flerackers (mflerackers@androme.be)
7  *		Stephan Aßmus <superstippi@gmx.de>
8  */
9 #ifndef _BMC_PRIVATE_H
10 #define _BMC_PRIVATE_H
11 
12 
13 #include <BeBuild.h>
14 #include <MenuBar.h>
15 #include <MenuItem.h>
16 #include <MessageFilter.h>
17 
18 class BMessageRunner;
19 
20 
21 class _BMCFilter_ : public BMessageFilter {
22 public:
23 								_BMCFilter_(BMenuField* menuField, uint32 what);
24 	virtual						~_BMCFilter_();
25 
26 	virtual	filter_result		Filter(BMessage* message, BHandler** handler);
27 
28 private:
29 			_BMCFilter_&		operator=(const _BMCFilter_&);
30 
31 			BMenuField*			fMenuField;
32 };
33 
34 
35 class _BMCMenuBar_ : public BMenuBar {
36 public:
37 								_BMCMenuBar_(BRect frame, bool fixedSize,
38 									BMenuField* menuField);
39 								_BMCMenuBar_(bool fixedSize,
40 									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				MessageReceived(BMessage* msg);
50 	virtual	void				MakeFocus(bool focused = true);
51 
52 			void				TogglePopUpMarker(bool show)
53 									{ fShowPopUpMarker = show; }
54 			bool				IsPopUpMarkerShown() const
55 									{ return fShowPopUpMarker; }
56 
57 	virtual BSize				MinSize();
58 	virtual	BSize				MaxSize();
59 
60 private:
61 								_BMCMenuBar_&operator=(const _BMCMenuBar_&);
62 
63 			void				_Init(bool setMaxContentWidth);
64 
65 			BMenuField*			fMenuField;
66 			bool				fFixedSize;
67 			BMessageRunner*		fRunner;
68 			bool				fShowPopUpMarker;
69 			float				fPreviousWidth;
70 };
71 
72 #endif // _BMC_PRIVATE_H
73