|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef QSTMEDGESCROLLGESTURERECOGNISER_H_ |
|
20 #define QSTMEDGESCROLLGESTURERECOGNISER_H_ |
|
21 |
|
22 |
|
23 #include <qstmgestureengine_if.h> |
|
24 #include <qstmgesture_if.h> |
|
25 #include <qstmgesturelistener_if.h> |
|
26 |
|
27 namespace qstmGesture |
|
28 { |
|
29 |
|
30 /*! |
|
31 * QStm_EdgeScrollGestureRecogniser handles edge scroll gesture: Hold event near the edges of the window |
|
32 * |
|
33 */ |
|
34 class QStm_EdgeScrollGestureRecogniser : public QObject, public QStm_GestureRecogniser |
|
35 { |
|
36 public: |
|
37 static const QStm_GestureUid KUid = EGestureUidEdgeScroll; |
|
38 |
|
39 QStm_EdgeScrollGestureRecogniser(QStm_GestureListenerIf* listener) ; |
|
40 virtual ~QStm_EdgeScrollGestureRecogniser(); |
|
41 |
|
42 virtual QStm_GestureRecognitionState recognise(int numOfActiveStreams, QStm_GestureEngineIf* ge) ; |
|
43 virtual void release(QStm_GestureEngineIf* ge) ; |
|
44 virtual void enable(bool enabled) ; |
|
45 virtual bool isEnabled() ; |
|
46 virtual void setOwner(void* owner) ; |
|
47 |
|
48 virtual QStm_GestureUid gestureUid() const { return KUid; } |
|
49 |
|
50 void setArea(const QRect& theArea) ; |
|
51 |
|
52 /*! |
|
53 * Define how close to the border the Hold UI event must be |
|
54 * \param rangeInPixels |
|
55 */ |
|
56 void setScrollRange(int rangeInPixels) ; |
|
57 /*! |
|
58 * for testing purposes we need to log the stuff somewhere... |
|
59 */ |
|
60 virtual void enableLogging(bool loggingOn) ; |
|
61 /*! |
|
62 * The timer function to handle timeout for generating scroll events |
|
63 */ |
|
64 |
|
65 private: |
|
66 bool m_loggingenabled ; |
|
67 void* m_powner ; // The owning control for this gesture |
|
68 QStm_GestureListenerIf* m_listener ; |
|
69 bool m_waitingforsecondtap ; |
|
70 QRect m_area ; |
|
71 bool m_gestureEnabled ; |
|
72 int m_rangesizeInPixels ; |
|
73 }; |
|
74 |
|
75 } // namespace |
|
76 |
|
77 |
|
78 #endif /* QSTMEDGESCROLLGESTURERECOGNISER_H_ */ |