lib Library API Documentation

svgpathparser.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002, 2003 The Karbon Developers
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __SVGPATHPARSER_H__
00021 #define __SVGPATHPARSER_H__
00022 
00023 class QString;
00024 
00036 class SVGPathParser
00037 {
00038 public:
00039     void parseSVG( const QString &d, bool process = false );
00040 
00041 protected:
00042     virtual void svgMoveTo( double x1, double y1, bool abs = true ) = 0;
00043     virtual void svgLineTo( double x1, double y1, bool abs = true ) = 0;
00044     virtual void svgLineToHorizontal( double x, bool abs = true );
00045     virtual void svgLineToVertical( double y, bool abs = true );
00046     virtual void svgCurveToCubic( double x1, double y1, double x2, double y2, double x, double y, bool abs = true ) = 0;
00047     virtual void svgCurveToCubicSmooth( double x, double y, double x2, double y2, bool abs = true );
00048     virtual void svgCurveToQuadratic( double x, double y, double x1, double y1, bool abs = true );
00049     virtual void svgCurveToQuadraticSmooth( double x, double y, bool abs = true );
00050     virtual void svgArcTo( double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs = true );
00051     virtual void svgClosePath() = 0;
00052 
00053 private:
00054     const char *getCoord( const char *, double & );
00055     void calculateArc( bool relative, double &curx, double &cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag );
00056 };
00057 
00058 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Nov 17 13:19:28 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2003