xref: /haiku/src/libs/icon/flat_icon/FlatIconImporter.h (revision b2537f99cdffc40818b65879120ecae67b29d7d9)
1 /*
2  * Copyright 2006-2007, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 #ifndef FLAT_ICON_IMPORTER_H
9 #define FLAT_ICON_IMPORTER_H
10 
11 
12 #ifdef ICON_O_MATIC
13 #	include "Importer.h"
14 #else
15 #	include <SupportDefs.h>
16 #endif
17 
18 class BMessage;
19 class BPositionIO;
20 
21 namespace BPrivate {
22 namespace Icon {
23 
24 class Icon;
25 class LittleEndianBuffer;
26 class PathContainer;
27 class Shape;
28 class ShapeContainer;
29 class StyleContainer;
30 
31 #ifdef ICON_O_MATIC
32 class FlatIconImporter : public Importer {
33 #else
34 class FlatIconImporter {
35 #endif
36  public:
37 								FlatIconImporter();
38 	virtual						~FlatIconImporter();
39 
40 	// FlatIconImporter
41 			status_t			Import(Icon* icon,
42 									   BPositionIO* stream);
43 
44 			status_t			Import(Icon* icon,
45 									   uint8* buffer, size_t size);
46 
47  private:
48 			status_t			_ParseSections(LittleEndianBuffer& buffer,
49 											   Icon* icon);
50 
51 			status_t			_ParseStyles(LittleEndianBuffer& buffer,
52 											 StyleContainer* styles);
53 			status_t			_ParsePaths(LittleEndianBuffer& buffer,
54 											PathContainer* paths);
55 			Shape*				_ReadPathSourceShape(
56 									LittleEndianBuffer& buffer,
57 									StyleContainer* styles,
58 									PathContainer* paths);
59 			status_t			_ParseShapes(LittleEndianBuffer& buffer,
60 											 StyleContainer* styles,
61 											 PathContainer* paths,
62 											 ShapeContainer* shapes);
63 };
64 
65 }	// namespace Icon
66 }	// namespace BPrivate
67 
68 #endif	// FLAT_ICON_IMPORTER_H
69