Add focus transition and other fixes.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / layouting / layout-transition-data-impl.h
index eb9e9d9..dec0b76 100644 (file)
@@ -37,9 +37,11 @@ namespace Internal
 
 struct LayoutTransition
 {
 
 struct LayoutTransition
 {
-  LayoutTransition( LayoutItem& layoutItem, int layoutTransitionType )
+  LayoutTransition( LayoutItem& layoutItem, int layoutTransitionType, Actor gainedChild, Actor lostChild )
   : layoutItem( &layoutItem )
   , layoutTransitionType( layoutTransitionType )
   : layoutItem( &layoutItem )
   , layoutTransitionType( layoutTransitionType )
+  , gainedChild( gainedChild )
+  , lostChild( lostChild )
   {
   }
 
   {
   }
 
@@ -50,11 +52,16 @@ struct LayoutTransition
 
   bool operator==( const LayoutTransition& rhs )
   {
 
   bool operator==( const LayoutTransition& rhs )
   {
-    return ( ( layoutItem.Get() == rhs.layoutItem.Get() ) && layoutTransitionType == rhs.layoutTransitionType );
+    return ( layoutItem.Get() == rhs.layoutItem.Get()
+        && layoutTransitionType == rhs.layoutTransitionType
+        && gainedChild == rhs.gainedChild
+        && lostChild == rhs.lostChild );
   }
 
   LayoutItemPtr layoutItem;
   int layoutTransitionType;
   }
 
   LayoutItemPtr layoutItem;
   int layoutTransitionType;
+  Actor gainedChild;
+  Actor lostChild;
 };
 
 const float DEFAULT_TRANSITION_DURATION( 0.5f );
 };
 
 const float DEFAULT_TRANSITION_DURATION( 0.5f );
@@ -111,16 +118,10 @@ using LayoutPositionDataArray = std::vector< LayoutPositionData >;
 struct LayoutDataElement
 {
   LayoutDataElement()
 struct LayoutDataElement
 {
   LayoutDataElement()
-  : propertyIndex( Property::INVALID_KEY ), animatorIndex( -1 ), positionDataIndex(-1 )
-  {
-  };
-
-  LayoutDataElement( Actor actor, Property::Index propertyIndex, Property::Value value )
-  : handle( actor ),
-    propertyIndex( propertyIndex ),
-    targetValue( value ),
+  : propertyIndex( Property::INVALID_KEY ),
     animatorIndex( -1 ),
     animatorIndex( -1 ),
-    positionDataIndex( -1 )
+    positionDataIndex(-1 ),
+    condition( Dali::Toolkit::LayoutTransitionData::Condition::NONE )
   {
   };
 
   {
   };
 
@@ -130,6 +131,7 @@ struct LayoutDataElement
   Property::Value targetValue;
   int animatorIndex;
   int positionDataIndex;
   Property::Value targetValue;
   int animatorIndex;
   int positionDataIndex;
+  int condition;
 };
 
 class LayoutTransitionData;
 };
 
 class LayoutTransitionData;
@@ -166,22 +168,86 @@ public:
   LayoutTransitionData( const LayoutTransitionData& ) = delete;
   LayoutTransitionData& operator=( const LayoutTransitionData& ) = delete;
 
   LayoutTransitionData( const LayoutTransitionData& ) = delete;
   LayoutTransitionData& operator=( const LayoutTransitionData& ) = delete;
 
+  /**
+   * @brief Add a property animator for an actor in the transition
+   * @param[in] actor The actor
+   * @param[in] map The map containing the transition animator keys
+   *
+   * This will add the property animator to the list of animators related to this transition
+   */
   void AddPropertyAnimator( Actor actor, Property::Map map );
   void AddPropertyAnimator( Actor actor, Property::Map map );
