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> |
|
24 #include "Timer.h" |
23 #include "Timer.h" |
25 |
24 #include <rt_gesturehelper.h> |
26 |
25 |
27 namespace WebCore |
26 namespace WebCore |
28 { |
27 { |
29 class Node; |
28 class Node; |
30 class Element; |
29 class Element; |
31 }; |
30 }; |
32 |
31 |
33 class WebView; |
32 class WebView; |
34 class CActiveSchedulerWait; |
33 class CActiveSchedulerWait; |
35 class WebGestureInterface; |
|
36 |
34 |
37 class WebPointerEventHandler : public CBase |
35 class WebPointerEventHandler : public CBase, public RT_GestureHelper::MGestureObserver |
38 { |
36 { |
39 public: |
37 public: |
40 static WebPointerEventHandler* NewL(WebView* view); |
38 static WebPointerEventHandler* NewL(WebView* view); |
41 void ConstructL(); |
39 void ConstructL(); |
42 virtual ~WebPointerEventHandler(); |
40 virtual ~WebPointerEventHandler(); |
43 |
41 |
44 public: |
42 public: |
45 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
43 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
46 void HandleHighlightChange(const TPoint &aPoint); |
44 void HandleHighlightChange(const TPoint &aPoint); |
47 void HandleGestureEventL(const TStmGestureEvent& aGesture); |
45 |
|
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 TStmGestureEvent& aGesture); |
57 void handleTouchDownL(const RT_GestureHelper::TGestureEvent& aEvent); |
58 void handleTouchUp(const TStmGestureEvent& aGesture); |
58 void handleTouchUp(const RT_GestureHelper::TGestureEvent& aEvent); |
59 void handleTapL(const TStmGestureEvent& aGesture); |
59 void handleTapL(const RT_GestureHelper::TGestureEvent& aEvent); |
60 void handleDoubleTap(const TStmGestureEvent& aGesture); |
60 void handleDoubleTap(const RT_GestureHelper::TGestureEvent& aEvent); |
61 void handleMove(const TStmGestureEvent& aGesture); |
61 void handleMove(const RT_GestureHelper::TGestureEvent& aEvent); |
62 void doTapL(); |
62 void doTapL(); |
63 void updateCursor(const TPoint& pos); |
63 void updateCursor(const TPoint& pos); |
64 void setFocusRing(); |
|
65 void handlePinchZoomL(const TStmGestureEvent& aGesture); |
|
66 private: |
64 private: |
67 WebPointerEventHandler(WebView* view); |
65 WebPointerEventHandler(WebView* view); |
68 WebView* m_webview; |
66 WebView* m_webview; |
69 |
67 |
70 |
68 |
77 TPoint m_highlightPos; |
75 TPoint m_highlightPos; |
78 WebCore::Node* m_highlightedNode; |
76 WebCore::Node* m_highlightedNode; |
79 TPointerEvent m_currentEvent; |
77 TPointerEvent m_currentEvent; |
80 WebCore::Timer<WebPointerEventHandler> m_buttonDownTimer; |
78 WebCore::Timer<WebPointerEventHandler> m_buttonDownTimer; |
81 |
79 |
|
80 RT_GestureHelper::CGestureHelper* m_gestureHelper; |
82 TPointerEvent m_lastPointerEvent; |
81 TPointerEvent m_lastPointerEvent; |
83 bool m_ignoreTap; |
82 bool m_ignoreTap; |
84 CActiveSchedulerWait* m_waiter; |
83 CActiveSchedulerWait* m_waiter; |
85 WebGestureInterface* m_gestureInterface; |
|
86 |
84 |
87 }; |
85 }; |
88 |
86 |
89 |
87 |
90 |
88 |