karbon

vselectnodestool.h
1/* This file is part of the KDE project
2 Copyright (C) 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 __VSELECTNODESTOOL_H__
21#define __VSELECTNODESTOOL_H__
22
23#include "vtool.h"
24
25class VSelectNodesTool : public VTool
26{
27public:
28 VSelectNodesTool( KarbonView *view );
29 virtual ~VSelectNodesTool();
30
31 virtual void activate();
32
33 virtual void setup(TDEActionCollection *collection);
34 virtual TQString uiname() { return i18n( "Select Nodes Tool" ); }
35 virtual enumToolType toolType() { return TOOL_SELECT; }
36 virtual TQString statusText();
37 virtual uint priority() { return 1; }
38
39protected:
40 virtual void draw();
41
42 virtual void setCursor() const;
43
44 virtual void mouseButtonPress();
45 virtual void mouseButtonRelease();
46 virtual void mouseDragRelease();
47 virtual void mouseDrag();
48 virtual void rightMouseButtonPress();
49 virtual void rightMouseButtonRelease();
50
51 virtual bool keyReleased( TQt::Key );
52
53 virtual void cancel();
54
55private:
56 enum { normal, dragging, moving, movingbezier1, movingbezier2 } m_state;
57
58 void recalc();
59
60 KoRect calcSelRect( const KoPoint &pos ) const;
61
62 // A list of temporary objects:
63 VObjectList m_objects;
64
65 KoPoint m_current;
66 KoPoint m_first;
67
68 bool m_select;
69};
70
71#endif
72
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 bool keyReleased(TQt::Key)
Specified key released.
Definition vtool.h:250
virtual void rightMouseButtonRelease()
Right mouse button release.
Definition vtool.h:200
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 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 rightMouseButtonPress()
Right mouse button press.
Definition vtool.h:190
virtual void mouseDrag()
Mouse drag.
Definition vtool.h:215
KarbonView * view() const
Returns the connected karbon part.
Definition vtool.cpp:66