krita

kis_canvas_controller.h

00001 /*
00002  *  Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef KIS_CANVAS_CONTROLLER_H_
00020 #define KIS_CANVAS_CONTROLLER_H_
00021 
00022 #include <qglobal.h>
00023 #include <qpoint.h>
00024 #include <qrect.h>
00025 #include "kis_types.h"
00026 
00027 class QWidget;
00028 class KisTool;
00029 class KisRect;
00030 class KisPoint;
00031 class KisCanvas;
00032 class KisInputDevice;
00033 
00039 class KisCanvasController {
00040 public:
00041     KisCanvasController() {};
00042     virtual ~KisCanvasController() {};
00043 
00044 public:
00045 
00049     virtual KisCanvas *kiscanvas() const = 0;
00050 
00051 
00055     virtual Q_INT32 horzValue() const = 0;
00056 
00060     virtual Q_INT32 vertValue() const = 0;
00061     
00068     virtual void scrollTo(Q_INT32 x, Q_INT32 y) = 0;
00069     
00073     virtual void updateCanvas() = 0;
00074 
00075 
00080     virtual void updateCanvas(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) = 0;
00081 
00086     virtual void updateCanvas(const QRect& rc) = 0;
00087     
00091     virtual void zoomIn() = 0;
00092 
00099     virtual void zoomIn(Q_INT32 x, Q_INT32 y) = 0;
00100     
00104     virtual void zoomOut() = 0;
00105 
00106 
00113     virtual void zoomOut(Q_INT32 x, Q_INT32 y) = 0;
00114     
00122     virtual void zoomAroundPoint(double x, double y, double zf) = 0;
00123 
00129     virtual void zoomTo(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) = 0;
00130 
00136     virtual void zoomTo(const QRect& r) = 0;
00137     
00143     virtual void zoomTo(const KisRect& r) = 0;
00144     
00155     virtual QPoint viewToWindow(const QPoint& pt) = 0;
00156     virtual KisPoint viewToWindow(const KisPoint& pt) = 0;
00157     virtual QRect viewToWindow(const QRect& rc) = 0;
00158     virtual KisRect viewToWindow(const KisRect& rc) = 0;
00159     virtual void viewToWindow(Q_INT32 *x, Q_INT32 *y) = 0;
00160     
00164     virtual QPoint windowToView(const QPoint& pt) = 0;
00165     virtual KisPoint windowToView(const KisPoint& pt) = 0;
00166     virtual QRect windowToView(const QRect& rc) = 0;
00167     virtual KisRect windowToView(const KisRect& rc) = 0;
00168     virtual void windowToView(Q_INT32 *x, Q_INT32 *y) = 0;
00169     
00177     virtual QCursor setCanvasCursor(const QCursor & cursor) = 0;
00178     
00186     virtual void setInputDevice(KisInputDevice inputDevice) = 0;
00187 
00191     virtual KisInputDevice currentInputDevice() const = 0;
00192 
00193 
00194 private:
00195     KisCanvasController(const KisCanvasController&);
00196     KisCanvasController& operator=(const KisCanvasController&);
00197 };
00198 
00199 #endif // KIS_CANVAS_CONTROLLER_H_
00200 
KDE Home | KDE Accessibility Home | Description of Access Keys