Abstraction for an Animation that can be applied to Views, Surfaces, or other objects. More...
#include <SAnimation.h>
Public Member Functions | |
SAnimation () | |
Default constructor for SAnimation. | |
~SAnimation () | |
Destructor for SAnimation. | |
IAnimation * | clone () SCONST OVERRIDE |
Creates a new animation with a duration of 0ms, the default interpolator, with fillBefore set to true and fillAfter set to false. | |
void | copy (const IAnimation *src) OVERRIDE |
Copies the properties of another animation to this animation. | |
void | reset () OVERRIDE |
Resets the animation to its initial state. | |
void | cancel () OVERRIDE |
Cancels the animation. | |
void | setInterpolator (IInterpolator *i) OVERRIDE |
Sets the interpolator used by the animation to smooth the movement. | |
void | setDuration (long durationMillis) OVERRIDE |
Sets the duration of one animation cycle in milliseconds. | |
void | scaleCurrentDuration (float scale) OVERRIDE |
Scales the current duration of the animation. | |
void | setFillBefore (BOOL bFill) OVERRIDE |
Sets whether the animation transformation should be applied before the animation starts. | |
void | setFillAfter (BOOL bFill) OVERRIDE |
Sets whether the animation transformation should be applied after the animation ends. | |
BOOL | getFillBefore () SCONST OVERRIDE |
Gets whether the animation transformation should be applied before the animation starts. | |
BOOL | getFillAfter () SCONST OVERRIDE |
Gets whether the animation transformation should be applied after the animation ends. | |
void | setStartOffset (long offset) OVERRIDE |
Sets the delay in milliseconds after which the animation must start. | |
BOOL | isFillEnabled () SCONST OVERRIDE |
Checks whether fillBefore should be taken into account. | |
void | setFillEnabled (BOOL fillEnabled) OVERRIDE |
Sets whether fillBefore should be taken into account. | |
void | setStartTime (int64_t startTimeMillis) OVERRIDE |
Sets the start time of the animation. | |
void | start () OVERRIDE |
Starts the animation. | |
void | startNow () OVERRIDE |
Starts the animation immediately. | |
void | setRepeatMode (RepeatMode repeatMode) OVERRIDE |
Sets the repeat mode of the animation. | |
void | setRepeatCount (int repeatCount) OVERRIDE |
Sets the number of times the animation must repeat. | |
void | setZAdjustment (ZAdjustment zAdjustment) OVERRIDE |
Sets the desired Z order mode during animation. | |
IInterpolator * | getInterpolator () SCONST OVERRIDE |
Gets the interpolator used by the animation. | |
int64_t | getStartTime () SCONST OVERRIDE |
Gets the start time of the animation. | |
long | getDuration () SCONST OVERRIDE |
Gets the duration of one animation cycle. | |
long | getStartOffset () SCONST OVERRIDE |
Gets the delay in milliseconds after which the animation must start. | |
RepeatMode | getRepeatMode () SCONST OVERRIDE |
Gets the repeat mode of the animation. | |
int | getRepeatCount () SCONST OVERRIDE |
Gets the number of times the animation must repeat. | |
ZAdjustment | getZAdjustment () SCONST OVERRIDE |
Gets the desired Z order mode during animation. | |
void | setAnimationListener (IAnimationListener *listener) OVERRIDE |
Sets the animation listener to be notified when the animation starts, ends, or repeats. | |
long | computeDurationHint () SCONST OVERRIDE |
Computes the duration hint for the animation. | |
BOOL | getTransformation2 (uint64_t currentTime, ITransformation *outTransformation, float scale) OVERRIDE |
Gets the transformation at a specific time. | |
BOOL | getTransformation (uint64_t currentTime, ITransformation *outTransformation) OVERRIDE |
Gets the transformation at a specific time. | |
BOOL | hasStarted () SCONST OVERRIDE |
Checks whether the animation has started. | |
BOOL | hasEnded () SCONST OVERRIDE |
Checks whether the animation has ended. | |
void | applyTransformation (float interpolatedTime, ITransformation *t) OVERRIDE |
Applies the transformation at a specific interpolated time. | |
BOOL | hasAlpha () SCONST OVERRIDE |
Checks whether the animation affects the alpha property. | |
void | initialize (int width, int height, int parentWidth, int parentHeight, int nScale) OVERRIDE |
Initializes the animation with the dimensions of the object and its parent. | |
void | setUserData (ULONG_PTR data) OVERRIDE |
Sets user data associated with the animation. | |
ULONG_PTR | getUserData () SCONST OVERRIDE |
Gets user data associated with the animation. | |
void | pause () OVERRIDE |
Pauses the animation. | |
void | resume () OVERRIDE |
Resumes the animation. | |
virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
Attributes for SAnimation. | |
![]() | |
TObjRefImpl () | |
Constructor that initializes the reference count to 1. | |
virtual | ~TObjRefImpl () |
Virtual destructor. | |
long | AddRef () override |
Increments the reference count. | |
long | Release () override |
Decrements the reference count and deletes the object if the count reaches zero. | |
void | OnFinalRelease () override |
Deletes the object. | |
![]() | |
SObjectImpl () | |
Constructor. | |
BOOL | InitFromXml (IXmlNode *pXmlNode) OVERRIDE |
Initializes the object from an XML node. | |
LPCWSTR | GetName () SCONST OVERRIDE |
Retrieves the object's name. | |
LPCSTR | GetNameA () SCONST OVERRIDE |
Retrieves the object's name in ANSI format. | |
void | SetName (LPCWSTR pszName) OVERRIDE |
Sets the object's name. | |
int | GetID () SCONST OVERRIDE |
Retrieves the object's ID. | |
void | SetID (int nID) OVERRIDE |
Sets the object's ID. | |
HRESULT | AfterAttribute (LPCWSTR strAttribName, LPCWSTR strValue, BOOL bLoading, HRESULT hr) OVERRIDE |
Handles attribute processing after setting an attribute. | |
HRESULT | SetAttributeA (LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading) OVERRIDE |
Sets an attribute using ANSI strings. | |
HRESULT | SetAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading) OVERRIDE |
Sets an attribute using wide strings. | |
virtual HRESULT | SetAttribute (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading) |
Sets an attribute using wide strings. | |
HRESULT | ISetAttribute (const IStringW *strAttr, const IStringW *strValue, BOOL bLoading) OVERRIDE |
Sets an attribute using IStringW objects. | |
LPCWSTR | GetObjectClass () SCONST OVERRIDE |
Retrieves the object's class name. | |
int | GetObjectType () SCONST OVERRIDE |
Retrieves the object's type. | |
BOOL | IsClass (LPCWSTR lpszName) SCONST OVERRIDE |
Checks if the object is of a specific class. | |
BOOL | GetAttribute (LPCWSTR strAttr, IStringW *pValue) SCONST OVERRIDE |
Retrieves an attribute value. | |
void | OnInitFinished (IXmlNode *xmlNode) OVERRIDE |
Handles initialization completion. | |
void | SetAttrHandler (FunAttrHandler attrHandler) OVERRIDE |
Sets the attribute handler. | |
virtual HRESULT | DefAttributeProc (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading) |
Default attribute processing. | |
Protected Member Functions | |
bool | isCanceled () |
Checks whether the animation is canceled. | |
void | fireAnimationStart () |
Notifies the animation listener that the animation has started. | |
void | fireAnimationRepeat () |
Notifies the animation listener that the animation has repeated. | |
void | fireAnimationEnd () |
Notifies the animation listener that the animation has ended. | |
int | resolveSize (const SValueDescription &value, int size, int parentSize, int nScale) |
Converts the information in the description of a size to an actual dimension. | |
void | ensureInterpolator () |
Ensures that this animation has an interpolator. Will use an AccelerateDecelerateInterpolator if nothing else was specified. | |
float | getScaleFactor () |
Gets the scale factor that should be applied to pre-scaled values in an Animation. Such as the pivot points in ScaleAnimation and RotateAnimation . | |
Protected Attributes | |
bool | mEnded |
Set by getTransformation(long, STransformation) when the animation ends. | |
bool | mStarted |
Set by getTransformation(long, STransformation) when the animation starts. | |
bool | mCycleFlip |
Set by getTransformation(long, STransformation) when the animation repeats in REVERSE mode. | |
uint64_t | mStartTime |
The time in milliseconds at which the animation must start. | |
long | mStartOffset |
The delay in milliseconds after which the animation must start. When the start offset is > 0, the start time of the animation is startTime + startOffset. | |
long | mDuration |
The duration of one animation cycle in milliseconds. | |
int | mRepeatCount |
The number of times the animation must repeat. By default, an animation repeats indefinitely. | |
int | mRepeated |
Indicates how many times the animation was repeated. | |
RepeatMode | mRepeatMode |
The behavior of the animation when it repeats. The repeat mode is either RESTART or REVERSE . | |
SAutoRefPtr< IInterpolator > | mInterpolator |
The interpolator used by the animation to smooth the movement. | |
IAnimationListener * | mListener |
The animation listener to be notified when the animation starts, ends, or repeats. | |
ZAdjustment | mZAdjustment |
Desired Z order mode during animation. | |
float | mScaleFactor |
Scale factor to apply to pivot points, etc. during animation. Subclasses retrieve the value via getScaleFactor(). | |
BOOL | mFillBefore |
Indicates whether the animation transformation should be applied before the animation starts. The value of this variable is only relevant if mFillEnabled is true; otherwise, it is assumed to be true. | |
BOOL | mFillAfter |
Indicates whether the animation transformation should be applied after the animation ends. | |
BOOL | mFillEnabled |
Indicates whether fillBefore should be taken into account. | |
ULONG_PTR | mUserData |
User data associated with the animation. | |
bool | mPaused |
Indicates whether the animation is paused. | |
uint64_t | mPauseTime |
The time at which the animation was paused. | |
![]() | |
LONG | m_cRef |
Reference count. | |
![]() | |
SStringW | m_strName |
int | m_nID |
FunAttrHandler | m_attrHandler |
Additional Inherited Members | |
![]() | |
static int | GetClassType () |
Retrieves the class type. | |
static LPCWSTR | GetClassName () |
Retrieves the class name. | |
static LPCWSTR | GetClassAlias () |
Retrieves the class alias. | |
static void | MarkAttributeHandled (SXmlAttr xmlAttr, bool bHandled) |
Marks an attribute as handled. | |
static bool | IsAttributeHandled (SXmlAttr xmlAttr) |
Checks if an attribute is handled. | |
Abstraction for an Animation that can be applied to Views, Surfaces, or other objects.
See the animation package description file
.
Definition at line 67 of file SAnimation.h.
SAnimation::SAnimation | ( | ) |
Default constructor for SAnimation.
Definition at line 414 of file SAnimation.cpp.
SAnimation::~SAnimation | ( | ) |
Destructor for SAnimation.
Definition at line 455 of file SAnimation.cpp.
void SAnimation::applyTransformation | ( | float | interpolatedTime, |
ITransformation * | t ) |
Applies the transformation at a specific interpolated time.
interpolatedTime | Interpolated time between 0 and 1. |
t | Pointer to the transformation to apply. |
Definition at line 60 of file SAnimation.cpp.
void SAnimation::cancel | ( | ) |
Cancels the animation.
Definition at line 342 of file SAnimation.cpp.
IAnimation * SAnimation::clone | ( | ) |
Creates a new animation with a duration of 0ms, the default interpolator, with fillBefore set to true and fillAfter set to false.
Definition at line 400 of file SAnimation.cpp.
long SAnimation::computeDurationHint | ( | ) |
Computes the duration hint for the animation.
Definition at line 192 of file SAnimation.cpp.
void SAnimation::copy | ( | const IAnimation * | src | ) |
Copies the properties of another animation to this animation.
src | Pointer to the source animation to copy from. |
Definition at line 381 of file SAnimation.cpp.
|
protected |
Ensures that this animation has an interpolator. Will use an AccelerateDecelerateInterpolator if nothing else was specified.
Definition at line 201 of file SAnimation.cpp.
|
protected |
Notifies the animation listener that the animation has ended.
Definition at line 74 of file SAnimation.cpp.
|
protected |
Notifies the animation listener that the animation has repeated.
Definition at line 82 of file SAnimation.cpp.
|
protected |
Notifies the animation listener that the animation has started.
Definition at line 90 of file SAnimation.cpp.
long SAnimation::getDuration | ( | ) |
Gets the duration of one animation cycle.
Definition at line 234 of file SAnimation.cpp.
BOOL SAnimation::getFillAfter | ( | ) |
Gets whether the animation transformation should be applied after the animation ends.
Definition at line 306 of file SAnimation.cpp.
BOOL SAnimation::getFillBefore | ( | ) |
Gets whether the animation transformation should be applied before the animation starts.
Definition at line 316 of file SAnimation.cpp.
IInterpolator * SAnimation::getInterpolator | ( | ) |
Gets the interpolator used by the animation.
Definition at line 244 of file SAnimation.cpp.
int SAnimation::getRepeatCount | ( | ) |
Gets the number of times the animation must repeat.
Definition at line 219 of file SAnimation.cpp.
RepeatMode SAnimation::getRepeatMode | ( | ) |
Gets the repeat mode of the animation.
Definition at line 224 of file SAnimation.cpp.
|
protected |
Gets the scale factor that should be applied to pre-scaled values in an Animation. Such as the pivot points in ScaleAnimation
and RotateAnimation
.
Definition at line 249 of file SAnimation.cpp.
long SAnimation::getStartOffset | ( | ) |
Gets the delay in milliseconds after which the animation must start.
Definition at line 229 of file SAnimation.cpp.
int64_t SAnimation::getStartTime | ( | ) |
Gets the start time of the animation.
Definition at line 239 of file SAnimation.cpp.
BOOL SAnimation::getTransformation | ( | uint64_t | currentTime, |
ITransformation * | outTransformation ) |
Gets the transformation at a specific time.
currentTime | Current time in milliseconds. |
outTransformation | Pointer to the transformation to apply. |
Definition at line 103 of file SAnimation.cpp.
BOOL SAnimation::getTransformation2 | ( | uint64_t | currentTime, |
ITransformation * | outTransformation, | ||
float | scale ) |
Gets the transformation at a specific time.
currentTime | Current time in milliseconds. |
outTransformation | Pointer to the transformation to apply. |
scale | Scale factor. |
Definition at line 186 of file SAnimation.cpp.
ULONG_PTR SAnimation::getUserData | ( | ) |
Gets user data associated with the animation.
Definition at line 424 of file SAnimation.cpp.
ZAdjustment SAnimation::getZAdjustment | ( | ) |
Gets the desired Z order mode during animation.
Definition at line 214 of file SAnimation.cpp.
BOOL SAnimation::hasAlpha | ( | ) |
Checks whether the animation affects the alpha property.
Definition at line 35 of file SAnimation.cpp.
BOOL SAnimation::hasEnded | ( | ) |
Checks whether the animation has ended.
Definition at line 64 of file SAnimation.cpp.
BOOL SAnimation::hasStarted | ( | ) |
Checks whether the animation has started.
Definition at line 69 of file SAnimation.cpp.
void SAnimation::initialize | ( | int | width, |
int | height, | ||
int | parentWidth, | ||
int | parentHeight, | ||
int | nScale ) |
Initializes the animation with the dimensions of the object and its parent.
width | Width of the object being animated. |
height | Height of the object being animated. |
parentWidth | Width of the parent of the object being animated. |
parentHeight | Height of the parent of the object being animated. |
nScale | Scale factor. |
Definition at line 410 of file SAnimation.cpp.
|
protected |
Checks whether the animation is canceled.
Definition at line 98 of file SAnimation.cpp.
BOOL SAnimation::isFillEnabled | ( | ) |
Checks whether fillBefore should be taken into account.
Definition at line 301 of file SAnimation.cpp.
void SAnimation::pause | ( | ) |
Pauses the animation.
Definition at line 429 of file SAnimation.cpp.
void SAnimation::reset | ( | ) |
Resets the animation to its initial state.
Definition at line 352 of file SAnimation.cpp.
|
protected |
Converts the information in the description of a size to an actual dimension.
value | The dimension associated with the type parameter. |
size | The size of the object being animated. |
parentSize | The size of the parent of the object being animated. |
nScale | Scale factor. |
Definition at line 40 of file SAnimation.cpp.
void SAnimation::resume | ( | ) |
Resumes the animation.
Definition at line 440 of file SAnimation.cpp.
void SAnimation::scaleCurrentDuration | ( | float | scale | ) |
Scales the current duration of the animation.
scale | Scale factor. |
Definition at line 326 of file SAnimation.cpp.
void SAnimation::setAnimationListener | ( | IAnimationListener * | listener | ) |
Sets the animation listener to be notified when the animation starts, ends, or repeats.
listener | Pointer to the animation listener. |
Definition at line 209 of file SAnimation.cpp.
|
inlinevirtual |
Attributes for SAnimation.
< Duration of the animation in milliseconds. Delay before the animation starts in milliseconds. Whether fillBefore and fillAfter are taken into account. Whether the animation transformation should be applied before the animation starts. Whether the animation transformation should be applied after the animation ends. Number of times the animation must repeat.
< Normal Z order adjustment. Top Z order adjustment. Bottom Z order adjustment.
< Restart repeat mode. Reverse repeat mode.
< Interpolator used by the animation.
Reimplemented in SAlphaAnimation, SAnimationSet, SRotateAnimation, SScaleAnimation, and STranslateAnimation.
Definition at line 475 of file SAnimation.h.
void SAnimation::setDuration | ( | long | durationMillis | ) |
Sets the duration of one animation cycle in milliseconds.
durationMillis | Duration in milliseconds. |
Definition at line 332 of file SAnimation.cpp.
void SAnimation::setFillAfter | ( | BOOL | bFill | ) |
Sets whether the animation transformation should be applied after the animation ends.
bFill | Boolean indicating whether to fill after. |
Definition at line 311 of file SAnimation.cpp.
void SAnimation::setFillBefore | ( | BOOL | bFill | ) |
Sets whether the animation transformation should be applied before the animation starts.
bFill | Boolean indicating whether to fill before. |
Definition at line 321 of file SAnimation.cpp.
void SAnimation::setFillEnabled | ( | BOOL | fillEnabled | ) |
Sets whether fillBefore should be taken into account.
fillEnabled | Boolean indicating whether fill is enabled. |
Definition at line 296 of file SAnimation.cpp.
void SAnimation::setInterpolator | ( | IInterpolator * | i | ) |
Sets the interpolator used by the animation to smooth the movement.
i | Pointer to the interpolator. |
Definition at line 337 of file SAnimation.cpp.
void SAnimation::setRepeatCount | ( | int | repeatCount | ) |
Sets the number of times the animation must repeat.
repeatCount | Number of repeats. |
Definition at line 259 of file SAnimation.cpp.
void SAnimation::setRepeatMode | ( | RepeatMode | repeatMode | ) |
Sets the repeat mode of the animation.
repeatMode | Repeat mode (RESTART or REVERSE). |
Definition at line 268 of file SAnimation.cpp.
void SAnimation::setStartOffset | ( | long | offset | ) |
Sets the delay in milliseconds after which the animation must start.
offset | Delay in milliseconds. |
Definition at line 291 of file SAnimation.cpp.
void SAnimation::setStartTime | ( | int64_t | startTimeMillis | ) |
Sets the start time of the animation.
startTimeMillis | Start time in milliseconds. |
Definition at line 283 of file SAnimation.cpp.
void SAnimation::setUserData | ( | ULONG_PTR | data | ) |
Sets user data associated with the animation.
data | User data. |
Definition at line 419 of file SAnimation.cpp.
void SAnimation::setZAdjustment | ( | ZAdjustment | zAdjustment | ) |
Sets the desired Z order mode during animation.
zAdjustment | Z order adjustment mode. |
Definition at line 254 of file SAnimation.cpp.
void SAnimation::start | ( | ) |
Starts the animation.
Definition at line 278 of file SAnimation.cpp.
void SAnimation::startNow | ( | ) |
Starts the animation immediately.
Definition at line 273 of file SAnimation.cpp.
|
protected |
Set by getTransformation(long, STransformation)
when the animation repeats in REVERSE mode.
Definition at line 84 of file SAnimation.h.
|
protected |
The duration of one animation cycle in milliseconds.
Definition at line 100 of file SAnimation.h.
|
protected |
Set by getTransformation(long, STransformation)
when the animation ends.
Definition at line 74 of file SAnimation.h.
|
protected |
Indicates whether the animation transformation should be applied after the animation ends.
Definition at line 146 of file SAnimation.h.
|
protected |
Indicates whether the animation transformation should be applied before the animation starts. The value of this variable is only relevant if mFillEnabled is true; otherwise, it is assumed to be true.
Definition at line 141 of file SAnimation.h.
|
protected |
Indicates whether fillBefore should be taken into account.
Definition at line 151 of file SAnimation.h.
|
protected |
The interpolator used by the animation to smooth the movement.
Definition at line 120 of file SAnimation.h.
|
protected |
The animation listener to be notified when the animation starts, ends, or repeats.
Definition at line 125 of file SAnimation.h.
|
protected |
Indicates whether the animation is paused.
Definition at line 161 of file SAnimation.h.
|
protected |
The time at which the animation was paused.
Definition at line 166 of file SAnimation.h.
|
protected |
The number of times the animation must repeat. By default, an animation repeats indefinitely.
Definition at line 105 of file SAnimation.h.
|
protected |
Indicates how many times the animation was repeated.
Definition at line 110 of file SAnimation.h.
|
protected |
The behavior of the animation when it repeats. The repeat mode is either RESTART
or REVERSE
.
Definition at line 115 of file SAnimation.h.
|
protected |
Scale factor to apply to pivot points, etc. during animation. Subclasses retrieve the value via getScaleFactor().
Definition at line 135 of file SAnimation.h.
|
protected |
Set by getTransformation(long, STransformation)
when the animation starts.
Definition at line 79 of file SAnimation.h.
|
protected |
The delay in milliseconds after which the animation must start. When the start offset is > 0, the start time of the animation is startTime + startOffset.
Definition at line 95 of file SAnimation.h.
|
protected |
The time in milliseconds at which the animation must start.
Definition at line 89 of file SAnimation.h.
|
protected |
User data associated with the animation.
Definition at line 156 of file SAnimation.h.
|
protected |
Desired Z order mode during animation.
Definition at line 130 of file SAnimation.h.