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
18class BMessageRunner;
19
20
21class _BMCFilter_ : public BMessageFilter {
22public:
23								_BMCFilter_(BMenuField* menuField, uint32 what);
24	virtual						~_BMCFilter_();
25
26	virtual	filter_result		Filter(BMessage* message, BHandler** handler);
27
28private:
29			_BMCFilter_&		operator=(const _BMCFilter_&);
30
31			BMenuField*			fMenuField;
32};
33
34
35class _BMCMenuBar_ : public BMenuBar {
36public:
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
60private:
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