Animation
struct · ferroui-base · v0.5.0
struct Animation
Tracks the progress of an animation.
Members
TYPEto_refduration_propertydurationset_durationiteration_count_propertyiteration_countset_iteration_countplayback_direction_propertyplayback_directionset_playback_directionplayback_behavior_propertyplayback_behaviorset_playback_behaviorfill_mode_propertyfill_modeset_fill_modedelay_propertydelayset_delaydelay_between_iterations_propertydelay_between_iterationsset_delay_between_iterationseasing_propertyspeed_ratio_propertyconstructneweasingset_easingspeed_ratioset_speed_ratiochildrenapplyapply_for_previewrun_asyncrun_async_with_clockset_animatorregister_custom_animator
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Animation>
Returns a strong reference to this object.
duration_property
fn duration_property() -> &'static DirectProperty<Animation, SignedDuration>
Defines the Duration property: the active time of one iteration.
duration
fn duration(self: &Self) -> SignedDuration
set_duration
fn set_duration(self: &Self, value: SignedDuration)
iteration_count_property
fn iteration_count_property() -> &'static DirectProperty<Animation, IterationCount>
Defines the IterationCount property: the repeat count.
iteration_count
fn iteration_count(self: &Self) -> IterationCount
set_iteration_count
fn set_iteration_count(self: &Self, value: IterationCount)
playback_direction_property
fn playback_direction_property() -> &'static DirectProperty<Animation, PlaybackDirection>
Defines the PlaybackDirection property.
playback_direction
fn playback_direction(self: &Self) -> PlaybackDirection
set_playback_direction
fn set_playback_direction(self: &Self, value: PlaybackDirection)
playback_behavior_property
fn playback_behavior_property() -> &'static DirectProperty<Animation, PlaybackBehavior>
Defines the PlaybackBehavior property: whether the animation
pauses when its target is not effectively visible.
playback_behavior
fn playback_behavior(self: &Self) -> PlaybackBehavior
set_playback_behavior
fn set_playback_behavior(self: &Self, value: PlaybackBehavior)
fill_mode_property
fn fill_mode_property() -> &'static DirectProperty<Animation, FillMode>
Defines the FillMode property: the value fill mode.
fill_mode
fn fill_mode(self: &Self) -> FillMode
set_fill_mode
fn set_fill_mode(self: &Self, value: FillMode)
delay_property
fn delay_property() -> &'static DirectProperty<Animation, SignedDuration>
Defines the Delay property: the initial delay time.
delay
fn delay(self: &Self) -> SignedDuration
set_delay
fn set_delay(self: &Self, value: SignedDuration)
delay_between_iterations_property
fn delay_between_iterations_property() -> &'static DirectProperty<Animation, SignedDuration>
Defines the DelayBetweenIterations property.
delay_between_iterations
fn delay_between_iterations(self: &Self) -> SignedDuration
set_delay_between_iterations
fn set_delay_between_iterations(self: &Self, value: SignedDuration)
easing_property
fn easing_property() -> &'static DirectProperty<Animation, Easing>
Defines the Easing property: the easing function to be used.
speed_ratio_property
fn speed_ratio_property() -> &'static DirectProperty<Animation, f64>
Defines the SpeedRatio property: the speed multiple.
construct
fn construct() -> Self
Creates the class data; see FerroObject::construct.
new
fn new() -> Ref<Self>
easing
fn easing(self: &Self) -> Easing
The easing function to be used for this animation.
set_easing
fn set_easing(self: &Self, value: impl Into<Easing>)
speed_ratio
fn speed_ratio(self: &Self) -> f64
The speed multiple for this animation.
set_speed_ratio
fn set_speed_ratio(self: &Self, value: f64)
children
fn children(self: &Self) -> KeyFrames
The children of the animation: its key frames.
apply
fn apply(self: &Self, control: &Animatable, clock: Option<Rc<dyn IClock>>, match_: Rc<dyn IObservable<bool>>, on_complete: Option<Rc<dyn Fn() -> ()>>, is_manually_started: bool) -> Rc<dyn IDisposable>
Applies the animation to control: it runs while match_ is true,
on clock (or on the control's clock, or on the global clock).
on_complete runs when the animation ends by itself.
is_manually_started tells an animation started by code from one
started by a style. Disposing the result removes the animation.
apply_for_preview
fn apply_for_preview(self: &Self, control: &Animatable, clock: Option<Rc<dyn IClock>>, on_complete: Option<Rc<dyn Fn() -> ()>>) -> Rc<dyn IDisposable>
Applies an isolated snapshot using the framework animators, retaining final fill
and automatically created transforms at animation priority. Disposing the result
restores the control's underlying values and bindings, including after completion.
This is intended for interactive authoring and inspection; ordinary apply retains
its application semantics, including committing forward fill to a local value.
run_async
fn run_async(self: &Self, control: &Animatable, cancellation_token: CancellationToken) -> AnimationTask
Starts the animation on control and returns a task that completes
when it has ended or cancellation_token was cancelled.
run_async_with_clock
fn run_async_with_clock(self: &Self, control: &Animatable, clock: Option<Rc<dyn IClock>>, cancellation_token: CancellationToken) -> AnimationTask
run_async on an explicit clock.
set_animator
fn set_animator(setter: &Rc<dyn IAnimationSetter>, value: Rc<dyn ICustomAnimator>)
Sets the value of the Animator attached property for a setter: the
custom animator that animates the setter's property instead of the
one selected by the property's type.
register_custom_animator
fn register_custom_animator<TAnimator: InterpolatingAnimator + Default>()
Registers a user-provided animator for properties of its value type. It takes precedence over the animators registered before it.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeFerroObjectImplExtClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyErasedDestructorIntoEitherDerefUpcast<T>Upcast<Animation>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.