Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeContainer.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2006-2010 Thomas Zander <zander@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KOSHAPECONTAINER_H
8#define KOSHAPECONTAINER_H
9
10#include "KoShape.h"
11
12#include <QList>
13
14#include "kritaflake_export.h"
15
16class QPainter;
18class KoShapeContainerPrivate;
19
55class KRITAFLAKE_EXPORT KoShapeContainer : public KoShape
56{
57public:
58
66 explicit KoShapeContainer(KoShapeContainerModel *model = 0);
67
72 ~KoShapeContainer() override;
73
82 void addShape(KoShape *shape);
83
91 void removeShape(KoShape *shape);
92
97 int shapeCount() const;
98
111 void setClipped(const KoShape *child, bool clipping);
112
125 bool isClipped(const KoShape *child) const;
126
139 void setInheritsTransform(const KoShape *shape, bool inherit);
140
153 bool inheritsTransform(const KoShape *shape) const;
154
155
157 void paint(QPainter &painter) const override;
158
167 virtual void paintComponent(QPainter &painter) const = 0;
168
169 using KoShape::update;
171 void update() const override;
172
177 QList<KoShape*> shapes() const;
178
183
184protected:
185
189 void setModel(KoShapeContainerModel *model);
193 void setModelInit(KoShapeContainerModel *model);
194
195public:
196
204
213 void addShape(KoShape *shape);
214
222 void removeShape(KoShape *shape);
223
224 protected:
226 };
227
229
230protected:
232
239 virtual void shapeCountChanged() { }
240
241 void shapeChanged(ChangeType type, KoShape *shape = 0) override;
242
243private:
244 class Private;
245 QScopedPointer<Private> d;
246};
247
248#endif
virtual void shapeCountChanged()
KoShapeContainerModel * model() const
ShapeInterface * shapeInterface()
QScopedPointer< Private > d
virtual void paintComponent(QPainter &painter) const =0
Paint the component Implement this method to allow the shape to paint itself, just like the KoShape::...
virtual void update() const
Definition KoShape.cpp:605
virtual void shapeChanged(ChangeType type, KoShape *shape=0)
Definition KoShape.cpp:1253
virtual void paint(QPainter &painter) const =0
Paint the shape fill The class extending this one is responsible for painting itself....