kiviotargettool.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Peter Simonsson <psn@linux.se>,
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#ifndef KIVIOKIVIOTARGETTOOL_H
20#define KIVIOKIVIOTARGETTOOL_H
21
22#include <KoPoint.h>
23
24#include "kivio_mousetool.h"
25
26class TQMouseEvent;
27
28namespace Kivio {
29 class MouseToolAction;
30}
31
32class KivioStencil;
33class KivioView;
34
35namespace Kivio {
36 class TargetTool : public MouseTool
37 {
38 TQ_OBJECT
39
40 public:
41 TargetTool(KivioView* parent);
42 ~TargetTool();
43
44 virtual bool processEvent(TQEvent* e);
45
46 public slots:
47 virtual void setActivated(bool);
48 virtual void applyToolAction(KivioStencil* stencil, const KoPoint& pos);
49
50 protected slots:
51 void makePermanent();
52
53 protected:
54 void mousePress(TQMouseEvent* e);
55 void mouseMove(TQMouseEvent* e);
56
57 private:
58 Kivio::MouseToolAction* m_targetAction;
59 bool m_permanent;
60 };
61}
62
63#endif
Baseclass for mouse tools (like eg the select tool)
virtual void applyToolAction(TQPtrList< KivioStencil > *stencils)
This function should apply a change to stencils done by the tool.