kpresenter

KPrSVGPathParser.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
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 KPRSVGPATHPARSER_H
21#define KPRSVGPATHPARSER_H
22
23#include <svgpathparser.h>
24#include "global.h"
25#include "KoPointArray.h"
26
27class KPrSVGPathParser : public SVGPathParser
28{
29public:
33 virtual ~KPrSVGPathParser() {};
34
48 ObjType getType( TQString &d );
49
58 KoPointArray getPoints( TQString &d, bool convert2lines = false );
59
60protected:
61 virtual void svgMoveTo( double x1, double y1, bool abs = true );
62 virtual void svgLineTo( double x1, double y1, bool abs = true );
63 virtual void svgCurveToCubic( double x1, double y1, double x2, double y2, double x, double y, bool abs = true );
64 virtual void svgClosePath();
65
66private:
68 bool m_type;
69 enum PathType
70 {
71 SEEN_MOVE = 1,
72 SEEN_LINE = 2,
73 SEEN_CUBIC = 4,
74 SEEN_QUADRIC = 8,
75 SEEN_CLOSE = 16,
76 NO_BEZIER = 32,
77 UNSUPPORTED = 64
78 };
80 int m_pathType;
81
83 KoPointArray m_points;
85 KoPoint m_curPoint;
87 int m_pointIdx;
89 bool m_convert2lines;
90};
91
92#endif /* KPRSVGPATHPARSER_H */