# Animatable

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/animation/struct-animatable/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct Animatable
```

Base class for all animatable objects.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L16)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`clock_property`](#function-clock_property)
- [`transitions_property`](#function-transitions_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`clock`](#function-clock)
- [`set_clock`](#function-set_clock)
- [`transitions`](#function-transitions)
- [`set_transitions`](#function-set_transitions)
- [`enable_transitions`](#function-enable_transitions)
- [`disable_transitions`](#function-disable_transitions)
- [`try_get_transition_instance`](#function-try_get_transition_instance)
- [`take_transition_interruption_state`](#function-take_transition_interruption_state)
- [`report_transition_interruption_state`](#function-report_transition_interruption_state)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L71)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Animatable>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L71)

<a id="function-clock_property"></a>

### clock_property

```rust
fn clock_property() -> &'static StyledProperty<Option<Rc<dyn IClock>>>
```

Defines the `Clock` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L171)

<a id="function-transitions_property"></a>

### transitions_property

```rust
fn transitions_property() -> &'static StyledProperty<Option<Transitions>>
```

Defines the `Transitions` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L171)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L189)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L201)

<a id="function-clock"></a>

### clock

```rust
fn clock(self: &Self) -> Option<Rc<dyn IClock>>
```

The clock which controls the animations and transitions on the
object and, by inheritance, on its descendants. The global clock is
used when there is none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L208)

<a id="function-set_clock"></a>

### set_clock

```rust
fn set_clock(self: &Self, value: Option<Rc<dyn IClock>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L212)

<a id="function-transitions"></a>

### transitions

```rust
fn transitions(self: &Self) -> Option<Transitions>
```

The property transitions of the object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L217)

<a id="function-set_transitions"></a>

### set_transitions

```rust
fn set_transitions(self: &Self, value: Option<Transitions>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L221)

<a id="function-enable_transitions"></a>

### enable_transitions

```rust
fn enable_transitions(self: &Self)
```

Enables transitions for the object.

This is called when the object is attached to the visual tree, so
that transitions do not run on its initial property values.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L229)

<a id="function-disable_transitions"></a>

### disable_transitions

```rust
fn disable_transitions(self: &Self)
```

Disables transitions for the object.

This is called when the object is detached from the visual tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L247)

<a id="function-try_get_transition_instance"></a>

### try_get_transition_instance

```rust
fn try_get_transition_instance(self: &Self, transition: &Rc<dyn ITransition>) -> Option<Rc<TransitionInstance>>
```

The progress of the transition that `transition` is currently
running on this object: the instance created when the transition was
last applied. `None` when the transition is not one of the object's
transitions or has not been applied.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L364)

<a id="function-take_transition_interruption_state"></a>

### take_transition_interruption_state

```rust
fn take_transition_interruption_state<T: Any>(self: &Self) -> Option<Rc<T>>
```

Takes state left by the preceding application of the same transition on this object.

This is only available synchronously inside `ITransition::apply`. A spring transition
can retain its last sampled velocity here, without storing mutable animation state in
a transition definition that may be shared by several controls. Removal or visual-tree
detachment discards the state. Normal duration-based transitions do not use this hook.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L380)

<a id="function-report_transition_interruption_state"></a>

### report_transition_interruption_state

```rust
fn report_transition_interruption_state<T: Any>(self: &Self, state: Rc<T>)
```

Reports state to carry into the next application of this transition on this object.

Call only from `ITransition::apply`. The state may be updated by the running animation,
but must not strongly own the target object. Outside a transition application this has
no effect. Store zero velocity when an animation completes or is accessibility-canceled.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animatable.rs#L389)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Animatable>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
