Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/KoShapeGroup.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
47 | */ | 47 | */ | ||
48 | class KRITAFLAKE_EXPORT KoShapeGroup : public KoShapeContainer | 48 | class KRITAFLAKE_EXPORT KoShapeGroup : public KoShapeContainer | ||
49 | { | 49 | { | ||
50 | public: | 50 | public: | ||
51 | /// Constructor | 51 | /// Constructor | ||
52 | KoShapeGroup(); | 52 | KoShapeGroup(); | ||
53 | /// destructor | 53 | /// destructor | ||
54 | virtual ~KoShapeGroup(); | 54 | virtual ~KoShapeGroup(); | ||
55 | | ||||
56 | KoShape* cloneShape() const override; | ||||
57 | | ||||
55 | /// This implementation is empty since a group is itself not visible. | 58 | /// This implementation is empty since a group is itself not visible. | ||
56 | virtual void paintComponent(QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &paintcontext); | 59 | virtual void paintComponent(QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &paintcontext); | ||
57 | /// always returns false since the group itself can't be selected or hit | 60 | /// always returns false since the group itself can't be selected or hit | ||
58 | virtual bool hitTest(const QPointF &position) const; | 61 | virtual bool hitTest(const QPointF &position) const; | ||
59 | /// a group in flake doesn't have a size, this function just returns QSizeF(0,0) | 62 | QSizeF size() const override; | ||
60 | virtual QSizeF size() const; | 63 | void setSize(const QSizeF &size) override; | ||
64 | QRectF outlineRect() const override; | ||||
61 | /// a group's boundingRect | 65 | /// a group's boundingRect | ||
62 | virtual QRectF boundingRect() const; | 66 | QRectF boundingRect() const override; | ||
63 | /// reimplemented from KoShape | 67 | /// reimplemented from KoShape | ||
64 | virtual void saveOdf(KoShapeSavingContext &context) const; | 68 | virtual void saveOdf(KoShapeSavingContext &context) const; | ||
65 | // reimplemented | 69 | // reimplemented | ||
66 | virtual bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context); | 70 | virtual bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context); | ||
67 | 71 | | |||
72 | private: | ||||
73 | friend class ShapeGroupContainerModel; | ||||
74 | | ||||
68 | /** | 75 | /** | ||
69 | * @brief Invalidate the size cache of the group | 76 | * @brief Invalidate the size cache of the group | ||
70 | * | 77 | * | ||
71 | * The group shape caches the size of itself as it can be quite expensive to recalculate | 78 | * The group shape caches the size of itself as it can be quite expensive to recalculate | ||
72 | * the size if there are a lot of subshapes. This function is called when the cache needs | 79 | * the size if there are a lot of subshapes. This function is called when the cache needs | ||
73 | * to be invalidated. | 80 | * to be invalidated. | ||
74 | */ | 81 | */ | ||
75 | void invalidateSizeCache(); | 82 | void invalidateSizeCache(); | ||
76 | 83 | | |||
77 | private: | 84 | private: | ||
85 | KoShapeGroup(const KoShapeGroup &rhs); | ||||
86 | | ||||
87 | private: | ||||
78 | virtual void shapeChanged(ChangeType type, KoShape *shape = 0); | 88 | virtual void shapeChanged(ChangeType type, KoShape *shape = 0); | ||
79 | 89 | | |||
80 | Q_DECLARE_PRIVATE(KoShapeGroup) | 90 | Q_DECLARE_PRIVATE(KoShapeGroup) | ||
81 | }; | 91 | }; | ||
82 | 92 | | |||
83 | #endif | 93 | #endif |