|
1 /* |
|
2 * Copyright (c) 2008 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 the License "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:LongPress Gesture Recognizer |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LONGPRESSGESTURERECOGNISER_H_ |
|
19 #define LONGPRESSGESTURERECOGNISER_H_ |
|
20 |
|
21 #include "rt_gestureengineif.h" |
|
22 #include <rt_gestureif.h> |
|
23 #include <rt_gesturelistener.h> |
|
24 |
|
25 class CCoeControl ; |
|
26 |
|
27 namespace stmGesture |
|
28 { |
|
29 |
|
30 /*! |
|
31 * CLongPressGestureRecogniser handles long press gesture (generated from Hold UI event) |
|
32 * |
|
33 */ |
|
34 NONSHARABLE_CLASS( CLongPressGestureRecogniser ): public CGestureRecogniser |
|
35 { |
|
36 public: |
|
37 static const TGestureUid KUid = EGestureUidLongPress; |
|
38 |
|
39 /** Two-phase constructor */ |
|
40 static CLongPressGestureRecogniser* NewL(MGestureListener* aListener); |
|
41 virtual ~CLongPressGestureRecogniser(); |
|
42 |
|
43 /*! |
|
44 * MGestureRecogniserIf methods |
|
45 */ |
|
46 virtual TGestureRecognitionState recognise(int numOfActiveStreams, MGestureEngineIf* ge) ; |
|
47 virtual void release(MGestureEngineIf* ge) ; |
|
48 |
|
49 virtual TGestureUid gestureUid() const |
|
50 { |
|
51 return KUid; |
|
52 } |
|
53 |
|
54 /*! |
|
55 * Additional methods to set up edge scroll gesture recogniser: |
|
56 * define the rectangle |
|
57 * \param theArea |
|
58 */ |
|
59 void setArea(const TRect& theArea) ; |
|
60 |
|
61 private: |
|
62 CLongPressGestureRecogniser(MGestureListener* aListener) ; |
|
63 |
|
64 private: |
|
65 bool m_waitingforsecondtap ; |
|
66 TRect m_area ; |
|
67 }; |
|
68 |
|
69 } // namespace |
|
70 |
|
71 #endif /* LONGPRESSGESTURERECOGNISER_H_ */ |