Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRemoveKeyframeCommand Class Reference

#include <kis_keyframe_commands.h>

+ Inheritance diagram for KisRemoveKeyframeCommand:

Public Member Functions

 KisRemoveKeyframeCommand (KisKeyframeChannel *channel, int time, KUndo2Command *parentCmd=nullptr)
 
void redo () override
 
void undo () override
 
- 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 ()
 

Private Attributes

KisKeyframeSP m_cached
 
KisKeyframeChannelm_channel
 
int m_time
 

Detailed Description

Definition at line 34 of file kis_keyframe_commands.h.

Constructor & Destructor Documentation

◆ KisRemoveKeyframeCommand()

KisRemoveKeyframeCommand::KisRemoveKeyframeCommand ( KisKeyframeChannel * channel,
int time,
KUndo2Command * parentCmd = nullptr )

Definition at line 36 of file kis_keyframe_commands.cpp.

37 : KUndo2Command(parentCmd),
38 m_channel(channel),
40{
41 m_cached = channel->keyframeAt(time);
42}
virtual QTime time() const
KUndo2Command(KUndo2Command *parent=0)
KisKeyframeSP keyframeAt(int time) const
Get a keyframe at specified time. Used primarily when the value of a given keyframe is needed.
KisKeyframeChannel * m_channel

References KisKeyframeChannel::keyframeAt(), m_cached, and KUndo2Command::time().

Member Function Documentation

◆ redo()

void KisRemoveKeyframeCommand::redo ( )
overridevirtual

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 44 of file kis_keyframe_commands.cpp.

45{
47}
virtual void removeKeyframe(int time, KUndo2Command *parentUndoCmd=nullptr)
Remove a keyframe from the channel at the specified time.

References m_channel, m_time, and KisKeyframeChannel::removeKeyframe().

◆ undo()

void KisRemoveKeyframeCommand::undo ( )
overridevirtual

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 49 of file kis_keyframe_commands.cpp.

50{
52}
virtual void insertKeyframe(int time, KisKeyframeSP keyframe, KUndo2Command *parentUndoCmd=nullptr)
Insert an existing keyframe into the channel at the specified time.

References KisKeyframeChannel::insertKeyframe(), m_cached, m_channel, and m_time.

Member Data Documentation

◆ m_cached

KisKeyframeSP KisRemoveKeyframeCommand::m_cached
private

Definition at line 46 of file kis_keyframe_commands.h.

◆ m_channel

KisKeyframeChannel* KisRemoveKeyframeCommand::m_channel
private

Definition at line 43 of file kis_keyframe_commands.h.

◆ m_time

int KisRemoveKeyframeCommand::m_time
private

Definition at line 44 of file kis_keyframe_commands.h.


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