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 Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/dali.h>
24 #include <dali-toolkit/public-api/controls/control-impl.h>
25 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h>
26 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
27 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
29 // predefined effect includes
30 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-custom-effect.h>
42 typedef IntrusivePtr<ScrollView> ScrollViewPtr;
44 class ScrollInternalConstraints;
45 typedef IntrusivePtr<ScrollInternalConstraints> ScrollInternalConstraintsPtr;
47 class ScrollOvershootIndicator;
48 typedef IntrusivePtr<ScrollOvershootIndicator> ScrollOvershootIndicatorPtr;
51 * @copydoc Toolkit::ScrollView
53 class ScrollView : public ScrollBase
58 * FindDirection specifies how searching is conducted within the Find... routines.
62 None = -3, ///< Includes none within the search query.
63 All = -2, ///< Includes all within the search query.
64 Left = -1, ///< Includes only those not right !(>)
65 Right = 1, ///< Includes only those right (>)
66 Up = -1, ///< Includes only those not below !(>)
67 Down = 1, ///< Includes only those below (>)
68 Out = -1, ///< Includes only those not infront !(>)
69 In = 1 ///< Includes only those infront (>)
74 LockPossible = 0, ///< Locking is possible, but not set in stone yet.
75 LockHorizontal, ///< Locking is set to horizontal. (can pan vertically)
76 LockVertical, ///< Locking is set to vertical. (can pan horizontally)
77 LockNone ///< Locking is set to none (free panning).
83 * Create a new ScrollView.
84 * @return A public handle to the newly allocated ScrollView.
86 static Dali::Toolkit::ScrollView New();
91 * @copydoc Toolkit::ScrollView::GetScrollSnapAlphaFunction
93 AlphaFunction GetScrollSnapAlphaFunction() const;
96 * @copydoc Toolkit::ScrollView::SetScrollSnapAlphaFunction
98 void SetScrollSnapAlphaFunction(AlphaFunction alpha);
101 * @copydoc Toolkit::ScrollView::GetScrollFlickAlphaFunction
103 AlphaFunction GetScrollFlickAlphaFunction() const;
106 * @copydoc Toolkit::ScrollView::SetScrollFlickAlphaFunction
108 void SetScrollFlickAlphaFunction(AlphaFunction alpha);
111 * @copydoc Toolkit::ScrollView::GetScrollSnapDuration
113 float GetScrollSnapDuration() const;
116 * @copydoc Toolkit::ScrollView::SetScrollSnapDuration
118 void SetScrollSnapDuration(float time);
121 * @copydoc Toolkit::ScrollView::GetScrollFlickDuration
123 float GetScrollFlickDuration() const;
126 * @copydoc Toolkit::ScrollView::SetScrollFlickDuration
128 void SetScrollFlickDuration(float time);
131 * @copydoc Toolkit::ScrollView::ApplyEffect
133 void ApplyEffect(Toolkit::ScrollViewEffect effect);
136 * @brief ApplyEffect Applies a predefined effect
139 Toolkit::ScrollViewEffect ApplyEffect(Toolkit::ScrollView::PageEffect effect);
142 * @copydoc Toolkit::ScrollView::RemoveEffect
144 void RemoveEffect(Toolkit::ScrollViewEffect effect);
147 * @copydoc Toolkit::ScrollView::RemoveAllEffects
149 void RemoveAllEffects();
152 * @copydoc Toolkit::ScrollView::ApplyConstraintToChildren
154 void ApplyConstraintToChildren(Constraint constraint);
157 * @copydoc Toolkit::ScrollView::RemoveConstraintsFromChildren
159 void RemoveConstraintsFromChildren();
162 * @copydoc Toolkit::ScrollView::GetRulerX
164 const RulerPtr GetRulerX() const;
167 * @copydoc Toolkit::ScrollView::GetRulerY
169 const RulerPtr GetRulerY() const;
172 * @copydoc Toolkit::ScrollView::SetRulerX
174 void SetRulerX(RulerPtr ruler);
177 * @copydoc Toolkit::ScrollView::SetRulerY
179 void SetRulerY(RulerPtr ruler);
182 * @copydoc Toolkit::ScrollView::SetRulerScaleX
184 void SetRulerScaleX(RulerPtr ruler);
187 * @copydoc Toolkit::ScrollView::SetRulerScaleY
189 void SetRulerScaleY(RulerPtr ruler);
192 * Set Rotation axis ruler (defines how rotating is snapped in radians)
193 * @param[in] ruler The ruler to be used for the Rotation axis
195 void SetRulerRotation(RulerPtr ruler);
198 * @copydoc Toolkit::ScrollView::SetScrollSensitive
200 void SetScrollSensitive(bool sensitive);
203 * @copydoc Toolkit::ScrollView::SetMaxOvershoot
205 void SetMaxOvershoot(float overshootX, float overshootY);
208 * @copydoc Toolkit::ScrollView::SetSnapOvershootAlphaFunction
210 void SetSnapOvershootAlphaFunction(AlphaFunction alpha);
213 * @copydoc Toolkit::ScrollView::SetSnapOvershootDuration
215 void SetSnapOvershootDuration(float duration);
218 * @copydoc Toolkit::ScrollView::SetTouchesRequiredForPanning
220 void SetTouchesRequiredForPanning(unsigned int minTouches, unsigned int maxTouches, bool endOutside);
223 * @copydoc Toolkit::ScrollView::SetActorAutoSnap
225 void SetActorAutoSnap(bool enable);
228 * Enables or Disables Auto Resizing mode for ScrollView contents.
230 * When enabled, the ScrollView's X/Y Domains are restricted to the
231 * dimensions of the content's bounds, which may change as Actors are
232 * Added/Removed, and repositioned.
234 * @note This has been disabled for now, as this requires some fundamental
235 * changes to the way Actors positions and bounds are retrieved.
236 * (currently only constraints have these initial state knowledge)
238 * @param[in] enable Enables (true), or disables (false) Auto Resize.
240 void SetAutoResize(bool enable);
243 * Returns whether the wrap mode has been enabled (true) or not (false).
245 * @return Wrap Mode Enabled flag.
247 bool GetWrapMode() const;
250 * @copydoc Toolkit::ScrollView::SetWrapMode
252 void SetWrapMode(bool enable);
255 * @copydoc Toolkit::ScrollView::GetRefreshInterval
257 int GetRefreshInterval() const;
260 * @copydoc Toolkit::ScrollView::SetRefreshInterval
262 void SetRefreshInterval(int milliseconds);
265 * @copydoc Toolkit::ScrollView::GetAxisAutoLock
267 bool GetAxisAutoLock() const;
270 * @copydoc Toolkit::ScrollView::SetAxisAutoLock
272 void SetAxisAutoLock(bool enable);
275 * @copydoc Toolkit::ScrollView::GetAxisAutoLockGradient
277 float GetAxisAutoLockGradient() const;
280 * @copydoc Toolkit::ScrollView::SetAxisAutoLockGradient
282 void SetAxisAutoLockGradient(float gradient);
285 * @copydoc Toolkit::ScrollView::GetFrictionCoefficient
287 float GetFrictionCoefficient() const;
290 * @copydoc Toolkit::ScrollView::SetFrictionCoefficient
292 void SetFrictionCoefficient(float friction);
295 * @copydoc Toolkit::ScrollView::GetFlickSpeedCoefficient
297 float GetFlickSpeedCoefficient() const;
300 * @copydoc Toolkit::ScrollView::SetFlickSpeedCoefficient
302 void SetFlickSpeedCoefficient(float speed);
305 * @copydoc Toolkit::ScrollView::GetMaxFlickSpeed
307 float GetMaxFlickSpeed() const;
310 * @copydoc Toolkit::ScrollView::SetMaxFlickSpeed
312 void SetMaxFlickSpeed(float speed);
315 * @copydoc Toolkit::ScrollView::GetMouseWheelScrollDistanceStep
317 Vector2 GetMouseWheelScrollDistanceStep() const;
320 * @copydoc Toolkit::ScrollView::SetMouseWheelScrollDistanceStep
322 void SetMouseWheelScrollDistanceStep(Vector2 step);
325 * @copydoc Toolkit::ScrollView::GetCurrentPage
327 unsigned int GetCurrentPage() const;
330 * @copydoc Toolkit::ScrollView::GetCurrentScrollPosition
332 Vector3 GetCurrentScrollPosition() const;
335 * @copydoc Toolkit::ScrollView::GetCurrentScrollScale
337 Vector3 GetCurrentScrollScale() const;
340 * @copydoc Toolkit::Scrollable::GetDomainSize
342 Vector3 GetDomainSize() const;
345 * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation)
347 void TransformTo(const Vector3& position, const Vector3& scale, float rotation,
348 DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
351 * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration)
353 void TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration,
354 DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
357 * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position)
359 void ScrollTo(const Vector3 &position);
362 * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration)
364 void ScrollTo(const Vector3& position, float duration);
367 * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
369 void ScrollTo(const Vector3& position, float duration,
370 DirectionBias horizontalBias, DirectionBias verticalBias);
373 * @copydoc Toolkit::ScrollView::ScrollTo(unsigned int page)
375 void ScrollTo(unsigned int page);
378 * @copydoc Toolkit::ScrollView::ScrollTo(unsigned int page, float duration, DirectionBias bias)
380 void ScrollTo(unsigned int page, float duration, DirectionBias bias = DirectionBiasNone);
383 * @copydoc Toolkit::ScrollView::ScrollTo(Actor& actor)
385 void ScrollTo(Actor &actor);
388 * @copydoc Toolkit::ScrollView::ScrollTo(Actor& actor, float duration)
390 void ScrollTo(Actor &actor, float duration);
393 * @copydoc Toolkit::ScrollView::SetScrollingDirection()
395 void SetScrollingDirection( Radian direction, Radian threshold );
398 * @copydoc Toolkit::ScrollView::RemoveScrollingDirection()
400 void RemoveScrollingDirection( Radian angle );
403 * Finds the closest Actor to the current center of the ScrollView.
405 * @return A handle to the actor if found, or an empty handle if not.
407 Actor FindClosestActor();
410 * Finds the closest Actor to position in ScrollView
412 * @param[in] position position within ScrollView.
413 * @param[in] dirX Whether to search only those elements that are Left,Right, or All
414 * @param[in] dirY Whether to search only those elements that are Up,Down, or All
415 * @param[in] dirZ Whether to search only those elements that are Out,In, or All
416 * @return A handle to the actor if found, or an empty handle if not.
418 Actor FindClosestActorToPosition(const Vector3& position, FindDirection dirX = All, FindDirection dirY = All, FindDirection dirZ = All);
421 * @copydoc Toolkit::ScrollView::ScrollToSnapPoint
423 bool ScrollToSnapPoint();
426 * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale)
428 void ScaleTo(const Vector3& scale);
431 * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale, float duration)
433 void ScaleTo(const Vector3& scale, float duration);
438 void StopAnimation(void);
441 * Animates to position/scale/rotation transform.
443 * @param[in] position The position to animate to
444 * @param[in] positionDuration The number of seconds this animation should run for in each axis.
445 * @param[in] scale The scale to animate to
446 * @param[in] scaleDuration The number of seconds this animation should run for in each axis.
447 * @param[in] rotation The angle to animate to
448 * @param[in] rotationDuration The number of seconds this animation should run for in each axis.
449 * @param[in] alpha The easing alpha function to use.
450 * @param[in] findShortcuts (optional) Whether to find the shortest route (in Wrap mode)
451 * @param[in] horizontalBias (optional) Whether to bias animation to left or right (or no biasing)
452 * @param[in] verticalBias (optional) Whether to bias animation to top or bottom (or no biasing)
453 * @return True if animation necessary and taking place to reach desired transform.
455 bool AnimateTo(const Vector3& position, const Vector3& positionDuration,
456 const Vector3& scale, const Vector3& scaleDuration,
457 float rotation, float rotationDuration,
458 AlphaFunction alpha, bool findShortcuts = true,
459 DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone,
460 SnapType snapType = Snap);
463 * @copydoc Toolkit::Scrollable::AddOverlay()
465 void AddOverlay(Actor actor);
468 * @copydoc Toolkit::Scrollable::RemoveOverlay()
470 void RemoveOverlay(Actor actor);
475 * @copydoc Dali::Toolkit::ScrollView::SnapStartedSignal()
477 Toolkit::ScrollView::SnapStartedSignalV2& SnapStartedSignal();
480 * Connects a callback function with the object's signals.
481 * @param[in] object The object providing the signal.
482 * @param[in] tracker Used to disconnect the signal.
483 * @param[in] signalName The signal to connect to.
484 * @param[in] functor A newly allocated FunctorDelegate.
485 * @return True if the signal was connected.
486 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
488 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
490 private: // private overriden functions from CustomActorImpl and Controls
493 * @copydoc Dali::CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
495 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
498 * @copydoc Dali::ControlImpl::OnControlSizeSet(const Vector3&)
500 virtual void OnControlSizeSet( const Vector3& size );
503 * From CustomActorImpl; called after a child has been added to the owning actor.
504 * @param[in] child The child which has been added.
506 virtual void OnChildAdd(Actor& child);
509 * From CustomActorImpl; called shortly before a child is removed from the owning actor.
510 * @param[in] child The child being removed.
512 virtual void OnChildRemove(Actor& child);
515 * From CustomActorImpl; called after a touch-signal is received by the owning actor.
517 * We don't listen to these events as content within the contain may consume events.
519 * @param[in] event The touch event.
520 * @return True if the event should be consumed.
522 virtual bool OnTouchEvent(const TouchEvent& event);
525 * From CustomActorImpl; called after a mouse-wheel-event is received by the owning actor.
526 * @param[in] event The mouse wheel event.
527 * @return True if the event should be consumed.
529 virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
532 * @copydoc Toolkit::Control::OnInitialize()
534 virtual void OnInitialize();
537 * @copydoc Toolkit::Control::OnControlStageConnection()
539 virtual void OnControlStageConnection();
542 * @copydoc Toolkit::Control::OnControlStageConnection()
544 virtual void OnControlStageDisconnection();
547 * @copydoc Toolkit::Control::OnAccessibilityPan()
549 virtual bool OnAccessibilityPan(PanGesture gesture);
552 * @copydoc Toolkit::Scrollable::SetOvershootEnabled()
554 virtual void SetOvershootEnabled(bool enable);
559 * Called whenever a snap animation has completed
560 * @param[in] source the Animation instance that has completed.
562 void OnSnapAnimationFinished( Animation& source );
565 * Called whenever a snap animation on the x-axis has completed
566 * @param[in] source the Animation instance that has completed.
568 void OnSnapXAnimationFinished( Animation& source );
571 * Called whenever a snap animation on the y-axis has completed
572 * @param[in] source the Animation instance that has completed.
574 void OnSnapYAnimationFinished( Animation& source );
577 * This is called internally whenever the Scroll Rulers are
578 * modified. This will update the properties: 'scroll-position-min'
579 * and 'scroll-position-max' to reflect the changes.
581 * @param[in] size size of the visible scroll area (ScrollView control size)
583 void UpdatePropertyDomain(const Vector3& size);
586 * Called when the gesture starts.
588 void GestureStarted();
591 * Amalgamated Gesture Continuing event
593 * @param[in] panDelta average panning delta from base position (0)
594 * @param[in] scaleDelta average scale delta from base scale (1)
595 * @param[in] rotationDelta average rotation delta from base angle (0)
597 void GestureContinuing(Vector2 panDelta, Vector2 scaleDelta, float rotationDelta);
600 * Called upon pan gesture event.
602 * @param[in] gesture The gesture event.
604 void OnPan(PanGesture pan);
607 * Extension of the above gestures.
609 * @param[in] gesture The gesture event.
611 void OnGestureEx(Gesture::State state);
614 * Performs snapping while taking into account Velocity of gesture
615 * (velocity in pixels/sec)
617 * @param[in] velocity velocity in pixels/sec
619 bool SnapWithVelocity(Vector2 velocity);
622 * Updates Container Transform based on Pan, Scale, and Rotation props.
623 * (occurs when continuing gesture i.e. dragging/pinching.)
625 void UpdateTransform();
628 * Finishes Container Transform
629 * (occurs upon finishing gesture i.e. releasing)
631 void FinishTransform();
634 * Sets Overshoot to origin / cancels animation
636 void SetOvershootToOrigin();
639 * Animates Overshoot to origin
641 void AnimateOvershootToOrigin(float xDelay, float yDelay);
644 * Called whenever a snap overshoot animation has completed.
645 * @param[in] source the Animation instance that has completed.
647 void OnSnapOvershootAnimationFinished( Animation& source );
650 * Returns overshoot vector based on current position
652 * Overshoot vector is defined as how far outside of bounds
653 * the viewport is trying to view (prior to being clamped).
655 * an overshoot of (100,50), means user is in bottom right corner,
656 * trying to pan +100 to the right, and +50 below. This can be used
657 * to determine an effect, such as stretching.
659 * @param[in] position The position for which you wish to obtain overshoot vector
661 Vector3 GetOvershoot(Vector3& position) const;
664 * Clamps position within the domain set up by X/Y Rulers
666 * @param[in,out] position The position you wish to clamp
668 void ClampPosition(Vector3& position) const;
671 * Clamps position within the domain set up by X/Y Rulers
673 * @param[in,out] position The position you wish to clamp
674 * @param[out] clamped The results of the clamping.
676 void ClampPosition(Vector3& position, ClampState3 &clamped) const;
679 * Wraps position within the domain set up by X/Y Rulers
681 * @note Only wraps if mWrapMode is enabled, and respective domains
684 * @param[in,out] position The position you wish to wrap
686 void WrapPosition(Vector3& position) const;
689 * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers
691 * @param[in,out] scale The scale you wish to clamp
693 void ClampScale(Vector3& scale) const;
696 * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers
698 * @param[in,out] scale The scale you wish to clamp
699 * @param[out] clamped The results of the clamping.
701 void ClampScale(Vector3& scale, ClampState3 &clamped) const;
704 * Updates the main internal scroll constraints with new ruler and domain
707 void UpdateMainInternalConstraint();
710 * Enables/disables the overshoot constraints
712 * @param[in] enabled whether to enable or disable the overshoot constraints
714 void SetOvershootConstraintsEnabled(bool enabled);
717 * Sets internal constraints for this ScrollView.
718 * Many of these internal constraints are based on properties within
721 void SetInternalConstraints();
726 * Construct a new ScrollView.
731 * A reference counted object may only be deleted by calling Unreference()
733 virtual ~ScrollView();
738 * Searches this ScrollView, and attempts to Unbind
739 * systematically this Actor from the ScrollView attached.
741 * @param[in] child The actor to be unbound.
743 virtual void FindAndUnbindActor(Actor child);
746 * Gets position property.
748 * @return The current position
750 Vector3 GetPropertyPrePosition() const;
753 * Gets position property.
755 * @return The current position
757 Vector3 GetPropertyPosition() const;
760 * Gets scale property.
762 * @return The current scale
764 Vector3 GetPropertyScale() const;
767 * Handles a Stopped animation. Its position/scale/rotation properties need to be
768 * saved, and the animation flag switched off.
770 void HandleStoppedAnimation();
773 * Handles a Stopped animation (whether the animation completed, or was
774 * manually stopped). Its position/scale/rotation properties need to be
775 * saved, and the animation flag switched off.
777 void HandleSnapAnimationFinished();
780 * Helper to start the refresh timer.
782 void StartRefreshTimer();
785 * Helper to cancel the refresh timer.
787 void CancelRefreshTimer();
790 * Refresh the ScrollView (used when animating to update application developer of changes)
791 * @return True if the refresh timer should be kept running.
793 bool OnRefreshTick();
798 ScrollView(const ScrollView&);
801 ScrollView& operator=(const ScrollView& rhs);
806 bool mScrolling; ///< Flag indicating whether the scroll view is being scrolled (by user or animation)
807 bool mScrollInterrupted; ///< Flag set for when a down event interrupts a scroll
808 unsigned long mTouchDownTime; ///< The touch down time
809 Vector2 mTouchDownPosition; ///< The touch down position
811 bool mSensitive; ///< Scroll Sensitivity Flag.
813 int mGestureStackDepth; ///< How many gestures are currently occuring.
814 Vector2 mGestureReferencePosition; ///< Point where scaling should occur from.
815 Vector2 mPinchGestureLastPosition;
816 Vector2 mPinchGestureLastScale;
818 Vector3 mPanDelta; ///< Amount currently panned.
819 Vector3 mScaleDelta; ///< Amount currently scaled.
820 float mRotationDelta; ///< Amount currently rotated.
822 // Scroll delegate pre and post position/scale/rotation properties...
823 Vector3 mScrollPrePosition; ///< Scroll delegate pre-position
824 Vector3 mScrollPostPosition; ///< Scroll delegate post-position (affected by current touch)
825 Vector3 mScrollPreScale; ///< Scroll delegate pre-scale
826 Vector3 mScrollPostScale; ///< Scroll delegate post-scale (affected by current touch)
827 float mScrollPreRotation; ///< Scroll delegate pre-rotation
828 float mScrollPostRotation; ///< Scroll delegate post-rotation (affected by current touch)
829 Vector3 mDomainOffset; ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses)
831 // Rulers for each axes...
834 RulerPtr mRulerScaleX;
835 RulerPtr mRulerScaleY;
836 RulerPtr mRulerRotation;
837 bool mTouchDownReceived;
838 bool mActorAutoSnapEnabled; ///< Whether to automatically snap to closest actor.
839 bool mAutoResizeContainerEnabled; ///< Whether to automatically resize container (affects RulerDomain's on X/Y axes)
840 bool mWrapMode; ///< Whether to wrap contents based on container size.
841 bool mAxisAutoLock; ///< Whether to automatically lock axis when panning.
842 unsigned int mMinTouchesForPanning; ///< Minimum number of touches for panning to be used.
843 unsigned int mMaxTouchesForPanning; ///< Maximum number of touches for panning to be used.
845 Animation mSnapAnimation;
846 Animation mSnapXAnimation; ///< Animates from current x-axis position to the snapped (or scrolled) x-axis position.
847 Animation mSnapYAnimation; ///< Animates from current y-axis position to the snapped (or scrolled) y-axis position.
848 Animation mSnapOvershootAnimation; ///< Animates scroll-overshoot from current position to 0,0 based on specified easing equation.
851 Vector2 mLastVelocity; ///< Record the last velocity from PanGesture (Finish event doesn't have correct velocity)
854 Timer mOvershootRefreshTimer;
855 Timer mRefreshTimer; ///< Refresh timer is used to provide the Application developer with updates as animations run.
856 int mRefreshIntervalMilliseconds; ///< Refresh timer interval.
858 bool mAlterChild; ///< Internal flag to control behavior of OnChildAdd/OnChildRemove when Adding internal Actors.
859 Actor mInternalActor; ///< Internal actor (we keep internal actors in here e.g. scrollbars, so we can ignore it in searches)
861 ScrollViewEffectContainer mEffects; ///< Container keeping track of all the applied effects.
863 float mOvershootDelay; ///< Time to wait for input before reducing overshoot back to 0
864 Vector2 mMaxOvershoot; ///< Number of scrollable pixels that will take overshoot from 0.0f to 1.0f
865 bool mDefaultMaxOvershoot; ///< Whether to use default max overshoot or application defined one
866 float mSnapOvershootDuration; ///< Duration for overshoot snapping back to Vector3::ZERO
867 AlphaFunction mSnapOvershootAlphaFunction; ///< AlphaFunction to be used for this overshoot.
869 float mSnapDuration; ///< Time for the snap animation to take (in seconds).
870 AlphaFunction mSnapAlphaFunction; ///< AlphaFunction to be used for the Snap Animation.
872 float mFlickDuration; ///< Time for the flick animation to take (in seconds).
873 AlphaFunction mFlickAlphaFunction; ///< AlphaFunction to be used for the Flick Animation.
875 float mAxisAutoLockGradient; ///< Axis Auto-lock gradient threshold. Above this gradient and it will lock scrolling to closest axis.
876 float mFrictionCoefficient; ///< Friction coefficient. Amount of friction to apply to free panning flick animation. in stage.lengths/sec
877 float mFlickSpeedCoefficient; ///< Flick velocity coefficient. Input touch velocity is multiplied by this.
878 float mMaxFlickSpeed; ///< Maximum flick speed. Maximum speed of flick in stage.lengths/sec.
880 Vector2 mMouseWheelScrollDistanceStep; ///< The step of scroll distance in actor coordinates in X and Y axes for each mouse wheel event received.
882 //ScrollInternalConstraintsPtr mScrollInternalConstraints;
883 ActiveConstraint mScrollMainInternalPrePositionConstraint;
884 ActiveConstraint mScrollMainInternalPositionConstraint;
885 ActiveConstraint mScrollMainInternalXConstraint;
886 ActiveConstraint mScrollMainInternalYConstraint;
887 ActiveConstraint mScrollMainInternalOvershootXConstraint;
888 ActiveConstraint mScrollMainInternalOvershootYConstraint;
889 ActiveConstraint mScrollMainInternalDeltaConstraint;
890 ActiveConstraint mScrollMainInternalFinalConstraint;
891 ActiveConstraint mScrollMainInternalRelativeConstraint;
893 ScrollOvershootIndicatorPtr mOvershootIndicator;
895 Toolkit::ScrollView::SnapStartedSignalV2 mSnapStartedSignalV2;
898 } // namespace Internal
900 // Helpers for public-api forwarding methods
902 inline Toolkit::Internal::ScrollView& GetImpl(Toolkit::ScrollView& scrollView)
904 DALI_ASSERT_ALWAYS(scrollView);
906 Dali::RefObject& handle = scrollView.GetImplementation();
908 return static_cast<Toolkit::Internal::ScrollView&>(handle);
911 inline const Toolkit::Internal::ScrollView& GetImpl(const Toolkit::ScrollView& scrollView)
913 DALI_ASSERT_ALWAYS(scrollView);
915 const Dali::RefObject& handle = scrollView.GetImplementation();
917 return static_cast<const Toolkit::Internal::ScrollView&>(handle);
920 } // namespace Toolkit
924 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_H__