#define DALI_ANIMATION_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/animation/alpha-function.h>
#include <dali/public-api/animation/key-frames.h>
* | pause | Pause() |
* @SINCE_1_0.0
*/
-class DALI_IMPORT_API Animation : public BaseHandle
+class DALI_CORE_API Animation : public BaseHandle
{
public:
+ using AnimationSignalType = Signal<void( Animation& )>; ///< Animation finished signal type @SINCE_1_0.0
- typedef Signal< void (Animation&) > AnimationSignalType; ///< Animation finished signal type @SINCE_1_0.0
-
- typedef Any AnyFunction; ///< Interpolation function @SINCE_1_0.0
+ using AnyFunction = Any; ///< Interpolation function @SINCE_1_0.0
/**
* @brief Enumeration for what to do when the animation ends, is stopped, or is destroyed.
*/
enum EndAction
{
- Bake, ///< When the animation ends, the animated property values are saved. @SINCE_1_0.0
- Discard, ///< When the animation ends, the animated property values are forgotten. @SINCE_1_0.0
- BakeFinal ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake. @SINCE_1_0.0
+ BAKE, ///< When the animation ends, the animated property values are saved. @SINCE_1_0.0
+ DISCARD, ///< When the animation ends, the animated property values are forgotten. @SINCE_1_0.0
+ BAKE_FINAL ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake. @SINCE_1_0.0
};
/**
*/
enum Interpolation
{
- Linear, ///< Values in between key frames are interpolated using a linear polynomial. (Default) @SINCE_1_0.0
- Cubic ///< Values in between key frames are interpolated using a cubic polynomial. @SINCE_1_0.0
+ LINEAR, ///< Values in between key frames are interpolated using a linear polynomial. (Default) @SINCE_1_0.0
+ CUBIC ///< Values in between key frames are interpolated using a cubic polynomial. @SINCE_1_0.0
};
/**
Animation& operator=(const Animation& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Animation( Animation&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Animation& operator=( Animation&& rhs );
+
+ /**
* @brief Sets the duration of an animation.
*
* @SINCE_1_0.0
* @brief Enables looping for 'count' repeats.
*
* A zero is the same as SetLooping(true) i.e. repeat forever.
- * If Play() Stop() or 'count' loops is reached, the loop counter will reset.
+ * This function resets the looping value and should not be used with SetLooping(bool).
* Setting this parameter does not cause the animation to Play().
*
* @SINCE_1_1.20
* @param[in] count The number of times to loop
*/
- void SetLoopCount(int count);
+ void SetLoopCount(int32_t count);
/**
* @brief Gets the loop count.
* @SINCE_1_1.20
* @return The number of times to loop
*/
- int GetLoopCount();
+ int32_t GetLoopCount();
/**
* @brief Gets the current loop count.
* @SINCE_1_1.20
* @return The current number of loops that have occured
*/
- int GetCurrentLoop();
+ int32_t GetCurrentLoop();
/**
* @brief Queries whether the animation will loop.
* @SINCE_1_0.0
* @param[in] target The target object property to animate
* @param[in] keyFrames The set of time/value pairs between which to animate
- * @param[in] period The effect will occur duing this time period
+ * @param[in] period The effect will occur during this time period
* @param[in] interpolation The method used to interpolate between values
*/
void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation);
* @param[in] target The target object property to animate
* @param[in] keyFrames The set of time/value pairs between which to animate
* @param[in] alpha The alpha function to apply to the overall progress
- * @param[in] period The effect will occur duing this time period
+ * @param[in] period The effect will occur during this time period
* @param[in] interpolation The method used to interpolate between values
*/
void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);