libs/flake

KoParameterShape.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2006 Thorsten Zachmann <zachmann@kde.org>
00003    Copyright (C) 2007 Thomas Zander <zander@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KOPARAMETERSHAPE_H
00022 #define KOPARAMETERSHAPE_H
00023 
00024 #include "KoPathShape.h"
00025 #include "flake_export.h"
00026 
00027 class KoParameterShapePrivate;
00028 
00046 class FLAKE_EXPORT KoParameterShape : public KoPathShape
00047 {
00048 public:
00049     KoParameterShape();
00050     ~KoParameterShape();
00051 
00062     virtual void moveHandle(int handleId, const QPointF & point, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
00063 
00070     virtual int handleIdAt(const QRectF & rect) const;
00071 
00077     virtual QPointF handlePosition(int handleId);
00078 
00086     virtual void paintHandles(QPainter & painter, const KoViewConverter & converter, int handleRadius);
00087 
00096     virtual void paintHandle(QPainter & painter, const KoViewConverter & converter, int handleId, int handleRadius);
00097   
00103     virtual int getHandleCount();
00104     
00106     virtual void setSize(const QSizeF &size);
00107 
00115     bool isParametricShape() const;
00116 
00125     void setModified(bool modified);
00126 
00127     virtual QPointF normalize();
00128 
00129 protected:
00139     virtual void moveHandleAction(int handleId, const QPointF & point, Qt::KeyboardModifiers modifiers = Qt::NoModifier) = 0;
00140 
00146     virtual void updatePath(const QSizeF &size) = 0;
00147 
00149     QList<QPointF> m_handles;
00150 
00151 private:
00152     Q_DECLARE_PRIVATE(KoParameterShape)
00153 };
00154 
00155 #endif /* KOPARAMETERSHAPE_H */