00001 /* This file is part of the KDE project 00002 Copyright (C) 2006 Thorsten Zachmann <zachmann@kde.org> 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 KOPARAMETERSHAPE_H 00021 #define KOPARAMETERSHAPE_H 00022 00023 #include "KoPathShape.h" 00024 00025 class KoParameterShape : public KoPathShape 00026 { 00027 public: 00028 KoParameterShape(); 00029 ~KoParameterShape(); 00030 00041 virtual void moveHandle( int handleId, const QPointF & point, Qt::KeyboardModifiers modifiers = Qt::NoModifier ); 00042 00049 virtual int handleIdAt( const QRectF & rect ) const; 00050 00056 virtual QPointF handlePosition( int handleId ); 00057 00064 virtual void paintHandles( QPainter & painter, const KoViewConverter & converter ); 00065 00073 virtual void paintHandle( QPainter & painter, const KoViewConverter & converter, int handleId ); 00074 00075 virtual void resize( const QSizeF &newSize ); 00076 00084 bool isParametricShape() const { return !m_modified; } 00085 00094 void setModified( bool modified ) { m_modified = modified; } 00095 00096 virtual QPointF normalize(); 00097 00098 protected: 00108 virtual void moveHandleAction( int handleId, const QPointF & point, Qt::KeyboardModifiers modifiers = Qt::NoModifier ) = 0; 00109 00115 virtual void updatePath( const QSizeF &size ) = 0; 00116 00117 QList<QPointF> m_handles; 00118 bool m_modified; 00119 }; 00120 00121 #endif /* KOPARAMETERSHAPE_H */