跳转至

cf::ui::components::material::token_literals

Classes

Name
struct cf::ui::components::material::token_literals::AnimationTokenMapping
Animation token mapping entry.

Functions

Name
constAnimationTokenMapping * findTokenMapping(constchar * token)
Find a mapping entry by animation token.
bool hasTokenMapping(constchar * token)
Check if an animation token exists in the mapping table.

Attributes

Name
constexprconstchar[] ANIMATION_FADE_IN
Fade-in animation token.
constexprconstchar[] ANIMATION_FADE_OUT
Fade-out animation token.
constexprconstchar[] ANIMATION_SLIDE_UP
Slide-up animation token.
constexprconstchar[] ANIMATION_SLIDE_DOWN
Slide-down animation token.
constexprconstchar[] ANIMATION_SLIDE_LEFT
Slide-left animation token.
constexprconstchar[] ANIMATION_SLIDE_RIGHT
Slide-right animation token.
constexprconstchar[] ANIMATION_SCALE_UP
Scale-up animation token.
constexprconstchar[] ANIMATION_SCALE_DOWN
Scale-down animation token.
constexprconstchar[] ANIMATION_ROTATE_IN
Rotate-in animation token.
constexprconstchar[] ANIMATION_ROTATE_OUT
Rotate-out animation token.
constexprconstchar[] ANIMATION_RIPPLE_EXPAND
Ripple expand animation token.
constexprconstchar[] ANIMATION_RIPPLE_FADE
Ripple fade animation token.
constexprconstchar *const[] ALL_ANIMATION_TOKENS
Array containing all Material Design 3 animation token literals.
constexprsize_t ANIMATION_TOKEN_COUNT
Total count of Material Design 3 animation tokens.
constexprAnimationTokenMapping[] TOKEN_MAPPINGS
Complete animation token mapping table.
constexprsize_t TOKEN_MAPPING_COUNT
Total number of animation token mappings.

Functions Documentation

function findTokenMapping

inline constAnimationTokenMapping * findTokenMapping(
    constchar * token
)

Find a mapping entry by animation token.

Parameters:

  • token The animation token to look up.

Exceptions:

  • None

Return: Pointer to the matching mapping entry, or nullptr if not found.

Since: 0.1

Note: Linear search is acceptable for small tables (< 100 entries).

Warning: The returned pointer is valid only as long as TOKEN_MAPPINGS is accessible (meaning: program lifetime).

Performs a linear search through the mapping table. Returns nullptr if the token is not found.

const auto* mapping = findTokenMapping("md.animation.fadeIn");
if (mapping) {
    // mapping->animationType == "fade"
    // mapping->motionToken == "md.motion.shortEnter"
    // mapping->property == "opacity"
    // mapping->defaultFrom == 0.0f
    // mapping->defaultTo == 1.0f
}

function hasTokenMapping

inline bool hasTokenMapping(
    constchar * token
)

Check if an animation token exists in the mapping table.

Parameters:

  • token The animation token to check.

Exceptions:

  • None

Return: true if the token is found, false otherwise.

Since: 0.1

Note: None

Warning: None

Attributes Documentation

variable ANIMATION_FADE_IN

constexprconstchar[] ANIMATION_FADE_IN = "md.animation.fadeIn";

Fade-in animation token.

Since: 0.1

Opacity animation from 0 to 1. Uses shortEnter timing by default.

variable ANIMATION_FADE_OUT

constexprconstchar[] ANIMATION_FADE_OUT = "md.animation.fadeOut";

Fade-out animation token.

Since: 0.1

Opacity animation from 1 to 0. Uses shortExit timing by default.

variable ANIMATION_SLIDE_UP

constexprconstchar[] ANIMATION_SLIDE_UP = "md.animation.slideUp";

Slide-up animation token.

Since: 0.1

Position animation sliding upward. Uses mediumEnter timing.

variable ANIMATION_SLIDE_DOWN

constexprconstchar[] ANIMATION_SLIDE_DOWN = "md.animation.slideDown";

