Merge "Size negotiation patch 1: Removed SetPreferred size" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-carousel-effect-impl.cpp
index fd352cb..6eb200b 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <boost/bind.hpp>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
+#include <dali/public-api/object/property-input.h>
 
+// INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h>
 
@@ -79,7 +83,7 @@ public:
    * @param[in] positionProperty The Actor's Position.
    * @param[in] scaleProperty The Actor's Scale.
    * @param[in] sizeProperty The Actor's Size
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
    * @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
    * @return The new visibility of this Actor.
    */
@@ -110,7 +114,7 @@ public:
    * @param[in] positionProperty The Actor's Position.
    * @param[in] scaleProperty The Actor's Scale.
    * @param[in] sizeProperty The Actor's Size
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
    * @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
    * @param[in] activateProperty Activation value (0 - normal, 1.0 - full effect)
    * @return The new orientation of this Actor.
@@ -160,7 +164,7 @@ public:
    * @param[in] current The current position of this Actor
    * @param[in] scaleProperty The Actor's Scale.
    * @param[in] sizeProperty The Actor's Size
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
    * @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
    * @param[in] activateProperty Activation value (0 - normal, 1.0 - full effect)
    * @return The new position of this Actor.
@@ -226,33 +230,33 @@ void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView,
   // Apply constraints to this actor //
   Constraint constraint;
 
-  constraint = Constraint::New<bool>( Actor::VISIBLE,
-                                      LocalSource( Actor::POSITION ),
-                                      LocalSource( Actor::SCALE ),
-                                      LocalSource( Actor::SIZE ),
-                                      Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-                                      Source(scrollView, Actor::SIZE ),
+  constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
+                                      LocalSource( Actor::Property::POSITION ),
+                                      LocalSource( Actor::Property::SCALE ),
+                                      LocalSource( Actor::Property::SIZE ),
+                                      Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                      Source(scrollView, Actor::Property::SIZE ),
                                       Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
                                       boost::bind( &ScrollCarouselEffectInfo::VisibilityConstraint, info, _1, _2, _3, _4, _5, _6) );
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Quaternion>( Actor::ROTATION,
-                                            LocalSource( Actor::POSITION ),
-                                            LocalSource( Actor::SCALE ),
-                                            LocalSource( Actor::SIZE ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-                                            Source(scrollView, Actor::SIZE ),
+  constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
+                                            LocalSource( Actor::Property::POSITION ),
+                                            LocalSource( Actor::Property::SCALE ),
+                                            LocalSource( Actor::Property::SIZE ),
+                                            Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                            Source(scrollView, Actor::Property::SIZE ),
                                             Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
                                             boost::bind( &ScrollCarouselEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::POSITION,
-                                         LocalSource( Actor::SCALE ),
-                                         LocalSource( Actor::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-                                         Source(scrollView, Actor::SIZE ),
+  constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+                                         LocalSource( Actor::Property::SCALE ),
+                                         LocalSource( Actor::Property::SIZE ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
                                          boost::bind( &ScrollCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6) );