browsercore/core/webdirectionalnavigation.h
branchGCC_SURGE
changeset 8 2e16851ffecd
parent 2 bf4420e9fa4d
parent 6 1c3b8676e58c
equal deleted inserted replaced
2:bf4420e9fa4d 8:2e16851ffecd
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef WEBDIRECTIONALNAVIGATION_H
       
    20 #define WEBDIRECTIONALNAVIGATION_H
       
    21 
       
    22 #include <qobject.h>
       
    23 #include <qevent.h>
       
    24 #include <qvector.h>
       
    25 #include <qpixmap.h>
       
    26 #include <qwebelement.h>
       
    27 
       
    28 class QWebPage;
       
    29 
       
    30 namespace WRT {
       
    31 
       
    32     class WebDirectionalNavigation : public QObject
       
    33     {
       
    34     Q_OBJECT
       
    35     public:
       
    36         WebDirectionalNavigation(QWebPage* webPage,QObject* view);
       
    37         virtual ~WebDirectionalNavigation();
       
    38 
       
    39         void install();
       
    40         void uninstall();
       
    41         void setPage( QWebPage * page){ m_webPage = page ;}
       
    42 
       
    43     signals:
       
    44         void pageScrollPositionZero();
       
    45 
       
    46     protected:
       
    47         bool eventFilter(QObject *object, QEvent *event);
       
    48         void initiallayoutCompleted();
       
    49         double calculateElementDistance(int direction, const QRect& possibleRect);
       
    50         bool nextElementInDirection(int direction);
       
    51         void scrollFrame(int direction);
       
    52         void scrollFrameOneDirection (int direction, int distance);
       
    53         void scrollCurrentFrame (int dx, int dy);
       
    54         void setCurrentFrameScrollPosition (QPoint& pos);
       
    55 
       
    56     protected:
       
    57         QWebPage* m_webPage;
       
    58         QObject* m_view;
       
    59         QWebElement m_webElement;
       
    60 		QString m_webElementStyle; 
       
    61         QPoint m_focusPoint;
       
    62     };
       
    63 
       
    64 };
       
    65 
       
    66 #endif