Warning, file /office/calligra/braindump/src/Layout.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * Copyright (c) 2009 Cyrille Berger <cberger@cberger.net> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Lesser General Public 0006 * License as published by the Free Software Foundation; 0007 * either version 2, or (at your option) any later version of the License. 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 * Lesser General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Lesser General Public License 0015 * along with this library; see the file COPYING. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef _LAYOUT_H_ 0021 #define _LAYOUT_H_ 0022 0023 #include <QObject> 0024 0025 class QRectF; 0026 0027 class KoShape; 0028 0029 class Layout : public QObject 0030 { 0031 Q_OBJECT 0032 public: 0033 explicit Layout(const QString& _id); 0034 virtual ~Layout(); 0035 public: 0036 const QString& id() const; 0037 public: 0038 void replaceLayout(Layout* layout); 0039 void addShapes(QList<KoShape*> _shapes); 0040 void addShape(KoShape* _shape); 0041 void removeShape(KoShape* _shape); 0042 virtual QRectF boundingBox() const; 0043 protected: 0044 const QList<KoShape*>& shapes() const; 0045 protected: 0046 /** 0047 * This function is called when a list of shapes is added to the layout. 0048 * 0049 * The default implementation call shapeAdded for each shape 0050 */ 0051 virtual void shapesAdded(QList<KoShape*> _shape); 0052 /** 0053 * This function is called when a shape is added to the layout. 0054 */ 0055 virtual void shapeAdded(KoShape* _shape) = 0; 0056 /** 0057 * This function is called when a shape is removed to the layout. 0058 */ 0059 virtual void shapeRemoved(KoShape* _shape) = 0; 0060 /** 0061 * This function is called when a shape geometry is changed. 0062 */ 0063 virtual void shapeGeometryChanged(KoShape* _shape) = 0; 0064 /** 0065 * This function is called when the layout is expected to update the position of shapes 0066 */ 0067 virtual void relayout() = 0; 0068 protected: 0069 // Reimplemented from QObject 0070 virtual bool event(QEvent * e); 0071 Q_SIGNALS: 0072 void boundingBoxChanged(const QRectF& _rect); 0073 private: 0074 struct Private; 0075 Private* const d; 0076 }; 0077 0078 #endif