Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShape::ShapeChangeListener Struct Referenceabstract

#include <KoShape.h>

+ Inheritance diagram for KoShape::ShapeChangeListener:

Public Member Functions

virtual void notifyShapeChanged (ChangeType type, KoShape *shape)=0
 
virtual ~ShapeChangeListener ()
 

Private Member Functions

void notifyShapeChangedImpl (ChangeType type, KoShape *shape)
 
void registerShape (KoShape *shape)
 
void unregisterShape (KoShape *shape)
 

Private Attributes

QList< KoShape * > m_registeredShapes
 

Friends

class KoShape
 

Detailed Description

Definition at line 1096 of file KoShape.h.

Constructor & Destructor Documentation

◆ ~ShapeChangeListener()

KoShape::ShapeChangeListener::~ShapeChangeListener ( )
virtual

Definition at line 1330 of file KoShape.cpp.

1331{
1332 Q_FOREACH(KoShape *shape, m_registeredShapes) {
1333 shape->removeShapeChangeListener(this);
1334 }
1335}
void removeShapeChangeListener(ShapeChangeListener *listener)
Definition KoShape.cpp:1368
QList< KoShape * > m_registeredShapes
Definition KoShape.h:1106

References m_registeredShapes, and KoShape::removeShapeChangeListener().

Member Function Documentation

◆ notifyShapeChanged()

virtual void KoShape::ShapeChangeListener::notifyShapeChanged ( ChangeType type,
KoShape * shape )
pure virtual

◆ notifyShapeChangedImpl()

void KoShape::ShapeChangeListener::notifyShapeChangedImpl ( KoShape::ChangeType type,
KoShape * shape )
private

Definition at line 1349 of file KoShape.cpp.

1350{
1352
1353 notifyShapeChanged(type, shape);
1354
1355 if (type == KoShape::Deleted) {
1356 unregisterShape(shape);
1357 }
1358}
@ Deleted
the shape was deleted
Definition KoShape.h:104
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
virtual void notifyShapeChanged(ChangeType type, KoShape *shape)=0
void unregisterShape(KoShape *shape)
Definition KoShape.cpp:1343

References KoShape::Deleted, and KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ registerShape()

void KoShape::ShapeChangeListener::registerShape ( KoShape * shape)
private

Definition at line 1337 of file KoShape.cpp.

1338{
1340 m_registeredShapes.append(shape);
1341}

References KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ unregisterShape()

void KoShape::ShapeChangeListener::unregisterShape ( KoShape * shape)
private

Definition at line 1343 of file KoShape.cpp.

1344{
1346 m_registeredShapes.removeAll(shape);
1347}

References KIS_SAFE_ASSERT_RECOVER_RETURN.

Friends And Related Symbol Documentation

◆ KoShape

friend class KoShape
friend

Definition at line 1101 of file KoShape.h.

Member Data Documentation

◆ m_registeredShapes

QList<KoShape*> KoShape::ShapeChangeListener::m_registeredShapes
private

Definition at line 1106 of file KoShape.h.


The documentation for this struct was generated from the following files: