File indexing completed on 2024-10-27 04:07:34
0001 /* 0002 * SPDX-FileCopyrightText: 2007 Boudewijn Rempt <boud@valdyas.org> 0003 * SPDX-FileCopyrightText: 2007 Sven Langkamp <sven.langkamp@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 #ifndef KIS_SHAPE_SELECTION_CANVAS_H 0008 #define KIS_SHAPE_SELECTION_CANVAS_H 0009 0010 #include <QScopedPointer> 0011 #include <KoCanvasBase.h> 0012 0013 #include <kis_types.h> 0014 0015 class KoShapeManager; 0016 class KoToolProxy; 0017 class KoViewConverter; 0018 class KUndo2Command; 0019 class QWidget; 0020 class KoUnit; 0021 class KisShapeController; 0022 0023 /** 0024 * Dummy canvas just to have a shapemanager for the shape selection 0025 */ 0026 class KisShapeSelectionCanvas : public KoCanvasBase 0027 { 0028 Q_OBJECT 0029 public: 0030 0031 KisShapeSelectionCanvas(KoShapeControllerBase *shapeController); 0032 ~KisShapeSelectionCanvas() override; 0033 0034 void gridSize(QPointF *offset, QSizeF *spacing) const override; 0035 bool snapToGrid() const override; 0036 void addCommand(KUndo2Command *command) override; 0037 KoShapeManager *shapeManager() const override; 0038 KoSelectedShapesProxy *selectedShapesProxy() const override; 0039 void updateCanvas(const QRectF& rc) override; 0040 KoToolProxy * toolProxy() const override; 0041 const KoViewConverter *viewConverter() const override; 0042 KoViewConverter *viewConverter() override; 0043 QWidget* canvasWidget() override; 0044 const QWidget* canvasWidget() const override; 0045 KoUnit unit() const override; 0046 void setCursor(const QCursor &) override {} 0047 private: 0048 QScopedPointer<KoShapeManager> m_shapeManager; 0049 QScopedPointer<KoSelectedShapesProxy> m_selectedShapesProxy; 0050 }; 0051 0052 #endif