xref: /haiku/src/apps/icon-o-matic/import_export/svg/SVGExporter.h (revision 445d4fd926c569e7b9ae28017da86280aaecbae2)
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 SVG_EXPORTER_H
9 #define SVG_EXPORTER_H
10 
11 
12 #include "Exporter.h"
13 
14 #include <String.h>
15 
16 
17 _BEGIN_ICON_NAMESPACE
18 	class Gradient;
19 	class Shape;
20 	class Style;
21 	class Transformable;
22 _END_ICON_NAMESPACE
23 
24 _USING_ICON_NAMESPACE
25 
26 
27 class SVGExporter : public Exporter {
28  public:
29 								SVGExporter();
30 	virtual						~SVGExporter();
31 
32 	// Exporter
33 	virtual	status_t			Export(const Icon* icon, BPositionIO* stream);
34 
35 	virtual	const char*			MIMEType() { return "image/svg+xml"; }
36 	virtual	const char*			Extension() { return "svg"; }
37 
38 	// SVGExporter
39 			void				SetOriginalEntry(const entry_ref* ref);
40 
41  private:
42 			bool				_DisplayWarning() const;
43 
44 			status_t			_ExportShape(const Shape* shape,
45 											 BPositionIO* stream);
46 			status_t			_ExportGradient(const Gradient* gradient,
47 												BPositionIO* stream);
48 			void				_AppendMatrix(const Transformable* object,
49 											  BString& string) const;
50 
51 			status_t			_GetFill(const Style* style,
52 										 char* string,
53 										 BPositionIO* stream);
54 
55  			int32				fGradientCount;
56 			entry_ref*			fOriginalEntry;
57 };
58 
59 
60 #endif // SVG_EXPORTER_H
61