9#ifndef KIS_KEYFRAME_CHANNEL_H
10#define KIS_KEYFRAME_CHANNEL_H
22#include "kritaimage_export.h"
55 void addKeyframe(
int time,
KUndo2Command *parentUndoCmd =
nullptr);
61 virtual void removeKeyframe(
int time,
KUndo2Command *parentUndoCmd =
nullptr);
85 template <
class KeyframeType>
87 return keyframeAt(time).dynamicCast<KeyframeType>();
90 template <
class KeyframeType>
92 return activeKeyframeAt(time).dynamicCast<KeyframeType>();
95 int keyframeCount()
const;
102 int activeKeyframeTime(
int time)
const;
112 int firstKeyframeTime()
const;
113 int previousKeyframeTime(
const int time)
const;
114 int nextKeyframeTime(
const int time)
const;
115 int lastKeyframeTime()
const;
118 QSet<int> allKeyframeTimes()
const;
121 QString name()
const;
129 int channelHash()
const;
133 virtual KisTimeSpan affectedFrames(
int time)
const;
140 virtual KisTimeSpan identicalFrames(
int time)
const;
147 virtual QDomElement toXML(QDomDocument doc,
const QString &layerFilename);
148 virtual void loadXML(
const QDomElement &channelNode);
150 static KoID channelIdToKoId(
const QString &
id);
176 int currentTime()
const;
182 virtual void removeKeyframeImpl(
int time,
KUndo2Command *parentUndoCmd);
191 Q_DECL_DEPRECATED
void workaroundBrokenFrameTimeBug(
int *time);
195 QScopedPointer<Private>
m_d;
202 virtual QPair<int, KisKeyframeSP>
loadKeyframe(
const QDomElement &keyframeNode) = 0;
KisKeyframeChannel stores and manages KisKeyframes. Maps units of time to virtual keyframe values....
void swapKeyframes(int timeA, int timeB, KUndo2Command *parentUndoCmd=nullptr)
static const KoID RotationY
virtual KisKeyframeSP createKeyframe()=0
Virtual keyframe creation function. Derived classes implement this function based on the needs of the...
void sigAnyKeyframeChange()
virtual QPair< int, KisKeyframeSP > loadKeyframe(const QDomElement &keyframeNode)=0
static const KoID RotationZ
void moveKeyframe(int sourceTime, int targetTime, KUndo2Command *parentUndoCmd=nullptr)
QMap< int, KisKeyframeSP > TimeKeyframeMap
static const KoID Opacity
static const KoID TransformArguments
QScopedPointer< Private > m_d
virtual void saveKeyframe(KisKeyframeSP keyframe, QDomElement keyframeElement, const QString &layerFilename)=0
static const KoID RotationX
QSharedPointer< KeyframeType > keyframeAt(int time) const
void sigKeyframeHasBeenRemoved(const KisKeyframeChannel *channel, int time)
This signal is emitted just AFTER a keyframe is removed from the channel.
QSharedPointer< KeyframeType > activeKeyframeAt(int time) const
int activeKeyframeTime() const
KisKeyframeSP activeKeyframeAt(int time) const
void sigKeyframeAboutToBeRemoved(const KisKeyframeChannel *channel, int time)
This signal is emitted just BEFORE a keyframe is removed from the channel.
static const KoID PositionX
static const KoID PositionY
void sigKeyframeChanged(const KisKeyframeChannel *channel, int time)
This signal is emitted just AFTER a non-raster keyframe was changed its value.
void copyKeyframe(int sourceTime, int targetTime, KUndo2Command *parentUndoCmd=nullptr)
virtual QRect affectedRect(int time) const =0
void sigAddedKeyframe(const KisKeyframeChannel *channel, int time)
This signal is emitted just AFTER a keyframe was added to the channel.