filters

karbon/svg/svgexport.h
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 __SVGEXPORT_H__
21#define __SVGEXPORT_H__
22
23#include <KoFilter.h>
24
25#include "vvisitor.h"
26#include "vgradient.h"
27
28#include "svggraphiccontext.h"
29
30#include <tqptrstack.h>
31
32class TQTextStream;
33class VColor;
34class VPath;
35class VDocument;
36class VFill;
37class VGroup;
38class VImage;
39class VLayer;
40class VSubpath;
41class VStroke;
42class VText;
43class VTransformCmd;
44
45
46class SvgExport : public KoFilter, private VVisitor
47{
48 TQ_OBJECT
49
50
51public:
52 SvgExport( KoFilter* parent, const char* name, const TQStringList& );
53 virtual ~SvgExport() {}
54
55 virtual KoFilter::ConversionStatus convert( const TQCString& from, const TQCString& to );
56
57private:
58 virtual void visitVPath( VPath& composite );
59 virtual void visitVDocument( VDocument& document );
60 virtual void visitVGroup( VGroup& group );
61 virtual void visitVImage( VImage& image );
62 virtual void visitVLayer( VLayer& layer );
63 virtual void visitVSubpath( VSubpath& path );
64 virtual void visitVText( VText& text );
65
66 void getStroke( const VStroke& stroke, TQTextStream *stream );
67 void getColorStops( const TQPtrVector<VColorStop> &colorStops );
68 void getFill( const VFill& fill, TQTextStream *stream );
69 void getGradient( const VGradient& grad );
70 void getPattern( const VPattern& patt );
71 void getHexColor( TQTextStream *, const VColor& color );
72 TQString getID( VObject *obj );
73
74 void writePathToStream( VPath &composite, const TQString &id, TQTextStream *stream, unsigned int indent );
75
76 TQTextStream* m_stream;
77 TQTextStream* m_defs;
78 TQTextStream* m_body;
79
80 TQPtrStack<SvgGraphicsContext> m_gc;
81
82 unsigned int m_indent;
83 unsigned int m_indent2;
84
85 VTransformCmd *m_trans;
86};
87
88#endif
89