1 /* This file is part of the KDE project
2    Copyright (C) 2002, 2003 The Karbon Developers
3 
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License as published by the Free Software Foundation; either
7    version 2 of the License, or (at your option) any later version.
8 
9    This library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Library General Public License for more details.
13 
14    You should have received a copy of the GNU Library General Public License
15    along with this library; see the file COPYING.LIB.  If not, write to
16    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __XAMLEXPORT_H__
21 #define __XAMLEXPORT_H__
22 
23 #include <KoFilter.h>
24 
25 #include "vvisitor.h"
26 #include "vgradient.h"
27 
28 #include "xamlgraphiccontext.h"
29 
30 #include <QStack>
31 #include <QTextStream>
32 #include <QByteArray>
33 #include <QVariantList>
34 
35 class QTextStream;
36 class VColor;
37 class VPath;
38 class KarbonDocument;
39 class VFill;
40 class VGroup;
41 class VSubpath;
42 class VStroke;
43 class VText;
44 
45 
46 class XAMLExport : public KoFilter, private VVisitor
47 {
48     Q_OBJECT
49 
50 public:
51     XAMLExport(KoFilter* parent, const char* name, const QVariantList&);
~XAMLExport()52     virtual ~XAMLExport() {}
53 
54     virtual KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
55 
56 private:
57     virtual void visitVPath(VPath& composite);
58     virtual void visitVDocument(KarbonDocument& document);
59     virtual void visitVGroup(VGroup& group);
60     virtual void visitVSubpath(VSubpath& path);
61     //virtual void visitVText( VText& text );
62 
63     void getStroke(const VStroke& stroke);
64     void getColorStops(const QVector<VColorStop*> &colorStops);
65     void getFill(const VFill& fill);
66     void getGradient(const VGradient& grad);
67     void getHexColor(QTextStream *, const VColor& color);
68     QString getID(VObject *obj);
69 
70     QTextStream* m_stream;
71     QTextStream* m_defs;
72     QTextStream* m_body;
73 
74     QStack<XAMLGraphicsContext*> m_gc;
75 };
76 
77 #endif
78 
79