karbon
vshapetool.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 #ifndef __VSHAPETOOL_H__ 00021 #define __VSHAPETOOL_H__ 00022 00023 #include <qstring.h> 00024 00025 #include <KoPoint.h> 00026 00027 #include "vtool.h" 00028 00029 00030 class VPath; 00031 class VCursor; 00032 00033 class VShapeTool : public VTool 00034 { 00035 public: 00036 VShapeTool( KarbonView *view, const char *name, bool polar = false ); 00037 00038 virtual enumToolType toolType() { return TOOL_SHAPE; } 00039 virtual QString statusText(); 00040 virtual QString contextHelp(); 00041 00042 virtual void activate(); 00043 00044 protected: 00045 virtual void draw(); 00046 00047 virtual void mouseButtonPress(); 00048 virtual void mouseButtonRelease(); 00049 virtual void mouseDrag(); 00050 virtual void mouseDragRelease(); 00051 virtual void mouseDragShiftPressed(); 00052 virtual void mouseDragCtrlPressed(); 00053 virtual void mouseDragShiftReleased(); 00054 virtual void mouseDragCtrlReleased(); 00055 00056 virtual void cancel(); 00057 00058 // Make it "abstract": 00059 virtual ~VShapeTool(); 00060 00061 virtual VPath* shape( bool interactive = false ) const = 0; 00062 00066 KoPoint m_p; 00067 double m_d1; 00068 double m_d2; 00069 00070 private: 00071 void recalc(); 00072 00074 bool m_isPolar; 00075 00077 bool m_isSquare; 00078 bool m_isCentered; 00079 00080 QCursor* m_cursor; 00081 }; 00082 00083 #endif