Change public member variable to private
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / animation-definition.h
index 27fe2ac..ff72e3f 100644 (file)
@@ -49,6 +49,8 @@ public: // METHODS
 
   AnimationDefinition(AnimationDefinition&& other);
 
+  AnimationDefinition& operator=(AnimationDefinition&& other);
+
   /**
    * @brief Registers the properties against the given @a animation. @a getActor
    *  will be used to obtain the Actors for each AnimatedProperty.
@@ -61,13 +63,138 @@ public: // METHODS
    */
   Animation ReAnimate(AnimatedProperty::GetActor getActor);
 
-  AnimationDefinition& operator=(AnimationDefinition&& other);
+  /**
+   * @brief Set the name of the animation.
+   *
+   * @param[in] name The name of the animation.
+   */
+  void SetName(const std::string& name);
+
+  /**
+   * @brief Get the name of the animation.
+   *
+   * @return The name of the animation.
+   */
+  const std::string& GetName() const;
+
+  /**
+   * @brief Set the duration of the animation in seconds.
+   *
+   * @param[in] duration The duration of the animation in seconds.
+   */
+  void SetDuration(float duration);
+
+  /**
+   * @brief Get the duration of the animation in seconds.
+   *
+   * @return The duration of the animation in seconds.
+   */
+  float GetDuration() const;
+
+  /**
+   * @brief Set the number of times to loop the animation.
+   *
+   * @param[in] loopCount The number of times to loop the animation. Use -1 for infinite looping.
+   */
+  void SetLoopCount(int32_t loopCount);
+
+  /**
+   * @brief Get the number of times to loop the animation.
+   *
+   * @return The number of times to loop the animation. Use -1 for infinite looping.
+   */
+  int GetLoopCount() const;
+
+  /**
+   * @brief Set what should happen when an animation is disconnected from an object.
+   *
+   * @param[in] disconnectAction What should happen when an animation is disconnected from an object.
+   */
+  void SetDisconnectAction(Animation::EndAction disconnectAction);
+
+  /**
+   * @brief Get what should happen when an animation is disconnected from an object.
+   *
+   * @return What should happen when an animation is disconnected from an object.
+   */
+  Animation::EndAction GetDisconnectAction() const;
+
+  /**
+   * @brief Set what should happen when an animation reaches its end.
+   *
+   * @param[in] endAction What should happen when an animation reaches its end.
+   */
+  void SetEndAction(Animation::EndAction endAction);
+
+  /**
+   * @brief Get what should happen when an animation reaches its end.
+   *
+   * @return What should happen when an animation reaches its end.
+   */
+  Animation::EndAction GetEndAction() const;
+
+  /**
+   * @brief Set a speed factor for this animation. This can be used to speed up or slow down playback of this animation relative to other animations in a scene.
+   *
+   * @param[in] speedFactor The speed factor for this animation. 1.0 is normal speed, 2.0 is double speed, 0.5 is half speed, etc.
+   */
+  void SetSpeedFactor(float speedFactor);
+
+  /**
+   * @brief Get a speed factor for this animation. This can be used to speed up or slow down playback of this animation relative to other animations in a scene.
+   *
+   * @return The speed factor for this animation. 1.0 is normal speed, 2.0 is double speed, 0.5 is half speed, etc.
+   */
+  float GetSpeedFactor() const;
+
+  /**
+   * @brief Set a range within which to play this animation. This can be used to play only part of an animation or to play it backwards by setting playRange.y < playRange.x
+   *
+   * @param[in] playRange A range within which to play this animation. x = start time in seconds, y = end time in seconds
+   */
+  void SetPlayRange(const Vector2& playRange);
+
+  /**
+   * @brief Get a range within which to play this animation. This can be used to play only part of an animation or to play it backwards by setting playRange.y < playRange.x
+   *
+   * @return A range within which to play this animation. x = start time in seconds, y = end time in seconds
+   */
+  Vector2 GetPlayRange() const;
+
+  /**
+   * @brief Reserves Animated property vector's size
+   *
+   * @param[in] size The size to reserve property
+   */
+  void ReserveSize(uint32_t size);
+
+  /**
+   * @brief Retrieves the number of animated properties' count
+   *
+   * @return The count of animated properties.
+   */
+  uint32_t GetPropertyCount();
+
+  /**
+   * @brief Add a property that will be animated by this AnimationDefinition
+   *
+   * @param[in] index The index the property will be stored.
+   * @param[in] property The property that will be animated by this AnimationDefinition
+   */
+  void SetProperty(uint32_t index, AnimatedProperty&& property);
+
+  /**
+   * @brief Retrieves animated property at the index
+   *
+   * @param[in] index The index of property to be retrieved.
+   */
+  const AnimatedProperty& GetPropertyAt(uint32_t index);
 
-public: // DATA
+private: // DATA
   std::string mName;
 
   float                mDuration         = DEFAULT_DURATION_SECONDS;
-  int                  mLoopCount        = 1;
+  int32_t              mLoopCount        = 1;
   Animation::EndAction mDisconnectAction = Animation::BAKE_FINAL;
   Animation::EndAction mEndAction        = Animation::BAKE;
   float                mSpeedFactor      = 1.f;
@@ -84,4 +211,4 @@ struct AnimationGroupDefinition
 
 } // namespace Dali::Scene3D::Loader
 
-#endif //DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H
+#endif // DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H