File indexing completed on 2024-05-12 15:56:50

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2008-2009 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 #ifndef KOSNAPPROXY_H
0007 #define KOSNAPPROXY_H
0008 
0009 
0010 class KoSnapGuide;
0011 class KoShape;
0012 class KoPathSegment;
0013 class KoCanvasBase;
0014 #include <QList>
0015 #include "kritaflake_export.h"
0016 
0017 class QPointF;
0018 class QRectF;
0019 /**
0020  * This class provides access to different shape related snap targets to snap strategies.
0021  */
0022 class KRITAFLAKE_EXPORT KoSnapProxy
0023 {
0024 public:
0025     KoSnapProxy(KoSnapGuide *snapGuide);
0026 
0027     /// returns list of points in given rectangle in document coordinates
0028     QList<QPointF> pointsInRect(const QRectF &rect, bool omitEditedShape);
0029 
0030     /// returns list of shape in given rectangle in document coordinates
0031     QList<KoShape*> shapesInRect(const QRectF &rect, bool omitEditedShape = false);
0032 
0033     /// returns list of points from given shape
0034     QList<QPointF> pointsFromShape(KoShape *shape);
0035 
0036     /// returns list of points in given rectangle in document coordinates
0037     QList<KoPathSegment> segmentsInRect(const QRectF &rect, bool omitEditedShape);
0038 
0039     /// returns list of all shapes
0040     QList<KoShape*> shapes(bool omitEditedShape = false);
0041 
0042     /// returns canvas we are working on
0043     KoCanvasBase *canvas();
0044 
0045 private:
0046     KoSnapGuide *m_snapGuide;
0047 };
0048 
0049 #endif