+
+  /**
+   * @brief Add a property animator for an actor in the transition
+   * @param[in] actor The actor
+   * @param[in] map The map containing the transition animator keys
+   * @param[in] keyFrames The key frames used by the property animator
+   * @param[in] interpolation The interpolation used by the property animator
+   *
+   * This will add the property animator to the list of animators related to this transition
+   */
   void AddPropertyAnimator( Actor actor, Property::Map map, KeyFrames keyFrames, Animation::Interpolation interpolation );
   void AddPropertyAnimator( Actor actor, Property::Map map, KeyFrames keyFrames, Animation::Interpolation interpolation );
+
+  /**
+   * @brief Add a property animator for an actor in the transition
+   * @param[in] actor The actor
+   * @param[in] map The map containing the transition animator keys
+   * @param[in] path The path for the property animator
+   * @param[in] forward The forward vector for the property animator
+   *
+   * This will add the property animator to the list of animators related to this transition
+   */
   void AddPropertyAnimator( Actor actor, Property::Map map, Path path, Vector3 forward );
 
   void AddPropertyAnimator( Actor actor, Property::Map map, Path path, Vector3 forward );
 
+  /**
+   * @brief Convert the transition property animators to the layout data elements
+   * @param[in] actor The actor the transition property animators are applied to
+   * @param[in] layoutData The layout data containing layout data elements array for the layout update
+   *
+   * This will parse the property animators and add the layout data elements to the layout data elements array
+   */
   void ConvertToLayoutDataElements( Actor, LayoutData& layoutData );
 
   /**
   void ConvertToLayoutDataElements( Actor, LayoutData& layoutData );
 
   /**
-   * @copydoc Dali::Animation::FinishedSignal()
+   * @brief Convert the transition children property animators to the layout data elements
+   * @param[in] actor The actor the transition property animators are applied to
+   * @param[in] layoutData The layout data containing layout data elements array for the layout update
+   *
+   * This will parse the children property animators and add the layout data elements to the layout data elements array
+   */
+  static void ConvertChildrenAnimatorsToLayoutDataElements( Actor, LayoutData& layoutData );
+
+  /**
+   * @copydoc Dali::Toolkit::LayoutTransitionData::FinishedSignal()
    */
   Dali::Toolkit::LayoutTransitionData::LayoutTransitionSignalType& FinishedSignal();
 
    */
   Dali::Toolkit::LayoutTransitionData::LayoutTransitionSignalType& FinishedSignal();
 
+  /**
+   * @brief Emit the transition finish signal
+   * @param[in] layoutTransitionType The transition type
+   */
   void EmitSignalFinish( int layoutTransitionType );
 
 private:
   void EmitSignalFinish( int layoutTransitionType );
 
 private:
-  bool ConvertToLayoutAnimator( const Property::Map& animatorData, const PropertyAnimator& propertyAnimator, LayoutDataAnimator& layoutAnimator );
-  bool ConvertToLayoutDataElement( const PropertyAnimator& propertyAnimator, LayoutDataElement& layoutDataElement, LayoutData& layoutData );
+  /**
+   * @brief Convert the property animator data to the layout data animator
+   * @param[in] animatorData The animator data map
+   * @param[in] propertyAnimator The property animator
+   * @param[in] layoutAnimator The layout animator
+   *
+   * This will parse the property animator data and add the layout data element animator
+   */
+  static bool ConvertToLayoutAnimator( const Property::Map& animatorData, const PropertyAnimator& propertyAnimator, LayoutDataAnimator& layoutAnimator );
+
+  /**
+   * @brief Convert the property animator to the layout data element
+   * @param[in] propertyAnimator The property animator
+   * @param[in] layoutDataElement The layout data element
+   * @param[in] layoutDataElement The layout data
+   *
+   * This will parse the children property animators and add the layout data elements to the layout data elements array
+   */
+  static bool ConvertToLayoutDataElement( const PropertyAnimator& propertyAnimator, LayoutDataElement& layoutDataElement, LayoutData& layoutData );
 
   PropertyAnimatorArray mPropertyAnimators;
 
 
   PropertyAnimatorArray mPropertyAnimators;