~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/tools/kis_tool_zoom.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  Copyright (c) 1999 Matthias Elter  <me@kde.org>
3
 
 *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
4
 
 *  Copyright (c) 2004 Boudewijn Rempt <boud@valdyas.org>
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
 
 */
20
 
 
21
 
#ifndef KIS_ZOOM_TOOL_H_
22
 
#define KIS_ZOOM_TOOL_H_
23
 
 
24
 
#include "kis_tool_non_paint.h"
25
 
 
26
 
#include "kis_tool_factory.h"
27
 
 
28
 
class KisCanvasSubject;
29
 
 
30
 
class KisToolZoom : public KisToolNonPaint {
31
 
 
32
 
        typedef KisToolNonPaint super;
33
 
        Q_OBJECT
34
 
 
35
 
public:
36
 
        KisToolZoom();
37
 
        virtual ~KisToolZoom();
38
 
 
39
 
public:
40
 
        virtual void update(KisCanvasSubject *subject);
41
 
 
42
 
public:
43
 
        virtual void setup(KActionCollection *collection);
44
 
        virtual void buttonPress(KisButtonPressEvent *e);
45
 
        virtual void move(KisMoveEvent *e);
46
 
        virtual void buttonRelease(KisButtonReleaseEvent *e);
47
 
        virtual void paint(QPainter& gc);
48
 
        virtual void paint(QPainter& gc, const QRect& rc);
49
 
 
50
 
private:
51
 
        void paintOutline();
52
 
        void paintOutline(QPainter& gc, const QRect& rc);
53
 
 
54
 
private:
55
 
        KisCanvasSubject *m_subject;
56
 
        QPoint m_startPos;
57
 
        QPoint m_endPos;
58
 
        bool m_dragging;
59
 
};
60
 
 
61
 
 
62
 
class KisToolZoomFactory : public KisToolFactory {
63
 
        typedef KisToolFactory super;
64
 
public:
65
 
        KisToolZoomFactory(KActionCollection * ac) : super(ac) {};
66
 
        virtual ~KisToolZoomFactory(){};
67
 
        
68
 
        virtual KisTool * createTool() { 
69
 
                KisTool * t = new KisToolZoom(); 
70
 
                Q_CHECK_PTR(t);
71
 
                t -> setup(m_ac); 
72
 
                return t; 
73
 
        }
74
 
        virtual KisID id() { return KisID("zoom", i18n("Zoom tool")); }
75
 
};
76
 
 
77
 
 
78
 
#endif // KIS_ZOOM_TOOL_H_