Krita Source Code Documentation
Loading...
Searching...
No Matches
KoCanvasBase.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2
3 SPDX-FileCopyrightText: 2006, 2010 Boudewijn Rempt <boud@valdyas.org>
4 SPDX-FileCopyrightText: 2006, 2010 Thomas Zander <zander@kde.org>
5 SPDX-FileCopyrightText: 2006 Thorsten Zachmann <zachmann@kde.org>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#ifndef KOCANVASBASE_H
11#define KOCANVASBASE_H
12
13#include <QPoint>
14
15#include "kritaflake_export.h"
16
17class KUndo2Command;
18
19class KoUnit;
21class KoShapeManager;
22class KoToolProxy;
23class KoViewConverter;
27class KoShape;
28class KoSnapGuide;
31
32class QWidget;
33class QCursor;
34class QPointF;
35class QRectF;
36class QSizeF;
37
38#include <QObject>
39
45class KRITAFLAKE_EXPORT KoCanvasBase : public QObject
46{
47 Q_OBJECT
48public:
49
55 explicit KoCanvasBase(KoShapeControllerBase *shapeController, KoCanvasResourceProvider *sharedResourceManager = 0);
56 ~KoCanvasBase() override;
57
58public:
59
63 virtual bool canvasIsOpenGL() const { return false; }
64
71 virtual void gridSize(QPointF *offset, QSizeF *spacing) const = 0;
72
77 virtual bool snapToGrid() const = 0;
78
79
86 virtual void setCursor(const QCursor &cursor) = 0;
87
99 virtual void addCommand(KUndo2Command *command) = 0;
100
109 virtual KoShapeManager *shapeManager() const = 0;
110
118
138 return nullptr;
139 }
140
154 Q_UNUSED(source)
155 }
160 virtual void updateCanvas(const QRectF &rc) = 0;
161
167 virtual KoToolProxy *toolProxy() const = 0;
168
173 virtual const KoViewConverter *viewConverter() const = 0;
175
182 virtual KoColorDisplayRendererInterface* displayRendererInterface() const;
183
188 virtual QPointF viewToDocument(const QPointF &viewPoint) const;
189
193 virtual QWidget *canvasWidget() = 0;
194
198 virtual const QWidget *canvasWidget() const = 0;
199
205 virtual KoUnit unit() const = 0;
206
216 virtual void clipToDocument(const KoShape *shape, QPointF &move) const;
217
223 virtual QPoint documentOrigin() const {
224 return QPoint(0, 0);
225 }
226
232 virtual void disconnectCanvasObserver(QObject *object);
233
246
252
256 KoCanvasController *canvasController() const;
257
262
264 void setCanvasController(KoCanvasController *controller);
265
266private:
267 // we need a KoShapeControllerBase so that it can work
269
270 class Private;
271 Private * const d;
272};
273
274#endif // KOCANVASBASE_H
KisMagneticGraph::vertex_descriptor source(typename KisMagneticGraph::edge_descriptor e, KisMagneticGraph g)
virtual KoShape * currentShapeManagerOwnerShape() const
the shape that owns the currently active shape manager
virtual void setCurrentShapeManagerOwnerShape(KoShape *source)
sets the group shape that is supposed to be "entered"
virtual KoViewConverter * viewConverter()=0
KoShapeController * shapeController() const
virtual void setCursor(const QCursor &cursor)=0
virtual void gridSize(QPointF *offset, QSizeF *spacing) const =0
virtual KoShapeManager * shapeManager() const =0
virtual const QWidget * canvasWidget() const =0
Private *const d
virtual bool canvasIsOpenGL() const
KoCanvasResourceProvider * resourceManager() const
virtual KoUnit unit() const =0
virtual KoToolProxy * toolProxy() const =0
virtual QPoint documentOrigin() const
virtual const KoViewConverter * viewConverter() const =0
virtual void updateCanvas(const QRectF &rc)=0
virtual void addCommand(KUndo2Command *command)=0
virtual QWidget * canvasWidget()=0
KoSnapGuide * snapGuide() const
virtual KoSelectedShapesProxy * selectedShapesProxy() const =0
selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged...
virtual bool snapToGrid() const =0
The KoSelectedShapesProxy class is a special interface of KoCanvasBase to have a stable connection to...