libs/flake
KoShapeManager.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KOSHAPEMANAGER_H
00023 #define KOSHAPEMANAGER_H
00024
00025 #include <QList>
00026 #include <QObject>
00027 #include <QSet>
00028
00029 #include "KoFlake.h"
00030 #include "flake_export.h"
00031
00032 class KoShape;
00033 class KoSelection;
00034 class KoViewConverter;
00035 class KoCanvasBase;
00036 class KoPointerEvent;
00037 class KoShapeManagerPaintingStrategy;
00038
00039
00040 class QPainter;
00041 class QPointF;
00042 class QRectF;
00043
00050 class FLAKE_EXPORT KoShapeManager : public QObject
00051 {
00052 Q_OBJECT
00053
00054 public:
00056 enum Repaint {
00057 PaintShapeOnAdd,
00058 AddWithoutRepaint
00059 };
00060
00064 explicit KoShapeManager(KoCanvasBase *canvas);
00070 KoShapeManager(KoCanvasBase *canvas, const QList<KoShape *> &shapes);
00071 virtual ~KoShapeManager();
00072
00079 void setShapes(const QList<KoShape *> &shapes, Repaint repaint = PaintShapeOnAdd);
00080
00082 QList<KoShape*> shapes() const;
00083
00087 QList<KoShape*> topLevelShapes() const;
00088
00095 void add(KoShape *shape, Repaint repaint = PaintShapeOnAdd);
00096
00102 void addAdditional(KoShape *shape);
00103
00108 void remove(KoShape *shape);
00109
00115 void removeAdditional(KoShape *shape);
00116
00118 KoSelection *selection() const;
00119
00126 virtual void paint(QPainter &painter, const KoViewConverter &converter, bool forPrint);
00127
00136 KoShape *shapeAt(const QPointF &position, KoFlake::ShapeSelection selection = KoFlake::ShapeOnTop, bool omitHiddenShapes = true);
00137
00143 QList<KoShape *> shapesAt(const QRectF &rect, bool omitHiddenShapes = true);
00144
00157 void update(QRectF &rect, const KoShape *shape = 0, bool selectionHandles = false);
00158
00166 void notifyShapeChanged(KoShape *shape);
00167
00174 void suggestChangeTool(KoPointerEvent *event);
00175
00184 void paintShape(KoShape *shape, QPainter &painter, const KoViewConverter &converter, bool forPrint);
00185
00193 void setPaintingStrategy(KoShapeManagerPaintingStrategy *strategy);
00194
00195 signals:
00197 void selectionChanged();
00199 void selectionContentChanged();
00200
00201 private:
00202 class Private;
00203 Private * const d;
00204 };
00205
00206 #endif
|