ginebra2/ContentViews/GWebContentViewJSObject.h
changeset 3 0954f5dd2cd0
parent 0 1450b09d0cfd
child 9 b39122337a00
--- a/ginebra2/ContentViews/GWebContentViewJSObject.h	Fri May 14 15:40:36 2010 +0300
+++ b/ginebra2/ContentViews/GWebContentViewJSObject.h	Tue Jun 29 00:46:29 2010 -0400
@@ -1,26 +1,30 @@
 /*
 * Copyright (c) 2010 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".
+*
+* 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.
 *
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
+* 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 GWebContentViewJSObject_H_
 #define GWebContentViewJSObject_H_
 
 #include <QObject>
 #include "controllableviewimpl.h"
 #include "GWebContentView.h"
+#include "GSuperWebPage.h"
 
 class WebViewEventContext;
 
@@ -35,7 +39,7 @@
     GWebContentViewJSObject(GWebContentView *contentView, ::QWebFrame *chromeFrame, const QString &objectName)
       : ::ControllableViewJSObject(contentView, chromeFrame, objectName)
     {
-      qDebug() << "GWebContentViewJSObject::GWebContentViewJSObject: " << this;
+      //qDebug() << "GWebContentViewJSObject::GWebContentViewJSObject: " << this;
     }
 
     qreal getZoomFactor() const { return webContentViewConst()->getZoomFactor(); }
@@ -48,8 +52,24 @@
     /*! This property holds whether touch navigation is enabled.
      */
     Q_PROPERTY(bool gesturesEnabled READ getGesturesEnabled WRITE setGesturesEnabled)
-    bool getGesturesEnabled() const { return webContentViewConst()->gesturesEnabled(); }
-    void setGesturesEnabled(bool value) { webContentView()->setGesturesEnabled(value); }
+    bool getGesturesEnabled() const
+    {
+#ifdef BEDROCK_TILED_BACKING_STORE
+        return false;
+#else
+        return webContentViewConst()->gesturesEnabled();
+#endif
+    }
+    void setGesturesEnabled(bool value)
+    {
+#ifndef BEDROCK_TILED_BACKING_STORE
+        webContentView()->setGesturesEnabled(value);
+#endif
+    }
+
+    Q_PROPERTY(bool enabled WRITE setEnabled READ enabled)
+    bool enabled() const { return webContentViewConst()->enabled(); }
+    void setEnabled(bool value) { webContentView()->setEnabled(value); }
 
 public slots:
     void loadUrlToCurrentPage(const QString & url)
@@ -58,13 +78,16 @@
     void back() { webContentView()->back(); }
     void forward() { webContentView()->forward(); }
     void reload() { webContentView()->reload(); }
+#ifndef BEDROCK_TILED_BACKING_STORE
     void zoomIn(qreal deltaPercent = 0.1) { webContentView()->zoomIn(deltaPercent); }
     void zoomOut(qreal deltaPercent = 0.1) { webContentView()->zoomOut(deltaPercent); }
     void zoomBy(qreal delta) { zoomIn(delta); }
+#endif	
     void zoom(bool in) { webContentView()->zoom(in); }
     void toggleZoom() { webContentView()->toggleZoom(); }
     void stopZoom() { webContentView()->stopZoom(); }
     void scrollBy(int deltaX, int deltaY) { webContentView()->scrollBy(deltaX, deltaY); }
+    void scrollTo(int x, int y) { webContentView()->scrollTo(x, y); }
     int scrollX() { return webContentView()->scrollX(); }
     int scrollY() { return webContentView()->scrollY(); }
     int contentWidth() { return webContentView()->contentWidth(); }
@@ -72,17 +95,29 @@
     void showNormalPage() { return webContentView()->showNormalPage(); }
     bool currentPageIsSuperPage() { return webContentView()->currentPageIsSuperPage(); }
     void dump() { return webContentView()->dump(); }
-    
+    bool frozen() const { return webContentViewConst()->frozen(); }
+    void freeze() { return webContentView()->freeze(); }
+    void unfreeze() { return webContentView()->unfreeze(); }
+
     // Super page slots.
-    QObject * createSuperPage(const QString &name) { return webContentView()->createSuperPage(name); }
+    QObject * createSuperPage(const QString &name, bool persist=false) { return webContentView()->createSuperPage(name, persist); }
     void destroySuperPage(const QString &name) { webContentView()->destroySuperPage(name); }
     void setCurrentSuperPage(const QString &name) { webContentView()->setCurrentSuperPage(name); }
     QObject * currentSuperPage() { return webContentView()->currentSuperPage(); }
-	QString currentSuperPageName() { return webContentView()->currentSuperPage()->objectName(); }
+    QString currentSuperPageName() { return webContentView()->currentSuperPage()->objectName(); }
     void showSuperPage(const QString &name) { webContentView()->showSuperPage(name); }
     QObject * superPage(const QString &name) { return webContentView()->superPage(name); }
     bool isSuperPage(const QString &name) { return webContentView()->isSuperPage(name); }
 
+    bool bedrockTiledBackingStoreEnabled() 
+    {
+#ifdef BEDROCK_TILED_BACKING_STORE
+        return true;
+#else
+        return false;
+#endif
+    }
+
 signals:
     void ContextChanged();
     void iconChanged();
@@ -102,6 +137,8 @@
     void onDisplayModeChanged(const QString &orientation);
 
     void contextEvent(QObject *context);
+	void superPageShown(const QString &name);
+    
 
 private slots:
     void statusBarMessage( const QString & text );