summaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2010-06-18 12:22:13 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2010-06-18 12:23:45 (GMT)
commit8f1def139d6eaf99c22b43536d056964e0d41245 (patch)
tree8bfa47eb4a9632bebe45f8896c511c6833ea84f9 /src/imports
parent0ce072e74aea546852b6bb4b7f0c0fe0e2678aa5 (diff)
downloadQt-8f1def139d6eaf99c22b43536d056964e0d41245.zip
Qt-8f1def139d6eaf99c22b43536d056964e0d41245.tar.gz
Qt-8f1def139d6eaf99c22b43536d056964e0d41245.tar.bz2
Remove the old WebView element in src/import. The new one is in src/3rdparty/webkit
Also change a bit the demo due to a little API change. The module is not org.webkit but QtWebKit now. Reviewed-by:simon hausmann
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/webkit/plugin.cpp67
-rw-r--r--src/imports/webkit/qdeclarativewebview.cpp1212
-rw-r--r--src/imports/webkit/qdeclarativewebview_p.h300
-rw-r--r--src/imports/webkit/qdeclarativewebview_p_p.h151
-rw-r--r--src/imports/webkit/qmldir1
-rw-r--r--src/imports/webkit/webkit.pro27
7 files changed, 0 insertions, 1760 deletions
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 7f9331a..5e50b08 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -2,5 +2,3 @@ TEMPLATE = subdirs
SUBDIRS += folderlistmodel particles gestures
-contains(QT_CONFIG, webkit): SUBDIRS += webkit
-
diff --git a/src/imports/webkit/plugin.cpp b/src/imports/webkit/plugin.cpp
deleted file mode 100644
index c8e56ba..0000000
--- a/src/imports/webkit/plugin.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
-#include <QtDeclarative/qdeclarative.h>
-
-#include "qdeclarativewebview_p.h"
-#include "qdeclarativewebview_p_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class WebKitQmlPlugin : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-public:
- virtual void registerTypes(const char *uri)
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("org.webkit"));
- qmlRegisterType<QDeclarativeWebSettings>();
- qmlRegisterType<QDeclarativeWebView>(uri,1,0,"WebView");
- }
-};
-
-QT_END_NAMESPACE
-
-#include "plugin.moc"
-
-Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin));
-
diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp
deleted file mode 100644
index 383f1ce..0000000
--- a/src/imports/webkit/qdeclarativewebview.cpp
+++ /dev/null
@@ -1,1212 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativewebview_p.h"
-#include "qdeclarativewebview_p_p.h"
-
-#include <qdeclarative.h>
-#include <qdeclarativeengine.h>
-#include <qdeclarativecontext.h>
-
-#include <QDebug>
-#include <QPen>
-#include <QFile>
-#include <QEvent>
-#include <QMouseEvent>
-#include <QKeyEvent>
-#include <QBasicTimer>
-#include <QApplication>
-#include <QGraphicsSceneMouseEvent>
-#include <QtWebKit/QWebPage>
-#include <QtWebKit/QWebFrame>
-#include <QtWebKit/QWebElement>
-#include <QtWebKit/QWebSettings>
-
-QT_BEGIN_NAMESPACE
-
-static const int MAX_DOUBLECLICK_TIME=500; // XXX need better gesture system
-
-class QDeclarativeWebViewPrivate
-{
-public:
- QDeclarativeWebViewPrivate(QDeclarativeWebView* qq)
- : q(qq), page(0), preferredwidth(0), preferredheight(0),
- progress(1.0), status(QDeclarativeWebView::Null), pending(PendingNone),
- newWindowComponent(0), newWindowParent(0),
- pressTime(400),
- rendering(true)
- {
- QObject::connect(q, SIGNAL(focusChanged(bool)), q, SLOT(propagateFocusToWebPage(bool)));
- }
-
- QDeclarativeWebView *q;
-
- QUrl url; // page url might be different if it has not loaded yet
- QWebPage *page;
- QGraphicsWebView* view;
-
- int preferredwidth, preferredheight;
- qreal progress;
- QDeclarativeWebView::Status status;
- QString statusText;
- enum { PendingNone, PendingUrl, PendingHtml, PendingContent } pending;
- QUrl pending_url;
- QString pending_string;
- QByteArray pending_data;
- mutable QDeclarativeWebSettings settings;
- QDeclarativeComponent *newWindowComponent;
- QDeclarativeItem *newWindowParent;
-
- QBasicTimer pressTimer;
- QPoint pressPoint;
- int pressTime; // milliseconds before it's a "hold"
-
- static void windowObjects_append(QDeclarativeListProperty<QObject> *prop, QObject *o) {
- static_cast<QDeclarativeWebViewPrivate *>(prop->data)->windowObjects.append(o);
- static_cast<QDeclarativeWebViewPrivate *>(prop->data)->updateWindowObjects();
- }
-
- void updateWindowObjects();
- QObjectList windowObjects;
-
- bool rendering;
-};
-
-/*!
- \qmlclass WebView QDeclarativeWebView
- \since 4.7
- \brief The WebView item allows you to add web content to a canvas.
- \inherits Item
-
- A WebView renders web content based on a URL.
-
- This type is made available by importing the \c org.webkit module:
-
- \bold{import org.webkit 1.0}
-
- If the width and height of the item is not set, they will
- dynamically adjust to a size appropriate for the content.
- This width may be large for typical online web pages.
-
- If the width or height is explictly set, the rendered website
- will be clipped, not scaled, to fit into the set dimensions.
-
- If the preferredWidth is set, the width will be this amount or larger,
- usually laying out the web content to fit the preferredWidth.
-
- \qml
- import org.webkit 1.0
-
- WebView {
- url: "http://www.nokia.com"
- preferredWidth: 490
- preferredHeight: 400
- scale: 0.5
- smooth: false
- smoothCache: true
- }
- \endqml
-
- \image webview.png
-
- The item includes no scrolling, scaling,
- toolbars, etc., those must be implemented around WebView. See the WebBrowser example
- for a demonstration of this.
-
- When this item has keyboard focus, all keyboard input will be sent directly to the
- web page within.
-*/
-
-/*!
- \internal
- \class QDeclarativeWebView
- \brief The QDeclarativeWebView class allows you to add web content to a QDeclarativeView.
-
- A WebView renders web content base on a URL.
-
- \image webview.png
-
- The item includes no scrolling, scaling,
- toolbars, etc., those must be implemented around WebView. See the WebBrowser example
- for a demonstration of this.
-
- A QDeclarativeWebView object can be instantiated in Qml using the tag \l WebView.
-*/
-
-QDeclarativeWebView::QDeclarativeWebView(QDeclarativeItem *parent)
- : QDeclarativeItem(parent)
-{
- init();
-}
-
-QDeclarativeWebView::~QDeclarativeWebView()
-{
- delete d->page;
- delete d;
-}
-
-void QDeclarativeWebView::init()
-{
- d = new QDeclarativeWebViewPrivate(this);
-
- QWebSettings::enablePersistentStorage();
-
- setAcceptHoverEvents(true);
- setAcceptedMouseButtons(Qt::LeftButton);
- setFlag(QGraphicsItem::ItemHasNoContents, true);
- setClip(true);
-
- d->page = 0;
- d->view = new QGraphicsWebView(this);
- d->view->setResizesToContents(true);
- d->view->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
- connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize()));
- connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged()));
-}
-
-void QDeclarativeWebView::componentComplete()
-{
- QDeclarativeItem::componentComplete();
- switch (d->pending) {
- case QDeclarativeWebViewPrivate::PendingUrl:
- setUrl(d->pending_url);
- break;
- case QDeclarativeWebViewPrivate::PendingHtml:
- setHtml(d->pending_string, d->pending_url);
- break;
- case QDeclarativeWebViewPrivate::PendingContent:
- setContent(d->pending_data, d->pending_string, d->pending_url);
- break;
- default:
- break;
- }
- d->pending = QDeclarativeWebViewPrivate::PendingNone;
- d->updateWindowObjects();
-}
-
-QDeclarativeWebView::Status QDeclarativeWebView::status() const
-{
- return d->status;
-}
-
-
-/*!
- \qmlproperty real WebView::progress
- This property holds the progress of loading the current URL, from 0 to 1.
-
- If you just want to know when progress gets to 1, use
- WebView::onLoadFinished() or WebView::onLoadFailed() instead.
-*/
-qreal QDeclarativeWebView::progress() const
-{
- return d->progress;
-}
-
-void QDeclarativeWebView::doLoadStarted()
-{
-
- if (!d->url.isEmpty()) {
- d->status = Loading;
- emit statusChanged(d->status);
- }
- emit loadStarted();
-}
-
-void QDeclarativeWebView::doLoadProgress(int p)
-{
- if (d->progress == p/100.0)
- return;
- d->progress = p/100.0;
- emit progressChanged();
-}
-
-void QDeclarativeWebView::pageUrlChanged()
-{
- updateContentsSize();
-
- if ((d->url.isEmpty() && page()->mainFrame()->url() != QUrl(QLatin1String("about:blank")))
- || (d->url != page()->mainFrame()->url() && !page()->mainFrame()->url().isEmpty()))
- {
- d->url = page()->mainFrame()->url();
- if (d->url == QUrl(QLatin1String("about:blank")))
- d->url = QUrl();
- emit urlChanged();
- }
-}
-
-void QDeclarativeWebView::doLoadFinished(bool ok)
-{
-
- if (title().isEmpty())
- pageUrlChanged(); // XXX bug 232556 - pages with no title never get urlChanged()
-
- if (ok) {
- d->status = d->url.isEmpty() ? Null : Ready;
- emit loadFinished();
- } else {
- d->status = Error;
- emit loadFailed();
- }
- emit statusChanged(d->status);
-}
-
-/*!
- \qmlproperty url WebView::url
- This property holds the URL to the page displayed in this item. It can be set,
- but also can change spontaneously (eg. because of network redirection).
-
- If the url is empty, the page is blank.
-
- The url is always absolute (QML will resolve relative URL strings in the context
- of the containing QML document).
-*/
-QUrl QDeclarativeWebView::url() const
-{
- return d->url;
-}
-
-void QDeclarativeWebView::setUrl(const QUrl &url)
-{
- if (url == d->url)
- return;
-
- if (isComponentComplete()) {
- d->url = url;
- updateContentsSize();
- QUrl seturl = url;
- if (seturl.isEmpty())
- seturl = QUrl(QLatin1String("about:blank"));
-
- Q_ASSERT(!seturl.isRelative());
-
- page()->mainFrame()->load(seturl);
-
- emit urlChanged();
- } else {
- d->pending = d->PendingUrl;
- d->pending_url = url;
- }
-}
-
-/*!
- \qmlproperty int WebView::preferredWidth
- This property holds the ideal width for displaying the current URL.
-*/
-int QDeclarativeWebView::preferredWidth() const
-{
- return d->preferredwidth;
-}
-
-void QDeclarativeWebView::setPreferredWidth(int iw)
-{
- if (d->preferredwidth == iw) return;
- d->preferredwidth = iw;
- updateContentsSize();
- emit preferredWidthChanged();
-}
-
-/*!
- \qmlproperty int WebView::preferredHeight
- This property holds the ideal height for displaying the current URL.
- This only affects the area zoomed by heuristicZoom().
-*/
-int QDeclarativeWebView::preferredHeight() const
-{
- return d->preferredheight;
-}
-
-void QDeclarativeWebView::setPreferredHeight(int ih)
-{
- if (d->preferredheight == ih) return;
- d->preferredheight = ih;
- updateContentsSize();
- emit preferredHeightChanged();
-}
-
-/*!
- \qmlmethod bool WebView::evaluateJavaScript(string)
-
- Evaluates the \a scriptSource JavaScript inside the context of the
- main web frame, and returns the result of the last executed statement.
-
- Note that this JavaScript does \e not have any access to QML objects
- except as made available as windowObjects.
-*/
-QVariant QDeclarativeWebView::evaluateJavaScript(const QString &scriptSource)
-{
- return this->page()->mainFrame()->evaluateJavaScript(scriptSource);
-}
-
-void QDeclarativeWebView::propagateFocusToWebPage(bool hasFocus)
-{
- QFocusEvent e(hasFocus ? QEvent::FocusIn : QEvent::FocusOut);
- page()->event(&e);
-}
-
-void QDeclarativeWebView::updateDeclarativeWebViewSize()
-{
- QSizeF size = d->view->geometry().size() * contentsScale();
- setImplicitWidth(size.width());
- setImplicitHeight(size.height());
-}
-
-void QDeclarativeWebView::initialLayout()
-{
- // nothing useful to do at this point
-}
-
-void QDeclarativeWebView::updateContentsSize()
-{
- if (d->page)
- d->page->setPreferredContentsSize(QSize(
- d->preferredwidth>0 ? d->preferredwidth : width(),
- d->preferredheight>0 ? d->preferredheight : height()));
-}
-
-void QDeclarativeWebView::geometryChanged(const QRectF &newGeometry,
- const QRectF &oldGeometry)
-{
- if (newGeometry.size() != oldGeometry.size() && d->page) {
- QSize cs = d->page->preferredContentsSize();
- if (widthValid())
- cs.setWidth(width());
- if (heightValid())
- cs.setHeight(height());
- if (cs != d->page->preferredContentsSize())
- d->page->setPreferredContentsSize(cs);
- }
- QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
-}
-
-/*!
- \qmlproperty list<object> WebView::javaScriptWindowObjects
-
- A list of QML objects to expose to the web page.
-
- Each object will be added as a property of the web frame's window object. The
- property name is controlled by the value of \c WebView.windowObjectName
- attached property.
-
- Exposing QML objects to a web page allows JavaScript executing in the web
- page itself to communicate with QML, by reading and writing properties and
- by calling methods of the exposed QML objects.
-
- This example shows how to call into a QML method using a window object.
-
- \qml
- WebView {
- javaScriptWindowObjects: QtObject {
- WebView.windowObjectName: "qml"
-
- function qmlCall() {
- console.log("This call is in QML!");
- }
- }
-
- html: "<script>console.log(\"This is in WebKit!\"); window.qml.qmlCall();</script>"
- }
- \endqml
-
- The output of the example will be:
- \code
- This is in WebKit!
- This call is in QML!
- \endcode
-
- If Javascript is not enabled for the page, then this property does nothing.
-*/
-QDeclarativeListProperty<QObject> QDeclarativeWebView::javaScriptWindowObjects()
-{
- return QDeclarativeListProperty<QObject>(this, d, &QDeclarativeWebViewPrivate::windowObjects_append);
-}
-
-QDeclarativeWebViewAttached *QDeclarativeWebView::qmlAttachedProperties(QObject *o)
-{
- return new QDeclarativeWebViewAttached(o);
-}
-
-void QDeclarativeWebViewPrivate::updateWindowObjects()
-{
- if (!q->isComponentCompletePublic() || !page)
- return;
-
- for (int ii = 0; ii < windowObjects.count(); ++ii) {
- QObject *object = windowObjects.at(ii);
- QDeclarativeWebViewAttached *attached = static_cast<QDeclarativeWebViewAttached *>(qmlAttachedPropertiesObject<QDeclarativeWebView>(object));
- if (attached && !attached->windowObjectName().isEmpty()) {
- page->mainFrame()->addToJavaScriptWindowObject(attached->windowObjectName(), object);
- }
- }
-}
-
-bool QDeclarativeWebView::renderingEnabled() const
-{
- return d->rendering;
-}
-
-void QDeclarativeWebView::setRenderingEnabled(bool enabled)
-{
- if (d->rendering == enabled)
- return;
- d->rendering = enabled;
- emit renderingEnabledChanged();
-
- d->view->setTiledBackingStoreFrozen(!enabled);
-}
-
-QMouseEvent *QDeclarativeWebView::sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent *e)
-{
- QEvent::Type t;
- switch(e->type()) {
- default:
- case QEvent::GraphicsSceneMousePress:
- t = QEvent::MouseButtonPress;
- break;
- case QEvent::GraphicsSceneMouseRelease:
- t = QEvent::MouseButtonRelease;
- break;
- case QEvent::GraphicsSceneMouseMove:
- t = QEvent::MouseMove;
- break;
- case QGraphicsSceneEvent::GraphicsSceneMouseDoubleClick:
- t = QEvent::MouseButtonDblClick;
- break;
- }
-
- QMouseEvent *me = new QMouseEvent(t, (e->pos()/contentsScale()).toPoint(), e->button(), e->buttons(), 0);
- return me;
-}
-
-QMouseEvent *QDeclarativeWebView::sceneHoverMoveEventToMouseEvent(QGraphicsSceneHoverEvent *e)
-{
- QEvent::Type t = QEvent::MouseMove;
-
- QMouseEvent *me = new QMouseEvent(t, (e->pos()/contentsScale()).toPoint(), Qt::NoButton, Qt::NoButton, 0);
-
- return me;
-}
-
-/*!
- \qmlsignal WebView::onDoubleClick(clickx,clicky)
-
- The WebView does not pass double-click events to the web engine, but rather
- emits this signals.
-*/
-
-void QDeclarativeWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
-{
- QMouseEvent *me = sceneMouseEventToMouseEvent(event);
- emit doubleClick(me->x(),me->y());
- delete me;
-}
-
-/*!
- \qmlmethod bool WebView::heuristicZoom(clickX,clickY,maxzoom)
-
- Finds a zoom that:
- \list
- \i shows a whole item
- \i includes (\a clickX, \a clickY)
- \i fits into the preferredWidth and preferredHeight
- \i zooms by no more than \a maxzoom
- \i is more than 10% above the current zoom
- \endlist
-
- If such a zoom exists, emits zoomTo(zoom,centerX,centerY) and returns true; otherwise,
- no signal is emitted and returns false.
-*/
-bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxzoom)
-{
- if (contentsScale() >= maxzoom/zoomFactor())
- return false;
- qreal ozf = contentsScale();
- QRect showarea = elementAreaAt(clickX, clickY, d->preferredwidth/maxzoom, d->preferredheight/maxzoom);
- qreal z = qMin(qreal(d->preferredwidth)/showarea.width(),qreal(d->preferredheight)/showarea.height());
- if (z > maxzoom/zoomFactor())
- z = maxzoom/zoomFactor();
- if (z/ozf > 1.2) {
- QRectF r(showarea.left()*z, showarea.top()*z, showarea.width()*z, showarea.height()*z);
- emit zoomTo(z,r.x()+r.width()/2, r.y()+r.height()/2);
- return true;
- } else {
- return false;
- }
-}
-
-/*!
- \qmlproperty int WebView::pressGrabTime
-
- The number of milliseconds the user must press before the WebView
- starts passing move events through to the web engine (rather than
- letting other QML elements such as a Flickable take them).
-
- Defaults to 400ms. Set to 0 to always grab and pass move events to
- the web engine.
-*/
-int QDeclarativeWebView::pressGrabTime() const
-{
- return d->pressTime;
-}
-
-void QDeclarativeWebView::setPressGrabTime(int ms)
-{
- if (d->pressTime == ms)
- return;
- d->pressTime = ms;
- emit pressGrabTimeChanged();
-}
-
-void QDeclarativeWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- setFocus (true);
- QMouseEvent *me = sceneMouseEventToMouseEvent(event);
-
- d->pressPoint = me->pos();
- if (d->pressTime) {
- d->pressTimer.start(d->pressTime,this);
- setKeepMouseGrab(false);
- } else {
- grabMouse();
- setKeepMouseGrab(true);
- }
-
- page()->event(me);
- event->setAccepted(
-/*
- It is not correct to send the press event upwards, if it is not accepted by WebKit
- e.g. push button does not work, if done so as QGraphicsScene will not send the release event at all to WebKit
- Might be a bug in WebKit, though
- */
-#if 1 //QT_VERSION <= 0x040500 // XXX see bug 230835
- true
-#else
- me->isAccepted()
-#endif
- );
- delete me;
- if (!event->isAccepted()) {
- QDeclarativeItem::mousePressEvent(event);
- }
-}
-
-void QDeclarativeWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- QMouseEvent *me = sceneMouseEventToMouseEvent(event);
- page()->event(me);
- d->pressTimer.stop();
- event->setAccepted(
-/*
- It is not correct to send the press event upwards, if it is not accepted by WebKit
- e.g. push button does not work, if done so as QGraphicsScene will not send all the events to WebKit
- */
-#if 1 //QT_VERSION <= 0x040500 // XXX see bug 230835
- true
-#else
- me->isAccepted()
-#endif
- );
- delete me;
- if (!event->isAccepted()) {
- QDeclarativeItem::mouseReleaseEvent(event);
- }
- setKeepMouseGrab(false);
- ungrabMouse();
-}
-
-void QDeclarativeWebView::timerEvent(QTimerEvent *event)
-{
- if (event->timerId() == d->pressTimer.timerId()) {
- d->pressTimer.stop();
- grabMouse();
- setKeepMouseGrab(true);
- }
-}
-
-void QDeclarativeWebView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- QMouseEvent *me = sceneMouseEventToMouseEvent(event);
- if (d->pressTimer.isActive()) {
- if ((me->pos() - d->pressPoint).manhattanLength() > QApplication::startDragDistance()) {
- d->pressTimer.stop();
- }
- }
- if (keepMouseGrab()) {
- page()->event(me);
- event->setAccepted(
-/*
- It is not correct to send the press event upwards, if it is not accepted by WebKit
- e.g. push button does not work, if done so as QGraphicsScene will not send the release event at all to WebKit
- Might be a bug in WebKit, though
- */
-#if 1 // QT_VERSION <= 0x040500 // XXX see bug 230835
- true
-#else
- me->isAccepted()
-#endif
- );
- }
- delete me;
- if (!event->isAccepted())
- QDeclarativeItem::mouseMoveEvent(event);
-}
-
-void QDeclarativeWebView::hoverMoveEvent (QGraphicsSceneHoverEvent * event)
-{
- QMouseEvent *me = sceneHoverMoveEventToMouseEvent(event);
- page()->event(me);
- event->setAccepted(
-#if QT_VERSION <= 0x040500 // XXX see bug 230835
- true
-#else
- me->isAccepted()
-#endif
- );
- delete me;
- if (!event->isAccepted())
- QDeclarativeItem::hoverMoveEvent(event);
-}
-
-bool QDeclarativeWebView::sceneEvent(QEvent *event)
-{
- if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)//Key events go to the page
- return page()->event(event);
- return QDeclarativeItem::sceneEvent(event);
-}
-
-#ifndef QT_NO_ACTION
-/*!
- \qmlproperty action WebView::back
- This property holds the action for causing the previous URL in the history to be displayed.
-*/
-QAction *QDeclarativeWebView::backAction() const
-{
- return page()->action(QWebPage::Back);
-}
-
-/*!
- \qmlproperty action WebView::forward
- This property holds the action for causing the next URL in the history to be displayed.
-*/
-QAction *QDeclarativeWebView::forwardAction() const
-{
- return page()->action(QWebPage::Forward);
-}
-
-/*!
- \qmlproperty action WebView::reload
- This property holds the action for reloading with the current URL
-*/
-QAction *QDeclarativeWebView::reloadAction() const
-{
- return page()->action(QWebPage::Reload);
-}
-
-/*!
- \qmlproperty action WebView::stop
- This property holds the action for stopping loading with the current URL
-*/
-QAction *QDeclarativeWebView::stopAction() const
-{
- return page()->action(QWebPage::Stop);
-}
-#endif // QT_NO_ACTION
-
-/*!
- \qmlproperty real WebView::title
- This property holds the title of the web page currently viewed
-
- By default, this property contains an empty string.
-*/
-QString QDeclarativeWebView::title() const
-{
- return page()->mainFrame()->title();
-}
-
-
-
-/*!
- \qmlproperty pixmap WebView::icon
- This property holds the icon associated with the web page currently viewed
-*/
-QPixmap QDeclarativeWebView::icon() const
-{
- return page()->mainFrame()->icon().pixmap(QSize(256,256));
-}
-
-
-/*!
- \qmlproperty real WebView::zoomFactor
- This property holds the multiplier used to scale the contents of a Web page.
-*/
-void QDeclarativeWebView::setZoomFactor(qreal factor)
-{
- if (factor == page()->mainFrame()->zoomFactor())
- return;
-
- page()->mainFrame()->setZoomFactor(factor);
- updateContentsSize();
-
- emit zoomFactorChanged();
-}
-
-qreal QDeclarativeWebView::zoomFactor() const
-{
- return page()->mainFrame()->zoomFactor();
-}
-
-/*!
- \qmlproperty string WebView::statusText
-
- This property is the current status suggested by the current web page. In a web browser,
- such status is often shown in some kind of status bar.
-*/
-void QDeclarativeWebView::setStatusText(const QString& s)
-{
- d->statusText = s;
- emit statusTextChanged();
-}
-
-void QDeclarativeWebView::windowObjectCleared()
-{
- d->updateWindowObjects();
-}
-
-QString QDeclarativeWebView::statusText() const
-{
- return d->statusText;
-}
-
-QWebPage *QDeclarativeWebView::page() const
-{
-
- if (!d->page) {
- QDeclarativeWebView *self = const_cast<QDeclarativeWebView*>(this);
- QWebPage *wp = new QDeclarativeWebPage(self);
-
- wp->setNetworkAccessManager(qmlEngine(this)->networkAccessManager());
-
- self->setPage(wp);
-
- return wp;
- }
-
- return d->page;
-}
-
-
-// The QObject interface to settings().
-/*!
- \qmlproperty string WebView::settings.standardFontFamily
- \qmlproperty string WebView::settings.fixedFontFamily
- \qmlproperty string WebView::settings.serifFontFamily
- \qmlproperty string WebView::settings.sansSerifFontFamily
- \qmlproperty string WebView::settings.cursiveFontFamily
- \qmlproperty string WebView::settings.fantasyFontFamily
-
- \qmlproperty int WebView::settings.minimumFontSize
- \qmlproperty int WebView::settings.minimumLogicalFontSize
- \qmlproperty int WebView::settings.defaultFontSize
- \qmlproperty int WebView::settings.defaultFixedFontSize
-
- \qmlproperty bool WebView::settings.autoLoadImages
- \qmlproperty bool WebView::settings.javascriptEnabled
- \qmlproperty bool WebView::settings.javaEnabled
- \qmlproperty bool WebView::settings.pluginsEnabled
- \qmlproperty bool WebView::settings.privateBrowsingEnabled
- \qmlproperty bool WebView::settings.javascriptCanOpenWindows
- \qmlproperty bool WebView::settings.javascriptCanAccessClipboard
- \qmlproperty bool WebView::settings.developerExtrasEnabled
- \qmlproperty bool WebView::settings.linksIncludedInFocusChain
- \qmlproperty bool WebView::settings.zoomTextOnly
- \qmlproperty bool WebView::settings.printElementBackgrounds
- \qmlproperty bool WebView::settings.offlineStorageDatabaseEnabled
- \qmlproperty bool WebView::settings.offlineWebApplicationCacheEnabled
- \qmlproperty bool WebView::settings.localStorageDatabaseEnabled
- \qmlproperty bool WebView::settings.localContentCanAccessRemoteUrls
-
- These properties give access to the settings controlling the web view.
-
- See QWebSettings for details of these properties.
-
- \qml
- WebView {
- settings.pluginsEnabled: true
- settings.standardFontFamily: "Arial"
- ...
- }
- \endqml
-*/
-QDeclarativeWebSettings *QDeclarativeWebView::settingsObject() const
-{
- d->settings.s = page()->settings();
- return &d->settings;
-}
-
-void QDeclarativeWebView::setPage(QWebPage *page)
-{
- if (d->page == page)
- return;
- if (d->page) {
- if (d->page->parent() == this) {
- delete d->page;
- } else {
- d->page->disconnect(this);
- }
- }
- d->page = page;
- updateContentsSize();
- d->page->mainFrame()->setScrollBarPolicy(Qt::Horizontal,Qt::ScrollBarAlwaysOff);
- d->page->mainFrame()->setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff);
- connect(d->page->mainFrame(),SIGNAL(urlChanged(QUrl)),this,SLOT(pageUrlChanged()));
- connect(d->page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
- connect(d->page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(iconChanged()));
- connect(d->page->mainFrame(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
- connect(d->page->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayout()));
- connect(d->page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SIGNAL(contentsSizeChanged(QSize)));
-
- connect(d->page,SIGNAL(loadStarted()),this,SLOT(doLoadStarted()));
- connect(d->page,SIGNAL(loadProgress(int)),this,SLOT(doLoadProgress(int)));
- connect(d->page,SIGNAL(loadFinished(bool)),this,SLOT(doLoadFinished(bool)));
- connect(d->page,SIGNAL(statusBarMessage(QString)),this,SLOT(setStatusText(QString)));
-
- connect(d->page->mainFrame(),SIGNAL(javaScriptWindowObjectCleared()),this,SLOT(windowObjectCleared()));
-
- d->page->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true);
-
- d->view->setPage(page);
-}
-
-/*!
- \qmlsignal WebView::onLoadStarted()
-
- This handler is called when the web engine begins loading
- a page. Later, WebView::onLoadFinished() or WebView::onLoadFailed()
- will be emitted.
-*/
-
-/*!
- \qmlsignal WebView::onLoadFinished()
-
- This handler is called when the web engine \e successfully
- finishes loading a page, including any component content
- (WebView::onLoadFailed() will be emitted otherwise).
-
- \sa progress
-*/
-
-/*!
- \qmlsignal WebView::onLoadFailed()
-
- This handler is called when the web engine fails loading
- a page or any component content
- (WebView::onLoadFinished() will be emitted on success).
-*/
-
-void QDeclarativeWebView::load(const QNetworkRequest &request,
- QNetworkAccessManager::Operation operation,
- const QByteArray &body)
-{
- page()->mainFrame()->load(request, operation, body);
-}
-
-QString QDeclarativeWebView::html() const
-{
- return page()->mainFrame()->toHtml();
-}
-
-/*!
- \qmlproperty string WebView::html
- This property holds HTML text set directly
-
- The html property can be set as a string.
-
- \qml
- WebView {
- html: "<p>This is <b>HTML</b>."
- }
- \endqml
-*/
-void QDeclarativeWebView::setHtml(const QString &html, const QUrl &baseUrl)
-{
- updateContentsSize();
- if (isComponentComplete())
- page()->mainFrame()->setHtml(html, baseUrl);
- else {
- d->pending = d->PendingHtml;
- d->pending_url = baseUrl;
- d->pending_string = html;
- }
- emit htmlChanged();
-}
-
-void QDeclarativeWebView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
-{
- updateContentsSize();
-
- if (isComponentComplete())
- page()->mainFrame()->setContent(data,mimeType,qmlContext(this)->resolvedUrl(baseUrl));
- else {
- d->pending = d->PendingContent;
- d->pending_url = baseUrl;
- d->pending_string = mimeType;
- d->pending_data = data;
- }
-}
-
-QWebHistory *QDeclarativeWebView::history() const
-{
- return page()->history();
-}
-
-QWebSettings *QDeclarativeWebView::settings() const
-{
- return page()->settings();
-}
-
-QDeclarativeWebView *QDeclarativeWebView::createWindow(QWebPage::WebWindowType type)
-{
- switch (type) {
- case QWebPage::WebBrowserWindow: {
- if (!d->newWindowComponent && d->newWindowParent)
- qWarning("WebView::newWindowComponent not set - WebView::newWindowParent ignored");
- else if (d->newWindowComponent && !d->newWindowParent)
- qWarning("WebView::newWindowParent not set - WebView::newWindowComponent ignored");
- else if (d->newWindowComponent && d->newWindowParent) {
- QDeclarativeWebView *webview = 0;
- QDeclarativeContext *windowContext = new QDeclarativeContext(qmlContext(this));
-
- QObject *nobj = d->newWindowComponent->create(windowContext);
- if (nobj) {
- windowContext->setParent(nobj);
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(nobj);
- if (!item) {
- delete nobj;
- } else {
- webview = item->findChild<QDeclarativeWebView*>();
- if (!webview) {
- delete item;
- } else {
- nobj->setParent(d->newWindowParent);
- static_cast<QGraphicsObject*>(item)->setParentItem(d->newWindowParent);
- }
- }
- } else {
- delete windowContext;
- }
-
- return webview;
- }
- }
- break;
- case QWebPage::WebModalDialog: {
- // Not supported
- }
- }
- return 0;
-}
-
-/*!
- \qmlproperty component WebView::newWindowComponent
-
- This property holds the component to use for new windows.
- The component must have a WebView somewhere in its structure.
-
- When the web engine requests a new window, it will be an instance of
- this component.
-
- The parent of the new window is set by newWindowParent. It must be set.
-*/
-QDeclarativeComponent *QDeclarativeWebView::newWindowComponent() const
-{
- return d->newWindowComponent;
-}
-
-void QDeclarativeWebView::setNewWindowComponent(QDeclarativeComponent *newWindow)
-{
- if (newWindow == d->newWindowComponent)
- return;
- d->newWindowComponent = newWindow;
- emit newWindowComponentChanged();
-}
-
-
-/*!
- \qmlproperty item WebView::newWindowParent
-
- The parent item for new windows.
-
- \sa newWindowComponent
-*/
-QDeclarativeItem *QDeclarativeWebView::newWindowParent() const
-{
- return d->newWindowParent;
-}
-
-void QDeclarativeWebView::setNewWindowParent(QDeclarativeItem *parent)
-{
- if (parent == d->newWindowParent)
- return;
- if (d->newWindowParent && parent) {
- QList<QGraphicsItem *> children = d->newWindowParent->childItems();
- for (int i = 0; i < children.count(); ++i) {
- children.at(i)->setParentItem(parent);
- }
- }
- d->newWindowParent = parent;
- emit newWindowParentChanged();
-}
-
-QSize QDeclarativeWebView::contentsSize() const
-{
- return d->page->mainFrame()->contentsSize() * contentsScale();
-}
-
-qreal QDeclarativeWebView::contentsScale() const
-{
- return d->view->scale();
-}
-
-void QDeclarativeWebView::setContentsScale(qreal scale)
-{
- if (scale == d->view->scale())
- return;
- d->view->setScale(scale);
- updateDeclarativeWebViewSize();
- emit contentsScaleChanged();
-}
-
-/*!
- Returns the area of the largest element at position (\a x,\a y) that is no larger
- than \a maxwidth by \a maxheight pixels.
-
- May return an area larger in the case when no smaller element is at the position.
-*/
-QRect QDeclarativeWebView::elementAreaAt(int x, int y, int maxwidth, int maxheight) const
-{
- QWebHitTestResult hit = page()->mainFrame()->hitTestContent(QPoint(x,y));
- QRect rv = hit.boundingRect();
- QWebElement element = hit.enclosingBlockElement();
- if (maxwidth<=0) maxwidth = INT_MAX;
- if (maxheight<=0) maxheight = INT_MAX;
- while (!element.parent().isNull() && element.geometry().width() <= maxwidth && element.geometry().height() <= maxheight) {
- rv = element.geometry();
- element = element.parent();
- }
- return rv;
-}
-
-/*!
- \internal
- \class QDeclarativeWebPage
- \brief The QDeclarativeWebPage class is a QWebPage that can create QML plugins.
-
- \sa QDeclarativeWebView
-*/
-QDeclarativeWebPage::QDeclarativeWebPage(QDeclarativeWebView *parent) :
- QWebPage(parent)
-{
-}
-
-QDeclarativeWebPage::~QDeclarativeWebPage()
-{
-}
-
-void QDeclarativeWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
-{
- qWarning() << sourceID << ':' << lineNumber << ':' << message;
-}
-
-QString QDeclarativeWebPage::chooseFile(QWebFrame *originatingFrame, const QString& oldFile)
-{
- // Not supported (it's modal)
- Q_UNUSED(originatingFrame)
- Q_UNUSED(oldFile)
- return oldFile;
-}
-
-/*!
- \qmlsignal WebView::onAlert(message)
-
- This handler is called when the web engine sends a JavaScript alert. The \a message is the text
- to be displayed in the alert to the user.
-*/
-
-
-void QDeclarativeWebPage::javaScriptAlert(QWebFrame *originatingFrame, const QString& msg)
-{
- Q_UNUSED(originatingFrame)
- emit viewItem()->alert(msg);
-}
-
-bool QDeclarativeWebPage::javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg)
-{
- // Not supported (it's modal)
- Q_UNUSED(originatingFrame)
- Q_UNUSED(msg)
- return false;
-}
-
-bool QDeclarativeWebPage::javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result)
-{
- // Not supported (it's modal)
- Q_UNUSED(originatingFrame)
- Q_UNUSED(msg)
- Q_UNUSED(defaultValue)
- Q_UNUSED(result)
- return false;
-}
-
-
-QDeclarativeWebView *QDeclarativeWebPage::viewItem()
-{
- return static_cast<QDeclarativeWebView*>(parent());
-}
-
-QWebPage *QDeclarativeWebPage::createWindow(WebWindowType type)
-{
- QDeclarativeWebView *newView = viewItem()->createWindow(type);
- if (newView)
- return newView->page();
- return 0;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/imports/webkit/qdeclarativewebview_p.h b/src/imports/webkit/qdeclarativewebview_p.h
deleted file mode 100644
index 042237e..0000000
--- a/src/imports/webkit/qdeclarativewebview_p.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEWEBVIEW_H
-#define QDECLARATIVEWEBVIEW_H
-
-#include <qdeclarativeitem.h>
-
-#include <QtGui/QAction>
-#include <QtCore/QUrl>
-#include <QtNetwork/qnetworkaccessmanager.h>
-#include <QtWebKit/QWebPage>
-#include <QtWebKit/QGraphicsWebView>
-
-QT_BEGIN_HEADER
-
-class QWebHistory;
-class QWebSettings;
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-class QDeclarativeWebSettings;
-class QDeclarativeWebViewPrivate;
-class QNetworkRequest;
-class QDeclarativeWebView;
-class QDeclarativeWebViewPrivate;
-
-class QDeclarativeWebPage : public QWebPage
-{
- Q_OBJECT
-public:
- explicit QDeclarativeWebPage(QDeclarativeWebView *parent);
- ~QDeclarativeWebPage();
-protected:
- QWebPage *createWindow(WebWindowType type);
- void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID);
- QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile);
- void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg);
- bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg);
- bool javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result);
-
-private:
- QDeclarativeWebView *viewItem();
-};
-
-
-class QDeclarativeWebViewAttached;
-
-//### TODO: browser plugins
-
-class QDeclarativeWebView : public QDeclarativeItem
-{
- Q_OBJECT
-
- Q_ENUMS(Status SelectionMode)
-
- Q_PROPERTY(QString title READ title NOTIFY titleChanged)
- Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged)
- Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged)
- Q_PROPERTY(QString statusText READ statusText NOTIFY statusTextChanged)
-
- Q_PROPERTY(QString html READ html WRITE setHtml NOTIFY htmlChanged)
-
- Q_PROPERTY(int pressGrabTime READ pressGrabTime WRITE setPressGrabTime NOTIFY pressGrabTimeChanged)
-
- Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged)
- Q_PROPERTY(int preferredHeight READ preferredHeight WRITE setPreferredHeight NOTIFY preferredHeightChanged)
- Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
- Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
- Q_PROPERTY(Status status READ status NOTIFY statusChanged)
-
-#ifndef QT_NO_ACTION
- Q_PROPERTY(QAction* reload READ reloadAction CONSTANT)
- Q_PROPERTY(QAction* back READ backAction CONSTANT)
- Q_PROPERTY(QAction* forward READ forwardAction CONSTANT)
- Q_PROPERTY(QAction* stop READ stopAction CONSTANT)
-#endif
-
- Q_PROPERTY(QDeclarativeWebSettings* settings READ settingsObject CONSTANT)
-
- Q_PROPERTY(QDeclarativeListProperty<QObject> javaScriptWindowObjects READ javaScriptWindowObjects CONSTANT)
-
- Q_PROPERTY(QDeclarativeComponent* newWindowComponent READ newWindowComponent WRITE setNewWindowComponent NOTIFY newWindowComponentChanged)
- Q_PROPERTY(QDeclarativeItem* newWindowParent READ newWindowParent WRITE setNewWindowParent NOTIFY newWindowParentChanged)
-
- Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged)
-
- Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeChanged)
- Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged)
-
-public:
- QDeclarativeWebView(QDeclarativeItem *parent=0);
- ~QDeclarativeWebView();
-
- QUrl url() const;
- void setUrl(const QUrl &);
-
- QString title() const;
-
- QPixmap icon() const;
-
- qreal zoomFactor() const;
- void setZoomFactor(qreal);
- Q_INVOKABLE bool heuristicZoom(int clickX, int clickY, qreal maxzoom);
- QRect elementAreaAt(int x, int y, int minwidth, int minheight) const;
-
- int pressGrabTime() const;
- void setPressGrabTime(int);
-
- int preferredWidth() const;
- void setPreferredWidth(int);
- int preferredHeight() const;
- void setPreferredHeight(int);
-
- enum Status { Null, Ready, Loading, Error };
- Status status() const;
- qreal progress() const;
- QString statusText() const;
-
-#ifndef QT_NO_ACTION
- QAction *reloadAction() const;
- QAction *backAction() const;
- QAction *forwardAction() const;
- QAction *stopAction() const;
-#endif
-
- QWebPage *page() const;
- void setPage(QWebPage *page);
-
- void load(const QNetworkRequest &request,
- QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
- const QByteArray &body = QByteArray());
-
- QString html() const;
-
- void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
- void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
-
- QWebHistory *history() const;
- QWebSettings *settings() const;
- QDeclarativeWebSettings *settingsObject() const;
-
- bool renderingEnabled() const;
- void setRenderingEnabled(bool);
-
- QDeclarativeListProperty<QObject> javaScriptWindowObjects();
-
- static QDeclarativeWebViewAttached *qmlAttachedProperties(QObject *);
-
- QDeclarativeComponent *newWindowComponent() const;
- void setNewWindowComponent(QDeclarativeComponent *newWindow);
- QDeclarativeItem *newWindowParent() const;
- void setNewWindowParent(QDeclarativeItem *newWindow);
-
- bool isComponentCompletePublic() const { return isComponentComplete(); }
-
- QSize contentsSize() const;
-
- void setContentsScale(qreal scale);
- qreal contentsScale() const;
-
-Q_SIGNALS:
- void preferredWidthChanged();
- void preferredHeightChanged();
- void urlChanged();
- void progressChanged();
- void statusChanged(Status);
- void titleChanged(const QString&);
- void iconChanged();
- void statusTextChanged();
- void htmlChanged();
- void pressGrabTimeChanged();
- void zoomFactorChanged();
- void newWindowComponentChanged();
- void newWindowParentChanged();
- void renderingEnabledChanged();
- void contentsSizeChanged(const QSize&);
- void contentsScaleChanged();
-
- void loadStarted();
- void loadFinished();
- void loadFailed();
-
- void doubleClick(int clickX, int clickY);
-
- void zoomTo(qreal zoom, int centerX, int centerY);
-
- void alert(const QString& message);
-
-public Q_SLOTS:
- QVariant evaluateJavaScript(const QString&);
-
-private Q_SLOTS:
- void doLoadStarted();
- void doLoadProgress(int p);
- void doLoadFinished(bool ok);
- void setStatusText(const QString&);
- void windowObjectCleared();
- void pageUrlChanged();
- void initialLayout();
-
- void propagateFocusToWebPage(bool);
-
- void updateDeclarativeWebViewSize();
-
-protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
- void timerEvent(QTimerEvent *event);
- void hoverMoveEvent (QGraphicsSceneHoverEvent * event);
- virtual void geometryChanged(const QRectF &newGeometry,
- const QRectF &oldGeometry);
- virtual bool sceneEvent(QEvent *event);
- QDeclarativeWebView *createWindow(QWebPage::WebWindowType type);
-
-private:
- void updateContentsSize();
- void init();
- virtual void componentComplete();
- Q_DISABLE_COPY(QDeclarativeWebView)
- QDeclarativeWebViewPrivate* d;
- QMouseEvent *sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent *);
- QMouseEvent *sceneHoverMoveEventToMouseEvent(QGraphicsSceneHoverEvent *);
- friend class QDeclarativeWebPage;
-};
-
-class QDeclarativeWebViewAttached : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString windowObjectName READ windowObjectName WRITE setWindowObjectName)
-public:
- QDeclarativeWebViewAttached(QObject *parent)
- : QObject(parent)
- {
- }
-
- QString windowObjectName() const
- {
- return m_windowObjectName;
- }
-
- void setWindowObjectName(const QString &n)
- {
- m_windowObjectName = n;
- }
-
-private:
- QString m_windowObjectName;
-};
-
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeWebView)
-QML_DECLARE_TYPEINFO(QDeclarativeWebView, QML_HAS_ATTACHED_PROPERTIES)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/imports/webkit/qdeclarativewebview_p_p.h b/src/imports/webkit/qdeclarativewebview_p_p.h
deleted file mode 100644
index 258b472..0000000
--- a/src/imports/webkit/qdeclarativewebview_p_p.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEWEBVIEW_P_H
-#define QDECLARATIVEWEBVIEW_P_H
-
-#include <qdeclarative.h>
-
-#include <QtWebKit/QWebPage>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeWebSettings : public QObject {
- Q_OBJECT
-
- Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily)
- Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily)
- Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily)
- Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily)
- Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily)
- Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily)
-
- Q_PROPERTY(int minimumFontSize READ minimumFontSize WRITE setMinimumFontSize)
- Q_PROPERTY(int minimumLogicalFontSize READ minimumLogicalFontSize WRITE setMinimumLogicalFontSize)
- Q_PROPERTY(int defaultFontSize READ defaultFontSize WRITE setDefaultFontSize)
- Q_PROPERTY(int defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize)
-
- Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages)
- Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled)
- Q_PROPERTY(bool javaEnabled READ javaEnabled WRITE setJavaEnabled)
- Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled)
- Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled)
- Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows)
- Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard)
- Q_PROPERTY(bool developerExtrasEnabled READ developerExtrasEnabled WRITE setDeveloperExtrasEnabled)
- Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain)
- Q_PROPERTY(bool zoomTextOnly READ zoomTextOnly WRITE setZoomTextOnly)
- Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds)
- Q_PROPERTY(bool offlineStorageDatabaseEnabled READ offlineStorageDatabaseEnabled WRITE setOfflineStorageDatabaseEnabled)
- Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled)
- Q_PROPERTY(bool localStorageDatabaseEnabled READ localStorageDatabaseEnabled WRITE setLocalStorageDatabaseEnabled)
- Q_PROPERTY(bool localContentCanAccessRemoteUrls READ localContentCanAccessRemoteUrls WRITE setLocalContentCanAccessRemoteUrls)
-
-public:
- QDeclarativeWebSettings() {}
-
- QString standardFontFamily() const { return s->fontFamily(QWebSettings::StandardFont); }
- void setStandardFontFamily(const QString& f) { s->setFontFamily(QWebSettings::StandardFont,f); }
- QString fixedFontFamily() const { return s->fontFamily(QWebSettings::FixedFont); }
- void setFixedFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FixedFont,f); }
- QString serifFontFamily() const { return s->fontFamily(QWebSettings::SerifFont); }
- void setSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SerifFont,f); }
- QString sansSerifFontFamily() const { return s->fontFamily(QWebSettings::SansSerifFont); }
- void setSansSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SansSerifFont,f); }
- QString cursiveFontFamily() const { return s->fontFamily(QWebSettings::CursiveFont); }
- void setCursiveFontFamily(const QString& f) { s->setFontFamily(QWebSettings::CursiveFont,f); }
- QString fantasyFontFamily() const { return s->fontFamily(QWebSettings::FantasyFont); }
- void setFantasyFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FantasyFont,f); }
-
- int minimumFontSize() const { return s->fontSize(QWebSettings::MinimumFontSize); }
- void setMinimumFontSize(int size) { s->setFontSize(QWebSettings::MinimumFontSize,size); }
- int minimumLogicalFontSize() const { return s->fontSize(QWebSettings::MinimumLogicalFontSize); }
- void setMinimumLogicalFontSize(int size) { s->setFontSize(QWebSettings::MinimumLogicalFontSize,size); }
- int defaultFontSize() const { return s->fontSize(QWebSettings::DefaultFontSize); }
- void setDefaultFontSize(int size) { s->setFontSize(QWebSettings::DefaultFontSize,size); }
- int defaultFixedFontSize() const { return s->fontSize(QWebSettings::DefaultFixedFontSize); }
- void setDefaultFixedFontSize(int size) { s->setFontSize(QWebSettings::DefaultFixedFontSize,size); }
-
- bool autoLoadImages() const { return s->testAttribute(QWebSettings::AutoLoadImages); }
- void setAutoLoadImages(bool on) { s->setAttribute(QWebSettings::AutoLoadImages, on); }
- bool javascriptEnabled() const { return s->testAttribute(QWebSettings::JavascriptEnabled); }
- void setJavascriptEnabled(bool on) { s->setAttribute(QWebSettings::JavascriptEnabled, on); }
- bool javaEnabled() const { return s->testAttribute(QWebSettings::JavaEnabled); }
- void setJavaEnabled(bool on) { s->setAttribute(QWebSettings::JavaEnabled, on); }
- bool pluginsEnabled() const { return s->testAttribute(QWebSettings::PluginsEnabled); }
- void setPluginsEnabled(bool on) { s->setAttribute(QWebSettings::PluginsEnabled, on); }
- bool privateBrowsingEnabled() const { return s->testAttribute(QWebSettings::PrivateBrowsingEnabled); }
- void setPrivateBrowsingEnabled(bool on) { s->setAttribute(QWebSettings::PrivateBrowsingEnabled, on); }
- bool javascriptCanOpenWindows() const { return s->testAttribute(QWebSettings::JavascriptCanOpenWindows); }
- void setJavascriptCanOpenWindows(bool on) { s->setAttribute(QWebSettings::JavascriptCanOpenWindows, on); }
- bool javascriptCanAccessClipboard() const { return s->testAttribute(QWebSettings::JavascriptCanAccessClipboard); }
- void setJavascriptCanAccessClipboard(bool on) { s->setAttribute(QWebSettings::JavascriptCanAccessClipboard, on); }
- bool developerExtrasEnabled() const { return s->testAttribute(QWebSettings::DeveloperExtrasEnabled); }
- void setDeveloperExtrasEnabled(bool on) { s->setAttribute(QWebSettings::DeveloperExtrasEnabled, on); }
- bool linksIncludedInFocusChain() const { return s->testAttribute(QWebSettings::LinksIncludedInFocusChain); }
- void setLinksIncludedInFocusChain(bool on) { s->setAttribute(QWebSettings::LinksIncludedInFocusChain, on); }
- bool zoomTextOnly() const { return s->testAttribute(QWebSettings::ZoomTextOnly); }
- void setZoomTextOnly(bool on) { s->setAttribute(QWebSettings::ZoomTextOnly, on); }
- bool printElementBackgrounds() const { return s->testAttribute(QWebSettings::PrintElementBackgrounds); }
- void setPrintElementBackgrounds(bool on) { s->setAttribute(QWebSettings::PrintElementBackgrounds, on); }
- bool offlineStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled); }
- void setOfflineStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, on); }
- bool offlineWebApplicationCacheEnabled() const { return s->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled); }
- void setOfflineWebApplicationCacheEnabled(bool on) { s->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, on); }
- bool localStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::LocalStorageDatabaseEnabled); }
- void setLocalStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, on); }
- bool localContentCanAccessRemoteUrls() const { return s->testAttribute(QWebSettings::LocalContentCanAccessRemoteUrls); }
- void setLocalContentCanAccessRemoteUrls(bool on) { s->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, on); }
-
- QWebSettings *s;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeWebSettings)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/imports/webkit/qmldir b/src/imports/webkit/qmldir
deleted file mode 100644
index dcfdd06..0000000
--- a/src/imports/webkit/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin qmlwebkitplugin
diff --git a/src/imports/webkit/webkit.pro b/src/imports/webkit/webkit.pro
deleted file mode 100644
index 7b2ac66..0000000
--- a/src/imports/webkit/webkit.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-TARGET = qmlwebkitplugin
-TARGETPATH = org/webkit
-include(../qimportbase.pri)
-
-QT += webkit declarative
-
-SOURCES += qdeclarativewebview.cpp plugin.cpp
-HEADERS += qdeclarativewebview_p.h \
- qdeclarativewebview_p_p.h
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
-target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
-
-qmldir.files += $$PWD/qmldir
-qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
-
-symbian:{
- load(data_caging_paths)
- include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-
- importFiles.sources = qmlwebkitplugin.dll qmldir
- importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
- DEPLOYMENT = importFiles
-}
-
-INSTALLS += target qmldir