ginebra2/GWebTouchNavigation.h
changeset 6 1c3b8676e58c
parent 5 0f2326c2a325
equal deleted inserted replaced
5:0f2326c2a325 6:1c3b8676e58c
    38 
    38 
    39 class QWebFrame;
    39 class QWebFrame;
    40 class QWebPage;
    40 class QWebPage;
    41 class QTimer;
    41 class QTimer;
    42 class QWebElement;
    42 class QWebElement;
       
    43 class WebViewEventContext;
    43 
    44 
    44 namespace GVA
    45 namespace GVA
    45 {
    46 {
    46     class GWebContentViewWidget;
    47     class GWebContentViewWidget;
    47     class ChromeWidget;
    48     class ChromeWidget;
    84         bool enabled() const { return m_enabled; }
    85         bool enabled() const { return m_enabled; }
    85         void setEnabled(bool value) { m_enabled = value; }
    86         void setEnabled(bool value) { m_enabled = value; }
    86         void setWantSlideViewCalls(bool value) { m_wantSlideViewCalls = value; }
    87         void setWantSlideViewCalls(bool value) { m_wantSlideViewCalls = value; }
    87 
    88 
    88     signals:
    89     signals:
    89         void longPressEvent();// mouse long press signal
    90         void longPressEvent(QPoint pos);// mouse long press signal
    90         void focusElementChanged(wrtBrowserDefs::BrowserElementType &);// mouse long press signal
    91         void focusElementChanged(wrtBrowserDefs::BrowserElementType &);
    91         void pageScrollPositionZero();
    92         void pageScrollPositionZero();
    92 
    93 
    93         /// Sent when this object starts panning/scrolling the page.  Can be useful for
    94         /// Sent when this object starts panning/scrolling the page.  Can be useful for
    94         /// cancelling things like long-press timers which otherwise wouldn't get
    95         /// cancelling things like long-press timers which otherwise wouldn't get
    95         /// mouse-move events.
    96         /// mouse-move events.
    96         void startingPanGesture(int directionHint);
    97         void startingPanGesture(int directionHint);
    97         void mouseEvent(QEvent::Type type);
    98         void mouseEvent(QEvent::Type type);
    98 
    99 
       
   100         
    99     protected slots:
   101     protected slots:
   100         void scrollToEdge();
   102         void scrollToEdge();
   101         void doubleClickTimerExpired();
   103         void doubleClickTimerExpired();
   102         void timerControl();// local slot for controlling timer
   104         void onLongPressTimer();
   103         void pan();
   105         void pan();
   104         void kineticScroll();
   106         void kineticScroll();
   105         void BlockFocusChanged(QPoint pt);
   107         void BlockFocusChanged(QPoint pt);
   106         void onLoadStarted();
   108         void onLoadStarted();
   107         void onLoadFinished(bool ok);
   109         void onLoadFinished(bool ok);
   108         void onContentsSizeChanged(const QSize &);
   110         void onContentsSizeChanged(const QSize &);
       
   111         void enableDClick(bool aValue);
       
   112         
   109     protected:
   113     protected:
   110         bool eventFilter(QObject *object, QEvent *event);
   114         bool eventFilter(QObject *object, QEvent *event);
   111         void mousePressEvent(const QPoint& pos);
   115         void mousePressEvent(const QPoint& pos);
   112         void mouseMoveEvent(const QPoint& pos, const QPoint& diff);
   116         void mouseMoveEvent(const QPoint& pos, const QPoint& diff);
   113         void mouseReleaseEvent(const QPoint& pos);
   117         void mouseReleaseEvent(const QPoint& pos);
   152         bool traverseNextNode(QWebElement parentNode,QWebElement& nextNode);
   156         bool traverseNextNode(QWebElement parentNode,QWebElement& nextNode);
   153 
   157 
   154         void handleHighlightChange(QMouseEvent* ev);
   158         void handleHighlightChange(QMouseEvent* ev);
   155         bool canDehighlight(QMouseEvent* ev);
   159         bool canDehighlight(QMouseEvent* ev);
   156         void dehighlight(QMouseEvent* ev);
   160         void dehighlight(QMouseEvent* ev);
   157         void getFocusedElement();
   161         void emitFocusedElementChanged();
   158         void startTimer();
   162         void startLongPressTimer();
   159         void stopTimer();
   163         void stopLongPressTimer();
   160 
   164 
   161         void stopScrolling();
   165         void stopScrolling();
   162         void startPanGesture(PanDirection);
   166         void startPanGesture(PanDirection);
   163         void panBy(const QPointF& delta);
   167         void panBy(const QPointF& delta);
   164         void scrollCurrentFrame (int dx, int dy);
   168         void scrollCurrentFrame (int dx, int dy);
   185         QWebElement m_anchorElement;
   189         QWebElement m_anchorElement;
   186         QPoint m_higlightedPos;
   190         QPoint m_higlightedPos;
   187         bool m_ishighlighted;
   191         bool m_ishighlighted;
   188         int m_offset;
   192         int m_offset;
   189         QTimer* m_longPressTimer;// long press timer
   193         QTimer* m_longPressTimer;// long press timer
       
   194         QPoint m_longPressPosition;
   190         QPoint m_initialSpeed;
   195         QPoint m_initialSpeed;
   191         qreal m_finalzoomfactor;
   196         qreal m_finalzoomfactor;
   192         QTimer* m_scrollTimer;
   197         QTimer* m_scrollTimer;
   193         QPoint  m_scrollDelta;
   198         QPoint  m_scrollDelta;
   194         QTimer* m_kineticTimer;
   199         QTimer* m_kineticTimer;
   211         // are ignored when this flags is true to avoid activating links when
   216         // are ignored when this flags is true to avoid activating links when
   212         // the context menu is activated over them.
   217         // the context menu is activated over them.
   213         bool m_isContextEvent;
   218         bool m_isContextEvent;
   214         // Flag that governs whether calls to slideView should be made or not.
   219         // Flag that governs whether calls to slideView should be made or not.
   215         bool m_wantSlideViewCalls;
   220         bool m_wantSlideViewCalls;
       
   221         
       
   222         bool m_doubleClickEnabled;
   216     };
   223     };
   217 
   224 
   218 }
   225 }
   219 
   226 
   220 #endif
   227 #endif