25 |
25 |
26 #ifndef HBPOINTRECORDER_P_H |
26 #ifndef HBPOINTRECORDER_P_H |
27 #define HBPOINTRECORDER_P_H |
27 #define HBPOINTRECORDER_P_H |
28 |
28 |
29 #include "hbglobal.h" |
29 #include "hbglobal.h" |
30 #include "hbgestures_p.h" |
|
31 |
30 |
32 #include <QList> |
31 #include <QList> |
33 #include <QPair> |
32 #include <QPair> |
34 |
33 |
35 #include <QSet> |
34 #include <QSet> |
36 |
35 |
37 class QTime; |
36 typedef QPair<qreal, qint64> HbPointTime; |
38 typedef QPair<qreal, QTime> HbPointTime; |
|
39 |
37 |
40 class HB_CORE_PRIVATE_EXPORT HbPointRecorder : public QList<HbPointTime> |
38 class HB_CORE_PRIVATE_EXPORT HbPointRecorder |
41 { |
39 { |
42 public: |
40 public: |
43 HbPointRecorder(); |
41 HbPointRecorder(); |
44 ~HbPointRecorder(); |
42 ~HbPointRecorder(); |
45 |
43 |
46 void record(qreal pos, const QTime &time); |
44 void record(qreal pos, qint64 time); |
47 void resetRecorder(qreal threshold); |
45 void resetRecorder(qreal threshold = 0.0f); |
48 |
46 |
49 qreal lastPoint() const; |
47 qreal lastPoint() const; |
50 const QTime& lastTime() const; |
48 qint64 lastTime() const; |
51 bool dirChanged(qreal point) const; |
49 bool dirChanged(qreal point) const; |
52 HbPointTime operator[](int index) const; |
|
53 QList<HbPointTime> getLastRecords( int number ) const; |
50 QList<HbPointTime> getLastRecords( int number ) const; |
54 |
51 |
|
52 int count() const { return mPoints.count(); } |
|
53 bool isEmpty() const { return mPoints.isEmpty(); } |
|
54 HbPointTime at(int i) const { return mPoints.at(i); } |
|
55 |
55 qreal mThreshold; |
56 qreal mThreshold; |
|
57 QList<HbPointTime> mPoints; |
56 }; |
58 }; |
57 |
|
58 inline uint qHash(const QTime &) |
|
59 { |
|
60 return 0; |
|
61 } |
|
62 |
59 |
63 inline uint qHash(const qreal) |
60 inline uint qHash(const qreal) |
64 { |
61 { |
65 return 0; |
62 return 0; |
66 } |
63 } |