#ifndef KQUICKSMOOTHEDANIMATION_H
#define KQUICKSMOOTHEDANIMATION_H

#include <qqml.h>
#include <private/qquickanimation_p.h>

#include <QtCore/qobject.h>

QT_BEGIN_NAMESPACE

class QQmlProperty;
class KQuickSmoothedAnimationPrivate;
class Q_AUTOTEST_EXPORT KQuickSmoothedAnimation : public QQuickNumberAnimation
{
    Q_OBJECT
    Q_DECLARE_PRIVATE(KQuickSmoothedAnimation)

    Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged)
    Q_PROPERTY(ReversingMode reversingMode READ reversingMode WRITE setReversingMode NOTIFY reversingModeChanged)
    Q_PROPERTY(qreal maximumEasingTime READ maximumEasingTime WRITE setMaximumEasingTime NOTIFY maximumEasingTimeChanged)

public:
    enum ReversingMode { Eased, Immediate, Sync };
    Q_ENUM(ReversingMode)

    KQuickSmoothedAnimation(QObject *parent = nullptr);
    ~KQuickSmoothedAnimation();

    ReversingMode reversingMode() const;
    void setReversingMode(ReversingMode);

    int duration() const override;
    void setDuration(int) override;

    qreal velocity() const;
    void setVelocity(qreal);

    int maximumEasingTime() const;
    void setMaximumEasingTime(int);

    QAbstractAnimationJob* transition(QQuickStateActions &actions,
                            QQmlProperties &modified,
                            TransitionDirection direction,
                            QObject *defaultTarget = nullptr) override;
Q_SIGNALS:
    void velocityChanged();
    void reversingModeChanged();
    void maximumEasingTimeChanged();
};

QT_END_NAMESPACE

QML_DECLARE_TYPE(KQuickSmoothedAnimation)

#endif // KQUICKSMOOTHEDANIMATION_H
