18 #ifndef __WEBPOINTEREVENTHANDLER_H__ |
18 #ifndef __WEBPOINTEREVENTHANDLER_H__ |
19 #define __WEBPOINTEREVENTHANDLER_H__ |
19 #define __WEBPOINTEREVENTHANDLER_H__ |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <w32std.h> |
22 #include <w32std.h> |
|
23 #include <stmgestureinterface.h> |
23 #include "Timer.h" |
24 #include "Timer.h" |
24 #include <rt_gesturehelper.h> |
25 |
25 |
26 |
26 namespace WebCore |
27 namespace WebCore |
27 { |
28 { |
28 class Node; |
29 class Node; |
29 class Element; |
30 class Element; |
30 }; |
31 }; |
31 |
32 |
32 class WebView; |
33 class WebView; |
33 class CActiveSchedulerWait; |
34 class CActiveSchedulerWait; |
|
35 class WebGestureInterface; |
34 |
36 |
35 class WebPointerEventHandler : public CBase, public RT_GestureHelper::MGestureObserver |
37 class WebPointerEventHandler : public CBase |
36 { |
38 { |
37 public: |
39 public: |
38 static WebPointerEventHandler* NewL(WebView* view); |
40 static WebPointerEventHandler* NewL(WebView* view); |
39 void ConstructL(); |
41 void ConstructL(); |
40 virtual ~WebPointerEventHandler(); |
42 virtual ~WebPointerEventHandler(); |
41 |
43 |
42 public: |
44 public: |
43 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
45 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
44 void HandleHighlightChange(const TPoint &aPoint); |
46 void HandleHighlightChange(const TPoint &aPoint); |
45 |
47 void HandleGestureEventL(const TStmGestureEvent& aGesture); |
46 virtual void HandleGestureL( const RT_GestureHelper::TGestureEvent& aEvent ); |
|
47 |
|
48 |
48 |
49 private: |
49 private: |
50 bool checkForEventListener(WebCore::Node* node); |
50 bool checkForEventListener(WebCore::Node* node); |
51 bool canDehighlight(const TPoint &aPoint); |
51 bool canDehighlight(const TPoint &aPoint); |
52 void dehighlight(); |
52 void dehighlight(); |
53 |
53 |
54 bool isHighlitableElement(TBrCtlDefs::TBrCtlElementType& elType); |
54 bool isHighlitableElement(TBrCtlDefs::TBrCtlElementType& elType); |
55 TBrCtlDefs::TBrCtlElementType highlitableElement(); |
55 TBrCtlDefs::TBrCtlElementType highlitableElement(); |
56 void buttonDownTimerCB(WebCore::Timer<WebPointerEventHandler>* t); |
56 void buttonDownTimerCB(WebCore::Timer<WebPointerEventHandler>* t); |
57 void handleTouchDownL(const RT_GestureHelper::TGestureEvent& aEvent); |
57 void handleTouchDownL(const TStmGestureEvent& aGesture); |
58 void handleTouchUp(const RT_GestureHelper::TGestureEvent& aEvent); |
58 void handleTouchUp(const TStmGestureEvent& aGesture); |
59 void handleTapL(const RT_GestureHelper::TGestureEvent& aEvent); |
59 void handleTapL(const TStmGestureEvent& aGesture); |
60 void handleDoubleTap(const RT_GestureHelper::TGestureEvent& aEvent); |
60 void handleDoubleTap(const TStmGestureEvent& aGesture); |
61 void handleMove(const RT_GestureHelper::TGestureEvent& aEvent); |
61 void handleMove(const TStmGestureEvent& aGesture); |
62 void doTapL(); |
62 void doTapL(); |
63 void updateCursor(const TPoint& pos); |
63 void updateCursor(const TPoint& pos); |
64 void setFocusRing(); |
64 void setFocusRing(); |
|
65 void handlePinchZoomL(const TStmGestureEvent& aGesture); |
65 private: |
66 private: |
66 WebPointerEventHandler(WebView* view); |
67 WebPointerEventHandler(WebView* view); |
67 WebView* m_webview; |
68 WebView* m_webview; |
68 |
69 |
69 |
70 |
76 TPoint m_highlightPos; |
77 TPoint m_highlightPos; |
77 WebCore::Node* m_highlightedNode; |
78 WebCore::Node* m_highlightedNode; |
78 TPointerEvent m_currentEvent; |
79 TPointerEvent m_currentEvent; |
79 WebCore::Timer<WebPointerEventHandler> m_buttonDownTimer; |
80 WebCore::Timer<WebPointerEventHandler> m_buttonDownTimer; |
80 |
81 |
81 RT_GestureHelper::CGestureHelper* m_gestureHelper; |
|
82 TPointerEvent m_lastPointerEvent; |
82 TPointerEvent m_lastPointerEvent; |
83 bool m_ignoreTap; |
83 bool m_ignoreTap; |
84 CActiveSchedulerWait* m_waiter; |
84 CActiveSchedulerWait* m_waiter; |
|
85 WebGestureInterface* m_gestureInterface; |
85 |
86 |
86 }; |
87 }; |
87 |
88 |
88 |
89 |
89 |
90 |