F:/KPlato/koffice/libs/flake/KoCanvasBase.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002 
00003    Copyright (C) 2006 Boudewijn Rempt <boud@valdyas.org>
00004    Copyright (C) 2006 Thomas Zander <zander@kde.org>
00005    Copyright (C) 2006 Thorsten Zachmann <zachmann@kde.org>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef KOCANVASBASE_H
00024 #define KOCANVASBASE_H
00025 
00026 #include <KoUnit.h>
00027 
00028 #include <QPointF>
00029 #include <QPoint>
00030 #include <QRectF>
00031 #include <QRect>
00032 #include <QWidget>
00033 
00034 
00035 class KoCanvasResourceProvider;
00036 class KoSelection;
00037 class KCommand;
00038 class KoShapeManager;
00039 class KoToolProxy;
00040 class KoViewConverter;
00041 
00047 class KoCanvasBase {
00048 
00049 public:
00050 
00051     KoCanvasBase();
00052     virtual ~KoCanvasBase();
00053 
00054 public:
00055 
00062     virtual void gridSize(double *horizontal, double *vertical) const = 0;
00063 
00068     virtual bool snapToGrid() const = 0;
00069 
00082     virtual void addCommand(KCommand *command, bool execute = true) = 0;
00083 
00088     virtual KoShapeManager *shapeManager() const = 0;
00089 
00094     virtual void updateCanvas(const QRectF& rc) = 0;
00095 
00101     virtual KoToolProxy * toolProxy() = 0;
00102 
00107     virtual KoViewConverter *viewConverter() = 0;
00108 
00112     virtual QWidget* canvasWidget() = 0;
00113 
00119     virtual KoUnit::Unit unit() = 0;
00120 
00126     virtual QPoint documentOrigin() { return QPoint(0,0); };
00127 
00133     KoCanvasResourceProvider * resourceProvider()
00134     {
00135         return m_resourceProvider;
00136     }
00137 
00138 #if 0
00139 /*  The next list of methods are naming taken from Krita, which means they have already been
00140     toughened by time.  So, if you ever need a method in this interface; please uncomment the
00141     respective one here for good naming conventions.  It will probably save you time in
00142     implementing some of the methods in the different KOffice apps as well ;)
00143 */
00144 
00145 
00146     virtual KoSelection * currentSelection() const 0;
00147 
00151     virtual qint32 horizontalScrollbarValue() const  0;
00152 
00156     virtual qint32 verticalScrollbarValue() const  0;
00157 q
00164     virtual void scrollTo(qint32 x, qint32 y)  0;
00165 
00169     virtual void updateCanvas()  0;
00170 
00175     virtual void updateCanvas(qint32 x, qint32 y, qint32 w, qint32 h)  0;
00176 
00180     virtual void zoomIn()  0;
00181 
00191     virtual void zoomIn(qint32 x, qint32 y)  0;
00192 
00196     virtual void zoomOut()  0;
00197 
00198 
00205     virtual void zoomOut(qint32 x, qint32 y)  0;
00206 
00214     virtual void zoomAroundPoint(double x, double y, double zf)  0;
00215 
00221     virtual void zoomTo(qint32 x, qint32 y, qint32 w, qint32 h)  0;
00222 
00228     virtual void zoomTo(const QRect& r)  0;
00229 
00235     virtual void zoomTo(const QRectF& r)  0;
00236 
00247     virtual QPoint viewToWindow(const QPoint& pt)  0;
00248     virtual QPointF viewToWindow(const QPointF& pt)  0;
00249     virtual QRect viewToWindow(const QRect& rc)  0;
00250     virtual QRectF viewToWindow(const QRectF& rc)  0;
00251     virtual void viewToWindow(qint32 *x, qint32 *y)  0;
00252 
00256     virtual QPoint windowToView(const QPoint& pt)  0;
00257     virtual QPointF windowToView(const QPointF& pt)  0;
00258     virtual QRect windowToView(const QRect& rc)  0;
00259     virtual QRectF windowToView(const QRectF& rc)  0;
00260     virtual void windowToView(qint32 *x, qint32 *y)  0;
00261 
00269     virtual QCursor setCanvasCursor(const QCursor & cursor)  0;
00270 
00278     virtual void setInputDevice(KoInputDevice inputDevice)  0;
00279 
00283     virtual KoInputDevice currentInputDevice() const  0;
00284 #endif
00285 
00286 private:
00287 
00288     KoCanvasResourceProvider * m_resourceProvider;
00289 };
00290 
00291 
00292 
00293 #endif // KOCANVASBASE_H

Généré le Wed Nov 22 23:40:58 2006 pour KPlato par  doxygen 1.5.1-p1