[dali_2.3.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / transition / transition-base-impl.h
index 84ef316..73e30dd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_TRANSITION_BASE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -92,15 +92,40 @@ public:
    */
   void TransitionFinished();
 
-protected:
   /**
-   * @brief Set property map which will be used as a initial properties.
-   * @param[in] propertyMap propertyMap that will be used as a start value of transition.
+   * @brief Set this transition is appearing transition or not.
+   * @param[in] appearingTransition True if this transition is appearing transition.
+   */
+  void SetAppearingTransition(bool appearingTransition)
+  {
+    mIsAppearingTransition = appearingTransition;
+  }
+
+  /**
+   * @brief Returns whether this transition is appearing transition or not
+   */
+  bool IsAppearingTransition() const
+  {
+    return mIsAppearingTransition;
+  }
+
+  /**
+   * @brief Returns whether this transition is a transition from a Control to another Control or effect to appearing or disappearing.
+   */
+  bool IsPairTransition() const
+  {
+    return mIsPairTransition;
+  }
+
+  /**
+   * @brief Returns target which will be transition.
    */
-  void SetInitialPropertyMap(const Property::Map& propertyMap)
+  const Dali::Toolkit::Control GetTarget() const
   {
-    mInitialPropertyMap = propertyMap;
+    return mTarget;
   }
+
+protected:
   /**
    * @brief Set property map which will be used as a animation start properties.
    * @param[in] propertyMap propertyMap that will be used as a start value of transition.
@@ -137,23 +162,20 @@ protected:
   }
 
   /**
-   * @brief Gets world transform of input Actor.
-   * @param[in] actor actor for get world transform.
-   */
-  Matrix GetWorldTransform(Dali::Actor actor);
-
-  /**
-   * @brief Gets world color of input Actor.
-   * @param[in] actor actor for get world color.
+   * @brief Returns whether this transition will be applied to children of target or not.
    */
-  Vector4 GetWorldColor(Dali::Actor actor);
+  bool IsTransitionWithChild() const
+  {
+    return mTransitionWithChild;
+  }
 
   /**
-   * @brief Returns whether this transition will be applied to children of target or not.
+   * @brief Set whether this transition is a transition from a Control to another Control or effect to appearing or disappearing.
+   * @param[in] pairTransition True if this transition is appearing transition.
    */
-  bool IsTransitionWithChild()
+  void SetPairTransition(bool pairTransition)
   {
-    return mTransitionWithChild;
+    mIsPairTransition = pairTransition;
   }
 
 protected:
@@ -189,11 +211,10 @@ private:
    * @brief Adds a property on an animation between sourceValue and destimationValue.
    * @param[in] target target control to be animated.
    * @param[in] index property index for animation.
-   * @param[in] initialValue initial value of animation.
    * @param[in] sourceValue source value of animation.
    * @param[in] destinationValue destination value of animation.
    */
-  void AnimateBetween(Dali::Toolkit::Control target, Property::Index index, Property::Value initialValue, Property::Value sourceValue, Property::Value destinationValue);
+  void AnimateBetween(Dali::Toolkit::Control target, Property::Index index, Property::Value sourceValue, Property::Value destinationValue);
 
   /**
    * @brief Copy target to make clone for the child Actors
@@ -222,18 +243,19 @@ private:
   }
 
 private:
-  Dali::Toolkit::Control       mTarget;              ///< Target that will be animated.
-  Dali::Actor                  mCopiedActor;         ///< Copied View that will replace mTarget during transition
-  Dali::Animation              mAnimation;           ///< Property animations for the transition of mTarget
-  AlphaFunction                mAlphaFunction;       ///< Alpha function that will applied for the property animation
-  Property::Map                mInitialPropertyMap;  ///< Initial properties to be animated. (world transform)
-  Property::Map                mStartPropertyMap;    ///< Start properties to be animated. (world transform)
-  Property::Map                mFinishPropertyMap;   ///< Finish properties to be animated. (world transform)
-  Property::Map                mOriginalPropertyMap; ///< Original properties of mTarget to be used to restore after the transition is finished.
-  Dali::TimePeriod             mTimePeriod;          ///< TimePeriod of transition
-  bool                         mTransitionWithChild; ///< True, if mTarget transition is inherit to its child Actors.
-                                                     ///< If this is false, the child Actors are moved to the child of mCopiedActor that will have original properties of target Actor during Transition.
-  bool mMoveTargetChildren;                          ///< Flag, if mTransitionWithChild is false and mTarget has children than True.
+  Dali::Toolkit::Control mTarget;              ///< Target that will be animated.
+  Dali::Actor            mCopiedActor;         ///< Copied View that will replace mTarget during transition
+  Dali::Animation        mAnimation;           ///< Property animations for the transition of mTarget
+  AlphaFunction          mAlphaFunction;       ///< Alpha function that will applied for the property animation
+  Property::Map          mStartPropertyMap;    ///< Start properties to be animated. (world transform)
+  Property::Map          mFinishPropertyMap;   ///< Finish properties to be animated. (world transform)
+  Property::Map          mOriginalPropertyMap; ///< Original properties of mTarget to be used to restore after the transition is finished.
+  Dali::TimePeriod       mTimePeriod;          ///< TimePeriod of transition
+  bool                   mTransitionWithChild; ///< True, if mTarget transition is inherit to its child Actors.
+                                               ///< If this is false, the child Actors are moved to the child of mCopiedActor that will have original properties of target Actor during Transition.
+  bool mMoveTargetChildren;                    ///< Flag, if mTransitionWithChild is false and mTarget has children than True.
+  bool mIsAppearingTransition;                 ///< True, if this transition is appearing transition.
+  bool mIsPairTransition;                      ///< True, if this transition is started from a Control to another Control.
 };
 
 } // namespace Internal