X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view-impl.h;h=0ffd7d41f4c03217f6a34d4736e3970747529f86;hb=7e315a440bad7033d19fefa8f9952d625ee6f076;hp=ae1a41a0fa6b0f395857033028559856ec75ab5b;hpb=0a8c04cf17eea5d52982c59ebb0e03c06c1c8dd2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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 ae1a41a..0ffd7d4 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 @@ -19,7 +19,9 @@ */ // EXTERNAL INCLUDES -#include +#include +#include +#include // INTERNAL INCLUDES #include @@ -27,9 +29,6 @@ #include #include -// predefined effect includes -#include - namespace Dali { @@ -147,12 +146,6 @@ public: void ApplyEffect(Toolkit::ScrollViewEffect effect); /** - * @brief ApplyEffect Applies a predefined effect - * @param effect - */ - Toolkit::ScrollViewEffect ApplyEffect(Toolkit::ScrollView::PageEffect effect); - - /** * @copydoc Toolkit::ScrollView::RemoveEffect */ void RemoveEffect(Toolkit::ScrollViewEffect effect); @@ -193,22 +186,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,18 +243,6 @@ public: void SetWrapMode(bool enable); /** - * @deprecated - * @copydoc Toolkit::ScrollView::GetRefreshInterval - */ - int GetRefreshInterval() const; - - /** - * @deprecated - * @copydoc Toolkit::ScrollView::SetRefreshInterval - */ - void SetRefreshInterval(int milliseconds); - - /** * @copydoc Toolkit::ScrollView::GetScrollupdateDistance */ int GetScrollUpdateDistance() const; @@ -328,6 +293,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; @@ -363,25 +348,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, AlhpaFunction, DirectionBias, DirectionBias) */ - void TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration, + void TransformTo(const Vector3& position, float duration, AlphaFunction alpha, DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone); /** @@ -395,12 +375,23 @@ public: void ScrollTo(const Vector3& position, float duration); /** + * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha) + */ + void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha); + + /** * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias) */ void ScrollTo(const Vector3& position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias); /** + * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias) + */ + void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha, + DirectionBias horizontalBias, DirectionBias verticalBias); + + /** * @copydoc Toolkit::ScrollView::ScrollTo(unsigned int page) */ void ScrollTo(unsigned int page); @@ -454,16 +445,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); @@ -476,14 +457,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) @@ -491,8 +468,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); @@ -517,7 +492,7 @@ public: //Signals /** * @copydoc Dali::Toolkit::ScrollView::SnapStartedSignal() */ - Toolkit::ScrollView::SnapStartedSignalV2& SnapStartedSignal(); + Toolkit::ScrollView::SnapStartedSignalType& SnapStartedSignal(); /** * Connects a callback function with the object's signals. @@ -704,17 +679,15 @@ 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. * * @param[in] gesture The gesture event. */ - void OnPan(PanGesture pan); + void OnPan( const PanGesture& pan); /** * Extension of the above gestures. @@ -732,12 +705,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) */ @@ -783,21 +750,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 */ @@ -854,22 +806,15 @@ 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(); @@ -897,28 +842,19 @@ private: unsigned long mTouchDownTime; ///< The touch down time int mGestureStackDepth; ///< How many gestures are currently occuring. - + 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; @@ -927,7 +863,6 @@ private: 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 @@ -954,6 +889,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. @@ -967,8 +904,6 @@ private: //ScrollInternalConstraintsPtr mScrollInternalConstraints; ActiveConstraint mScrollMainInternalPrePositionConstraint; ActiveConstraint mScrollMainInternalPositionConstraint; - ActiveConstraint mScrollMainInternalXConstraint; - ActiveConstraint mScrollMainInternalYConstraint; ActiveConstraint mScrollMainInternalOvershootXConstraint; ActiveConstraint mScrollMainInternalOvershootYConstraint; ActiveConstraint mScrollMainInternalDeltaConstraint; @@ -977,7 +912,7 @@ private: ScrollOvershootIndicatorPtr mOvershootIndicator; - Toolkit::ScrollView::SnapStartedSignalV2 mSnapStartedSignalV2; + Toolkit::ScrollView::SnapStartedSignalType mSnapStartedSignal; bool mInAccessibilityPan : 1; ///< With AccessibilityPan its easier to move between snap positions bool mInitialized:1;