File indexing completed on 2024-05-12 15:56:50
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KOSNAPDATA_H 0008 #define KOSNAPDATA_H 0009 0010 #include <kritaflake_export.h> 0011 0012 #include "KoPathSegment.h" 0013 0014 /** 0015 * This class is used to provide additional data to the snap guide. 0016 * 0017 * Some shapes might have internal data it wants snapping support for, 0018 * i.e. the axis of a chart shape, the row of a table shape, etc. 0019 * As the data is internal and special to that shape, the snap guide 0020 * does not know about it and can therefore not provide any snapping 0021 * to it. 0022 * So the shape can put that data in form of points or segments into 0023 * that class which the snap guide can retrieve and use accordingly. 0024 */ 0025 class KRITAFLAKE_EXPORT KoSnapData 0026 { 0027 public: 0028 KoSnapData(); 0029 ~KoSnapData(); 0030 0031 /// Returns list of points to snap to 0032 QList<QPointF> snapPoints() const; 0033 0034 /// Sets list of points to snap to 0035 void setSnapPoints(const QList<QPointF> &snapPoints); 0036 0037 /// Returns list of segments to snap to 0038 QList<KoPathSegment> snapSegments() const; 0039 0040 /// Sets list of segments to snap to 0041 void setSnapSegments(const QList<KoPathSegment> &snapSegments); 0042 0043 private: 0044 QList<QPointF> m_points; 0045 QList<KoPathSegment> m_segments; 0046 }; 0047 0048 #endif //KOSNAPDATA_H