kpresenter
KPrSVGPathParser.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPRSVGPATHPARSER_H
00021 #define KPRSVGPATHPARSER_H
00022
00023 #include <svgpathparser.h>
00024 #include "global.h"
00025 #include "KoPointArray.h"
00026
00027 class KPrSVGPathParser : public SVGPathParser
00028 {
00029 public:
00033 virtual ~KPrSVGPathParser() {};
00034
00048 ObjType getType( QString &d );
00049
00058 KoPointArray getPoints( QString &d, bool convert2lines = false );
00059
00060 protected:
00061 virtual void svgMoveTo( double x1, double y1, bool abs = true );
00062 virtual void svgLineTo( double x1, double y1, bool abs = true );
00063 virtual void svgCurveToCubic( double x1, double y1, double x2, double y2, double x, double y, bool abs = true );
00064 virtual void svgClosePath();
00065
00066 private:
00068 bool m_type;
00069 enum PathType
00070 {
00071 SEEN_MOVE = 1,
00072 SEEN_LINE = 2,
00073 SEEN_CUBIC = 4,
00074 SEEN_QUADRIC = 8,
00075 SEEN_CLOSE = 16,
00076 NO_BEZIER = 32,
00077 UNSUPPORTED = 64
00078 };
00080 int m_pathType;
00081
00083 KoPointArray m_points;
00085 KoPoint m_curPoint;
00087 int m_pointIdx;
00089 bool m_convert2lines;
00090 };
00091
00092 #endif
|