跳转至

ui/components/timing_animation.h

Timing-based Animation Interface. More...

Namespaces

Name
cf
cf::ui
cf::ui::components
cf::ui::components::core

Classes

Name
class cf::ui::components::ICFTimingAnimation
Timing-based animation interface.

Detailed Description

Timing-based Animation Interface.

Author: Charliechen114514 (chengh1922@mails.jlu.edu.cn)

Version: 0.1

Date: 2026-02-28

Copyright: Copyright © 2026

Defines the timing-based animation interface that uses motion spec for duration and easing values. This is the base class for animations that follow Material Design 3 motion specifications.

Source code

#pragma once

#include "animation.h"
#include "core/motion_spec.h"
#include <qobject.h>

namespace cf::ui::components {

// Forward declaration
namespace core {
struct IMotionSpec;
}

class CF_UI_EXPORT ICFTimingAnimation : public ICFAbstractAnimation {
    Q_OBJECT
  public:
    explicit ICFTimingAnimation(cf::ui::core::IMotionSpec* spec, QObject* parent = nullptr);

    virtual void setRange(float from, float to) {
        m_from = from;
        m_to = to;
    }

    virtual float currentValue() const = 0;

  protected:
    cf::ui::core::IMotionSpec* motion_spec_ = nullptr;
    float m_from = 0.0f;
    float m_to = 1.0f;
    int m_elapsed = 0;
};

} // namespace cf::ui::components

Updated on 2026-03-09 at 10:14:01 +0000