Warning, file /office/calligra/libs/flake/KoAnnotationLayoutManager.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2013 Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Library General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2 of the License, or (at your option) any later version. 0008 * 0009 * This library is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 * Library General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Library General Public License 0015 * along with this library; see the file COPYING.LIB. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 #ifndef KOANNOTATIONLAYOUTMANAGER_H 0020 #define KOANNOTATIONLAYOUTMANAGER_H 0021 0022 #include "flake_export.h" 0023 0024 #include <QObject> 0025 0026 class KoShapeManager; 0027 class KoCanvasBase; 0028 0029 class QPainter; 0030 class QPointF; 0031 0032 class KoShape; 0033 0034 class FLAKE_EXPORT KoAnnotationLayoutManager: public QObject 0035 { 0036 Q_OBJECT 0037 public: 0038 static const qreal shapeSpace; // Distance between annotation shapes. 0039 static const qreal shapeWidth; // Annotation shapes width. 0040 //Connection point of lines from shape to this point and from this point to refText position. 0041 static const qreal connectionPointLines; 0042 0043 explicit KoAnnotationLayoutManager(QObject *parent = 0); 0044 ~KoAnnotationLayoutManager() override; 0045 0046 void setShapeManager(KoShapeManager *shapeManager); 0047 0048 void setCanvasBase(KoCanvasBase *canvas); 0049 0050 void setViewContentWidth(qreal width); 0051 0052 void paintConnections(QPainter &painter); 0053 // Return true if shape is in annotation shapes list. 0054 bool isAnnotationShape(KoShape *shape) const; 0055 0056 public Q_SLOTS: 0057 /// register the position of an annotation shape. 0058 void registerAnnotationRefPosition(KoShape *annotationShape, const QPointF& refPosition); 0059 0060 /// Remove annotation shape. 0061 void removeAnnotationShape(KoShape *annotationShape); 0062 0063 /// Update layout annotation shapes. Called when shape size changed. 0064 void updateLayout(KoShape *shape); 0065 0066 Q_SIGNALS: 0067 void hasAnnotationsChanged(bool hasAnnotations); 0068 0069 private: 0070 /// layout annotation shapes 0071 void layoutAnnotationShapes(); 0072 0073 0074 private: 0075 class Private; 0076 Private * const d; 0077 }; 0078 0079 #endif // KOANNOTATIONLAYOUTMANAGER_H 0080