Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorAnimation::Profile Class Reference

Configuration for a single animation event. More...

#include <phosphor-animation/include/PhosphorAnimation/Profile.h>

Public Member Functions

 Profile ()=default
 
 Profile (const Profile &)=default
 
Profileoperator= (const Profile &)=default
 
 Profile (Profile &&)=default
 
Profileoperator= (Profile &&)=default
 
qreal effectiveDuration () const
 
int effectiveMinDistance () const
 
SequenceMode effectiveSequenceMode () const
 
int effectiveStaggerInterval () const
 
Profile withDefaults () const
 Copy with every unset field filled from library defaults.
 
QJsonObject toJson () const
 Serialize to JSON. Only set fields are emitted.
 
bool operator== (const Profile &other) const
 
bool operator!= (const Profile &other) const
 

Static Public Member Functions

static Profile fromJson (const QJsonObject &obj, const CurveRegistry &registry)
 Parse from JSON.
 

Public Attributes

std::shared_ptr< const Curvecurve
 nullptr = inherit from parent / library default (outCubic bezier).
 
std::optional< qreal > duration
 Animation length in ms. Spring curves derive their own settle time.
 
std::optional< intminDistance
 Skip threshold in px — animation skipped if distance < this and no size change.
 
std::optional< SequenceModesequenceMode
 
std::optional< intstaggerInterval
 Milliseconds between cascade starts.
 
std::optional< QStringpresetName
 Optional user-assigned preset name. Purely decorative for UI.
 

Static Public Attributes

static constexpr qreal DefaultDuration = 150.0
 
static constexpr int DefaultMinDistance = 0
 
static constexpr SequenceMode DefaultSequenceMode = SequenceMode::AllAtOnce
 
static constexpr int DefaultStaggerInterval = 30
 
static constexpr qreal MaxDurationMs = 60.0 * 60.0 * 1000.0
 
static constexpr int MaxStaggerIntervalMs = 60 * 60 * 1000
 
static constexpr auto JsonFieldCurve = "curve"
 
static constexpr auto JsonFieldDuration = "duration"
 
static constexpr auto JsonFieldMinDistance = "minDistance"
 
static constexpr auto JsonFieldSequenceMode = "sequenceMode"
 
static constexpr auto JsonFieldStaggerInterval = "staggerInterval"
 
static constexpr auto JsonFieldPresetName = "presetName"
 

Detailed Description

Configuration for a single animation event.

Fields are std::optional so ProfileTree inheritance can distinguish "inherit from parent" (nullopt) from "explicitly set" (engaged). Use effective*() getters or withDefaults() for runtime values with library defaults filled in.

Constructor & Destructor Documentation

◆ Profile() [1/3]

PhosphorAnimation::Profile::Profile ( )
default

◆ Profile() [2/3]

PhosphorAnimation::Profile::Profile ( const Profile )
default

◆ Profile() [3/3]

PhosphorAnimation::Profile::Profile ( Profile &&  )
default

Member Function Documentation

◆ effectiveDuration()

qreal PhosphorAnimation::Profile::effectiveDuration ( ) const
inline

◆ effectiveMinDistance()

int PhosphorAnimation::Profile::effectiveMinDistance ( ) const
inline

◆ effectiveSequenceMode()

SequenceMode PhosphorAnimation::Profile::effectiveSequenceMode ( ) const
inline

◆ effectiveStaggerInterval()

int PhosphorAnimation::Profile::effectiveStaggerInterval ( ) const
inline

◆ fromJson()

static Profile PhosphorAnimation::Profile::fromJson ( const QJsonObject obj,
const CurveRegistry registry 
)
static

Parse from JSON.

Missing keys produce unset fields. Curve resolved via registry. Out-of-range values are rejected (logged, left unset).

◆ operator!=()

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ operator==()

◆ toJson()

QJsonObject PhosphorAnimation::Profile::toJson ( ) const

Serialize to JSON. Only set fields are emitted.

◆ withDefaults()

Profile PhosphorAnimation::Profile::withDefaults ( ) const

Copy with every unset field filled from library defaults.

Curve is left null if still unset.

Member Data Documentation

◆ curve

std::shared_ptr<const Curve> PhosphorAnimation::Profile::curve

nullptr = inherit from parent / library default (outCubic bezier).

◆ DefaultDuration

constexpr qreal PhosphorAnimation::Profile::DefaultDuration = 150.0
staticconstexpr

◆ DefaultMinDistance

constexpr int PhosphorAnimation::Profile::DefaultMinDistance = 0
staticconstexpr

◆ DefaultSequenceMode

constexpr SequenceMode PhosphorAnimation::Profile::DefaultSequenceMode = SequenceMode::AllAtOnce
staticconstexpr

◆ DefaultStaggerInterval

constexpr int PhosphorAnimation::Profile::DefaultStaggerInterval = 30
staticconstexpr

◆ duration

std::optional<qreal> PhosphorAnimation::Profile::duration

Animation length in ms. Spring curves derive their own settle time.

◆ JsonFieldCurve

constexpr auto PhosphorAnimation::Profile::JsonFieldCurve = "curve"
staticconstexpr

◆ JsonFieldDuration

constexpr auto PhosphorAnimation::Profile::JsonFieldDuration = "duration"
staticconstexpr

◆ JsonFieldMinDistance

constexpr auto PhosphorAnimation::Profile::JsonFieldMinDistance = "minDistance"
staticconstexpr

◆ JsonFieldPresetName

constexpr auto PhosphorAnimation::Profile::JsonFieldPresetName = "presetName"
staticconstexpr

◆ JsonFieldSequenceMode

constexpr auto PhosphorAnimation::Profile::JsonFieldSequenceMode = "sequenceMode"
staticconstexpr

◆ JsonFieldStaggerInterval

constexpr auto PhosphorAnimation::Profile::JsonFieldStaggerInterval = "staggerInterval"
staticconstexpr

◆ MaxDurationMs

constexpr qreal PhosphorAnimation::Profile::MaxDurationMs = 60.0 * 60.0 * 1000.0
staticconstexpr

◆ MaxStaggerIntervalMs

constexpr int PhosphorAnimation::Profile::MaxStaggerIntervalMs = 60 * 60 * 1000
staticconstexpr

◆ minDistance

std::optional<int> PhosphorAnimation::Profile::minDistance

Skip threshold in px — animation skipped if distance < this and no size change.

◆ presetName

std::optional<QString> PhosphorAnimation::Profile::presetName

Optional user-assigned preset name. Purely decorative for UI.

◆ sequenceMode

std::optional<SequenceMode> PhosphorAnimation::Profile::sequenceMode

◆ staggerInterval

std::optional<int> PhosphorAnimation::Profile::staggerInterval

Milliseconds between cascade starts.


The documentation for this class was generated from the following file: