|
1 /* |
|
2 * Copyright (c) 2009 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: AknPhysics drag event observer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AKNPHYSICSDRAGOBSERVER_H |
|
20 #define C_AKNPHYSICSDRAGOBSERVER_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 class TPointerEvent; |
|
26 class CAknPhysicsParameterProvider; |
|
27 class CAknPhysicsFlickTracker; |
|
28 |
|
29 /** |
|
30 * AknPhysics drag event observer |
|
31 * |
|
32 */ |
|
33 NONSHARABLE_CLASS( CAknPhysicsDragObserver ) : public CBase |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CAknPhysicsDragObserver* NewL( |
|
42 CAknPhysicsParameterProvider* aProvider ); |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CAknPhysicsDragObserver* NewLC( |
|
48 CAknPhysicsParameterProvider* aProvider ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CAknPhysicsDragObserver(); |
|
54 |
|
55 /** |
|
56 * Registers pointer event position. |
|
57 * |
|
58 * @param aEvent pointer event |
|
59 */ |
|
60 void RegisterEventPosition( const TPointerEvent* aEvent ); |
|
61 |
|
62 /** |
|
63 * Returns changed drag distance point. |
|
64 * |
|
65 * @return Changed drag distance. |
|
66 */ |
|
67 TPoint ChangedDragDistance() const; |
|
68 |
|
69 /** |
|
70 * Returns changed vertical drag move time. |
|
71 * |
|
72 * @return Changed drag move time. |
|
73 */ |
|
74 TInt ChangedVerticalDragMoveTime() const; |
|
75 |
|
76 /** |
|
77 * Returns changed horizontal drag move time. |
|
78 * |
|
79 * @return Changed drag move time. |
|
80 */ |
|
81 TInt ChangedHorizontalDragMoveTime() const; |
|
82 |
|
83 /** |
|
84 * Returns ETrue if drag parameters has been changed during drag event. |
|
85 * |
|
86 * @return ETrue if drag parameters has been changed. |
|
87 */ |
|
88 TBool DragChanged() const; |
|
89 |
|
90 private: |
|
91 |
|
92 /** |
|
93 * C++ constructor. |
|
94 */ |
|
95 CAknPhysicsDragObserver(); |
|
96 |
|
97 /** |
|
98 * Symbian second-phase constructor. |
|
99 */ |
|
100 void ConstructL( CAknPhysicsParameterProvider* aProvider ); |
|
101 |
|
102 /** |
|
103 * Handles pointer down event. |
|
104 * |
|
105 * @param aPosition Down event position. |
|
106 */ |
|
107 void HandlePointerDownEvent( const TPoint& aPosition ); |
|
108 |
|
109 /** |
|
110 * Handles pointer drag event. |
|
111 * |
|
112 * @param aPosition Drag event position. |
|
113 */ |
|
114 void HandlePointerDragEvent( const TPoint& aPosition ); |
|
115 |
|
116 /** |
|
117 * Handles pointer up event. |
|
118 * |
|
119 * @param aPosition Up event position. |
|
120 */ |
|
121 void HandlePointerUpEvent( const TPoint& aPosition ); |
|
122 |
|
123 /** |
|
124 * Resets state. |
|
125 */ |
|
126 void Reset(); |
|
127 |
|
128 private: // data |
|
129 |
|
130 /** |
|
131 * Dragging event down position. |
|
132 */ |
|
133 TPoint iDownPosition; |
|
134 |
|
135 /** |
|
136 * Dragging event up position. |
|
137 */ |
|
138 TPoint iUpPosition; |
|
139 |
|
140 /** |
|
141 * Vertical flick tracker. |
|
142 * Own. |
|
143 */ |
|
144 CAknPhysicsFlickTracker* iVerticalTracker; |
|
145 |
|
146 /** |
|
147 * Horizontal flick tracker. |
|
148 * Own. |
|
149 */ |
|
150 CAknPhysicsFlickTracker* iHorizontalTracker; |
|
151 |
|
152 /** |
|
153 * Boolean flag to indicate whether pointer is considered to be down. |
|
154 */ |
|
155 TBool iPointerDown; |
|
156 }; |
|
157 |
|
158 |
|
159 #endif // C_AKNPHYSICSDRAGOBSERVER_H |
|
160 |