22 #ifndef KINETIC_SCROLLER_H_
23 #define KINETIC_SCROLLER_H_
28 #include <QEasingCurve>
30 #include <QTextStream>
36 class QPropertyAnimation;
47 KineticScroller(qreal minValue = -std::numeric_limits<qreal>::infinity(),
48 qreal maxValue = std::numeric_limits<qreal>::infinity());
70 void flickAnimationTick();
71 void overscrollTrigger();
72 void flickTransitionToOverscroll();
73 void stopFlickAnimation();
79 FlickOverscrollCorrection,
87 static FlickDirection direction(qreal x)
89 return x >= 0 ? FlickUp : FlickDown;
93 bool inOverscroll()
const;
95 void checkUserActionOnOverscroll();
97 qreal amountInOverscroll()
const;
98 qreal instantaneousVelocity()
const;
99 qreal easingCubicCoEfficient(qreal index)
const;
101 QTimer m_flickAnimationTimer;
102 QTimer m_flickFilter;
105 QEasingCurve m_easing;
108 qreal m_maxOverscroll;
109 qreal m_scrollOffset;
111 qreal m_previousVelocity;
112 qreal m_accumulatedScroll;
113 QPointer<QPropertyAnimation> m_flickAnimation;
114 QPointer<QPropertyAnimation> m_flickOverscrollAnimation;
115 QPointer<QPropertyAnimation> m_overscrollAnimation;
116 FlickDirection m_flickEventDirection;
117 FlickState m_flickState;
118 qreal m_flickVelocity;
120 qreal m_restoreForce;
121 qreal m_flickStopOffset;
122 qreal m_tRegularScrollingTime;
126 qreal m_sReferenceTime;
127 qreal m_sReferenceTime1;
129 qreal m_overScrollCorrectionStart;
130 bool m_BypassOverScrollInfo;
131 bool m_OverScrollCorrectionInterrupted;
136 QTextStream *m_plotMouse;
138 bool m_flickAnimationTimerActive;