webengine/osswebengine/WebKit/s60/webview/WebPointerEventHandler.h
branchRCL_3
changeset 94 919f36ff910f
parent 93 79859ed3eea9
child 99 ca6d8a014f4b
equal deleted inserted replaced
93:79859ed3eea9 94:919f36ff910f
    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);
       
    51     bool canDehighlight(const TPoint &aPoint);
    50     bool canDehighlight(const TPoint &aPoint);
    52     void dehighlight();
    51     void dehighlight();
    53 
    52 
    54     bool isHighlitableElement(TBrCtlDefs::TBrCtlElementType& elType);
    53     bool isHighlitableElement(TBrCtlDefs::TBrCtlElementType& elType);
    55     TBrCtlDefs::TBrCtlElementType highlitableElement();
    54     TBrCtlDefs::TBrCtlElementType highlitableElement();
    56     void buttonDownTimerCB(WebCore::Timer<WebPointerEventHandler>* t);
    55     void doTouchDownL();
    57     void handleTouchDownL(const RT_GestureHelper::TGestureEvent& aEvent);
    56     void handleTouchDownL(const TStmGestureEvent& aGesture);
    58     void handleTouchUp(const RT_GestureHelper::TGestureEvent& aEvent);
    57     void handleTouchUp(const TStmGestureEvent& aGesture);
    59     void handleTapL(const RT_GestureHelper::TGestureEvent& aEvent);
    58     void handleTapL(const TStmGestureEvent& aGesture);
    60     void handleDoubleTap(const RT_GestureHelper::TGestureEvent& aEvent);
    59     void handleDoubleTap(const TStmGestureEvent& aGesture);
    61     void handleMove(const RT_GestureHelper::TGestureEvent& aEvent);
    60     void handleMove(const TStmGestureEvent& aGesture);
    62     void doTapL();
    61     void doTapL();
    63     void updateCursor(const TPoint& pos);
    62     void updateCursor(const TPoint& pos);
       
    63     void handlePinchZoomL(const TStmGestureEvent& aGesture);
       
    64     bool isPluginConsumable(const TStmGestureUid uid);
    64 private:
    65 private:
    65     WebPointerEventHandler(WebView* view);            
    66     WebPointerEventHandler(WebView* view);            
    66     WebView* m_webview;
    67     WebView* m_webview;
    67 
    68 
    68                
    69                
    73     TBool m_isHighlighted;
    74     TBool m_isHighlighted;
    74     TInt m_offset;
    75     TInt m_offset;
    75     TPoint m_highlightPos;
    76     TPoint m_highlightPos;
    76     WebCore::Node* m_highlightedNode;
    77     WebCore::Node* m_highlightedNode;
    77     TPointerEvent m_currentEvent;
    78     TPointerEvent m_currentEvent;
    78     WebCore::Timer<WebPointerEventHandler> m_buttonDownTimer; 
       
    79     
       
    80     RT_GestureHelper::CGestureHelper* m_gestureHelper;
       
    81     TPointerEvent m_lastPointerEvent;
       
    82     bool   m_ignoreTap; 
    79     bool   m_ignoreTap; 
    83     CActiveSchedulerWait*    m_waiter; 
    80     WebGestureInterface*  m_gestureInterface; 
    84     
    81     
    85 };
    82 };
    86 
    83 
    87 
    84 
    88 
    85