F:/KPlato/koffice/libs/kopainter/svgpathparser.h

Aller à la documentation de ce fichier.
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., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __SVGPATHPARSER_H__
00021 #define __SVGPATHPARSER_H__
00022 
00023 class QString;
00024 
00025 #include <koffice_export.h>
00037 class KOPAINTER_EXPORT SVGPathParser
00038 {
00039 public:
00040         virtual ~SVGPathParser(){}
00041         void parseSVG( const QString &d, bool process = false );
00042 
00043 protected:
00044         virtual void svgMoveTo( double x1, double y1, bool abs = true ) = 0;
00045         virtual void svgLineTo( double x1, double y1, bool abs = true ) = 0;
00046         virtual void svgLineToHorizontal( double x, bool abs = true );
00047         virtual void svgLineToVertical( double y, bool abs = true );
00048         virtual void svgCurveToCubic( double x1, double y1, double x2, double y2, double x, double y, bool abs = true ) = 0;
00049         virtual void svgCurveToCubicSmooth( double x, double y, double x2, double y2, bool abs = true );
00050         virtual void svgCurveToQuadratic( double x, double y, double x1, double y1, bool abs = true );
00051         virtual void svgCurveToQuadraticSmooth( double x, double y, bool abs = true );
00052         virtual void svgArcTo( double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs = true );
00053         virtual void svgClosePath() = 0;
00054 
00055 private:
00056         const char *getCoord( const char *, double & );
00057         void calculateArc( bool relative, double &curx, double &cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag );
00058 };
00059 
00060 #endif

Généré le Wed Nov 22 23:41:06 2006 pour KPlato par  doxygen 1.5.1-p1