chalk

kis_tool_non_paint.h
1/*
2 * Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program 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
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef KIS_TOOL_NON_PAINT_H_
20#define KIS_TOOL_NON_PAINT_H_
21
22#include <tqcursor.h>
23#include <tqcolor.h>
24#include <tqwidget.h>
25
26#include "kis_global.h"
27#include "kis_types.h"
28#include "kis_tool.h"
29#include <koffice_export.h>
30
31class TQEvent;
32class TQKeyEvent;
33class TQPaintEvent;
34class TQRect;
35class KDialog;
37
38
39class KRITACORE_EXPORT KisToolNonPaint : public KisTool {
40
41 TQ_OBJECT
42
43 typedef KisTool super;
44
45public:
46 KisToolNonPaint(const TQString & UIName);
47 virtual ~KisToolNonPaint();
48
49// CanvasObserver
50public:
51 virtual void update(KisCanvasSubject *subject);
52
53// KisTool
54public:
55 virtual void paint(KisCanvasPainter& gc);
56 virtual void paint(KisCanvasPainter& gc, const TQRect& rc);
57
58 virtual void buttonPress(KisButtonPressEvent *e);
59 virtual void move(KisMoveEvent *e);
60 virtual void buttonRelease(KisButtonReleaseEvent *e);
61 virtual void doubleClick(KisDoubleClickEvent *e);
62 virtual void keyPress(TQKeyEvent *e);
63 virtual void keyRelease(TQKeyEvent *e);
64
65 virtual TQCursor cursor();
66 virtual void setCursor(const TQCursor& cursor);
67
68 virtual enumToolType toolType() { return TOOL_VIEW; }
69
70public slots:
71 virtual void activate();
72 virtual void deactivate();
73
74protected:
75 void notifyModified() const;
76
77protected:
78 KisCanvasSubject *m_subject;
79
80private:
81 TQCursor m_cursor;
82};
83
84#endif // KIS_TOOL_NON_PAINT_H_
85
virtual void update(KisCanvasSubject *subject)=0
Implement this function to query the KisCanvasSubject implementation about state that may be interest...
KisCanvasSubject is part of the Observer pattern.