xref: /haiku/headers/private/shared/IconView.h (revision 1a3518cf757c2da8006753f83962da5935bbc82b)
1 /*
2  * Copyright 2004-2020, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Adrien Destugues, pulkomandy@pulkomandy.tk
7  *		Michael Wilber
8  */
9 #ifndef ICONVIEW_H
10 #define ICONVIEW_H
11 
12 
13 #include <Bitmap.h>
14 #include <Mime.h>
15 #include <Path.h>
16 #include <View.h>
17 
18 
19 class IconView : public BView {
20 public:
21 							IconView(icon_size iconSize = B_LARGE_ICON);
22 
23 							~IconView();
24 
25 			status_t		InitCheck() const;
26 	virtual	void			Draw(BRect area);
27 
28 			void			DrawIcon(bool draw);
29 			status_t		SetIcon(const BPath& path,
30 								icon_size iconSize = B_LARGE_ICON);
31 			status_t		SetIcon(const uint8_t* hvifData, size_t size,
32 								icon_size iconSize = B_LARGE_ICON);
33 
34 private:
35 			void			_SetSize();
36 
37 			icon_size		fIconSize;
38 			BBitmap*		fIconBitmap;
39 			bool			fDrawIcon;
40 };
41 
42 #endif // #ifndef ICONVIEW_H
43