karbon

vshapetool.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, 2002, 2003 The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __VSHAPETOOL_H__
21#define __VSHAPETOOL_H__
22
23#include <tqstring.h>
24
25#include <KoPoint.h>
26
27#include "vtool.h"
28
29
30class VPath;
31class VCursor;
32
33class VShapeTool : public VTool
34{
35public:
36 VShapeTool( KarbonView *view, const char *name, bool polar = false );
37
38 virtual enumToolType toolType() { return TOOL_SHAPE; }
39 virtual TQString statusText();
40 virtual TQString contextHelp();
41
42 virtual void activate();
43
44protected:
45 virtual void draw();
46
47 virtual void mouseButtonPress();
48 virtual void mouseButtonRelease();
49 virtual void mouseDrag();
50 virtual void mouseDragRelease();
51 virtual void mouseDragShiftPressed();
52 virtual void mouseDragCtrlPressed();
53 virtual void mouseDragShiftReleased();
54 virtual void mouseDragCtrlReleased();
55
56 virtual void cancel();
57
58 // Make it "abstract":
59 virtual ~VShapeTool();
60
61 virtual VPath* shape( bool interactive = false ) const = 0;
62
66 KoPoint m_p;
67 double m_d1;
68 double m_d2;
69
70private:
71 void recalc();
72
74 bool m_isPolar;
75
77 bool m_isSquare;
78 bool m_isCentered;
79
80 TQCursor* m_cursor;
81};
82
83#endif
A helper class for easily creating cursors from XPMs.
Definition vcursor.h:33
A composite path consists of one or many subpaths.
Definition vcomposite.h:48
The base class for all karbon tools.
Definition vtool.h:52
virtual void mouseDragRelease()
Mouse button release.
Definition vtool.h:220
virtual void mouseButtonPress()
Left mouse button press.
Definition vtool.h:185
virtual void mouseButtonRelease()
Left mouse button release.
Definition vtool.h:195
virtual void draw(VPainter *painter)
Draws the actual tool state.
Definition vtool.h:158
virtual void mouseDragCtrlReleased()
"Ctrl" key released while mouse drag.
Definition vtool.h:240
virtual void cancel()
Cancels all tool operations.
Definition vtool.h:255
virtual TQString statusText()
The tool status text.
Definition vtool.h:108
virtual void activate()
Called during the tool activation.
Definition vtool.cpp:252
virtual void mouseDragCtrlPressed()
Mouse drag with "Ctrl" key pressed at the same time.
Definition vtool.h:230
virtual void mouseDragShiftPressed()
Mouse drag with "Shift" key pressed at the same time.
Definition vtool.h:225
virtual void mouseDragShiftReleased()
"Shift" key released while mouse drag.
Definition vtool.h:235
virtual TQString contextHelp()
The context help of the tool.
Definition vtool.h:98
virtual enumToolType toolType()
The tool type.
Definition vtool.h:103
virtual void mouseDrag()
Mouse drag.
Definition vtool.h:215
KarbonView * view() const
Returns the connected karbon part.
Definition vtool.cpp:66