F:/KPlato/koffice/libs/flake/KoShapeManager.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002 
00003    Copyright (C) 2006 Thorsten Zachmann <zachmann@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KOSHAPEMANAGER_H
00022 #define KOSHAPEMANAGER_H
00023 
00024 #include <QList>
00025 #include <QObject>
00026 #include <QSet>
00027 
00028 #include "KoFlake.h"
00029 #include <koffice_export.h>
00030 #include <KoRTree.h>
00031 
00032 class KoShape;
00033 class KoSelection;
00034 class KoViewConverter;
00035 class KoCanvasBase;
00036 
00037 class QPainter;
00038 class QPointF;
00039 class QRectF;
00040 
00047 class FLAKE_EXPORT KoShapeManager : public QObject
00048 {
00049     Q_OBJECT
00050 
00051 public:
00055     KoShapeManager(KoCanvasBase *canvas);
00061     KoShapeManager(KoCanvasBase *canvas, const QList<KoShape *> &shapes);
00062     virtual ~KoShapeManager();
00063 
00069     void setShapes( const QList<KoShape *> &shapes );
00070 
00072     const QList<KoShape *> & shapes() const { return m_shapes; }
00073 
00078     void add(KoShape *shape);
00079 
00084     void remove(KoShape *shape);
00085 
00087     KoSelection * selection() const { return m_selection; }
00088 
00095     virtual void paint( QPainter &painter, const KoViewConverter &converter, bool forPrint );
00096 
00105     KoShape * shapeAt( const QPointF &position, KoFlake::ShapeSelection selection = KoFlake::ShapeOnTop, bool omitHiddenShapes = false );
00106 
00112     QList<KoShape *> shapesAt( const QRectF &rect, bool omitHiddenShapes = false );
00113 
00126     void repaint( QRectF &rect, const KoShape *shape = 0, bool selectionHandles = false );
00127 
00135     void updateTree( KoShape * shape );
00136 
00137 protected:
00142     void updateTree();
00143 
00144 signals:
00146     void selectionChanged();
00147 
00148 private:
00149     QList<KoShape *> m_shapes;
00150     KoSelection * m_selection;
00151     KoCanvasBase * m_canvas;
00152     KoRTree<KoShape *> m_tree;
00153     QSet<KoShape *> m_aggregate4update;
00154 };
00155 
00156 #endif
00157 

Généré le Wed Nov 22 23:40:59 2006 pour KPlato par  doxygen 1.5.1-p1