跳转至

cf::ui::components::ICFTimingAnimation

Timing-based animation interface. More...

#include <timing_animation.h>

Inherits from cf::ui::components::ICFAbstractAnimation, QObject

Inherited by cf::ui::components::material::CFMaterialFadeAnimation, cf::ui::components::material::CFMaterialScaleAnimation, cf::ui::components::material::CFMaterialSlideAnimation

Public Functions

Name
ICFTimingAnimation(cf::ui::core::IMotionSpec * spec, QObject * parent =nullptr)
Constructor with motion specification.
virtual void setRange(float from, float to)
Sets the value range for the animation.
virtual float currentValue() const =0
Gets the current animated value.

Protected Attributes

Name
cf::ui::core::IMotionSpec * motion_spec_
float m_from
float m_to
int m_elapsed

Additional inherited members

Public Types inherited from cf::ui::components::ICFAbstractAnimation

Name
enum class State { Idle, Running, Paused, Finished}
Animation states.
enum class Direction { Forward, Backward}
Animation playback direction.

Public Signals inherited from cf::ui::components::ICFAbstractAnimation

Name
void started()
Signal emitted when animation starts.
void paused()
Signal emitted when animation is paused.
void stopped()
Signal emitted when animation stops.
void reversed()
Signal emitted when animation reverses direction.
void finished()
Signal emitted when animation finishes.
void progressChanged(float progress)
Signal emitted when animation progress changes.

Public Functions inherited from cf::ui::components::ICFAbstractAnimation

Name
ICFAbstractAnimation(QObject * parent =nullptr)
virtual void start(Direction dir =Direction::Forward) =0
Starts the animation in the specified direction.
virtual void pause() =0
Pauses the animation.
virtual void stop() =0
Stops the animation and resets to initial state.
virtual void reverse() =0
Reverses the animation direction.
virtual bool tick(int dt) =0
Updates the animation state.
virtual cf::WeakPtr< ICFAbstractAnimation > GetWeakPtr() =0
Gets a weak pointer to this animation.
bool getEnabled() const
Gets the enabled state of the animation.
void setTargetFps(float fps)
Set the target FPS for this animation.
int calculateInterval() const
Calculate the timer interval based on target FPS.

Protected Functions inherited from cf::ui::components::ICFAbstractAnimation

Name
void setEnabled(bool enabled)
Sets the enabled state of the animation.

Protected Attributes inherited from cf::ui::components::ICFAbstractAnimation

Name
QTimer * driven_internal_timer
float m_progress
State m_state
float targetFps_
Target FPS for this animation (default 60.0f)

Friends inherited from cf::ui::components::ICFAbstractAnimation

Name
class ICFAnimationManagerFactory(ICFAnimationManagerFactory )

Detailed Description

class cf::ui::components::ICFTimingAnimation;

Timing-based animation interface.

Since: 0.1

Base class for animations that use MotionSpec for timing and easing configuration following Material Design 3.

NOTE: The motion_spec pointer must remain valid for the lifetime of this animation. This is guaranteed when the animation is created by CFMaterialAnimationFactory, which holds a reference to the theme that owns the motion spec.

Public Functions Documentation

function ICFTimingAnimation

explicit ICFTimingAnimation(
    cf::ui::core::IMotionSpec * spec,
    QObject * parent =nullptr
)

Constructor with motion specification.

Parameters:

  • spec Raw pointer to the motion spec for timing/easing. Must remain valid for the lifetime of this animation.
  • parent QObject parent.

Exceptions:

  • None

Since: 0.1

Note: The motion_spec pointer must remain valid for the lifetime of this animation.

Warning: None

function setRange

inline virtual void setRange(
    float from,
    float to
)

Sets the value range for the animation.

Parameters:

  • from Start value of the animation.
  • to End value of the animation.

Exceptions:

  • None

Since: 0.1

Note: None

Warning: None

function currentValue

virtual float currentValue() const =0

Gets the current animated value.

Exceptions:

  • None

Return: Current animated value.

Since: 0.1

Note: None

Warning: None

Reimplemented by: cf::ui::components::material::CFMaterialFadeAnimation::currentValue, cf::ui::components::material::CFMaterialScaleAnimation::currentValue, cf::ui::components::material::CFMaterialSlideAnimation::currentValue

Protected Attributes Documentation

variable motion_spec_

cf::ui::core::IMotionSpec * motion_spec_ = nullptr;

variable m_from

float m_from = 0.0f;

variable m_to

float m_to = 1.0f;

variable m_elapsed

int m_elapsed = 0;

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