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

#include <kis_keyframe_commands.h>

+ Inheritance diagram for KisInsertKeyframeCommand:

Public Member Functions

 KisInsertKeyframeCommand (KisKeyframeChannel *channel, int time, KisKeyframeSP keyframe, 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

KisKeyframeChannelm_channel
 
KisKeyframeSP m_keyframe
 
KisKeyframeSP m_overwritten = nullptr
 
int m_time
 

Detailed Description

Definition at line 17 of file kis_keyframe_commands.h.

Constructor & Destructor Documentation

◆ KisInsertKeyframeCommand()

KisInsertKeyframeCommand::KisInsertKeyframeCommand ( KisKeyframeChannel * channel,
int time,
KisKeyframeSP keyframe,
KUndo2Command * parentCmd = nullptr )

Definition at line 12 of file kis_keyframe_commands.cpp.

13 : KUndo2Command(parentCmd),
14 m_channel(channel),
15 m_time(time),
16 m_keyframe(keyframe)
17{
19}
virtual QTime time() const
KUndo2Command(KUndo2Command *parent=0)
KisKeyframeChannel * m_channel
KisKeyframeSP keyframeAt(int time) const
Get a keyframe at specified time. Used primarily when the value of a given keyframe is needed.

References KisKeyframeChannel::keyframeAt(), m_channel, m_overwritten, and m_time.

Member Function Documentation

◆ redo()

void KisInsertKeyframeCommand::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 21 of file kis_keyframe_commands.cpp.

22{
24}
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_channel, m_keyframe, and m_time.

◆ undo()

void KisInsertKeyframeCommand::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 26 of file kis_keyframe_commands.cpp.

27{
29
30 if (m_overwritten) {
32 }
33}
virtual void removeKeyframe(int time, KUndo2Command *parentUndoCmd=nullptr)
Remove a keyframe from the channel at the specified time.

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

Member Data Documentation

◆ m_channel

KisKeyframeChannel* KisInsertKeyframeCommand::m_channel
private

Definition at line 26 of file kis_keyframe_commands.h.

◆ m_keyframe

KisKeyframeSP KisInsertKeyframeCommand::m_keyframe
private

Definition at line 28 of file kis_keyframe_commands.h.

◆ m_overwritten

KisKeyframeSP KisInsertKeyframeCommand::m_overwritten = nullptr
private

Definition at line 30 of file kis_keyframe_commands.h.

◆ m_time

int KisInsertKeyframeCommand::m_time
private

Definition at line 27 of file kis_keyframe_commands.h.


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