X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view-impl.h;h=5f2569dcfe7ebc17fc1b13975e160d05a55d4c1a;hp=1591fb6b5d03950bfbc19fb7f44c0725c4b1943e;hb=c708912335770047488e65100410cfc71ab15854;hpb=2685b40c3f05eb62d648835a1b28814498436e2c diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h index 1591fb6..5f2569d 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h @@ -193,22 +193,6 @@ public: void SetRulerY(RulerPtr ruler); /** - * @copydoc Toolkit::ScrollView::SetRulerScaleX - */ - void SetRulerScaleX(RulerPtr ruler); - - /** - * @copydoc Toolkit::ScrollView::SetRulerScaleY - */ - void SetRulerScaleY(RulerPtr ruler); - - /** - * Set Rotation axis ruler (defines how rotating is snapped in radians) - * @param[in] ruler The ruler to be used for the Rotation axis - */ - void SetRulerRotation(RulerPtr ruler); - - /** * @copydoc Toolkit::ScrollView::SetScrollSensitive */ void SetScrollSensitive(bool sensitive); @@ -266,14 +250,14 @@ public: void SetWrapMode(bool enable); /** - * @copydoc Toolkit::ScrollView::GetRefreshInterval + * @copydoc Toolkit::ScrollView::GetScrollupdateDistance */ - int GetRefreshInterval() const; + int GetScrollUpdateDistance() const; /** - * @copydoc Toolkit::ScrollView::SetRefreshInterval + * @copydoc Toolkit::ScrollView::SetScrollUpdateDistance */ - void SetRefreshInterval(int milliseconds); + void SetScrollUpdateDistance(int distance); /** * @copydoc Toolkit::ScrollView::GetAxisAutoLock @@ -316,6 +300,26 @@ public: void SetFlickSpeedCoefficient(float speed); /** + * @copydoc Toolkit::ScrollView::GetMinimumDistanceForFlick + */ + Vector2 GetMinimumDistanceForFlick() const; + + /** + * @copydoc Toolkit::ScrollView::SetMinimumDistanceForFlick + */ + void SetMinimumDistanceForFlick( const Vector2& distance ); + + /** + * @copydoc Toolkit::ScrollView::GetMinimumSpeedForFlick + */ + float GetMinimumSpeedForFlick() const; + + /** + * @copydoc Toolkit::ScrollView::SetMinimumSpeedForFlick + */ + void SetMinimumSpeedForFlick( float speed ); + + /** * @copydoc Toolkit::ScrollView::GetMaxFlickSpeed */ float GetMaxFlickSpeed() const; @@ -351,25 +355,20 @@ public: void SetScrollPosition(const Vector3& position); /** - * @copydoc Toolkit::ScrollView::GetCurrentScrollScale - */ - Vector3 GetCurrentScrollScale() const; - - /** * @copydoc Toolkit::Scrollable::GetDomainSize */ Vector3 GetDomainSize() const; /** - * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation) + * @copydoc ScrollTo(const Vector3&) */ - void TransformTo(const Vector3& position, const Vector3& scale, float rotation, + void TransformTo(const Vector3& position, DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone); /** - * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration) + * @copydoc ScrollTo(const Vector3&, float, DirectionBias, DirectionBias) */ - void TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration, + void TransformTo(const Vector3& position, float duration, DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone); /** @@ -442,16 +441,6 @@ public: bool ScrollToSnapPoint(); /** - * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale) - */ - void ScaleTo(const Vector3& scale); - - /** - * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale, float duration) - */ - void ScaleTo(const Vector3& scale, float duration); - - /** * Stops animation */ void StopAnimation(void); @@ -464,14 +453,10 @@ public: void StopAnimation(Animation& animation); /** - * Animates to position/scale/rotation transform. + * Animates to position transform. * * @param[in] position The position to animate to * @param[in] positionDuration The number of seconds this animation should run for in each axis. - * @param[in] scale The scale to animate to - * @param[in] scaleDuration The number of seconds this animation should run for in each axis. - * @param[in] rotation The angle to animate to - * @param[in] rotationDuration The number of seconds this animation should run for in each axis. * @param[in] alpha The easing alpha function to use. * @param[in] findShortcuts (optional) Whether to find the shortest route (in Wrap mode) * @param[in] horizontalBias (optional) Whether to bias animation to left or right (or no biasing) @@ -479,8 +464,6 @@ public: * @return True if animation necessary and taking place to reach desired transform. */ bool AnimateTo(const Vector3& position, const Vector3& positionDuration, - const Vector3& scale, const Vector3& scaleDuration, - float rotation, float rotationDuration, AlphaFunction alpha, bool findShortcuts = true, DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone, SnapType snapType = Snap); @@ -495,6 +478,11 @@ public: */ void RemoveOverlay(Actor actor); + /** + * @copydoc Toolkit::Internal::Scrollable::SetOvershootEffectColor + */ + void SetOvershootEffectColor( const Vector4& color ); + public: //Signals /** @@ -687,10 +675,8 @@ private: * Amalgamated Gesture Continuing event * * @param[in] panDelta average panning delta from base position (0) - * @param[in] scaleDelta average scale delta from base scale (1) - * @param[in] rotationDelta average rotation delta from base angle (0) */ - void GestureContinuing(const Vector2& panDelta, const Vector2& scaleDelta, float rotationDelta); + void GestureContinuing(const Vector2& panDelta); /** * Called upon pan gesture event. @@ -715,12 +701,6 @@ private: bool SnapWithVelocity(Vector2 velocity); /** - * Updates Container Transform based on Pan, Scale, and Rotation props. - * (occurs when continuing gesture i.e. dragging/pinching.) - */ - void UpdateTransform(); - - /** * Finishes Container Transform * (occurs upon finishing gesture i.e. releasing) */ @@ -766,21 +746,6 @@ private: void WrapPosition(Vector3& position) const; /** - * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers - * - * @param[in,out] scale The scale you wish to clamp - */ - void ClampScale(Vector3& scale) const; - - /** - * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers - * - * @param[in,out] scale The scale you wish to clamp - * @param[out] clamped The results of the clamping. - */ - void ClampScale(Vector3& scale, ClampState3 &clamped) const; - - /** * Updates the main internal scroll constraints with new ruler and domain * values */ @@ -837,40 +802,28 @@ private: Vector3 GetPropertyPosition() const; /** - * Gets scale property. - * - * @return The current scale - */ - Vector3 GetPropertyScale() const; - - /** - * Handles a Stopped animation. Its position/scale/rotation properties need to be - * saved, and the animation flag switched off. + * Handles a Stopped animation. Its position properties need to be saved, and the animation flag + * switched off. */ void HandleStoppedAnimation(); /** * Handles a Stopped animation (whether the animation completed, or was - * manually stopped). Its position/scale/rotation properties need to be - * saved, and the animation flag switched off. + * manually stopped). Its position properties need to be saved, and the + * animation flag switched off. */ void HandleSnapAnimationFinished(); /** - * Helper to start the refresh timer. + * Checks if the property notifications are active and adds them if not */ - void StartRefreshTimer(); - - /** - * Helper to cancel the refresh timer. - */ - void CancelRefreshTimer(); + void SetScrollUpdateNotification( bool enabled ); /** * Refresh the ScrollView (used when animating to update application developer of changes) * @return True if the refresh timer should be kept running. */ - bool OnRefreshTick(); + void OnScrollUpdateNotification(Dali::PropertyNotification& source); private: @@ -885,36 +838,27 @@ private: unsigned long mTouchDownTime; ///< The touch down time int mGestureStackDepth; ///< How many gestures are currently occuring. - Vector2 mGestureReferencePosition; ///< Point where scaling should occur from. - Vector2 mPinchGestureLastPosition; - Vector2 mPinchGestureLastScale; - + Vector2 mPanStartPosition; ///< Where the pan gesture's touch down occured Vector3 mPanDelta; ///< Amount currently panned. - Vector3 mScaleDelta; ///< Amount currently scaled. - float mRotationDelta; ///< Amount currently rotated. unsigned int mScrollStateFlags; ///< flags indicating current state of scrolling - // Scroll delegate pre and post position/scale/rotation properties... + // 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 mScrollPreScale; ///< Scroll delegate pre-scale - Vector3 mScrollPostScale; ///< Scroll delegate post-scale (affected by current touch) - float mScrollPreRotation; ///< Scroll delegate pre-rotation - float mScrollPostRotation; ///< Scroll delegate post-rotation (affected by current touch) Vector3 mDomainOffset; ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses) // Rulers for each axes... RulerPtr mRulerX; RulerPtr mRulerY; - RulerPtr mRulerScaleX; - RulerPtr mRulerScaleY; - RulerPtr mRulerRotation; + + // 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. - Animation mSnapAnimation; ///< Used to animate rotation and scaling of scroll properties 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 @@ -923,9 +867,10 @@ private: LockAxis mLockAxis; Timer mTouchDownTimer; ///< Used to interrupt snap-animation. This cannot be done in OnTouchEvent without breaking fast flick behavior. - Timer mOvershootRefreshTimer; - Timer mRefreshTimer; ///< Refresh timer is used to provide the Application developer with updates as animations run. - int mRefreshIntervalMilliseconds; ///< Refresh timer interval. + + float mScrollUpdateDistance; ///< Distance for scrolling to travel for the scroll update notifications + Dali::PropertyNotification mScrollXUpdateNotification; ///< scroll x position update notification + Dali::PropertyNotification mScrollYUpdateNotification; ///< scroll y position update notification Actor mInternalActor; ///< Internal actor (we keep internal actors in here e.g. scrollbars, so we can ignore it in searches) @@ -940,6 +885,8 @@ private: float mSnapDuration; ///< Time for the snap animation to take (in seconds). AlphaFunction mSnapAlphaFunction; ///< AlphaFunction to be used for the Snap Animation. + Vector2 mMinFlickDistance; ///< Minimum pan distance required for a flick + float mFlickSpeedThreshold; ///< Minimum pan speed required for a flick in pixels/ms float mFlickDuration; ///< Time for the flick animation to take (in seconds). AlphaFunction mFlickAlphaFunction; ///< AlphaFunction to be used for the Flick Animation. @@ -953,8 +900,6 @@ private: //ScrollInternalConstraintsPtr mScrollInternalConstraints; ActiveConstraint mScrollMainInternalPrePositionConstraint; ActiveConstraint mScrollMainInternalPositionConstraint; - ActiveConstraint mScrollMainInternalXConstraint; - ActiveConstraint mScrollMainInternalYConstraint; ActiveConstraint mScrollMainInternalOvershootXConstraint; ActiveConstraint mScrollMainInternalOvershootYConstraint; ActiveConstraint mScrollMainInternalDeltaConstraint; @@ -978,7 +923,8 @@ private: bool mAxisAutoLock:1; ///< Whether to automatically lock axis when panning. bool mAlterChild:1; ///< Internal flag to control behavior of OnChildAdd/OnChildRemove when Adding internal Actors. bool mDefaultMaxOvershoot:1; ///< Whether to use default max overshoot or application defined one - bool mUserSetPosition:1; ///< SetScrollPosition has been called, return this position until internals get control of scroll position again + bool mCanScrollHorizontal:1; ///< Local value of our property to check against + bool mCanScrollVertical:1; ///< Local value of our property to check against }; } // namespace Internal