1 #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_H__
2 #define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/dali.h>
25 #include <dali-toolkit/public-api/controls/control-impl.h>
26 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h>
27 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
28 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
30 // predefined effect includes
31 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-custom-effect.h>
43 typedef IntrusivePtr<ScrollView> ScrollViewPtr;
45 class ScrollInternalConstraints;
46 typedef IntrusivePtr<ScrollInternalConstraints> ScrollInternalConstraintsPtr;
48 class ScrollOvershootIndicator;
49 typedef IntrusivePtr<ScrollOvershootIndicator> ScrollOvershootIndicatorPtr;
52 * @copydoc Toolkit::ScrollView
54 class ScrollView : public ScrollBase
59 * FindDirection specifies how searching is conducted within the Find... routines.
63 None = -3, ///< Includes none within the search query.
64 All = -2, ///< Includes all within the search query.
65 Left = -1, ///< Includes only those not right !(>)
66 Right = 1, ///< Includes only those right (>)
67 Up = -1, ///< Includes only those not below !(>)
68 Down = 1, ///< Includes only those below (>)
69 Out = -1, ///< Includes only those not infront !(>)
70 In = 1 ///< Includes only those infront (>)
75 LockPossible = 0, ///< Locking is possible, but not set in stone yet.
76 LockHorizontal, ///< Locking is set to horizontal. (can pan vertically)
77 LockVertical, ///< Locking is set to vertical. (can pan horizontally)
78 LockNone ///< Locking is set to none (free panning).
84 * Create a new ScrollView.
85 * @return A public handle to the newly allocated ScrollView.
87 static Dali::Toolkit::ScrollView New();
92 * @copydoc Toolkit::ScrollView::GetScrollSnapAlphaFunction
94 AlphaFunction GetScrollSnapAlphaFunction() const;
97 * @copydoc Toolkit::ScrollView::SetScrollSnapAlphaFunction
99 void SetScrollSnapAlphaFunction(AlphaFunction alpha);
102 * @copydoc Toolkit::ScrollView::GetScrollFlickAlphaFunction
104 AlphaFunction GetScrollFlickAlphaFunction() const;
107 * @copydoc Toolkit::ScrollView::SetScrollFlickAlphaFunction
109 void SetScrollFlickAlphaFunction(AlphaFunction alpha);
112 * @copydoc Toolkit::ScrollView::GetScrollSnapDuration
114 float GetScrollSnapDuration() const;
117 * @copydoc Toolkit::ScrollView::SetScrollSnapDuration
119 void SetScrollSnapDuration(float time);
122 * @copydoc Toolkit::ScrollView::GetScrollFlickDuration
124 float GetScrollFlickDuration() const;
127 * @copydoc Toolkit::ScrollView::SetScrollFlickDuration
129 void SetScrollFlickDuration(float time);
132 * @copydoc Toolkit::ScrollView::ApplyEffect
134 void ApplyEffect(Toolkit::ScrollViewEffect effect);
137 * @brief ApplyEffect Applies a predefined effect
140 Toolkit::ScrollViewEffect ApplyEffect(Toolkit::ScrollView::PageEffect effect);
143 * @copydoc Toolkit::ScrollView::RemoveEffect
145 void RemoveEffect(Toolkit::ScrollViewEffect effect);
148 * @copydoc Toolkit::ScrollView::RemoveAllEffects
150 void RemoveAllEffects();
153 * @copydoc Toolkit::ScrollView::ApplyConstraintToChildren
155 void ApplyConstraintToChildren(Constraint constraint);
158 * @copydoc Toolkit::ScrollView::RemoveConstraintsFromChildren
160 void RemoveConstraintsFromChildren();
163 * @copydoc Toolkit::ScrollView::GetRulerX
165 const RulerPtr GetRulerX() const;
168 * @copydoc Toolkit::ScrollView::GetRulerY
170 const RulerPtr GetRulerY() const;
173 * @copydoc Toolkit::ScrollView::SetRulerX
175 void SetRulerX(RulerPtr ruler);
178 * @copydoc Toolkit::ScrollView::SetRulerY
180 void SetRulerY(RulerPtr ruler);
183 * @copydoc Toolkit::ScrollView::SetRulerScaleX
185 void SetRulerScaleX(RulerPtr ruler);
188 * @copydoc Toolkit::ScrollView::SetRulerScaleY
190 void SetRulerScaleY(RulerPtr ruler);
193 * Set Rotation axis ruler (defines how rotating is snapped in radians)
194 * @param[in] ruler The ruler to be used for the Rotation axis
196 void SetRulerRotation(RulerPtr ruler);
199 * @copydoc Toolkit::ScrollView::SetScrollSensitive
201 void SetScrollSensitive(bool sensitive);
204 * @copydoc Toolkit::ScrollView::SetMaxOvershoot
206 void SetMaxOvershoot(float overshootX, float overshootY);
209 * @copydoc Toolkit::ScrollView::SetSnapOvershootAlphaFunction
211 void SetSnapOvershootAlphaFunction(AlphaFunction alpha);
214 * @copydoc Toolkit::ScrollView::SetSnapOvershootDuration
216 void SetSnapOvershootDuration(float duration);
219 * @copydoc Toolkit::ScrollView::SetTouchesRequiredForPanning
221 void SetTouchesRequiredForPanning(unsigned int minTouches, unsigned int maxTouches, bool endOutside);
224 * @copydoc Toolkit::ScrollView::SetActorAutoSnap
226 void SetActorAutoSnap(bool enable);
229 * Enables or Disables Auto Resizing mode for ScrollView contents.
231 * When enabled, the ScrollView's X/Y Domains are restricted to the
232 * dimensions of the content's bounds, which may change as Actors are
233 * Added/Removed, and repositioned.
235 * @note This has been disabled for now, as this requires some fundamental
236 * changes to the way Actors positions and bounds are retrieved.
237 * (currently only constraints have these initial state knowledge)
239 * @param[in] enable Enables (true), or disables (false) Auto Resize.
241 void SetAutoResize(bool enable);
244 * Returns whether the wrap mode has been enabled (true) or not (false).
246 * @return Wrap Mode Enabled flag.
248 bool GetWrapMode() const;
251 * @copydoc Toolkit::ScrollView::SetWrapMode
253 void SetWrapMode(bool enable);
256 * @copydoc Toolkit::ScrollView::GetRefreshInterval
258 int GetRefreshInterval() const;
261 * @copydoc Toolkit::ScrollView::SetRefreshInterval
263 void SetRefreshInterval(int milliseconds);
266 * @copydoc Toolkit::ScrollView::GetAxisAutoLock
268 bool GetAxisAutoLock() const;
271 * @copydoc Toolkit::ScrollView::SetAxisAutoLock
273 void SetAxisAutoLock(bool enable);
276 * @copydoc Toolkit::ScrollView::GetAxisAutoLockGradient
278 float GetAxisAutoLockGradient() const;
281 * @copydoc Toolkit::ScrollView::SetAxisAutoLockGradient
283 void SetAxisAutoLockGradient(float gradient);
286 * @copydoc Toolkit::ScrollView::GetFrictionCoefficient
288 float GetFrictionCoefficient() const;
291 * @copydoc Toolkit::ScrollView::SetFrictionCoefficient
293 void SetFrictionCoefficient(float friction);
296 * @copydoc Toolkit::ScrollView::GetFlickSpeedCoefficient
298 float GetFlickSpeedCoefficient() const;
301 * @copydoc Toolkit::ScrollView::SetFlickSpeedCoefficient
303 void SetFlickSpeedCoefficient(float speed);
306 * @copydoc Toolkit::ScrollView::GetMaxFlickSpeed
308 float GetMaxFlickSpeed() const;
311 * @copydoc Toolkit::ScrollView::SetMaxFlickSpeed
313 void SetMaxFlickSpeed(float speed);
316 * @copydoc Toolkit::ScrollView::GetMouseWheelScrollDistanceStep
318 Vector2 GetMouseWheelScrollDistanceStep() const;
321 * @copydoc Toolkit::ScrollView::SetMouseWheelScrollDistanceStep
323 void SetMouseWheelScrollDistanceStep(Vector2 step);
326 * @copydoc Toolkit::ScrollView::GetCurrentPage
328 unsigned int GetCurrentPage() const;
331 * @copydoc Toolkit::ScrollView::GetCurrentScrollPosition
333 Vector3 GetCurrentScrollPosition() const;
336 * @copydoc Toolkit::ScrollView::GetCurrentScrollScale
338 Vector3 GetCurrentScrollScale() const;
341 * @copydoc Toolkit::Scrollable::GetDomainSize
343 Vector3 GetDomainSize() const;
346 * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation)
348 void TransformTo(const Vector3& position, const Vector3& scale, float rotation,
349 DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
352 * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration)
354 void TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration,
355 DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
358 * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position)
360 void ScrollTo(const Vector3 &position);
363 * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration)
365 void ScrollTo(const Vector3& position, float duration);
368 * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
370 void ScrollTo(const Vector3& position, float duration,
371 DirectionBias horizontalBias, DirectionBias verticalBias);
374 * @copydoc Toolkit::ScrollView::ScrollTo(unsigned int page)
376 void ScrollTo(unsigned int page);
379 * @copydoc Toolkit::ScrollView::ScrollTo(unsigned int page, float duration, DirectionBias bias)
381 void ScrollTo(unsigned int page, float duration, DirectionBias bias = DirectionBiasNone);
384 * @copydoc Toolkit::ScrollView::ScrollTo(Actor& actor)
386 void ScrollTo(Actor &actor);
389 * @copydoc Toolkit::ScrollView::ScrollTo(Actor& actor, float duration)
391 void ScrollTo(Actor &actor, float duration);
394 * @copydoc Toolkit::ScrollView::SetScrollingDirection()
396 void SetScrollingDirection( Radian direction, Radian threshold );
399 * @copydoc Toolkit::ScrollView::RemoveScrollingDirection()
401 void RemoveScrollingDirection( Radian angle );
404 * Finds the closest Actor to the current center of the ScrollView.
406 * @return A handle to the actor if found, or an empty handle if not.
408 Actor FindClosestActor();
411 * Finds the closest Actor to position in ScrollView
413 * @param[in] position position within ScrollView.
414 * @param[in] dirX Whether to search only those elements that are Left,Right, or All
415 * @param[in] dirY Whether to search only those elements that are Up,Down, or All
416 * @param[in] dirZ Whether to search only those elements that are Out,In, or All
417 * @return A handle to the actor if found, or an empty handle if not.
419 Actor FindClosestActorToPosition(const Vector3& position, FindDirection dirX = All, FindDirection dirY = All, FindDirection dirZ = All);
422 * @copydoc Toolkit::ScrollView::ScrollToSnapPoint
424 bool ScrollToSnapPoint();
427 * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale)
429 void ScaleTo(const Vector3& scale);
432 * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale, float duration)
434 void ScaleTo(const Vector3& scale, float duration);
439 void StopAnimation(void);
442 * Animates to position/scale/rotation transform.
444 * @param[in] position The position to animate to
445 * @param[in] positionDuration The number of seconds this animation should run for in each axis.
446 * @param[in] scale The scale to animate to
447 * @param[in] scaleDuration The number of seconds this animation should run for in each axis.
448 * @param[in] rotation The angle to animate to
449 * @param[in] rotationDuration The number of seconds this animation should run for in each axis.
450 * @param[in] alpha The easing alpha function to use.
451 * @param[in] findShortcuts (optional) Whether to find the shortest route (in Wrap mode)
452 * @param[in] horizontalBias (optional) Whether to bias animation to left or right (or no biasing)
453 * @param[in] verticalBias (optional) Whether to bias animation to top or bottom (or no biasing)
454 * @return True if animation necessary and taking place to reach desired transform.
456 bool AnimateTo(const Vector3& position, const Vector3& positionDuration,
457 const Vector3& scale, const Vector3& scaleDuration,
458 float rotation, float rotationDuration,
459 AlphaFunction alpha, bool findShortcuts = true,
460 DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone,
461 SnapType snapType = Snap);
464 * @copydoc Toolkit::Scrollable::AddOverlay()
466 void AddOverlay(Actor actor);
469 * @copydoc Toolkit::Scrollable::RemoveOverlay()
471 void RemoveOverlay(Actor actor);
476 * @copydoc Dali::Toolkit::ScrollView::SnapStartedSignal()
478 Toolkit::ScrollView::SnapStartedSignalV2& SnapStartedSignal();
481 * Connects a callback function with the object's signals.
482 * @param[in] object The object providing the signal.
483 * @param[in] tracker Used to disconnect the signal.
484 * @param[in] signalName The signal to connect to.
485 * @param[in] functor A newly allocated FunctorDelegate.
486 * @return True if the signal was connected.
487 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
489 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
491 private: // private overriden functions from CustomActorImpl and Controls
494 * @copydoc Dali::CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
496 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
499 * @copydoc Dali::Control::OnControlSizeSet(const Vector3&)
501 virtual void OnControlSizeSet( const Vector3& size );
504 * From CustomActorImpl; called after a child has been added to the owning actor.
505 * @param[in] child The child which has been added.
507 virtual void OnChildAdd(Actor& child);
510 * From CustomActorImpl; called shortly before a child is removed from the owning actor.
511 * @param[in] child The child being removed.
513 virtual void OnChildRemove(Actor& child);
516 * From CustomActorImpl; called after a touch-signal is received by the owning actor.
518 * We don't listen to these events as content within the contain may consume events.
520 * @param[in] event The touch event.
521 * @return True if the event should be consumed.
523 virtual bool OnTouchEvent(const TouchEvent& event);
526 * From CustomActorImpl; called after a mouse-wheel-event is received by the owning actor.
527 * @param[in] event The mouse wheel event.
528 * @return True if the event should be consumed.
530 virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
533 * @copydoc Toolkit::Control::OnInitialize()
535 virtual void OnInitialize();
538 * @copydoc Toolkit::Control::OnControlStageConnection()
540 virtual void OnControlStageConnection();
543 * @copydoc Toolkit::Control::OnControlStageConnection()
545 virtual void OnControlStageDisconnection();
548 * @copydoc Toolkit::Control::OnAccessibilityPan()
550 virtual bool OnAccessibilityPan(PanGesture gesture);
553 * @copydoc Toolkit::Scrollable::SetOvershootEnabled()
555 virtual void SetOvershootEnabled(bool enable);
560 * Start a timer which calls OnTouchDownTimeout()
562 void StartTouchDownTimer();
565 * Stop a timer which calls OnTouchDownTimeout()
567 void StopTouchDownTimer();
570 * Helper to detect when touch-point has been down (outside of pan gesture)
572 bool OnTouchDownTimeout();
575 * Called whenever a snap animation has completed
576 * @param[in] source the Animation instance that has completed.
578 void OnSnapAnimationFinished( Animation& source );
581 * Called whenever a snap animation on the x-axis has completed
582 * @param[in] source the Animation instance that has completed.
584 void OnSnapXAnimationFinished( Animation& source );
587 * Called whenever a snap animation on the y-axis has completed
588 * @param[in] source the Animation instance that has completed.
590 void OnSnapYAnimationFinished( Animation& source );
593 * This is called internally whenever the Scroll Rulers are
594 * modified. This will update the properties: 'scroll-position-min'
595 * and 'scroll-position-max' to reflect the changes.
597 * @param[in] size size of the visible scroll area (ScrollView control size)
599 void UpdatePropertyDomain(const Vector3& size);
602 * Called when the gesture starts.
604 void GestureStarted();
607 * Amalgamated Gesture Continuing event
609 * @param[in] panDelta average panning delta from base position (0)
610 * @param[in] scaleDelta average scale delta from base scale (1)
611 * @param[in] rotationDelta average rotation delta from base angle (0)
613 void GestureContinuing(Vector2 panDelta, Vector2 scaleDelta, float rotationDelta);
616 * Called upon pan gesture event.
618 * @param[in] gesture The gesture event.
620 void OnPan(PanGesture pan);
623 * Extension of the above gestures.
625 * @param[in] gesture The gesture event.
627 void OnGestureEx(Gesture::State state);
630 * Performs snapping while taking into account Velocity of gesture
631 * (velocity in pixels/sec)
633 * @param[in] velocity velocity in pixels/sec
635 bool SnapWithVelocity(Vector2 velocity);
638 * Updates Container Transform based on Pan, Scale, and Rotation props.
639 * (occurs when continuing gesture i.e. dragging/pinching.)
641 void UpdateTransform();
644 * Finishes Container Transform
645 * (occurs upon finishing gesture i.e. releasing)
647 void FinishTransform();
650 * Sets Overshoot to origin / cancels animation
652 void SetOvershootToOrigin();
655 * Animates Overshoot to origin
657 void AnimateOvershootToOrigin(float xDelay, float yDelay);
660 * Called whenever a snap overshoot animation has completed.
661 * @param[in] source the Animation instance that has completed.
663 void OnSnapOvershootAnimationFinished( Animation& source );
666 * Returns overshoot vector based on current position
668 * Overshoot vector is defined as how far outside of bounds
669 * the viewport is trying to view (prior to being clamped).
671 * an overshoot of (100,50), means user is in bottom right corner,
672 * trying to pan +100 to the right, and +50 below. This can be used
673 * to determine an effect, such as stretching.
675 * @param[in] position The position for which you wish to obtain overshoot vector
677 Vector3 GetOvershoot(Vector3& position) const;
680 * Clamps position within the domain set up by X/Y Rulers
682 * @param[in,out] position The position you wish to clamp
684 void ClampPosition(Vector3& position) const;
687 * Clamps position within the domain set up by X/Y Rulers
689 * @param[in,out] position The position you wish to clamp
690 * @param[out] clamped The results of the clamping.
692 void ClampPosition(Vector3& position, ClampState3 &clamped) const;
695 * Wraps position within the domain set up by X/Y Rulers
697 * @note Only wraps if mWrapMode is enabled, and respective domains
700 * @param[in,out] position The position you wish to wrap
702 void WrapPosition(Vector3& position) const;
705 * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers
707 * @param[in,out] scale The scale you wish to clamp
709 void ClampScale(Vector3& scale) const;
712 * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers
714 * @param[in,out] scale The scale you wish to clamp
715 * @param[out] clamped The results of the clamping.
717 void ClampScale(Vector3& scale, ClampState3 &clamped) const;
720 * Updates the main internal scroll constraints with new ruler and domain
723 void UpdateMainInternalConstraint();
726 * Enables/disables the overshoot constraints
728 * @param[in] enabled whether to enable or disable the overshoot constraints
730 void SetOvershootConstraintsEnabled(bool enabled);
733 * Sets internal constraints for this ScrollView.
734 * Many of these internal constraints are based on properties within
737 void SetInternalConstraints();
742 * Construct a new ScrollView.
747 * A reference counted object may only be deleted by calling Unreference()
749 virtual ~ScrollView();
754 * Searches this ScrollView, and attempts to Unbind
755 * systematically this Actor from the ScrollView attached.
757 * @param[in] child The actor to be unbound.
759 virtual void FindAndUnbindActor(Actor child);
762 * Gets position property.
764 * @return The current position
766 Vector3 GetPropertyPrePosition() const;
769 * Gets position property.
771 * @return The current position
773 Vector3 GetPropertyPosition() const;
776 * Gets scale property.
778 * @return The current scale
780 Vector3 GetPropertyScale() const;
783 * Handles a Stopped animation. Its position/scale/rotation properties need to be
784 * saved, and the animation flag switched off.
786 void HandleStoppedAnimation();
789 * Handles a Stopped animation (whether the animation completed, or was
790 * manually stopped). Its position/scale/rotation properties need to be
791 * saved, and the animation flag switched off.
793 void HandleSnapAnimationFinished();
796 * Helper to start the refresh timer.
798 void StartRefreshTimer();
801 * Helper to cancel the refresh timer.
803 void CancelRefreshTimer();
806 * Refresh the ScrollView (used when animating to update application developer of changes)
807 * @return True if the refresh timer should be kept running.
809 bool OnRefreshTick();
814 ScrollView(const ScrollView&);
817 ScrollView& operator=(const ScrollView& rhs);
822 bool mScrolling; ///< Flag indicating whether the scroll view is being scrolled (by user or animation)
823 bool mScrollInterrupted; ///< Flag set for when a down event interrupts a scroll
824 unsigned long mTouchDownTime; ///< The touch down time
826 bool mSensitive; ///< Scroll Sensitivity Flag.
828 int mGestureStackDepth; ///< How many gestures are currently occuring.
829 Vector2 mGestureReferencePosition; ///< Point where scaling should occur from.
830 Vector2 mPinchGestureLastPosition;
831 Vector2 mPinchGestureLastScale;
833 Vector3 mPanDelta; ///< Amount currently panned.
834 Vector3 mScaleDelta; ///< Amount currently scaled.
835 float mRotationDelta; ///< Amount currently rotated.
837 // Scroll delegate pre and post position/scale/rotation properties...
838 Vector3 mScrollPrePosition; ///< Scroll delegate pre-position
839 Vector3 mScrollPostPosition; ///< Scroll delegate post-position (affected by current touch)
840 Vector3 mScrollPreScale; ///< Scroll delegate pre-scale
841 Vector3 mScrollPostScale; ///< Scroll delegate post-scale (affected by current touch)
842 float mScrollPreRotation; ///< Scroll delegate pre-rotation
843 float mScrollPostRotation; ///< Scroll delegate post-rotation (affected by current touch)
844 Vector3 mDomainOffset; ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses)
846 // Rulers for each axes...
849 RulerPtr mRulerScaleX;
850 RulerPtr mRulerScaleY;
851 RulerPtr mRulerRotation;
852 bool mTouchDownTimeoutReached;
853 bool mActorAutoSnapEnabled; ///< Whether to automatically snap to closest actor.
854 bool mAutoResizeContainerEnabled; ///< Whether to automatically resize container (affects RulerDomain's on X/Y axes)
855 bool mWrapMode; ///< Whether to wrap contents based on container size.
856 bool mAxisAutoLock; ///< Whether to automatically lock axis when panning.
857 unsigned int mMinTouchesForPanning; ///< Minimum number of touches for panning to be used.
858 unsigned int mMaxTouchesForPanning; ///< Maximum number of touches for panning to be used.
860 Animation mSnapAnimation;
861 Animation mSnapXAnimation; ///< Animates from current x-axis position to the snapped (or scrolled) x-axis position.
862 Animation mSnapYAnimation; ///< Animates from current y-axis position to the snapped (or scrolled) y-axis position.
863 Animation mSnapOvershootAnimation; ///< Animates scroll-overshoot from current position to 0,0 based on specified easing equation.
866 Vector2 mLastVelocity; ///< Record the last velocity from PanGesture (Finish event doesn't have correct velocity)
869 Timer mTouchDownTimer; ///< Used to interrupt snap-animation. This cannot be done in OnTouchEvent without breaking fast flick behavior.
870 Timer mOvershootRefreshTimer;
871 Timer mRefreshTimer; ///< Refresh timer is used to provide the Application developer with updates as animations run.
872 int mRefreshIntervalMilliseconds; ///< Refresh timer interval.
874 bool mAlterChild; ///< Internal flag to control behavior of OnChildAdd/OnChildRemove when Adding internal Actors.
875 Actor mInternalActor; ///< Internal actor (we keep internal actors in here e.g. scrollbars, so we can ignore it in searches)
877 ScrollViewEffectContainer mEffects; ///< Container keeping track of all the applied effects.
879 float mOvershootDelay; ///< Time to wait for input before reducing overshoot back to 0
880 Vector2 mMaxOvershoot; ///< Number of scrollable pixels that will take overshoot from 0.0f to 1.0f
881 bool mDefaultMaxOvershoot; ///< Whether to use default max overshoot or application defined one
882 float mSnapOvershootDuration; ///< Duration for overshoot snapping back to Vector3::ZERO
883 AlphaFunction mSnapOvershootAlphaFunction; ///< AlphaFunction to be used for this overshoot.
885 float mSnapDuration; ///< Time for the snap animation to take (in seconds).
886 AlphaFunction mSnapAlphaFunction; ///< AlphaFunction to be used for the Snap Animation.
888 float mFlickDuration; ///< Time for the flick animation to take (in seconds).
889 AlphaFunction mFlickAlphaFunction; ///< AlphaFunction to be used for the Flick Animation.
891 float mAxisAutoLockGradient; ///< Axis Auto-lock gradient threshold. Above this gradient and it will lock scrolling to closest axis.
892 float mFrictionCoefficient; ///< Friction coefficient. Amount of friction to apply to free panning flick animation. in stage.lengths/sec
893 float mFlickSpeedCoefficient; ///< Flick velocity coefficient. Input touch velocity is multiplied by this.
894 float mMaxFlickSpeed; ///< Maximum flick speed. Maximum speed of flick in stage.lengths/sec.
896 Vector2 mMouseWheelScrollDistanceStep; ///< The step of scroll distance in actor coordinates in X and Y axes for each mouse wheel event received.
898 //ScrollInternalConstraintsPtr mScrollInternalConstraints;
899 ActiveConstraint mScrollMainInternalPrePositionConstraint;
900 ActiveConstraint mScrollMainInternalPositionConstraint;
901 ActiveConstraint mScrollMainInternalXConstraint;
902 ActiveConstraint mScrollMainInternalYConstraint;
903 ActiveConstraint mScrollMainInternalOvershootXConstraint;
904 ActiveConstraint mScrollMainInternalOvershootYConstraint;
905 ActiveConstraint mScrollMainInternalDeltaConstraint;
906 ActiveConstraint mScrollMainInternalFinalConstraint;
907 ActiveConstraint mScrollMainInternalRelativeConstraint;
909 ScrollOvershootIndicatorPtr mOvershootIndicator;
911 Toolkit::ScrollView::SnapStartedSignalV2 mSnapStartedSignalV2;
913 bool mInAccessibilityPan : 1; // With AccessibilityPan its easier to move between snap positions
916 } // namespace Internal
918 // Helpers for public-api forwarding methods
920 inline Toolkit::Internal::ScrollView& GetImpl(Toolkit::ScrollView& scrollView)
922 DALI_ASSERT_ALWAYS(scrollView);
924 Dali::RefObject& handle = scrollView.GetImplementation();
926 return static_cast<Toolkit::Internal::ScrollView&>(handle);
929 inline const Toolkit::Internal::ScrollView& GetImpl(const Toolkit::ScrollView& scrollView)
931 DALI_ASSERT_ALWAYS(scrollView);
933 const Dali::RefObject& handle = scrollView.GetImplementation();
935 return static_cast<const Toolkit::Internal::ScrollView&>(handle);
938 } // namespace Toolkit
942 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_H__