karbon

vpolylinetool.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
21#ifndef __VPOLYLINETOOL_H__
22#define __VPOLYLINETOOL_H__
23
24
25#include <tqptrlist.h>
26#include <tqstring.h>
27
28#include "KoPoint.h"
29
30#include "vtool.h"
31
32
33class TQLabel;
34class TQWidget;
35class VPath;
36class TQCursor;
37
49class VPolylineTool : public VTool
50{
51 TQ_OBJECT
52
53
54 public:
55 VPolylineTool( KarbonView *view );
57
58 virtual void setup(TDEActionCollection *collection);
59 virtual void activate();
60 virtual void deactivate();
61
62 virtual TQString uiname() { return i18n( "Polyline Tool" ); }
63 virtual TQString contextHelp();
64 virtual enumToolType toolType() { return TOOL_FREEHAND; }
65
66 protected:
70 void draw();
71
75 void drawBezierVector( KoPoint& start, KoPoint& end );
76
80 void createObject();
81
85 void initializePath( VPath &path );
86
87 virtual void mouseMove();
88 virtual void mouseButtonPress();
89 virtual void mouseButtonRelease();
90 virtual void rightMouseButtonRelease();
91 virtual void mouseButtonDblClick();
92 virtual void mouseDrag();
93 virtual void mouseDragRelease();
94 virtual void mouseDragShiftPressed();
95 virtual void mouseDragCtrlPressed();
96 virtual void mouseDragShiftReleased();
97 virtual void mouseDragCtrlReleased();
98
99 virtual void cancel();
100 virtual void cancelStep();
101 virtual void accept();
102
106 TQPtrList<KoPoint> m_bezierPoints;
107
112
117
122 protected slots:
123 void commandExecuted();
124
125 private:
126 TQCursor* m_crossCursor;
127};
128
129#endif
130
A composite path consists of one or many subpaths.
Definition vcomposite.h:48
The polyline tool.
void initializePath(VPath &path)
Initializes the specified path with the actual bezier points.
virtual void mouseDragCtrlReleased()
"Ctrl" key released while mouse drag.
virtual TQString contextHelp()
The context help of the tool.
virtual void activate()
Called during the tool activation.
virtual void mouseDrag()
Mouse drag.
KoPoint m_lastVectorEnd
The end of the last drawn vector.
virtual void mouseDragRelease()
Mouse button release.
virtual void cancelStep()
Cancels the last tool step (if any).
virtual void deactivate()
Deactivates the tool.
virtual void mouseButtonRelease()
Left mouse button release.
virtual void setup(TDEActionCollection *collection)
Called after tool creation.
void drawBezierVector(KoPoint &start, KoPoint &end)
Helper method: draws a bezier vector.
virtual void mouseButtonPress()
Left mouse button press.
virtual void mouseDragShiftPressed()
Mouse drag with "Shift" key pressed at the same time.
virtual void rightMouseButtonRelease()
Right mouse button release.
TQPtrList< KoPoint > m_bezierPoints
The list of this polyline points.
void createObject()
Creates the polyline from the bezier points.
virtual void accept()
Terminates the current tool drawing (if any).
virtual enumToolType toolType()
The tool type.
virtual void mouseDragShiftReleased()
"Shift" key released while mouse drag.
virtual void cancel()
Cancels all tool operations.
virtual void mouseMove()
Mouse move.
virtual void mouseDragCtrlPressed()
Mouse drag with "Ctrl" key pressed at the same time.
bool m_close
Indicates if the polyline is to close.
virtual TQString uiname()
The name of the tool.
virtual void mouseButtonDblClick()
Mouse button double click.
void draw()
Helper method: draws the polyline.
KoPoint m_lastVectorStart
The start of the last drawn vector.
The base class for all karbon tools.
Definition vtool.h:52
KarbonView * view() const
Returns the connected karbon part.
Definition vtool.cpp:66