kpresenter

KPrBezierCurveObject.h

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
00004    Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef kpcubicbeziercurveobject_h
00023 #define kpcubicbeziercurveobject_h
00024 
00025 #include "KPrPointObject.h"
00026 
00027 class QPainter;
00028 class DCOPObject;
00029 
00030 class KPrBezierCurveObject : public KPrPointObject
00031 {
00032 public:
00033     KPrBezierCurveObject();
00034     KPrBezierCurveObject( const KoPointArray &_controlPoints, const KoPointArray &_allPoints, const KoSize & _size,
00035                           const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
00036     virtual ~KPrBezierCurveObject() {}
00037 
00038     virtual QDomDocumentFragment save( QDomDocument& doc,double offset );
00039 
00040     virtual double load( const QDomElement &element );
00041     virtual void loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo* info );
00042 
00043     virtual void flip(bool horizontal );
00044 
00045     static KoPointArray bezier2polyline( const KoPointArray &bezierPoints );
00046 
00047 protected:
00048     virtual const char * getOasisElementName() const;
00049     virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
00050 
00051     virtual void updatePoints( double _fx, double _fy );
00052     virtual KoPointArray getDrawingPoints() const;
00053 
00054     KoPointArray allPoints;
00055 
00056 private:
00057     // Don't assign it
00058     KPrBezierCurveObject &operator=( const KPrBezierCurveObject & );
00059 };
00060 
00061 
00062 class KPrCubicBezierCurveObject : public KPrBezierCurveObject
00063 {
00064 public:
00065     KPrCubicBezierCurveObject();
00066     KPrCubicBezierCurveObject( const KoPointArray &_controlPoints, const KoPointArray &_allPoints, const KoSize & _size,
00067                                const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
00068     virtual ~KPrCubicBezierCurveObject() {}
00069 
00070     virtual DCOPObject* dcopObject();
00071 
00072     virtual ObjType getType() const { return OT_CUBICBEZIERCURVE; }
00073     virtual QString getTypeString() const { return i18n( "Cubic Bezier Curve" ); }
00074 };
00075 
00076 class KPrQuadricBezierCurveObject : public KPrBezierCurveObject
00077 {
00078 public:
00079     KPrQuadricBezierCurveObject();
00080     KPrQuadricBezierCurveObject( const KoPointArray &_controlPoints, const KoPointArray &_allPoints, const KoSize & _size,
00081                                  const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
00082     virtual ~KPrQuadricBezierCurveObject() {}
00083 
00084     virtual DCOPObject* dcopObject();
00085 
00086     virtual ObjType getType() const { return OT_CUBICBEZIERCURVE; }
00087     virtual QString getTypeString() const { return i18n( "Quadric Bezier Curve" ); }
00088 };
00089 
00090 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys