xref: /haiku/src/apps/processcontroller/IconMenuItem.h (revision 21258e2674226d6aa732321b6f8494841895af5f)
1 /*
2 
3 	IconMenuItem.h
4 
5 	ProcessController
6 	(c) 2000, Georges-Edouard Berenger, All Rights Reserved.
7 	Copyright (C) 2004 beunited.org
8 
9 	This library is free software; you can redistribute it and/or
10 	modify it under the terms of the GNU Lesser General Public
11 	License as published by the Free Software Foundation; either
12 	version 2.1 of the License, or (at your option) any later version.
13 
14 	This library is distributed in the hope that it will be useful,
15 	but WITHOUT ANY WARRANTY; without even the implied warranty of
16 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 	Lesser General Public License for more details.
18 
19 	You should have received a copy of the GNU Lesser General Public
20 	License along with this library; if not, write to the Free Software
21 	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22 
23 */
24 #ifndef _ICON_MENU_ITEM_H_
25 #define _ICON_MENU_ITEM_H_
26 
27 #include <MenuItem.h>
28 
29 
30 class BBitmap;
31 
32 
33 class IconMenuItem : public BMenuItem {
34 	public:
35 		IconMenuItem(BBitmap*, const char* title,
36 			BMessage*, bool drawText = true, bool purge = false);
37 
38 		IconMenuItem(BBitmap*, BMenu*, bool drawText = true,
39 			bool purge = false);
40 
41 		IconMenuItem(const char* mime, const char* title, BMessage*,
42 			bool drawText = true);
43 
44 		virtual ~IconMenuItem();
45 		virtual	void DrawContent();
46 		virtual	void Highlight(bool isHighlighted);
47 		virtual	void GetContentSize(float* width, float* height);
48 
49 		static	int	MinHeight();
50 
51 	private:
52 		void DefaultIcon(const char* mime);
53 		void DrawIcon();
54 
55 		BBitmap*	fIcon;
56 		bool		fDrawText;
57 		bool		fPurge;
58 };
59 
60 #endif // _ICON_MENU_ITEM_H_
61