kivio

tool_text.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2003 theKompany.com & Dave Marotti,
4 * Peter Simonsson
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20#ifndef TOOL_TEXT_H
21#define TOOL_TEXT_H
22
23#include "kivio_mousetool.h"
24#include <koffice_export.h>
25class TQMouseEvent;
26class TQCursor;
27
28namespace Kivio {
29 class MouseToolAction;
30}
31
32class KivioView;
33class KivioPage;
34class KoPoint;
35
36class KIVIO_EXPORT TextTool : public Kivio::MouseTool
37{
38 TQ_OBJECT
39
40 public:
41 TextTool( KivioView* parent );
42 ~TextTool();
43
44 virtual bool processEvent(TQEvent* e);
45
46 void text(TQRect);
47
48 public slots:
49 virtual void setActivated(bool a);
50 virtual void applyToolAction(TQPtrList<KivioStencil>* stencils);
51 virtual void applyToolAction(KivioStencil* stencil, const KoPoint& pos);
52
53 protected slots:
54 void makePermanent();
55
56 signals:
57 void operationDone();
58
59 protected:
60 void mousePress(TQMouseEvent *);
61 void mouseMove(TQMouseEvent *);
62 void mouseRelease(TQMouseEvent *);
63
64 bool startRubberBanding(TQMouseEvent*);
65 void continueRubberBanding(TQMouseEvent *);
66 void endRubberBanding(TQMouseEvent *);
67
68
69
70 TQPoint m_startPoint, m_releasePoint;
71
72 // Text Tool Mode
73 enum
74 {
75 stmNone,
76 stmDrawRubber
77 };
78
79 private:
80 // Flag to indicate that we are drawing a rubber band
81 int m_mode;
82 TQCursor* m_pTextCursor;
83 Kivio::MouseToolAction* m_textAction;
84 bool m_permanent;
85};
86
87#endif
88
89
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.