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#include "IconBuild.h"
19
20
21class BMessage;
22class BPositionIO;
23
24
25_BEGIN_ICON_NAMESPACE
26
27
28class Icon;
29class LittleEndianBuffer;
30class PathContainer;
31class Shape;
32class ShapeContainer;
33class StyleContainer;
34
35#ifdef ICON_O_MATIC
36class FlatIconImporter : public Importer {
37#else
38class FlatIconImporter {
39#endif
40 public:
41								FlatIconImporter();
42	virtual						~FlatIconImporter();
43
44	// FlatIconImporter
45			status_t			Import(Icon* icon,
46									   BPositionIO* stream);
47
48			status_t			Import(Icon* icon,
49									   uint8* buffer, size_t size);
50
51 private:
52			status_t			_ParseSections(LittleEndianBuffer& buffer,
53											   Icon* icon);
54
55			status_t			_ParseStyles(LittleEndianBuffer& buffer,
56											 StyleContainer* styles);
57			status_t			_ParsePaths(LittleEndianBuffer& buffer,
58											PathContainer* paths);
59			Shape*				_ReadPathSourceShape(
60									LittleEndianBuffer& buffer,
61									StyleContainer* styles,
62									PathContainer* paths);
63			status_t			_ParseShapes(LittleEndianBuffer& buffer,
64											 StyleContainer* styles,
65											 PathContainer* paths,
66											 ShapeContainer* shapes);
67};
68
69
70_END_ICON_NAMESPACE
71
72
73#endif	// FLAT_ICON_IMPORTER_H
74