xref: /haiku/headers/os/interface/IconUtils.h (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright 2006-2008, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ICON_UTILS_H
6 #define _ICON_UTILS_H
7 
8 
9 #include <Mime.h>
10 
11 class BBitmap;
12 class BNode;
13 
14 
15 class BIconUtils {
16 								BIconUtils();
17 								~BIconUtils();
18 								BIconUtils(const BIconUtils&);
19 			BIconUtils&			operator=(const BIconUtils&);
20 
21 public:
22 	static	status_t			GetIcon(BNode* node,
23 									const char* vectorIconAttrName,
24 									const char* smallIconAttrName,
25 									const char* largeIconAttrName,
26 									icon_size size, BBitmap* result);
27 
28 	static	status_t			GetVectorIcon(BNode* node,
29 									const char* attrName, BBitmap* result);
30 
31 	static	status_t			GetVectorIcon(const uint8* buffer,
32 									size_t size, BBitmap* result);
33 
34 	static	status_t			GetCMAP8Icon(BNode* node,
35 									const char* smallIconAttrName,
36 									const char* largeIconAttrName,
37 									icon_size size, BBitmap* icon);
38 
39 	static	status_t			ConvertFromCMAP8(BBitmap* source,
40 									BBitmap* result);
41 	static	status_t			ConvertToCMAP8(BBitmap* source,
42 									BBitmap* result);
43 
44 	static	status_t			ConvertFromCMAP8(const uint8* data,
45 									uint32 width, uint32 height,
46 									uint32 bytesPerRow, BBitmap* result);
47 
48 	static	status_t			ConvertToCMAP8(const uint8* data,
49 									uint32 width, uint32 height,
50 									uint32 bytesPerRow, BBitmap* result);
51 };
52 
53 #endif	// _ICON_UTILS_H
54