browsercore/core/wrtpage.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 __WRTPAGE_H__
       
    20 #define __WRTPAGE_H__
       
    21 
       
    22 #include <QWidget>
       
    23 #include "qwebpage.h"
       
    24 
       
    25 namespace WRT {
       
    26 
       
    27 #ifdef QT_MOBILITY_BEARER_MANAGEMENT
       
    28 class WebNetworkConnectionManager;
       
    29 #endif // QT_MOBILITY_BEARER_MANAGEMENT
       
    30 
       
    31 class WrtPage : public QWebPage
       
    32 {
       
    33     Q_OBJECT
       
    34 public:
       
    35     WrtPage(QObject *parent=0);
       
    36     virtual ~WrtPage();
       
    37 
       
    38     void setPageGroupName(const QString&);
       
    39 
       
    40 public:
       
    41     virtual QWebPage* createWindow(QWebPage::WebWindowType);
       
    42     virtual void javaScriptConsoleMessage(const QString& messageSource, const QString& messageLevel, const QString& message, int lineNumber, const QString& sourceID);
       
    43 #ifdef QT_MOBILITY_BEARER_MANAGEMENT
       
    44     void setNetworkConnectionManager(WebNetworkConnectionManager *manager);
       
    45 #endif // QT_MOBILITY_BEARER_MANAGEMENT
       
    46 
       
    47 Q_SIGNALS:
       
    48     void createWindow(WrtPage* page);
       
    49     void jsConsoleMessage(const QString& messageSource, const QString& messageLevel, const QString& message, int lineNumber, const QString& sourceID);
       
    50 
       
    51 
       
    52 public slots:
       
    53     //TODO always let js run for now. This allows sunspider testsuite to finish. But it will break the infinite loop test case.
       
    54     //TODO change to true after performance is improved and each sunspider test can finish in 10s.
       
    55     bool shouldInterruptJavaScript() {
       
    56         return false;
       
    57     }
       
    58 
       
    59 private:
       
    60 #ifdef QT_MOBILITY_BEARER_MANAGEMENT
       
    61     WebNetworkConnectionManager *m_ConnectionManager;
       
    62 #endif // QT_MOBILITY_BEARER_MANAGEMENT
       
    63 };
       
    64 
       
    65 }
       
    66 #endif