browsercore/core/wrtbrowsercontainer.h
changeset 3 0954f5dd2cd0
parent 0 1450b09d0cfd
child 16 3c88a81ff781
--- a/browsercore/core/wrtbrowsercontainer.h	Fri May 14 15:40:36 2010 +0300
+++ b/browsercore/core/wrtbrowsercontainer.h	Tue Jun 29 00:46:29 2010 -0400
@@ -1,28 +1,30 @@
 /*
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License for more details.
 *
-* Contributors:
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program.  If not, 
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
 *
-* Description: 
+* Description:
 *
 */
 
-
 #ifndef __WRTBROWSERCONTAINER_H__
 #define __WRTBROWSERCONTAINER_H__
 
 #include "brtglobal.h"
 
-#include "qwebpage.h"
-#include "wrtpage.h"
+#include <QWebPage>
 #include "wrtbrowsercontainer_p.h"
 #include "wrtBrowserDefs.h"
 #include "ZoomMetaData.h"
@@ -42,55 +44,36 @@
 
 namespace WRT {
 
-class WrtPage;
 class WrtController;
 class WrtBrowserContainerPrivate;
 class SchemeHandler;
 class SecureUIController;
 class LoadController;
 
-class WRT_BROWSER_EXPORT WrtBrowserContainer : public WrtPage
+class WRT_BROWSER_EXPORT WrtBrowserFileChooser
+{
+public:
+    virtual ~WrtBrowserFileChooser();
+    virtual QString chooseFile(QWebFrame * parentFrame, const QString & suggestedFile) = 0;
+};
+
+class WRT_BROWSER_EXPORT WrtBrowserContainer : public QWebPage
 {
     Q_OBJECT
 public:
-   /*!
-    * enum for security Level
-    */
-    enum {
-        /**Low security*/
-        SecurityLow,
-        /**Meduium Security*/
-        SecurityMedium,
-        /**High Security*/
-        SecurityHigh
-    };
-
-public:
     static WrtBrowserContainer* createPageWithWidgetParent(QObject* parent=0,WrtBrowserContainer* page=0);
     explicit WrtBrowserContainer(QObject* parent = 0);
     virtual ~WrtBrowserContainer();
     
+    virtual WrtBrowserContainer* createWindow(QWebPage::WebWindowType);
+
     QGraphicsWidget* webWidget() const;
     void setWebWidget(QGraphicsWidget* view);
     SchemeHandler* schemeHandler() const;
 
-    int getHistoryCount() const;
-    void clearCookies();
-    bool clearNetworkCache();
-	
     QImage pageThumbnail(qreal scaleX, qreal scaley);
-    void setPageZoomFactor(qreal zoom);
-    void setPageDirtyZoomFactor(qreal zoom);
-//   TODO: Hold on this hookup after zooming and scrolling improvment	
-//    void setPageCenterZoomFactor(qreal zoom); 
-    qreal pageZoomFactor() const;
-    void setCanvasScaleFactor(qreal scaleX, qreal scaleY);
 
-    bool allowOfflineStorage(const QUrl& url);
-
-    QWebPage* createWindow(QWebPage::WebWindowType webWindowType);
     void setPageFactory(BrowserPageFactory* f);
-    wrtBrowserDefs::BrowserElementType getElementType();
 
     QString pageTitle();
     
@@ -103,13 +86,22 @@
     /* Indicates whether this is a blank window with no page loaded*/
     bool emptyWindow();
     bool restoreSession();
+
+    void setFileChooser(WrtBrowserFileChooser * chooser);
     
+    void setUpdateThumbnail(bool update) { d->m_needUpdateThumbnail = update; }
+    bool needUpdateThumbnail() { return d->m_needUpdateThumbnail; }
+
+protected:
+    virtual QString chooseFile(QWebFrame * parentFrame, const QString & suggestedFile);
+    virtual QString userAgentForUrl(const QUrl& url) const;
+
+
 Q_SIGNALS:
+
     void createNewWindow(WrtBrowserContainer* page);
-
     void pageScrollPositionZero();
 
-    void longPressEvent();
     void secureStateChange(int);
 
 public slots:
@@ -118,13 +110,10 @@
     void slotProxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *);
     
 private slots:
-    void setElementType(wrtBrowserDefs::BrowserElementType& aElType);
     void pageSecureState(int);
-    void pageZoomMetaDataChange(QWebFrame*, ZoomMetaData);
 
 private:
     WrtBrowserContainerPrivate* d;
-    wrtBrowserDefs::BrowserElementType m_elementType;
 };
 
 }