Slide-down animation token.

Since: 0.1

Position animation sliding downward. Uses mediumExit timing.

variable ANIMATION_SLIDE_LEFT

constexprconstchar[] ANIMATION_SLIDE_LEFT = "md.animation.slideLeft";

Slide-left animation token.

Since: 0.1

Position animation sliding left. Uses mediumEnter timing.

variable ANIMATION_SLIDE_RIGHT

constexprconstchar[] ANIMATION_SLIDE_RIGHT = "md.animation.slideRight";

Slide-right animation token.

Since: 0.1

Position animation sliding right. Uses mediumEnter timing.

variable ANIMATION_SCALE_UP

constexprconstchar[] ANIMATION_SCALE_UP = "md.animation.scaleUp";

Scale-up animation token.

Since: 0.1

Size animation growing from smaller to normal. Uses shortEnter timing.

variable ANIMATION_SCALE_DOWN

constexprconstchar[] ANIMATION_SCALE_DOWN = "md.animation.scaleDown";

Scale-down animation token.

Since: 0.1

Size animation shrinking from normal to smaller. Uses shortExit timing.

variable ANIMATION_ROTATE_IN

constexprconstchar[] ANIMATION_ROTATE_IN = "md.animation.rotateIn";

Rotate-in animation token.

Since: 0.1

Rotation animation for entering elements. Uses mediumEnter timing.

variable ANIMATION_ROTATE_OUT

constexprconstchar[] ANIMATION_ROTATE_OUT = "md.animation.rotateOut";

Rotate-out animation token.

Since: 0.1

Rotation animation for exiting elements. Uses mediumExit timing.

variable ANIMATION_RIPPLE_EXPAND

constexprconstchar[] ANIMATION_RIPPLE_EXPAND = "md.animation.rippleExpand";

Ripple expand animation token.

Since: 0.1

Ripple effect radius expansion from 0 to maxRadius. Uses rippleExpand timing.

variable ANIMATION_RIPPLE_FADE

constexprconstchar[] ANIMATION_RIPPLE_FADE = "md.animation.rippleFade";

Ripple fade animation token.

Since: 0.1

Ripple effect opacity fade-out from 1 to 0. Uses rippleFade timing.

variable ALL_ANIMATION_TOKENS

constexprconstchar *const[] ALL_ANIMATION_TOKENS = {

    ANIMATION_FADE_IN, ANIMATION_FADE_OUT,

    ANIMATION_SLIDE_UP, ANIMATION_SLIDE_DOWN, ANIMATION_SLIDE_LEFT, ANIMATION_SLIDE_RIGHT,

    ANIMATION_SCALE_UP, ANIMATION_SCALE_DOWN,

    ANIMATION_ROTATE_IN, ANIMATION_ROTATE_OUT,

    ANIMATION_RIPPLE_EXPAND, ANIMATION_RIPPLE_FADE};

Array containing all Material Design 3 animation token literals.

Since: 0.1

Ordered by category: Fade (2), Slide (4), Scale (2), Rotate (2).

variable ANIMATION_TOKEN_COUNT

constexprsize_t ANIMATION_TOKEN_COUNT = 12;

Total count of Material Design 3 animation tokens.

Since: 0.1

variable TOKEN_MAPPINGS

constexprAnimationTokenMapping[] TOKEN_MAPPINGS;

Complete animation token mapping table.

Since: 0.1

Defines all predefined animation tokens and their corresponding configurations. This table is used by MaterialAnimationFactory to resolve tokens to descriptors.

The table is ordered by animation category for easier lookup:

  • Fade animations (2 entries)
  • Slide animations (4 entries)
  • Scale animations (2 entries)
  • Rotate animations (2 entries)
  • Ripple animations (2 entries)

variable TOKEN_MAPPING_COUNT

constexprsize_t TOKEN_MAPPING_COUNT =
    sizeof(TOKEN_MAPPINGS) / sizeof(AnimationTokenMapping);

Total number of animation token mappings.

Since: 0.1


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