[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / animated-property.h
index 6433d5c..1ba4ad2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H
 #define DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
  *
  */
 
-// INTERNAL INCLUDES
-#include "dali-scene3d/public-api/api.h"
-
 // EXTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/object/property.h>
 #include <functional>
 #include <memory>
-#include "dali/public-api/actors/actor.h"
-#include "dali/public-api/animation/animation.h"
-#include "dali/public-api/object/property.h"
 
-namespace Dali
-{
-namespace Scene3D
-{
-namespace Loader
+// INTERNAL INCLUDES
+#include <dali-scene3d/public-api/api.h>
+#include <dali-scene3d/public-api/loader/index.h>
+
+namespace Dali::Scene3D::Loader
 {
 /**
- * @brief Intermediate representation for a property that's given to
- *  a Animation to animate. Since there is no getting an
- *  animated property back from the Animation (i.e. past AnimateBetween/By/To()),
- *  changing properties (e.g. from the SDK) requires the whole Animation
- *  object to be recreated with all of its properties (incl. modifications).
+ * @brief Intermediate representation for a property that's given to a Animation to animate.
+ *
+ * Since there is no getting an animated property back from the Animation (i.e. past AnimateBetween/By/To()),
+ * changing properties (e.g. from the SDK) requires the whole Animation object to be recreated with all of
+ * its properties (incl. modifications).
+ * @SINCE_2_0.7
  */
 struct DALI_SCENE3D_API AnimatedProperty
 {
 public: // METHODS
   /**
-   * @brief Function to obtain an Actor based on its name. Its processing will
-   *  ignore empty handles returned by it.
+   * @brief Function to obtain an Actor based on its property. Its processing will ignore empty handles returned by it.
+   * @SINCE_2_0.7
    */
-  using GetActor = std::function<Actor(const std::string&)>;
+  using GetActor = std::function<Actor(const AnimatedProperty&)>;
 
   /**
+   * @brief Get the property object of the given actor.
+   * @SINCE_2_0.7
    * @return The Property object (of the given @a actor) whose value is being animated.
    */
-  Property GetProperty(Actor& actor)
+  Property GetProperty(Actor& actor) const
   {
     auto idx = actor.GetPropertyIndex(mPropertyName);
     return Property(actor, idx);
@@ -60,8 +60,9 @@ public: // METHODS
 
   /**
    * @brief The type of the Property (of the given @a actor) that is being animated.
+   * @SINCE_2_0.7
    */
-  Property::Type GetPropertyType(Actor& actor)
+  Property::Type GetPropertyType(Actor& actor) const
   {
     auto idx = actor.GetPropertyIndex(mPropertyName);
     return actor.GetPropertyType(idx);
@@ -69,11 +70,13 @@ public: // METHODS
 
   /**
    * @brief Registers the animation of this property against the given @a anim.
-   *  @a getActor will be used to obtain the Actor named by this property.
-   *  Failing to find the actor purely means that this property will not be
-   *  animated.
+   *
+   * @a getActor will be used to obtain the Actor named by this property.
+   * Failing to find the actor purely means that this property will not be
+   * animated.
+   * @SINCE_2_0.7
    */
-  void Animate(Animation& anim, GetActor getActor);
+  void Animate(Animation& anim, GetActor getActor) const;
 
 public: // DATA
   struct Value
@@ -82,6 +85,7 @@ public: // DATA
     bool            mIsRelative;
   };
 
+  Index       mNodeIndex = INVALID_INDEX;
   std::string mNodeName;
   std::string mPropertyName;
 
@@ -92,8 +96,6 @@ public: // DATA
   TimePeriod    mTimePeriod    = TimePeriod(0.f);
 };
 
-} // namespace Loader
-} // namespace Scene3D
-} // namespace Dali
+} // namespace Dali::Scene3D::Loader
 
 #endif //DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H