kivio

diapathparser.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003, The Kivio 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 __DIAPATHPARSER_H__
00021 #define __DIAPATHPARSER_H__
00022 
00023 #include "svgpathparser.h"
00024 #include <qvaluelist.h>
00025 #include <qdom.h>
00026 
00027 class DiaPointFinder : public SVGPathParser
00028 {
00029     public:
00030         DiaPointFinder(QValueList<float> *xlist,  QValueList<float> *ylist);
00031         void svgMoveTo( double x1, double y1, bool abs = true );
00032         void svgLineTo( double x1, double y1, bool abs = true );
00033         void svgCurveToCubic( double x1, double y1, double x2, double y2, double x3, double y3, bool abs = true );
00034         void svgClosePath();
00035 
00036     private:
00037         QValueList<float> *m_xlist;
00038         QValueList<float> *m_ylist;
00039 };
00040 
00041 class DiaPathParser : public SVGPathParser
00042 {
00043     public:
00044         DiaPathParser(QDomDocument *doc, QDomElement *shape, float xscale, float yscale, float lowestx, float lowesty);
00045 
00046         void svgMoveTo( double x1, double y1, bool abs = true );
00047         void svgLineTo( double x1, double y1, bool abs = true );
00048         void svgCurveToCubic( double x1, double y1, double x2, double y2, double x3, double y3, bool abs = true );
00049         void svgClosePath();
00050 
00051     private:
00052         float diaPointToKivio(float point, bool xpoint);
00053 
00054         QDomDocument *m_doc;
00055         QDomElement *m_shape;
00056         float lastX;
00057         float lastY;
00058         float m_xscale;
00059         float m_yscale;
00060         float m_lowestx;
00061         float m_lowesty;
00062 
00063 };
00064 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys