Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCommandUtils::SkipFirstRedoBase Struct Referenceabstract

#include <kis_command_utils.h>

+ Inheritance diagram for KisCommandUtils::SkipFirstRedoBase:

Public Member Functions

void redo () override final
 
void setSkipOneRedo (bool value)
 
 SkipFirstRedoBase (bool skipFirstRedo, const KUndo2MagicString &text, KUndo2Command *parent=0)
 
 SkipFirstRedoBase (bool skipFirstRedo, KUndo2Command *parent=0)
 
void undo () override final
 
- Public Member Functions inherited from KUndo2Command
QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Commandchild (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraDataextraData () 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 ()
 

Protected Member Functions

virtual void redoImpl ()=0
 
virtual void undoImpl ()=0
 

Private Attributes

bool m_firstRedo
 

Detailed Description

Definition at line 79 of file kis_command_utils.h.

Constructor & Destructor Documentation

◆ SkipFirstRedoBase() [1/2]

KisCommandUtils::SkipFirstRedoBase::SkipFirstRedoBase ( bool skipFirstRedo,
KUndo2Command * parent = 0 )

Definition at line 107 of file kis_command_utils.cpp.

108 : KUndo2Command(parent),
109 m_firstRedo(skipFirstRedo)
110 {
111 }
KUndo2Command(KUndo2Command *parent=0)

◆ SkipFirstRedoBase() [2/2]

KisCommandUtils::SkipFirstRedoBase::SkipFirstRedoBase ( bool skipFirstRedo,
const KUndo2MagicString & text,
KUndo2Command * parent = 0 )

Definition at line 113 of file kis_command_utils.cpp.

114 : KUndo2Command(text, parent),
115 m_firstRedo(skipFirstRedo)
116 {
117 }
KUndo2MagicString text() const

Member Function Documentation

◆ redo()

void KisCommandUtils::SkipFirstRedoBase::redo ( )
finaloverridevirtual

Applies a change to the document. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.

The default implementation calls redo() on all child commands.

See also
undo()

Reimplemented from KUndo2Command.

Definition at line 119 of file kis_command_utils.cpp.

120 {
121 if (m_firstRedo) {
122 m_firstRedo = false;
123 } else {
124 redoImpl();
126 }
127 }
virtual void redo()

References m_firstRedo, KUndo2Command::redo(), and redoImpl().

◆ redoImpl()

virtual void KisCommandUtils::SkipFirstRedoBase::redoImpl ( )
protectedpure virtual

Implemented in KoShapeResizeCommand.

◆ setSkipOneRedo()

void KisCommandUtils::SkipFirstRedoBase::setSkipOneRedo ( bool value)

Definition at line 135 of file kis_command_utils.cpp.

136 {
138 }
float value(const T *src, size_t ch)

References m_firstRedo, and value().

◆ undo()

void KisCommandUtils::SkipFirstRedoBase::undo ( )
finaloverridevirtual

Reverts a change to the document. After undo() is called, the state of the document should be the same as before redo() was called. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.

The default implementation calls undo() on all child commands in reverse order.

See also
redo()

Reimplemented from KUndo2Command.

Definition at line 129 of file kis_command_utils.cpp.

130 {
132 undoImpl();
133 }
virtual void undo()

References KUndo2Command::undo(), and undoImpl().

◆ undoImpl()

virtual void KisCommandUtils::SkipFirstRedoBase::undoImpl ( )
protectedpure virtual

Implemented in KoShapeResizeCommand.

Member Data Documentation

◆ m_firstRedo

bool KisCommandUtils::SkipFirstRedoBase::m_firstRedo
private

Definition at line 93 of file kis_command_utils.h.


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