karbon
vpolylinetool.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2001, 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 00021 #ifndef __VPOLYLINETOOL_H__ 00022 #define __VPOLYLINETOOL_H__ 00023 00024 00025 #include <qptrlist.h> 00026 #include <qstring.h> 00027 00028 #include "KoPoint.h" 00029 00030 #include "vtool.h" 00031 00032 00033 class QLabel; 00034 class QWidget; 00035 class VPath; 00036 class QCursor; 00037 00049 class VPolylineTool : public VTool 00050 { 00051 Q_OBJECT 00052 00053 public: 00054 VPolylineTool( KarbonView *view ); 00055 ~VPolylineTool(); 00056 00057 virtual void setup(KActionCollection *collection); 00058 virtual void activate(); 00059 virtual void deactivate(); 00060 00061 virtual QString uiname() { return i18n( "Polyline Tool" ); } 00062 virtual QString contextHelp(); 00063 virtual enumToolType toolType() { return TOOL_FREEHAND; } 00064 00065 protected: 00069 void draw(); 00070 00074 void drawBezierVector( KoPoint& start, KoPoint& end ); 00075 00076 virtual void mouseMove(); 00077 virtual void mouseButtonPress(); 00078 virtual void mouseButtonRelease(); 00079 virtual void rightMouseButtonRelease(); 00080 virtual void mouseButtonDblClick(); 00081 virtual void mouseDrag(); 00082 virtual void mouseDragRelease(); 00083 virtual void mouseDragShiftPressed(); 00084 virtual void mouseDragCtrlPressed(); 00085 virtual void mouseDragShiftReleased(); 00086 virtual void mouseDragCtrlReleased(); 00087 00088 virtual void cancel(); 00089 virtual void cancelStep(); 00090 virtual void accept(); 00091 00095 QPtrList<KoPoint> m_bezierPoints; 00096 00100 KoPoint m_lastVectorStart; 00101 00105 KoPoint m_lastVectorEnd; 00106 00110 bool m_close; 00111 protected slots: 00112 void commandExecuted(); 00113 00114 private: 00115 QCursor* m_crossCursor; 00116 }; 00117 00118 #endif 00119