karbon

vsheartool.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 __VSHEARTOOL_H__
21#define __VSHEARTOOL_H__
22
23#include "vtool.h"
24
25class VShearTool : public VTool
26{
27public:
28 VShearTool( KarbonView *view );
29 virtual ~VShearTool();
30
31 virtual void activate();
32
33 virtual void setup(TDEActionCollection *collection);
34 virtual TQString uiname() { return i18n( "Shear Tool" ); }
35 virtual enumToolType toolType() { return TOOL_MANIPULATION; }
36 virtual uint priority() { return 1; }
37 virtual TQString statusText();
38
39protected:
40 virtual void draw();
41
42 virtual void setCursor() const;
43 virtual void mouseButtonPress();
44 virtual void mouseDrag();
45 virtual void mouseDragRelease();
46
47 virtual void cancel();
48
49private:
50 void recalc();
51
52 KoPoint m_center;
53 double m_s1, m_s2;
54
55 VHandleNode m_activeNode;
56
57 // A list of temporary objects:
58 VObjectList m_objects;
59};
60
61#endif
62
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 draw(VPainter *painter)
Draws the actual tool state.
Definition vtool.h:158
virtual TQString uiname()
The name of the tool.
Definition vtool.h:93
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 uint priority()
Position in toolbox.
Definition vtool.h:114
virtual void setup(TDEActionCollection *)
Called after tool creation.
Definition vtool.h:144
virtual void setCursor() const
This function is called on each mouse event the tool receives.
Definition vtool.h:180
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