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 00079 void createObject(); 00080 00084 void initializePath( VPath &path ); 00085 00086 virtual void mouseMove(); 00087 virtual void mouseButtonPress(); 00088 virtual void mouseButtonRelease(); 00089 virtual void rightMouseButtonRelease(); 00090 virtual void mouseButtonDblClick(); 00091 virtual void mouseDrag(); 00092 virtual void mouseDragRelease(); 00093 virtual void mouseDragShiftPressed(); 00094 virtual void mouseDragCtrlPressed(); 00095 virtual void mouseDragShiftReleased(); 00096 virtual void mouseDragCtrlReleased(); 00097 00098 virtual void cancel(); 00099 virtual void cancelStep(); 00100 virtual void accept(); 00101 00105 QPtrList<KoPoint> m_bezierPoints; 00106 00110 KoPoint m_lastVectorStart; 00111 00115 KoPoint m_lastVectorEnd; 00116 00120 bool m_close; 00121 protected slots: 00122 void commandExecuted(); 00123 00124 private: 00125 QCursor* m_crossCursor; 00126 }; 00127 00128 #endif 00129