static const unsigned int SCROLL_ANIMATION_FLAGS = AnimatingInternalX | AnimatingInternalY;
static const unsigned int SNAP_ANIMATION_FLAGS = SnappingInternalX | SnappingInternalY;
+private:
+
+ typedef std::vector<Dali::Toolkit::ScrollViewEffect> ScrollViewEffectContainer; ///< Container of Dali::Toolkit::ScrollViewEffect
+ typedef ScrollViewEffectContainer::iterator ScrollViewEffectIter; ///< Iterator for Dali::Toolkit::ScrollViewEffectContainer
+
public:
/**
void SetSnapOvershootDuration(float duration);
/**
- * @copydoc Toolkit::ScrollView::SetTouchesRequiredForPanning
- */
- void SetTouchesRequiredForPanning(unsigned int minTouches, unsigned int maxTouches, bool endOutside);
-
- /**
* @copydoc Toolkit::ScrollView::SetActorAutoSnap
*/
void SetActorAutoSnap(bool enable);
/**
* @copydoc Toolkit::ScrollView::GetCurrentScrollPosition
*/
- Vector3 GetCurrentScrollPosition() const;
+ Vector2 GetCurrentScrollPosition() const;
/**
* @copydoc Toolkit::ScrollView::SetScrollPosition
*/
- void SetScrollPosition(const Vector3& position);
+ void SetScrollPosition(const Vector2& position);
/**
* @copydoc Toolkit::Scrollable::GetDomainSize
*/
- Vector3 GetDomainSize() const;
+ Vector2 GetDomainSize() const;
/**
- * @copydoc ScrollTo(const Vector3&)
+ * @copydoc ScrollTo(const Vector2&)
*/
- void TransformTo(const Vector3& position,
+ void TransformTo(const Vector2& position,
DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
/**
- * @copydoc ScrollTo(const Vector3&, float, AlhpaFunction, DirectionBias, DirectionBias)
+ * @copydoc ScrollTo(const Vector2&, float, AlhpaFunction, DirectionBias, DirectionBias)
*/
- void TransformTo(const Vector3& position, float duration, AlphaFunction alpha,
+ void TransformTo(const Vector2& position, float duration, AlphaFunction alpha,
DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
/**
- * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position)
+ * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2 &position)
*/
- void ScrollTo(const Vector3 &position);
+ void ScrollTo(const Vector2 &position);
/**
- * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration)
+ * @copydoc Toolkit::Scrollable::ScrollTo(const Vector2& position, float duration)
*/
- void ScrollTo(const Vector3& position, float duration);
+ void ScrollTo(const Vector2& position, float duration);
/**
- * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha)
+ * @copydoc Toolkit::Scrollable::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha)
*/
- void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha);
+ void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha);
/**
- * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
+ * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
*/
- void ScrollTo(const Vector3& position, float duration,
+ void ScrollTo(const Vector2& position, float duration,
DirectionBias horizontalBias, DirectionBias verticalBias);
/**
- * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias)
+ * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2 &position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias)
*/
- void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha,
+ void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha,
DirectionBias horizontalBias, DirectionBias verticalBias);
/**
* @param[in] verticalBias (optional) Whether to bias animation to top or bottom (or no biasing)
* @return True if animation necessary and taking place to reach desired transform.
*/
- bool AnimateTo(const Vector3& position, const Vector3& positionDuration,
+ bool AnimateTo(const Vector2& position, const Vector2& positionDuration,
AlphaFunction alpha, bool findShortcuts = true,
DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone,
SnapType snapType = Snap);
virtual void OnChildRemove(Actor& child);
/**
- * @copydoc Dali::CustomActorImpl::OnPropertySet( Property::Index index, Property::Value propertyValue )
- */
- virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
-
- /**
* From CustomActorImpl; called after a touch-signal is received by the owning actor.
*
* We don't listen to these events as content within the contain may consume events.
virtual bool OnAccessibilityPan(PanGesture gesture);
/**
- * @copydoc Toolkit::Scrollable::SetOvershootEnabled()
+ * @copydoc Toolkit::Scrollable::EnableScrollOvershoot()
*/
- virtual void SetOvershootEnabled(bool enable);
+ virtual void EnableScrollOvershoot(bool enable);
private:
/**
* Called whenever a snap animation has completed
* @param[in] source the Animation instance that has completed.
- * Resets all scrolling animations and states, leaving current scroll position at mPropertyPosition
+ * Resets all scrolling animations and states, leaving current scroll position at SCROLL_POSITION
*/
void ResetScrolling();
void OnScrollAnimationFinished( Animation& source );
/**
- * Called when either the X or Y internal scroll positions have finished snapping back to mPropertyPrePosition
+ * Called when either the X or Y internal scroll positions have finished snapping back to SCROLL_PRE_POSITION
*
* @param[in] source the Animation instance that has completed.
*/
*
* @param[in] position The position for which you wish to obtain overshoot vector
*/
- Vector3 GetOvershoot(Vector3& position) const;
+ Vector2 GetOvershoot(Vector2& position) const;
/**
* Clamps position within the domain set up by X/Y Rulers
*
* @param[in,out] position The position you wish to clamp
*/
- void ClampPosition(Vector3& position) const;
+ void ClampPosition(Vector2& position) const;
/**
* Clamps position within the domain set up by X/Y Rulers
* @param[in,out] position The position you wish to clamp
* @param[out] clamped The results of the clamping.
*/
- void ClampPosition(Vector3& position, ClampState3 &clamped) const;
+ void ClampPosition(Vector2& position, ClampState2D &clamped) const;
/**
* Wraps position within the domain set up by X/Y Rulers
*
* @param[in,out] position The position you wish to wrap
*/
- void WrapPosition(Vector3& position) const;
+ void WrapPosition(Vector2& position) const;
/**
* Updates the main internal scroll constraints with new ruler and domain
*
* @return The current position
*/
- Vector3 GetPropertyPrePosition() const;
+ Vector2 GetPropertyPrePosition() const;
/**
* Gets position property.
*
* @return The current position
*/
- Vector3 GetPropertyPosition() const;
+ Vector2 GetPropertyPosition() const;
/**
* Handles a Stopped animation. Its position properties need to be saved, and the animation flag
int mGestureStackDepth; ///< How many gestures are currently occuring.
Vector2 mPanStartPosition; ///< Where the pan gesture's touch down occured
- Vector3 mPanDelta; ///< Amount currently panned.
+ Vector2 mPanDelta; ///< Amount currently panned.
unsigned int mScrollStateFlags; ///< flags indicating current state of scrolling
// Scroll delegate pre and post position properties...
- Vector3 mScrollPrePosition; ///< Wrapped scroll position, but not clamped
- Vector3 mScrollPostPosition; ///< Wrapped and clamped, this is the final scroll position used
- Vector3 mScrollTargetPosition; ///< Final target position for an animated scroll
- Vector3 mDomainOffset; ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses)
+ Vector2 mScrollPrePosition; ///< Wrapped scroll position, but not clamped
+ Vector2 mScrollPostPosition; ///< Wrapped and clamped, this is the final scroll position used
+ Vector2 mScrollTargetPosition; ///< Final target position for an animated scroll
+ Vector2 mDomainOffset; ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses)
// Rulers for each axes...
RulerPtr mRulerX;
RulerPtr mRulerY;
// Last property values set to ScrollView
- Vector3 mMinScroll;
- Vector3 mMaxScroll;
-
- unsigned int mMinTouchesForPanning; ///< Minimum number of touches for panning to be used.
- unsigned int mMaxTouchesForPanning; ///< Maximum number of touches for panning to be used.
+ Vector2 mMinScroll;
+ Vector2 mMaxScroll;
Animation mInternalXAnimation; ///< Animates mPropertyX to a snap position or application requested scroll position
Animation mInternalYAnimation; ///< Animates mPropertyY to a snap position or application requested scroll position
ScrollViewEffectContainer mEffects; ///< Container keeping track of all the applied effects.
- float mOvershootDelay; ///< Time to wait for input before reducing overshoot back to 0
Vector2 mMaxOvershoot; ///< Number of scrollable pixels that will take overshoot from 0.0f to 1.0f
Vector2 mUserMaxOvershoot; ///< Set by user, allows overriding of default max overshoot for the scroll indicator
- float mSnapOvershootDuration; ///< Duration for overshoot snapping back to Vector3::ZERO
+ float mSnapOvershootDuration; ///< Duration for overshoot snapping back to Vector2::ZERO
AlphaFunction mSnapOvershootAlphaFunction; ///< AlphaFunction to be used for this overshoot.
float mSnapDuration; ///< Time for the snap animation to take (in seconds).
Vector2 mMouseWheelScrollDistanceStep; ///< The step of scroll distance in actor coordinates in X and Y axes for each mouse wheel event received.
//ScrollInternalConstraintsPtr mScrollInternalConstraints;
- ActiveConstraint mScrollMainInternalPrePositionConstraint;
- ActiveConstraint mScrollMainInternalPositionConstraint;
- ActiveConstraint mScrollMainInternalOvershootXConstraint;
- ActiveConstraint mScrollMainInternalOvershootYConstraint;
- ActiveConstraint mScrollMainInternalDeltaConstraint;
- ActiveConstraint mScrollMainInternalFinalConstraint;
- ActiveConstraint mScrollMainInternalRelativeConstraint;
+ Constraint mScrollMainInternalPrePositionConstraint;
+ Constraint mScrollMainInternalPositionConstraint;
+ Constraint mScrollMainInternalOvershootXConstraint;
+ Constraint mScrollMainInternalOvershootYConstraint;
+ Constraint mScrollMainInternalDeltaConstraint;
+ Constraint mScrollMainInternalFinalConstraint;
+ Constraint mScrollMainInternalRelativeConstraint;
+ Constraint mScrollMainInternalDomainConstraint;
+ Constraint mScrollMainInternalPrePositionMaxConstraint;
ScrollOvershootIndicatorPtr mOvershootIndicator;