Krita Source Code Documentation
Loading...
Searching...
No Matches
RemoveReferenceImagesCommand Struct Reference
+ Inheritance diagram for RemoveReferenceImagesCommand:

Public Member Functions

void redo () override
 redo the command
 
 RemoveReferenceImagesCommand (KisDocument *document, KisSharedPtr< KisReferenceImagesLayer > layer, QList< KoShape * > referenceImages, KUndo2Command *parent=nullptr)
 
void undo () override
 revert the actions done in redo
 
- Public Member Functions inherited from KoShapeDeleteCommand
 KoShapeDeleteCommand (KoShapeControllerBase *controller, const QList< KoShape * > &shapes, KUndo2Command *parent=0)
 
 KoShapeDeleteCommand (KoShapeControllerBase *controller, KoShape *shape, KUndo2Command *parent=0)
 
 Private (KoShapeControllerBase *c)
 
 ~KoShapeDeleteCommand () override
 
 ~Private ()
 
- Public Member Functions inherited from KUndo2Command
QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Command * child (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraData * extraData () const
 
bool hasParent () const
 
virtual int id () const
 
virtual bool isMerged () const
 
 KUndo2Command (const KUndo2MagicString &text, KUndo2Command *parent=0)
 
 KUndo2Command (KUndo2Command *parent=0)
 
virtual QVector< KUndo2Command * > mergeCommandsVector () const
 
virtual bool mergeWith (const KUndo2Command *other)
 
virtual void redoMergedCommands ()
 
void setEndTime ()
 
virtual void setEndTime (const QTime &time)
 
void setExtraData (KUndo2CommandExtraData *data)
 
void setText (const KUndo2MagicString &text)
 
void setTime ()
 
virtual void setTime (const QTime &time)
 
virtual void setTimedID (int timedID)
 
KUndo2MagicString text () const
 
virtual QTime time () const
 
virtual int timedId () const
 
virtual bool timedMergeWith (KUndo2Command *other)
 
virtual void undoMergedCommands ()
 
virtual ~KUndo2Command ()
 

Private Attributes

KisDocument * m_document
 
KisSharedPtr< KisReferenceImagesLayer > m_layer
 

Additional Inherited Members

- Public Attributes inherited from KoShapeDeleteCommand
KoShapeControllerBase * controller
 the shape controller to use for removing/readding
 
bool deleteShapes
 shows if shapes should be deleted when deleting the command
 
QList< KoShapeContainer * > oldParents
 the old parents of the shapes
 
QList< KoShape * > shapes
 the list of shapes to delete
 

Detailed Description

Definition at line 53 of file KisReferenceImagesLayer.cpp.

Constructor & Destructor Documentation

◆ RemoveReferenceImagesCommand()

RemoveReferenceImagesCommand::RemoveReferenceImagesCommand ( KisDocument * document,
KisSharedPtr< KisReferenceImagesLayer > layer,
QList< KoShape * > referenceImages,
KUndo2Command * parent = nullptr )
inline

Definition at line 55 of file KisReferenceImagesLayer.cpp.

56 : KoShapeDeleteCommand(layer->shapeController(), referenceImages, parent)
57 , m_document(document)
58 , m_layer(layer)
59 {}
KoShapeControllerBase * shapeController() const
KoShapeDeleteCommand(KoShapeControllerBase *controller, KoShape *shape, KUndo2Command *parent=0)
KisSharedPtr< KisReferenceImagesLayer > m_layer

Member Function Documentation

◆ redo()

void RemoveReferenceImagesCommand::redo ( )
inlineoverridevirtual

redo the command

Reimplemented from KoShapeDeleteCommand.

Definition at line 62 of file KisReferenceImagesLayer.cpp.

62 {
64
65 if (m_layer->shapeCount() == 0) {
66 m_document->setReferenceImagesLayer(nullptr, true);
67 }
68 }
void setReferenceImagesLayer(KisSharedPtr< KisReferenceImagesLayer > layer, bool updateImage)
void redo() override
redo the command

References m_document, m_layer, KoShapeDeleteCommand::redo(), KisDocument::setReferenceImagesLayer(), and KoShapeContainer::shapeCount().

◆ undo()

void RemoveReferenceImagesCommand::undo ( )
inlineoverridevirtual

revert the actions done in redo

Reimplemented from KoShapeDeleteCommand.

Definition at line 70 of file KisReferenceImagesLayer.cpp.

70 {
71 auto layer = m_document->referenceImagesLayer();
72 KIS_SAFE_ASSERT_RECOVER_NOOP(!layer || layer == m_layer);
73
74 if (!layer) {
76 }
77
79 }
KisSharedPtr< KisReferenceImagesLayer > referenceImagesLayer() const
void undo() override
revert the actions done in redo
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References KIS_SAFE_ASSERT_RECOVER_NOOP, m_document, m_layer, KisDocument::referenceImagesLayer(), KisDocument::setReferenceImagesLayer(), and KoShapeDeleteCommand::undo().

Member Data Documentation

◆ m_document

KisDocument* RemoveReferenceImagesCommand::m_document
private

Definition at line 82 of file KisReferenceImagesLayer.cpp.

◆ m_layer

KisSharedPtr<KisReferenceImagesLayer> RemoveReferenceImagesCommand::m_layer
private

Definition at line 83 of file KisReferenceImagesLayer.cpp.


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