commit e7f4118f609f29afe1c0ba06b847c76a212d12c8 | |
Author: Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | |
Date: Wed Nov 16 19:23:17 2011 +0100 | |
[Qt] Move WebKit2 C++ APIs to private API and build QML extension plugin on top of that | |
A new extension object has been added to QQuickWebView (the same approach should be used | |
for other API classes that need experimental APIs). The QML extension mechanism is then | |
built on top of the experimental object. | |
diff --git a/Source/QtWebKit.pro b/Source/QtWebKit.pro | |
index ed00ddb..8b27cae 100644 | |
--- a/Source/QtWebKit.pro | |
+++ b/Source/QtWebKit.pro | |
@@ -17,12 +17,9 @@ SUBDIRS += api | |
include(WebKit/qt/docs/docs.pri) | |
-SUBDIRS += WebKit/qt/declarative | |
-haveQt(5) { | |
- !no_webkit2 { | |
- SUBDIRS += WebKit/qt/declarative/private | |
- } | |
-} | |
+declarative.file = WebKit/qt/declarative/declarative.pro | |
+declarative.makefile = Makefile.declarative | |
+SUBDIRS += declarative | |
tests.file = tests.pri | |
SUBDIRS += tests | |
diff --git a/Source/WebKit/qt/declarative/declarative.pro b/Source/WebKit/qt/declarative/declarative.pro | |
index f81719e..7379283 100644 | |
--- a/Source/WebKit/qt/declarative/declarative.pro | |
+++ b/Source/WebKit/qt/declarative/declarative.pro | |
@@ -1,58 +1,18 @@ | |
# ------------------------------------------------------------------- | |
-# Project file for the QtWebKit QML plugin | |
+# Main project file for the Qt Quick (QML) plugin | |
# | |
# See 'Tools/qmake/README' for an overview of the build system | |
# ------------------------------------------------------------------- | |
-TEMPLATE = lib | |
-TARGET = qmlwebkitplugin | |
+TEMPLATE = subdirs | |
+CONFIG += ordered | |
-TARGET.module_name = QtWebKit | |
+public_api.file = public.pri | |
+public_api.makefile = Makefile.declarative.public | |
+SUBDIRS += public_api | |
-CONFIG += qt plugin | |
- | |
-win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release | |
- | |
-QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir | |
-copy2build.input = QMLDIRFILE | |
-copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir | |
-!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS | |
-copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} | |
-copy2build.name = COPY ${QMAKE_FILE_IN} | |
-copy2build.CONFIG += no_link | |
-QMAKE_EXTRA_COMPILERS += copy2build | |
- | |
-TARGET = $$qtLibraryTarget($$TARGET) | |
-contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols | |
- | |
-wince*:LIBS += $$QMAKE_LIBS_GUI | |
- | |
-CONFIG += qtwebkit | |
- | |
-QT += declarative | |
-haveQt(5): QT += widgets | |
- | |
-contains(QT_CONFIG, qtquick1): { | |
- QT += qtquick1 | |
-} | |
- | |
-DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name} | |
- | |
-CONFIG += rpath | |
-RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib | |
- | |
-SOURCES += qdeclarativewebview.cpp plugin.cpp | |
-HEADERS += qdeclarativewebview_p.h | |
- | |
-!no_webkit2: { | |
- DEFINES += HAVE_WEBKIT2 | |
- QT += network | |
+haveQt(5):!no_webkit2 { | |
+ experimental_api.file = experimental/experimental.pri | |
+ experimental_api.makefile = Makefile.declarative.experimental | |
+ SUBDIRS += experimental_api | |
} | |
- | |
-target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
- | |
- | |
-qmldir.files += $$PWD/qmldir | |
-qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
- | |
-INSTALLS += target qmldir | |
diff --git a/Source/WebKit/qt/declarative/experimental/experimental.pri b/Source/WebKit/qt/declarative/experimental/experimental.pri | |
new file mode 100644 | |
index 0000000..0e8909e | |
--- /dev/null | |
+++ b/Source/WebKit/qt/declarative/experimental/experimental.pri | |
@@ -0,0 +1,52 @@ | |
+# ------------------------------------------------------------------- | |
+# Project file for the Qt Quick (QML) experimental API plugin | |
+# | |
+# See 'Tools/qmake/README' for an overview of the build system | |
+# ------------------------------------------------------------------- | |
+ | |
+TEMPLATE = lib | |
+TARGET = qmlwebkitexperimentalplugin | |
+ | |
+TARGET.module_name = QtWebKit/experimental | |
+ | |
+CONFIG += qt plugin | |
+ | |
+win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release | |
+ | |
+QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir | |
+copy2build.input = QMLDIRFILE | |
+copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir | |
+!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS | |
+copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} | |
+copy2build.name = COPY ${QMAKE_FILE_IN} | |
+copy2build.CONFIG += no_link | |
+QMAKE_EXTRA_COMPILERS += copy2build | |
+ | |
+TARGET = $$qtLibraryTarget($$TARGET) | |
+contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols | |
+ | |
+wince*:LIBS += $$QMAKE_LIBS_GUI | |
+ | |
+CONFIG += qtwebkit qtwebkit-private | |
+ | |
+QT += declarative widgets network | |
+ | |
+DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name} | |
+ | |
+CONFIG += rpath | |
+RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib | |
+ | |
+SOURCES += plugin.cpp | |
+ | |
+DEFINES += HAVE_WEBKIT2 | |
+INCLUDEPATH += ../../../../WebKit2/UIProcess/API/qt | |
+ | |
+target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
+ | |
+ | |
+qmldir.files += $$PWD/qmldir | |
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
+ | |
+INSTALLS += target qmldir | |
+ | |
+ | |
diff --git a/Source/WebKit/qt/declarative/experimental/plugin.cpp b/Source/WebKit/qt/declarative/experimental/plugin.cpp | |
new file mode 100644 | |
index 0000000..91e54ce | |
--- /dev/null | |
+++ b/Source/WebKit/qt/declarative/experimental/plugin.cpp | |
@@ -0,0 +1,53 @@ | |
+/* | |
+ Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
+ | |
+ This library is free software; you can redistribute it and/or | |
+ modify it under the terms of the GNU Library General Public | |
+ License as published by the Free Software Foundation; either | |
+ version 2 of the License, or (at your option) any later version. | |
+ | |
+ This library 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 | |
+ Library General Public License for more details. | |
+ | |
+ You should have received a copy of the GNU Library General Public License | |
+ along with this library; see the file COPYING.LIB. If not, write to | |
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
+ Boston, MA 02110-1301, USA. | |
+*/ | |
+ | |
+#include "qquickwebpage_p.h" | |
+#include "qquickwebview_p.h" | |
+ | |
+#include <QtDeclarative/qdeclarative.h> | |
+#include <QtDeclarative/qdeclarativeextensionplugin.h> | |
+ | |
+QT_BEGIN_NAMESPACE | |
+ | |
+class QQuickWebViewExperimentalExtension : public QObject { | |
+ Q_OBJECT | |
+ Q_PROPERTY(QQuickWebViewExperimental* experimental READ experimental CONSTANT FINAL) | |
+public: | |
+ QQuickWebViewExperimentalExtension(QObject *parent = 0) : QObject(parent) {} | |
+ QQuickWebViewExperimental* experimental() { return static_cast<QQuickWebView*>(parent())->experimental(); } | |
+}; | |
+ | |
+class WebKitQmlExperimentalExtensionPlugin: public QDeclarativeExtensionPlugin { | |
+ Q_OBJECT | |
+public: | |
+ virtual void registerTypes(const char* uri) | |
+ { | |
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit.experimental")); | |
+ | |
+ qmlRegisterExtendedType<QQuickWebView, QQuickWebViewExperimentalExtension>(uri, 3, 0, "WebView"); | |
+ qmlRegisterUncreatableType<QQuickWebViewExperimental>(uri, 3, 0, "QQuickWebViewExperimental", | |
+ QObject::tr("Cannot create separate instance of QQuickWebViewExperimental")); | |
+ } | |
+}; | |
+ | |
+QT_END_NAMESPACE | |
+ | |
+#include "plugin.moc" | |
+ | |
+Q_EXPORT_PLUGIN2(qmlwebkitpluginexperimental, QT_PREPEND_NAMESPACE(WebKitQmlExperimentalExtensionPlugin)); | |
diff --git a/Source/WebKit/qt/declarative/experimental/qmldir b/Source/WebKit/qt/declarative/experimental/qmldir | |
new file mode 100644 | |
index 0000000..9dc8b0e | |
--- /dev/null | |
+++ b/Source/WebKit/qt/declarative/experimental/qmldir | |
@@ -0,0 +1 @@ | |
+plugin qmlwebkitprivateplugin | |
diff --git a/Source/WebKit/qt/declarative/plugin.cpp b/Source/WebKit/qt/declarative/plugin.cpp | |
index 379b979..91634ee 100644 | |
--- a/Source/WebKit/qt/declarative/plugin.cpp | |
+++ b/Source/WebKit/qt/declarative/plugin.cpp | |
@@ -23,10 +23,10 @@ | |
#include <QtDeclarative/qdeclarativeextensionplugin.h> | |
#if defined(HAVE_WEBKIT2) | |
-#include "qquickwebpage.h" | |
-#include "qquickwebview.h" | |
-#include "qwebdownloaditem.h" | |
-#include "qwebpreferences.h" | |
+#include "qquickwebpage_p.h" | |
+#include "qquickwebview_p.h" | |
+#include "qwebdownloaditem_p.h" | |
+#include "qwebpreferences_p.h" | |
#include <QtNetwork/qnetworkreply.h> | |
#endif | |
diff --git a/Source/WebKit/qt/declarative/private/plugin.cpp b/Source/WebKit/qt/declarative/private/plugin.cpp | |
deleted file mode 100644 | |
index 6b11344..0000000 | |
--- a/Source/WebKit/qt/declarative/private/plugin.cpp | |
+++ /dev/null | |
@@ -1,47 +0,0 @@ | |
-/* | |
- Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- | |
- This library is free software; you can redistribute it and/or | |
- modify it under the terms of the GNU Library General Public | |
- License as published by the Free Software Foundation; either | |
- version 2 of the License, or (at your option) any later version. | |
- | |
- This library 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 | |
- Library General Public License for more details. | |
- | |
- You should have received a copy of the GNU Library General Public License | |
- along with this library; see the file COPYING.LIB. If not, write to | |
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- Boston, MA 02110-1301, USA. | |
-*/ | |
- | |
-#include "config.h" | |
- | |
-#include "qquickwebpage.h" | |
-#include "qquickwebview.h" | |
-#include "qquickwebview_p.h" | |
-#include "qquickwebviewprivateextension_p.h" | |
- | |
-#include <QtDeclarative/qdeclarative.h> | |
-#include <QtDeclarative/qdeclarativeextensionplugin.h> | |
- | |
-QT_BEGIN_NAMESPACE | |
- | |
-class WebKitQmlPluginPrivate : public QDeclarativeExtensionPlugin { | |
- Q_OBJECT | |
-public: | |
- virtual void registerTypes(const char* uri) | |
- { | |
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit.private")); | |
- qmlRegisterExtendedType<QQuickWebView, QQuickWebViewPrivateExtension>(uri, 3, 0, "WebView"); | |
- qmlRegisterUncreatableType<QQuickWebViewPrivate>(uri, 3, 0, "WebViewPrivate", QObject::tr("Cannot create separate instance of WebViewPrivate")); | |
- } | |
-}; | |
- | |
-QT_END_NAMESPACE | |
- | |
-#include "plugin.moc" | |
- | |
-Q_EXPORT_PLUGIN2(qmlwebkitpluginprivate, QT_PREPEND_NAMESPACE(WebKitQmlPluginPrivate)); | |
diff --git a/Source/WebKit/qt/declarative/private/private.pro b/Source/WebKit/qt/declarative/private/private.pro | |
deleted file mode 100644 | |
index 886b73b..0000000 | |
--- a/Source/WebKit/qt/declarative/private/private.pro | |
+++ /dev/null | |
@@ -1,54 +0,0 @@ | |
-# ------------------------------------------------------------------- | |
-# Project file for the QtWebKit QML private plugin | |
-# | |
-# See 'Tools/qmake/README' for an overview of the build system | |
-# ------------------------------------------------------------------- | |
- | |
-TEMPLATE = lib | |
-TARGET = qmlwebkitprivateplugin | |
- | |
-TARGET.module_name = QtWebKit/private | |
- | |
-CONFIG += qt plugin | |
- | |
-win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release | |
- | |
-QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir | |
-copy2build.input = QMLDIRFILE | |
-copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir | |
-!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS | |
-copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} | |
-copy2build.name = COPY ${QMAKE_FILE_IN} | |
-copy2build.CONFIG += no_link | |
-QMAKE_EXTRA_COMPILERS += copy2build | |
- | |
-TARGET = $$qtLibraryTarget($$TARGET) | |
-contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols | |
- | |
-wince*:LIBS += $$QMAKE_LIBS_GUI | |
- | |
-load(javascriptcore) | |
-load(webcore) | |
-load(webkit2) | |
-CONFIG += qtwebkit | |
- | |
-QT += declarative widgets network | |
- | |
-DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name} | |
- | |
-CONFIG += rpath | |
-RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib | |
- | |
-SOURCES += plugin.cpp | |
- | |
-DEFINES += HAVE_WEBKIT2 | |
-INCLUDEPATH += ../../../../WebKit2/UIProcess/API/qt | |
- | |
-target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
- | |
- | |
-qmldir.files += $$PWD/qmldir | |
-qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
- | |
-INSTALLS += target qmldir | |
- | |
diff --git a/Source/WebKit/qt/declarative/private/qmldir b/Source/WebKit/qt/declarative/private/qmldir | |
deleted file mode 100644 | |
index 9dc8b0e..0000000 | |
--- a/Source/WebKit/qt/declarative/private/qmldir | |
+++ /dev/null | |
@@ -1 +0,0 @@ | |
-plugin qmlwebkitprivateplugin | |
diff --git a/Source/WebKit/qt/declarative/public.pri b/Source/WebKit/qt/declarative/public.pri | |
new file mode 100644 | |
index 0000000..b331339 | |
--- /dev/null | |
+++ b/Source/WebKit/qt/declarative/public.pri | |
@@ -0,0 +1,58 @@ | |
+# ------------------------------------------------------------------- | |
+# Project file for the QtWebKit QML plugin | |
+# | |
+# See 'Tools/qmake/README' for an overview of the build system | |
+# ------------------------------------------------------------------- | |
+ | |
+TEMPLATE = lib | |
+TARGET = qmlwebkitplugin | |
+ | |
+TARGET.module_name = QtWebKit | |
+ | |
+CONFIG += qt plugin | |
+ | |
+win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release | |
+ | |
+QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir | |
+copy2build.input = QMLDIRFILE | |
+copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir | |
+!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS | |
+copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} | |
+copy2build.name = COPY ${QMAKE_FILE_IN} | |
+copy2build.CONFIG += no_link | |
+QMAKE_EXTRA_COMPILERS += copy2build | |
+ | |
+TARGET = $$qtLibraryTarget($$TARGET) | |
+contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols | |
+ | |
+wince*:LIBS += $$QMAKE_LIBS_GUI | |
+ | |
+CONFIG += qtwebkit qtwebkit-private | |
+ | |
+QT += declarative | |
+haveQt(5): QT += widgets | |
+ | |
+contains(QT_CONFIG, qtquick1): { | |
+ QT += qtquick1 | |
+} | |
+ | |
+DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name} | |
+ | |
+CONFIG += rpath | |
+RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib | |
+ | |
+SOURCES += qdeclarativewebview.cpp plugin.cpp | |
+HEADERS += qdeclarativewebview_p.h | |
+ | |
+!no_webkit2: { | |
+ DEFINES += HAVE_WEBKIT2 | |
+ QT += network | |
+} | |
+ | |
+target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
+ | |
+ | |
+qmldir.files += $$PWD/qmldir | |
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name} | |
+ | |
+INSTALLS += target qmldir | |
diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri | |
index d378c54..d4a7405 100644 | |
--- a/Source/WebKit2/Target.pri | |
+++ b/Source/WebKit2/Target.pri | |
@@ -242,15 +242,14 @@ HEADERS += \ | |
UIProcess/API/cpp/WKRetainPtr.h \ | |
UIProcess/API/cpp/qt/WKStringQt.h \ | |
UIProcess/API/cpp/qt/WKURLQt.h \ | |
- UIProcess/API/qt/qwebpreferences.h \ | |
UIProcess/API/qt/qwebpreferences_p.h \ | |
- UIProcess/API/qt/qwebdownloaditem.h \ | |
+ UIProcess/API/qt/qwebpreferences_p_p.h \ | |
UIProcess/API/qt/qwebdownloaditem_p.h \ | |
- UIProcess/API/qt/qquickwebpage.h \ | |
+ UIProcess/API/qt/qwebdownloaditem_p_p.h \ | |
UIProcess/API/qt/qquickwebpage_p.h \ | |
- UIProcess/API/qt/qquickwebview.h \ | |
+ UIProcess/API/qt/qquickwebpage_p_p.h \ | |
UIProcess/API/qt/qquickwebview_p.h \ | |
- UIProcess/API/qt/qquickwebviewprivateextension_p.h \ | |
+ UIProcess/API/qt/qquickwebview_p_p.h \ | |
UIProcess/Authentication/AuthenticationChallengeProxy.h \ | |
UIProcess/Authentication/AuthenticationDecisionListener.h \ | |
UIProcess/Authentication/WebCredential.h \ | |
@@ -553,7 +552,6 @@ SOURCES += \ | |
UIProcess/API/qt/qquickwebpage.cpp \ | |
UIProcess/API/qt/qquickwebview.cpp \ | |
UIProcess/API/qt/qwebpreferences.cpp \ | |
- UIProcess/API/qt/qquickwebviewprivateextension.cpp \ | |
UIProcess/Authentication/AuthenticationChallengeProxy.cpp \ | |
UIProcess/Authentication/AuthenticationDecisionListener.cpp \ | |
UIProcess/Authentication/WebCredential.cpp \ | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp | |
index a12278f..ef1347e 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp | |
@@ -19,12 +19,12 @@ | |
*/ | |
#include "config.h" | |
-#include "qquickwebpage.h" | |
+#include "qquickwebpage_p.h" | |
#include "QtWebPageProxy.h" | |
#include "TransformationMatrix.h" | |
-#include "qquickwebpage_p.h" | |
-#include "qquickwebview.h" | |
+#include "qquickwebpage_p_p.h" | |
+#include "qquickwebview_p.h" | |
#include <QtCore/QUrl> | |
#include <QtDeclarative/QQuickCanvas> | |
#include <QtDeclarative/QSGEngine> | |
@@ -243,4 +243,4 @@ void QQuickWebPagePrivate::_q_onSceneGraphInitialized() | |
QObject::connect(engine, SIGNAL(afterRendering()), q, SLOT(_q_onAfterSceneRender()), Qt::DirectConnection); | |
} | |
-#include "moc_qquickwebpage.cpp" | |
+#include "moc_qquickwebpage_p.cpp" | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.h | |
deleted file mode 100644 | |
index 38b9cd4..0000000 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.h | |
+++ /dev/null | |
@@ -1,77 +0,0 @@ | |
-/* | |
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- * | |
- * This library is free software; you can redistribute it and/or | |
- * modify it under the terms of the GNU Library General Public | |
- * License as published by the Free Software Foundation; either | |
- * version 2 of the License, or (at your option) any later version. | |
- * | |
- * 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 | |
- * Library General Public License for more details. | |
- * | |
- * You should have received a copy of the GNU Library General Public License | |
- * along with this program; see the file COPYING.LIB. If not, write to | |
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- * Boston, MA 02110-1301, USA. | |
- * | |
- */ | |
- | |
-#ifndef qquickwebpage_h | |
-#define qquickwebpage_h | |
- | |
-#include "qwebkitglobal.h" | |
- | |
-#include <QtCore/QSharedPointer> | |
-#include <QtDeclarative/QQuickItem> | |
- | |
-class QQuickWebView; | |
-class QQuickWebPagePrivate; | |
-class QWebPreferences; | |
- | |
-namespace WebKit { | |
-class QtViewInterface; | |
-} | |
- | |
-class QWEBKIT_EXPORT QQuickWebPage : public QQuickItem { | |
- Q_OBJECT | |
-public: | |
- QQuickWebPage(QQuickItem* parent = 0); | |
- virtual ~QQuickWebPage(); | |
- | |
-protected: | |
- virtual void keyPressEvent(QKeyEvent*); | |
- virtual void keyReleaseEvent(QKeyEvent*); | |
- virtual void inputMethodEvent(QInputMethodEvent*); | |
- virtual void focusInEvent(QFocusEvent*); | |
- virtual void focusOutEvent(QFocusEvent*); | |
- virtual void mousePressEvent(QMouseEvent*); | |
- virtual void mouseMoveEvent(QMouseEvent*); | |
- virtual void mouseReleaseEvent(QMouseEvent *); | |
- virtual void mouseDoubleClickEvent(QMouseEvent*); | |
- virtual void wheelEvent(QWheelEvent*); | |
- virtual void hoverEnterEvent(QHoverEvent*); | |
- virtual void hoverMoveEvent(QHoverEvent*); | |
- virtual void hoverLeaveEvent(QHoverEvent*); | |
- virtual void dragMoveEvent(QDragMoveEvent*); | |
- virtual void dragEnterEvent(QDragEnterEvent*); | |
- virtual void dragLeaveEvent(QDragLeaveEvent*); | |
- virtual void dropEvent(QDropEvent*); | |
- virtual void touchEvent(QTouchEvent*); | |
- virtual bool event(QEvent*); | |
- virtual void geometryChanged(const QRectF&, const QRectF&); | |
- virtual void itemChange(ItemChange, const ItemChangeData&); | |
- | |
-private: | |
- Q_PRIVATE_SLOT(d, void _q_onAfterSceneRender()); | |
- Q_PRIVATE_SLOT(d, void _q_onSceneGraphInitialized()); | |
- | |
- QQuickWebPagePrivate* d; | |
- friend class QQuickWebViewPrivate; | |
- friend class WebKit::QtViewInterface; | |
-}; | |
- | |
-QML_DECLARE_TYPE(QQuickWebPage) | |
- | |
-#endif /* qquickwebpage_h */ | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h | |
index 18d818d..bc9cb28 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h | |
@@ -21,35 +21,57 @@ | |
#ifndef qquickwebpage_p_h | |
#define qquickwebpage_p_h | |
-#include "QtSGUpdateQueue.h" | |
-#include "QtViewInterface.h" | |
-#include "QtWebPageProxy.h" | |
-#include "qquickwebpage.h" | |
+#include "qwebkitglobal.h" | |
-QT_BEGIN_NAMESPACE | |
-class QRectF; | |
-class QSGNode; | |
-class QString; | |
-QT_END_NAMESPACE | |
+#include <QtCore/QSharedPointer> | |
+#include <QtDeclarative/QQuickItem> | |
-class QQuickWebPage; | |
+class QQuickWebView; | |
+class QQuickWebPagePrivate; | |
+class QWebPreferences; | |
-class QQuickWebPagePrivate { | |
-public: | |
- QQuickWebPagePrivate(QQuickWebPage* view); | |
+namespace WebKit { | |
+class QtViewInterface; | |
+} | |
- void setPageProxy(QtWebPageProxy*); | |
+class QWEBKIT_EXPORT QQuickWebPage : public QQuickItem { | |
+ Q_OBJECT | |
+public: | |
+ QQuickWebPage(QQuickItem* parent = 0); | |
+ virtual ~QQuickWebPage(); | |
- void initializeSceneGraphConnections(); | |
+protected: | |
+ virtual void keyPressEvent(QKeyEvent*); | |
+ virtual void keyReleaseEvent(QKeyEvent*); | |
+ virtual void inputMethodEvent(QInputMethodEvent*); | |
+ virtual void focusInEvent(QFocusEvent*); | |
+ virtual void focusOutEvent(QFocusEvent*); | |
+ virtual void mousePressEvent(QMouseEvent*); | |
+ virtual void mouseMoveEvent(QMouseEvent*); | |
+ virtual void mouseReleaseEvent(QMouseEvent *); | |
+ virtual void mouseDoubleClickEvent(QMouseEvent*); | |
+ virtual void wheelEvent(QWheelEvent*); | |
+ virtual void hoverEnterEvent(QHoverEvent*); | |
+ virtual void hoverMoveEvent(QHoverEvent*); | |
+ virtual void hoverLeaveEvent(QHoverEvent*); | |
+ virtual void dragMoveEvent(QDragMoveEvent*); | |
+ virtual void dragEnterEvent(QDragEnterEvent*); | |
+ virtual void dragLeaveEvent(QDragLeaveEvent*); | |
+ virtual void dropEvent(QDropEvent*); | |
+ virtual void touchEvent(QTouchEvent*); | |
+ virtual bool event(QEvent*); | |
+ virtual void geometryChanged(const QRectF&, const QRectF&); | |
+ virtual void itemChange(ItemChange, const ItemChangeData&); | |
- void _q_onAfterSceneRender(); | |
- void _q_onSceneGraphInitialized(); | |
- void paintToCurrentGLContext(); | |
+private: | |
+ Q_PRIVATE_SLOT(d, void _q_onAfterSceneRender()); | |
+ Q_PRIVATE_SLOT(d, void _q_onSceneGraphInitialized()); | |
- QQuickWebPage* const q; | |
- QtWebPageProxy* pageProxy; | |
- WebKit::QtSGUpdateQueue sgUpdateQueue; | |
- bool paintingIsInitialized; | |
+ QQuickWebPagePrivate* d; | |
+ friend class QQuickWebViewPrivate; | |
+ friend class WebKit::QtViewInterface; | |
}; | |
-#endif /* qquickwebpage_p_h */ | |
+QML_DECLARE_TYPE(QQuickWebPage) | |
+ | |
+#endif // qquickwebpage_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h | |
new file mode 100644 | |
index 0000000..3926baa | |
--- /dev/null | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h | |
@@ -0,0 +1,55 @@ | |
+/* | |
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
+ * | |
+ * This library is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU Library General Public | |
+ * License as published by the Free Software Foundation; either | |
+ * version 2 of the License, or (at your option) any later version. | |
+ * | |
+ * 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 | |
+ * Library General Public License for more details. | |
+ * | |
+ * You should have received a copy of the GNU Library General Public License | |
+ * along with this program; see the file COPYING.LIB. If not, write to | |
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
+ * Boston, MA 02110-1301, USA. | |
+ * | |
+ */ | |
+ | |
+#ifndef qquickwebpage_p_p_h | |
+#define qquickwebpage_p_p_h | |
+ | |
+#include "QtSGUpdateQueue.h" | |
+#include "QtViewInterface.h" | |
+#include "QtWebPageProxy.h" | |
+#include "qquickwebpage_p.h" | |
+ | |
+QT_BEGIN_NAMESPACE | |
+class QRectF; | |
+class QSGNode; | |
+class QString; | |
+QT_END_NAMESPACE | |
+ | |
+class QQuickWebPage; | |
+ | |
+class QQuickWebPagePrivate { | |
+public: | |
+ QQuickWebPagePrivate(QQuickWebPage* view); | |
+ | |
+ void setPageProxy(QtWebPageProxy*); | |
+ | |
+ void initializeSceneGraphConnections(); | |
+ | |
+ void _q_onAfterSceneRender(); | |
+ void _q_onSceneGraphInitialized(); | |
+ void paintToCurrentGLContext(); | |
+ | |
+ QQuickWebPage* const q; | |
+ QtWebPageProxy* pageProxy; | |
+ WebKit::QtSGUpdateQueue sgUpdateQueue; | |
+ bool paintingIsInitialized; | |
+}; | |
+ | |
+#endif // qquickwebpage_p_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp | |
index 6d0a6c6..955fb66 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp | |
@@ -19,7 +19,7 @@ | |
*/ | |
#include "config.h" | |
-#include "qquickwebview.h" | |
+#include "qquickwebview_p.h" | |
#include "QtViewInterface.h" | |
#include "QtWebPageProxy.h" | |
@@ -27,9 +27,9 @@ | |
#include "WebPageGroup.h" | |
#include "WebPreferences.h" | |
-#include "qquickwebpage_p.h" | |
-#include "qquickwebview_p.h" | |
-#include "qwebpreferences_p.h" | |
+#include "qquickwebpage_p_p.h" | |
+#include "qquickwebview_p_p.h" | |
+#include "qwebpreferences_p_p.h" | |
#include <QtDeclarative/QQuickCanvas> | |
#include <QtWidgets/QFileDialog> | |
@@ -355,9 +355,27 @@ void QQuickWebViewPrivate::setPageProxy(QtWebPageProxy* pageProxy) | |
QObject::connect(pageProxy, SIGNAL(receivedMessageFromNavigatorQtObject(QVariantMap)), q, SIGNAL(messageReceived(QVariantMap))); | |
} | |
+QQuickWebViewExperimental::QQuickWebViewExperimental(QQuickWebView *webView) | |
+ : QObject(webView) | |
+ , q_ptr(webView) | |
+ , d_ptr(webView->d_ptr.data()) | |
+{ | |
+} | |
+ | |
+QQuickWebViewExperimental::~QQuickWebViewExperimental() | |
+{ | |
+} | |
+ | |
+void QQuickWebViewExperimental::setUseTraditionalDesktopBehaviour(bool enable) | |
+{ | |
+ Q_D(QQuickWebView); | |
+ d->setUseTraditionalDesktopBehaviour(enable); | |
+} | |
+ | |
QQuickWebView::QQuickWebView(QQuickItem* parent) | |
: QQuickItem(parent) | |
, d_ptr(new QQuickWebViewPrivate) | |
+ , m_experimental(new QQuickWebViewExperimental(this)) | |
{ | |
Q_D(QQuickWebView); | |
d->initialize(this); | |
@@ -367,6 +385,7 @@ QQuickWebView::QQuickWebView(QQuickItem* parent) | |
QQuickWebView::QQuickWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, QQuickItem* parent) | |
: QQuickItem(parent) | |
, d_ptr(new QQuickWebViewPrivate) | |
+ , m_experimental(new QQuickWebViewExperimental(this)) | |
{ | |
Q_D(QQuickWebView); | |
d->initialize(this, contextRef, pageGroupRef); | |
@@ -468,6 +487,11 @@ QWebPreferences* QQuickWebView::preferences() const | |
return d->pageProxy->preferences(); | |
} | |
+QQuickWebViewExperimental* QQuickWebView::experimental() const | |
+{ | |
+ return m_experimental; | |
+} | |
+ | |
void QQuickWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry) | |
{ | |
Q_D(QQuickWebView); | |
@@ -493,5 +517,4 @@ WKPageRef QQuickWebView::pageRef() const | |
return d->pageProxy->pageRef(); | |
} | |
-#include "moc_qquickwebview.cpp" | |
#include "moc_qquickwebview_p.cpp" | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview.h | |
deleted file mode 100644 | |
index f8ba817..0000000 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.h | |
+++ /dev/null | |
@@ -1,138 +0,0 @@ | |
-/* | |
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- * | |
- * This library is free software; you can redistribute it and/or | |
- * modify it under the terms of the GNU Library General Public | |
- * License as published by the Free Software Foundation; either | |
- * version 2 of the License, or (at your option) any later version. | |
- * | |
- * 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 | |
- * Library General Public License for more details. | |
- * | |
- * You should have received a copy of the GNU Library General Public License | |
- * along with this program; see the file COPYING.LIB. If not, write to | |
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- * Boston, MA 02110-1301, USA. | |
- * | |
- */ | |
- | |
-#ifndef qquickwebview_h | |
-#define qquickwebview_h | |
- | |
-#include "qwebkitglobal.h" | |
-#include <QtDeclarative/qquickitem.h> | |
- | |
-class QQuickWebPage; | |
-class QQuickWebViewPrivate; | |
-class QWebDownloadItem; | |
-class QWebPreferences; | |
- | |
-namespace WebKit { | |
-class QtViewInterface; | |
-} | |
- | |
-namespace WTR { | |
-class PlatformWebView; | |
-} | |
- | |
-typedef const struct OpaqueWKContext* WKContextRef; | |
-typedef const struct OpaqueWKPageGroup* WKPageGroupRef; | |
-typedef const struct OpaqueWKPage* WKPageRef; | |
- | |
-QT_BEGIN_NAMESPACE | |
-class QPainter; | |
-class QUrl; | |
-QT_END_NAMESPACE | |
- | |
-class QWEBKIT_EXPORT QQuickWebView : public QQuickItem { | |
- Q_OBJECT | |
- Q_PROPERTY(QString title READ title NOTIFY titleChanged) | |
- Q_PROPERTY(QUrl url READ url NOTIFY urlChanged) | |
- Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged) | |
- Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY navigationStateChanged FINAL) | |
- Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY navigationStateChanged FINAL) | |
- Q_PROPERTY(bool canStop READ canStop NOTIFY navigationStateChanged FINAL) | |
- Q_PROPERTY(bool canReload READ canReload NOTIFY navigationStateChanged FINAL) | |
- Q_PROPERTY(QWebPreferences* preferences READ preferences CONSTANT FINAL) | |
- Q_PROPERTY(QQuickWebPage* page READ page CONSTANT FINAL) | |
- Q_ENUMS(NavigationPolicy) | |
- Q_ENUMS(ErrorType) | |
-public: | |
- enum NavigationPolicy { | |
- UsePolicy, | |
- DownloadPolicy, | |
- IgnorePolicy | |
- }; | |
- | |
- enum ErrorType { | |
- EngineError, | |
- NetworkError, | |
- HttpError, | |
- DownloadError | |
- }; | |
- QQuickWebView(QQuickItem* parent = 0); | |
- virtual ~QQuickWebView(); | |
- | |
- QUrl url() const; | |
- QString title() const; | |
- int loadProgress() const; | |
- | |
- bool canGoBack() const; | |
- bool canGoForward() const; | |
- bool canStop() const; | |
- bool canReload() const; | |
- | |
- QWebPreferences* preferences() const; | |
- QQuickWebPage* page(); | |
- | |
-public Q_SLOTS: | |
- void load(const QUrl&); | |
- void postMessage(const QString&); | |
- | |
- void goBack(); | |
- void goForward(); | |
- void stop(); | |
- void reload(); | |
- | |
-Q_SIGNALS: | |
- void titleChanged(const QString& title); | |
- void statusBarMessageChanged(const QString& message); | |
- void loadStarted(); | |
- void loadSucceeded(); | |
- void loadFailed(QQuickWebView::ErrorType errorType, int errorCode, const QUrl& url); | |
- void loadProgressChanged(int progress); | |
- void urlChanged(const QUrl& url); | |
- void messageReceived(const QVariantMap& message); | |
- void downloadRequested(QWebDownloadItem* downloadItem); | |
- void linkHovered(const QUrl& url, const QString& title); | |
- void viewModeChanged(); | |
- void navigationStateChanged(); | |
- | |
-protected: | |
- virtual void geometryChanged(const QRectF&, const QRectF&); | |
- virtual void touchEvent(QTouchEvent* event); | |
- | |
-private: | |
- Q_DECLARE_PRIVATE(QQuickWebView) | |
- | |
- QQuickWebView(WKContextRef, WKPageGroupRef, QQuickItem* parent = 0); | |
- WKPageRef pageRef() const; | |
- | |
- Q_PRIVATE_SLOT(d_func(), void _q_viewportUpdated()); | |
- Q_PRIVATE_SLOT(d_func(), void _q_viewportTrajectoryVectorChanged(const QPointF&)); | |
- Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFilesSelected()); | |
- Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFinished(int result)); | |
- Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged()); | |
- // Hides QObject::d_ptr allowing us to use the convenience macros. | |
- QScopedPointer<QQuickWebViewPrivate> d_ptr; | |
- | |
- friend class QtWebPageProxy; | |
- friend class WebKit::QtViewInterface; | |
- friend class WTR::PlatformWebView; | |
-}; | |
- | |
-QML_DECLARE_TYPE(QQuickWebView) | |
- | |
-#endif /* qquickwebview_h */ | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h | |
index 1883c7b..d73faa6 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h | |
@@ -21,77 +21,138 @@ | |
#ifndef qquickwebview_p_h | |
#define qquickwebview_p_h | |
-#include "QtPolicyInterface.h" | |
-#include "QtViewInterface.h" | |
-#include "QtViewportInteractionEngine.h" | |
-#include "QtWebPageProxy.h" | |
+#include "qwebkitglobal.h" | |
+#include <QtDeclarative/qquickitem.h> | |
-#include "qquickwebview.h" | |
+class QQuickWebPage; | |
+class QQuickWebViewPrivate; | |
+class QQuickWebViewExperimental; | |
+class QWebDownloadItem; | |
+class QWebPreferences; | |
-#include <QtCore/QObject> | |
-#include <QtCore/QScopedPointer> | |
+namespace WebKit { | |
+class QtViewInterface; | |
+} | |
-class QtWebPageProxy; | |
+namespace WTR { | |
+class PlatformWebView; | |
+} | |
+ | |
+typedef const struct OpaqueWKContext* WKContextRef; | |
+typedef const struct OpaqueWKPageGroup* WKPageGroupRef; | |
+typedef const struct OpaqueWKPage* WKPageRef; | |
QT_BEGIN_NAMESPACE | |
-class QFileDialog; | |
+class QPainter; | |
+class QUrl; | |
QT_END_NAMESPACE | |
-class QWEBKIT_EXPORT QQuickWebViewPrivate : public QObject, public WebKit::QtPolicyInterface { | |
+class QWEBKIT_EXPORT QQuickWebView : public QQuickItem { | |
Q_OBJECT | |
- Q_DECLARE_PUBLIC(QQuickWebView) | |
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged) | |
+ Q_PROPERTY(QUrl url READ url NOTIFY urlChanged) | |
+ Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged) | |
+ Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY navigationStateChanged FINAL) | |
+ Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY navigationStateChanged FINAL) | |
+ Q_PROPERTY(bool canStop READ canStop NOTIFY navigationStateChanged FINAL) | |
+ Q_PROPERTY(bool canReload READ canReload NOTIFY navigationStateChanged FINAL) | |
+ Q_PROPERTY(QWebPreferences* preferences READ preferences CONSTANT FINAL) | |
+ Q_PROPERTY(QQuickWebPage* page READ page CONSTANT FINAL) | |
+ Q_ENUMS(NavigationPolicy) | |
+ Q_ENUMS(ErrorType) | |
public: | |
- QQuickWebViewPrivate(); | |
- virtual ~QQuickWebViewPrivate() { } | |
- void setPageProxy(QtWebPageProxy*); | |
- void initialize(QQuickWebView* viewport, WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0); | |
- void initializeTouch(QQuickWebView* viewport); | |
- void initializeDesktop(QQuickWebView* viewport); | |
- void enableMouseEvents(); | |
- void disableMouseEvents(); | |
- | |
- void loadDidCommit(); | |
- void contentSizeChanged(const QSize& newSize); | |
- void scrollPositionRequested(const QPoint& pos); | |
- void updateViewportSize(); | |
- void updateViewportConstraints(); | |
- | |
- static QQuickWebViewPrivate* get(QQuickWebView* view) | |
- { | |
- return view->d_ptr.data(); | |
- } | |
- | |
- void _q_viewportUpdated(); | |
- void _q_viewportTrajectoryVectorChanged(const QPointF&); | |
- void _q_onOpenPanelFilesSelected(); | |
- void _q_onOpenPanelFinished(int result); | |
- void _q_onVisibleChanged(); | |
- | |
- // QtPolicyInterface. | |
- virtual QtPolicyInterface::PolicyAction navigationPolicyForURL(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers); | |
- | |
- void chooseFiles(WKOpenPanelResultListenerRef, const QStringList& selectedFileNames, WebKit::QtViewInterface::FileChooserType); | |
- void runJavaScriptAlert(const QString&); | |
- bool runJavaScriptConfirm(const QString&); | |
- QString runJavaScriptPrompt(const QString&, const QString& defaultValue, bool& ok); | |
- void didChangeViewportProperties(const WebCore::ViewportArguments& args); | |
- | |
-public slots: | |
- void setUseTraditionalDesktopBehaviour(bool enable); | |
+ enum NavigationPolicy { | |
+ UsePolicy, | |
+ DownloadPolicy, | |
+ IgnorePolicy | |
+ }; | |
+ | |
+ enum ErrorType { | |
+ EngineError, | |
+ NetworkError, | |
+ HttpError, | |
+ DownloadError | |
+ }; | |
+ QQuickWebView(QQuickItem* parent = 0); | |
+ virtual ~QQuickWebView(); | |
+ | |
+ QUrl url() const; | |
+ QString title() const; | |
+ int loadProgress() const; | |
+ | |
+ bool canGoBack() const; | |
+ bool canGoForward() const; | |
+ bool canStop() const; | |
+ bool canReload() const; | |
+ | |
+ QWebPreferences* preferences() const; | |
+ QQuickWebPage* page(); | |
+ | |
+ QQuickWebViewExperimental* experimental() const; | |
+ | |
+public Q_SLOTS: | |
+ void load(const QUrl&); | |
+ void postMessage(const QString&); | |
+ | |
+ void goBack(); | |
+ void goForward(); | |
+ void stop(); | |
+ void reload(); | |
+ | |
+Q_SIGNALS: | |
+ void titleChanged(const QString& title); | |
+ void statusBarMessageChanged(const QString& message); | |
+ void loadStarted(); | |
+ void loadSucceeded(); | |
+ void loadFailed(QQuickWebView::ErrorType errorType, int errorCode, const QUrl& url); | |
+ void loadProgressChanged(int progress); | |
+ void urlChanged(const QUrl& url); | |
+ void messageReceived(const QVariantMap& message); | |
+ void downloadRequested(QWebDownloadItem* downloadItem); | |
+ void linkHovered(const QUrl& url, const QString& title); | |
+ void viewModeChanged(); | |
+ void navigationStateChanged(); | |
+ | |
+protected: | |
+ virtual void geometryChanged(const QRectF&, const QRectF&); | |
+ virtual void touchEvent(QTouchEvent* event); | |
private: | |
- QScopedPointer<QQuickWebPage> pageView; | |
- QScopedPointer<WebKit::QtViewInterface> viewInterface; | |
- QScopedPointer<QtViewportInteractionEngine> interactionEngine; | |
+ Q_DECLARE_PRIVATE(QQuickWebView) | |
+ | |
+ QQuickWebView(WKContextRef, WKPageGroupRef, QQuickItem* parent = 0); | |
+ WKPageRef pageRef() const; | |
+ | |
+ Q_PRIVATE_SLOT(d_func(), void _q_viewportUpdated()); | |
+ Q_PRIVATE_SLOT(d_func(), void _q_viewportTrajectoryVectorChanged(const QPointF&)); | |
+ Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFilesSelected()); | |
+ Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFinished(int result)); | |
+ Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged()); | |
+ // Hides QObject::d_ptr allowing us to use the convenience macros. | |
+ QScopedPointer<QQuickWebViewPrivate> d_ptr; | |
+ QQuickWebViewExperimental* m_experimental; | |
+ | |
+ friend class QtWebPageProxy; | |
+ friend class WebKit::QtViewInterface; | |
+ friend class WTR::PlatformWebView; | |
+ friend class QQuickWebViewExperimental; | |
+}; | |
+ | |
+QML_DECLARE_TYPE(QQuickWebView) | |
- WebCore::ViewportArguments viewportArguments; | |
+class QWEBKIT_EXPORT QQuickWebViewExperimental : public QObject { | |
+ Q_OBJECT | |
+public: | |
+ QQuickWebViewExperimental(QQuickWebView* webView); | |
+ virtual ~QQuickWebViewExperimental(); | |
+ void setUseTraditionalDesktopBehaviour(bool enable); | |
+private: | |
QQuickWebView* q_ptr; | |
- QScopedPointer<QtWebPageProxy> pageProxy; | |
+ QQuickWebViewPrivate* d_ptr; | |
- bool useTraditionalDesktopBehaviour; | |
- QFileDialog* fileDialog; | |
- WKOpenPanelResultListenerRef openPanelResultListener; | |
+ Q_DECLARE_PRIVATE(QQuickWebView) | |
+ Q_DECLARE_PUBLIC(QQuickWebView) | |
}; | |
-#endif /* qquickwebview_p_h */ | |
+#endif // qquickwebview_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h | |
new file mode 100644 | |
index 0000000..c6abc16 | |
--- /dev/null | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h | |
@@ -0,0 +1,90 @@ | |
+/* | |
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
+ * | |
+ * This library is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU Library General Public | |
+ * License as published by the Free Software Foundation; either | |
+ * version 2 of the License, or (at your option) any later version. | |
+ * | |
+ * 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 | |
+ * Library General Public License for more details. | |
+ * | |
+ * You should have received a copy of the GNU Library General Public License | |
+ * along with this program; see the file COPYING.LIB. If not, write to | |
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
+ * Boston, MA 02110-1301, USA. | |
+ * | |
+ */ | |
+ | |
+#ifndef qquickwebview_p_p_h | |
+#define qquickwebview_p_p_h | |
+ | |
+#include "QtPolicyInterface.h" | |
+#include "QtViewInterface.h" | |
+#include "QtViewportInteractionEngine.h" | |
+#include "QtWebPageProxy.h" | |
+ | |
+#include "qquickwebview_p.h" | |
+ | |
+#include <QtCore/QObject> | |
+#include <QtCore/QScopedPointer> | |
+ | |
+class QtWebPageProxy; | |
+ | |
+QT_BEGIN_NAMESPACE | |
+class QFileDialog; | |
+QT_END_NAMESPACE | |
+ | |
+class QWEBKIT_EXPORT QQuickWebViewPrivate : public WebKit::QtPolicyInterface { | |
+ | |
+ Q_DECLARE_PUBLIC(QQuickWebView) | |
+public: | |
+ QQuickWebViewPrivate(); | |
+ virtual ~QQuickWebViewPrivate() { } | |
+ void setPageProxy(QtWebPageProxy*); | |
+ void initialize(QQuickWebView* viewport, WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0); | |
+ void initializeTouch(QQuickWebView* viewport); | |
+ void initializeDesktop(QQuickWebView* viewport); | |
+ void enableMouseEvents(); | |
+ void disableMouseEvents(); | |
+ | |
+ void loadDidCommit(); | |
+ void contentSizeChanged(const QSize& newSize); | |
+ void scrollPositionRequested(const QPoint& pos); | |
+ void updateViewportSize(); | |
+ void updateViewportConstraints(); | |
+ | |
+ void _q_viewportUpdated(); | |
+ void _q_viewportTrajectoryVectorChanged(const QPointF&); | |
+ void _q_onOpenPanelFilesSelected(); | |
+ void _q_onOpenPanelFinished(int result); | |
+ void _q_onVisibleChanged(); | |
+ | |
+ // QtPolicyInterface. | |
+ virtual QtPolicyInterface::PolicyAction navigationPolicyForURL(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers); | |
+ | |
+ void chooseFiles(WKOpenPanelResultListenerRef, const QStringList& selectedFileNames, WebKit::QtViewInterface::FileChooserType); | |
+ void runJavaScriptAlert(const QString&); | |
+ bool runJavaScriptConfirm(const QString&); | |
+ QString runJavaScriptPrompt(const QString&, const QString& defaultValue, bool& ok); | |
+ void didChangeViewportProperties(const WebCore::ViewportArguments& args); | |
+ void setUseTraditionalDesktopBehaviour(bool enable); | |
+ | |
+private: | |
+ QScopedPointer<QQuickWebPage> pageView; | |
+ QScopedPointer<WebKit::QtViewInterface> viewInterface; | |
+ QScopedPointer<QtViewportInteractionEngine> interactionEngine; | |
+ | |
+ WebCore::ViewportArguments viewportArguments; | |
+ | |
+ QQuickWebView* q_ptr; | |
+ QScopedPointer<QtWebPageProxy> pageProxy; | |
+ | |
+ bool useTraditionalDesktopBehaviour; | |
+ QFileDialog* fileDialog; | |
+ WKOpenPanelResultListenerRef openPanelResultListener; | |
+}; | |
+ | |
+#endif // qquickwebview_p_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension.cpp | |
deleted file mode 100644 | |
index 7ac4395..0000000 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension.cpp | |
+++ /dev/null | |
@@ -1,36 +0,0 @@ | |
-/* | |
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- * | |
- * This library is free software; you can redistribute it and/or | |
- * modify it under the terms of the GNU Library General Public | |
- * License as published by the Free Software Foundation; either | |
- * version 2 of the License, or (at your option) any later version. | |
- * | |
- * 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 | |
- * Library General Public License for more details. | |
- * | |
- * You should have received a copy of the GNU Library General Public License | |
- * along with this program; see the file COPYING.LIB. If not, write to | |
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- * Boston, MA 02110-1301, USA. | |
- * | |
- */ | |
- | |
-#include "config.h" | |
-#include "qquickwebviewprivateextension_p.h" | |
- | |
-#include "qquickwebpage.h" | |
-#include "qquickwebview.h" | |
-#include "qquickwebview_p.h" | |
- | |
-QQuickWebViewPrivateExtension::QQuickWebViewPrivateExtension(QObject* parent) | |
- : QObject(parent) | |
-{ | |
-} | |
- | |
-QQuickWebViewPrivate* QQuickWebViewPrivateExtension::viewPrivate() | |
-{ | |
- return QQuickWebViewPrivate::get(static_cast<QQuickWebView*>(parent())); | |
-} | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension_p.h | |
deleted file mode 100644 | |
index 1066552..0000000 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension_p.h | |
+++ /dev/null | |
@@ -1,38 +0,0 @@ | |
-/* | |
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- * | |
- * This library is free software; you can redistribute it and/or | |
- * modify it under the terms of the GNU Library General Public | |
- * License as published by the Free Software Foundation; either | |
- * version 2 of the License, or (at your option) any later version. | |
- * | |
- * 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 | |
- * Library General Public License for more details. | |
- * | |
- * You should have received a copy of the GNU Library General Public License | |
- * along with this program; see the file COPYING.LIB. If not, write to | |
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- * Boston, MA 02110-1301, USA. | |
- * | |
- */ | |
- | |
-#ifndef qquickwebviewprivateextension_p_h | |
-#define qquickwebviewprivateextension_p_h | |
- | |
-#include "qwebkitglobal.h" | |
- | |
-#include <QObject> | |
- | |
-class QQuickWebViewPrivate; | |
- | |
-class QWEBKIT_EXPORT QQuickWebViewPrivateExtension : public QObject { | |
- Q_OBJECT | |
- Q_PROPERTY(QQuickWebViewPrivate* privateObject READ viewPrivate CONSTANT FINAL) | |
-public: | |
- QQuickWebViewPrivateExtension(QObject *parent = 0); | |
- QQuickWebViewPrivate* viewPrivate(); | |
-}; | |
- | |
-#endif // qquickwebviewprivateextension_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp | |
index 6590b74..8547643 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp | |
+++ b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp | |
@@ -19,10 +19,10 @@ | |
*/ | |
#include "config.h" | |
-#include "qwebdownloaditem.h" | |
+#include "qwebdownloaditem_p.h" | |
#include "DownloadProxy.h" | |
-#include "qwebdownloaditem_p.h" | |
+#include "qwebdownloaditem_p_p.h" | |
QWebDownloadItemPrivate::QWebDownloadItemPrivate(QWebDownloadItem* qq) | |
: q(qq) | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.h b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.h | |
deleted file mode 100644 | |
index b44c5b0..0000000 | |
--- a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.h | |
+++ /dev/null | |
@@ -1,86 +0,0 @@ | |
-/* | |
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- * | |
- * This library is free software; you can redistribute it and/or | |
- * modify it under the terms of the GNU Library General Public | |
- * License as published by the Free Software Foundation; either | |
- * version 2 of the License, or (at your option) any later version. | |
- * | |
- * 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 | |
- * Library General Public License for more details. | |
- * | |
- * You should have received a copy of the GNU Library General Public License | |
- * along with this program; see the file COPYING.LIB. If not, write to | |
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- * Boston, MA 02110-1301, USA. | |
- * | |
- */ | |
- | |
-#ifndef qwebdownloaditem_h | |
-#define qwebdownloaditem_h | |
- | |
-#include "qwebkitglobal.h" | |
-#include <QObject> | |
-#include <QUrl> | |
- | |
-class QWebDownloadItemPrivate; | |
-class QtWebError; | |
- | |
-QT_BEGIN_NAMESPACE | |
-class QString; | |
-QT_END_NAMESPACE | |
- | |
-namespace WebKit { | |
-class QtDownloadManager; | |
-} | |
- | |
-class QWEBKIT_EXPORT QWebDownloadItem : public QObject { | |
- Q_OBJECT | |
- Q_PROPERTY(quint64 expectedContentLength READ expectedContentLength CONSTANT FINAL) | |
- Q_PROPERTY(QString destinationPath READ destinationPath WRITE setDestinationPath) | |
- Q_PROPERTY(QString suggestedFilename READ suggestedFilename CONSTANT FINAL) | |
- Q_PROPERTY(quint64 totalBytesReceived READ totalBytesReceived NOTIFY totalBytesReceivedChanged FINAL) | |
- Q_PROPERTY(QUrl url READ url CONSTANT FINAL) | |
- Q_ENUMS(DownloadError) | |
-public: | |
- virtual ~QWebDownloadItem(); | |
- | |
- enum DownloadError { | |
- Aborted = 0, | |
- CannotWriteToFile, | |
- CannotOpenFile, | |
- DestinationAlreadyExists, | |
- Cancelled, | |
- CannotDetermineFilename, | |
- NetworkFailure | |
- }; | |
- | |
- QUrl url() const; | |
- QString destinationPath() const; | |
- QString suggestedFilename() const; | |
- QString mimeType() const; | |
- quint64 expectedContentLength() const; | |
- quint64 totalBytesReceived() const; | |
- void setDestinationPath(const QString& destination); | |
- | |
-public Q_SLOTS: | |
- void start(); | |
- void cancel(); | |
- | |
-Q_SIGNALS: | |
- void destinationFileCreated(const QString& destinationPath); | |
- void totalBytesReceivedChanged(quint64 bytesReceived); | |
- void succeeded(); | |
- void failed(QWebDownloadItem::DownloadError error, const QUrl& url, const QString& description); | |
- | |
-private: | |
- QWebDownloadItem(QObject* parent = 0); | |
- QWebDownloadItemPrivate* d; | |
- | |
- friend class WebKit::QtDownloadManager; | |
- friend class QtWebPageProxy; | |
-}; | |
- | |
-#endif /* qwebdownloaditem_h */ | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h | |
index bb8c252..e809236 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h | |
+++ b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h | |
@@ -1,53 +1,86 @@ | |
/* | |
- Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- | |
- This library is free software; you can redistribute it and/or | |
- modify it under the terms of the GNU Library General Public | |
- License as published by the Free Software Foundation; either | |
- version 2 of the License, or (at your option) any later version. | |
- | |
- This library 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 | |
- Library General Public License for more details. | |
- | |
- You should have received a copy of the GNU Library General Public License | |
- along with this library; see the file COPYING.LIB. If not, write to | |
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- Boston, MA 02110-1301, USA. | |
-*/ | |
- | |
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
+ * | |
+ * This library is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU Library General Public | |
+ * License as published by the Free Software Foundation; either | |
+ * version 2 of the License, or (at your option) any later version. | |
+ * | |
+ * 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 | |
+ * Library General Public License for more details. | |
+ * | |
+ * You should have received a copy of the GNU Library General Public License | |
+ * along with this program; see the file COPYING.LIB. If not, write to | |
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
+ * Boston, MA 02110-1301, USA. | |
+ * | |
+ */ | |
#ifndef qwebdownloaditem_p_h | |
#define qwebdownloaditem_p_h | |
-#include "qwebdownloaditem.h" | |
+#include "qwebkitglobal.h" | |
+#include <QObject> | |
#include <QUrl> | |
+class QWebDownloadItemPrivate; | |
+class QtWebError; | |
+ | |
+QT_BEGIN_NAMESPACE | |
+class QString; | |
+QT_END_NAMESPACE | |
+ | |
namespace WebKit { | |
-class DownloadProxy; | |
+class QtDownloadManager; | |
} | |
-class QWebDownloadItemPrivate : public QObject { | |
+class QWEBKIT_EXPORT QWebDownloadItem : public QObject { | |
Q_OBJECT | |
+ Q_PROPERTY(quint64 expectedContentLength READ expectedContentLength CONSTANT FINAL) | |
+ Q_PROPERTY(QString destinationPath READ destinationPath WRITE setDestinationPath) | |
+ Q_PROPERTY(QString suggestedFilename READ suggestedFilename CONSTANT FINAL) | |
+ Q_PROPERTY(quint64 totalBytesReceived READ totalBytesReceived NOTIFY totalBytesReceivedChanged FINAL) | |
+ Q_PROPERTY(QUrl url READ url CONSTANT FINAL) | |
+ Q_ENUMS(DownloadError) | |
public: | |
- QWebDownloadItemPrivate(QWebDownloadItem*); | |
- | |
- void didReceiveResponse(QWebDownloadItem* download) { emit receivedResponse(download); } | |
+ virtual ~QWebDownloadItem(); | |
- QWebDownloadItem* q; | |
+ enum DownloadError { | |
+ Aborted = 0, | |
+ CannotWriteToFile, | |
+ CannotOpenFile, | |
+ DestinationAlreadyExists, | |
+ Cancelled, | |
+ CannotDetermineFilename, | |
+ NetworkFailure | |
+ }; | |
- WebKit::DownloadProxy* downloadProxy; | |
+ QUrl url() const; | |
+ QString destinationPath() const; | |
+ QString suggestedFilename() const; | |
+ QString mimeType() const; | |
+ quint64 expectedContentLength() const; | |
+ quint64 totalBytesReceived() const; | |
+ void setDestinationPath(const QString& destination); | |
- QUrl sourceUrl; | |
- QString suggestedFilename; | |
- QString destinationPath; | |
- QString mimeType; | |
- quint64 expectedContentLength; | |
- quint64 totalBytesReceived; | |
+public Q_SLOTS: | |
+ void start(); | |
+ void cancel(); | |
Q_SIGNALS: | |
- void receivedResponse(QWebDownloadItem*); | |
+ void destinationFileCreated(const QString& destinationPath); | |
+ void totalBytesReceivedChanged(quint64 bytesReceived); | |
+ void succeeded(); | |
+ void failed(QWebDownloadItem::DownloadError error, const QUrl& url, const QString& description); | |
+ | |
+private: | |
+ QWebDownloadItem(QObject* parent = 0); | |
+ QWebDownloadItemPrivate* d; | |
+ | |
+ friend class WebKit::QtDownloadManager; | |
+ friend class QtWebPageProxy; | |
}; | |
-#endif /* qwebdownloaditem_p_h */ | |
+#endif // qwebdownloaditem_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p_p.h b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p_p.h | |
new file mode 100644 | |
index 0000000..780848b | |
--- /dev/null | |
+++ b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p_p.h | |
@@ -0,0 +1,53 @@ | |
+/* | |
+ Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
+ | |
+ This library is free software; you can redistribute it and/or | |
+ modify it under the terms of the GNU Library General Public | |
+ License as published by the Free Software Foundation; either | |
+ version 2 of the License, or (at your option) any later version. | |
+ | |
+ This library 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 | |
+ Library General Public License for more details. | |
+ | |
+ You should have received a copy of the GNU Library General Public License | |
+ along with this library; see the file COPYING.LIB. If not, write to | |
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
+ Boston, MA 02110-1301, USA. | |
+*/ | |
+ | |
+ | |
+#ifndef qwebdownloaditem_p_p_h | |
+#define qwebdownloaditem_p_p_h | |
+ | |
+#include "qwebdownloaditem_p.h" | |
+#include <QUrl> | |
+ | |
+namespace WebKit { | |
+class DownloadProxy; | |
+} | |
+ | |
+class QWebDownloadItemPrivate : public QObject { | |
+ Q_OBJECT | |
+public: | |
+ QWebDownloadItemPrivate(QWebDownloadItem*); | |
+ | |
+ void didReceiveResponse(QWebDownloadItem* download) { emit receivedResponse(download); } | |
+ | |
+ QWebDownloadItem* q; | |
+ | |
+ WebKit::DownloadProxy* downloadProxy; | |
+ | |
+ QUrl sourceUrl; | |
+ QString suggestedFilename; | |
+ QString destinationPath; | |
+ QString mimeType; | |
+ quint64 expectedContentLength; | |
+ quint64 totalBytesReceived; | |
+ | |
+Q_SIGNALS: | |
+ void receivedResponse(QWebDownloadItem*); | |
+}; | |
+ | |
+#endif // qwebdownloaditem_p_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp | |
index ccef9eb..2071bae 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp | |
+++ b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp | |
@@ -18,7 +18,7 @@ | |
*/ | |
#include "config.h" | |
-#include "qwebpreferences.h" | |
+#include "qwebpreferences_p.h" | |
#include "QtWebPageProxy.h" | |
#include "WKPageGroup.h" | |
@@ -26,7 +26,7 @@ | |
#include "WKPreferencesPrivate.h" | |
#include "WKRetainPtr.h" | |
#include "WKStringQt.h" | |
-#include "qwebpreferences_p.h" | |
+#include "qwebpreferences_p_p.h" | |
QWebPreferences* QWebPreferencesPrivate::createPreferences(QtWebPageProxy* qtWebPageProxy) | |
{ | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.h b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.h | |
deleted file mode 100644 | |
index 4e20073..0000000 | |
--- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.h | |
+++ /dev/null | |
@@ -1,141 +0,0 @@ | |
-/* | |
- Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
- | |
- This library is free software; you can redistribute it and/or | |
- modify it under the terms of the GNU Library General Public | |
- License as published by the Free Software Foundation; either | |
- version 2 of the License, or (at your option) any later version. | |
- | |
- This library 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 | |
- Library General Public License for more details. | |
- | |
- You should have received a copy of the GNU Library General Public License | |
- along with this library; see the file COPYING.LIB. If not, write to | |
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
- Boston, MA 02110-1301, USA. | |
-*/ | |
- | |
-#ifndef qwebpreferences_h | |
-#define qwebpreferences_h | |
- | |
-#include "qwebkitglobal.h" | |
- | |
-#include <QtCore/QObject> | |
- | |
-class QWebPreferencesPrivate; | |
- | |
-class QWEBKIT_EXPORT QWebPreferences : public QObject { | |
- Q_OBJECT | |
-public: | |
- ~QWebPreferences(); | |
- | |
- Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages NOTIFY autoLoadImagesChanged FINAL) | |
- Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled NOTIFY javascriptEnabledChanged FINAL) | |
- Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged FINAL) | |
- Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled NOTIFY offlineWebApplicationCacheEnabledChanged FINAL) | |
- Q_PROPERTY(bool localStorageEnabled READ localStorageEnabled WRITE setLocalStorageEnabled NOTIFY localStorageEnabledChanged FINAL) | |
- Q_PROPERTY(bool xssAuditingEnabled READ xssAuditingEnabled WRITE setXssAuditingEnabled NOTIFY xssAuditingEnabledChanged FINAL) | |
- Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled NOTIFY privateBrowsingEnabledChanged FINAL) | |
- Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged FINAL) | |
- Q_PROPERTY(bool navigatorQtObjectEnabled READ navigatorQtObjectEnabled WRITE setNavigatorQtObjectEnabled NOTIFY navigatorQtObjectEnabledChanged FINAL) | |
- | |
- Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily NOTIFY standardFontFamilyChanged FINAL) | |
- Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily NOTIFY fixedFontFamilyChanged FINAL) | |
- Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily NOTIFY serifFontFamilyChanged FINAL) | |
- Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily NOTIFY sansSerifFontFamilyChanged FINAL) | |
- Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily NOTIFY cursiveFontFamilyChanged FINAL) | |
- Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily NOTIFY fantasyFontFamilyChanged FINAL) | |
- | |
- Q_PROPERTY(unsigned minimumFontSize READ minimumFontSize WRITE setMinimumFontSize NOTIFY minimumFontSizeChanged FINAL) | |
- Q_PROPERTY(unsigned defaultFontSize READ defaultFontSize WRITE setDefaultFontSize NOTIFY defaultFontSizeChanged FINAL) | |
- Q_PROPERTY(unsigned defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize NOTIFY defaultFixedFontSizeChanged FINAL) | |
- | |
- bool autoLoadImages() const; | |
- void setAutoLoadImages(bool enable); | |
- | |
- bool javascriptEnabled() const; | |
- void setJavascriptEnabled(bool enable); | |
- | |
- bool pluginsEnabled() const; | |
- void setPluginsEnabled(bool enable); | |
- | |
- bool offlineWebApplicationCacheEnabled() const; | |
- void setOfflineWebApplicationCacheEnabled(bool enable); | |
- | |
- bool localStorageEnabled() const; | |
- void setLocalStorageEnabled(bool enable); | |
- | |
- bool xssAuditingEnabled() const; | |
- void setXssAuditingEnabled(bool enable); | |
- | |
- bool privateBrowsingEnabled() const; | |
- void setPrivateBrowsingEnabled(bool enable); | |
- | |
- bool dnsPrefetchEnabled() const; | |
- void setDnsPrefetchEnabled(bool enable); | |
- | |
- bool navigatorQtObjectEnabled() const; | |
- void setNavigatorQtObjectEnabled(bool); | |
- | |
- QString standardFontFamily() const; | |
- void setStandardFontFamily(const QString& family); | |
- | |
- QString fixedFontFamily() const; | |
- void setFixedFontFamily(const QString& family); | |
- | |
- QString serifFontFamily() const; | |
- void setSerifFontFamily(const QString& family); | |
- | |
- QString sansSerifFontFamily() const; | |
- void setSansSerifFontFamily(const QString& family); | |
- | |
- QString cursiveFontFamily() const; | |
- void setCursiveFontFamily(const QString& family); | |
- | |
- QString fantasyFontFamily() const; | |
- void setFantasyFontFamily(const QString& family); | |
- | |
- unsigned minimumFontSize() const; | |
- void setMinimumFontSize(unsigned size); | |
- | |
- unsigned defaultFontSize() const; | |
- void setDefaultFontSize(unsigned size); | |
- | |
- unsigned defaultFixedFontSize() const; | |
- void setDefaultFixedFontSize(unsigned size); | |
- | |
-Q_SIGNALS: | |
- void autoLoadImagesChanged(); | |
- void pluginsEnabledChanged(); | |
- void javascriptEnabledChanged(); | |
- void offlineWebApplicationCacheEnabledChanged(); | |
- void localStorageEnabledChanged(); | |
- void xssAuditingEnabledChanged(); | |
- void privateBrowsingEnabledChanged(); | |
- void dnsPrefetchEnabledChanged(); | |
- void navigatorQtObjectEnabledChanged(); | |
- | |
- void standardFontFamilyChanged(); | |
- void fixedFontFamilyChanged(); | |
- void serifFontFamilyChanged(); | |
- void sansSerifFontFamilyChanged(); | |
- void cursiveFontFamilyChanged(); | |
- void fantasyFontFamilyChanged(); | |
- | |
- void minimumFontSizeChanged(); | |
- void defaultFontSizeChanged(); | |
- void defaultFixedFontSizeChanged(); | |
- | |
-private: | |
- Q_DISABLE_COPY(QWebPreferences) | |
- | |
- QWebPreferences(); | |
- | |
- QWebPreferencesPrivate *d; | |
- | |
- friend class QWebPreferencesPrivate; | |
-}; | |
- | |
-#endif // qwebpreferences_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h b/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h | |
index bda2f4a..29df04c 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h | |
+++ b/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h | |
@@ -1,5 +1,5 @@ | |
/* | |
- Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | |
+ Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Library General Public | |
@@ -17,55 +17,125 @@ | |
Boston, MA 02110-1301, USA. | |
*/ | |
-#include "WKPreferences.h" | |
+#ifndef qwebpreferences_p_h | |
+#define qwebpreferences_p_h | |
-class QtWebPageProxy; | |
+#include "qwebkitglobal.h" | |
-class QWebPreferencesPrivate { | |
+#include <QtCore/QObject> | |
+ | |
+class QWebPreferencesPrivate; | |
+ | |
+class QWEBKIT_EXPORT QWebPreferences : public QObject { | |
+ Q_OBJECT | |
public: | |
+ ~QWebPreferences(); | |
+ | |
+ Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages NOTIFY autoLoadImagesChanged FINAL) | |
+ Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled NOTIFY javascriptEnabledChanged FINAL) | |
+ Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged FINAL) | |
+ Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled NOTIFY offlineWebApplicationCacheEnabledChanged FINAL) | |
+ Q_PROPERTY(bool localStorageEnabled READ localStorageEnabled WRITE setLocalStorageEnabled NOTIFY localStorageEnabledChanged FINAL) | |
+ Q_PROPERTY(bool xssAuditingEnabled READ xssAuditingEnabled WRITE setXssAuditingEnabled NOTIFY xssAuditingEnabledChanged FINAL) | |
+ Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled NOTIFY privateBrowsingEnabledChanged FINAL) | |
+ Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged FINAL) | |
+ Q_PROPERTY(bool navigatorQtObjectEnabled READ navigatorQtObjectEnabled WRITE setNavigatorQtObjectEnabled NOTIFY navigatorQtObjectEnabledChanged FINAL) | |
+ | |
+ Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily NOTIFY standardFontFamilyChanged FINAL) | |
+ Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily NOTIFY fixedFontFamilyChanged FINAL) | |
+ Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily NOTIFY serifFontFamilyChanged FINAL) | |
+ Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily NOTIFY sansSerifFontFamilyChanged FINAL) | |
+ Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily NOTIFY cursiveFontFamilyChanged FINAL) | |
+ Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily NOTIFY fantasyFontFamilyChanged FINAL) | |
+ | |
+ Q_PROPERTY(unsigned minimumFontSize READ minimumFontSize WRITE setMinimumFontSize NOTIFY minimumFontSizeChanged FINAL) | |
+ Q_PROPERTY(unsigned defaultFontSize READ defaultFontSize WRITE setDefaultFontSize NOTIFY defaultFontSizeChanged FINAL) | |
+ Q_PROPERTY(unsigned defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize NOTIFY defaultFixedFontSizeChanged FINAL) | |
+ | |
+ bool autoLoadImages() const; | |
+ void setAutoLoadImages(bool enable); | |
+ | |
+ bool javascriptEnabled() const; | |
+ void setJavascriptEnabled(bool enable); | |
+ | |
+ bool pluginsEnabled() const; | |
+ void setPluginsEnabled(bool enable); | |
+ | |
+ bool offlineWebApplicationCacheEnabled() const; | |
+ void setOfflineWebApplicationCacheEnabled(bool enable); | |
+ | |
+ bool localStorageEnabled() const; | |
+ void setLocalStorageEnabled(bool enable); | |
+ | |
+ bool xssAuditingEnabled() const; | |
+ void setXssAuditingEnabled(bool enable); | |
+ | |
+ bool privateBrowsingEnabled() const; | |
+ void setPrivateBrowsingEnabled(bool enable); | |
+ | |
+ bool dnsPrefetchEnabled() const; | |
+ void setDnsPrefetchEnabled(bool enable); | |
+ | |
+ bool navigatorQtObjectEnabled() const; | |
+ void setNavigatorQtObjectEnabled(bool); | |
+ | |
+ QString standardFontFamily() const; | |
+ void setStandardFontFamily(const QString& family); | |
- enum WebAttribute { | |
- AutoLoadImages, | |
- JavascriptEnabled, | |
- PluginsEnabled, | |
- OfflineWebApplicationCacheEnabled, | |
- LocalStorageEnabled, | |
- XSSAuditingEnabled, | |
- FrameFlatteningEnabled, | |
- PrivateBrowsingEnabled, | |
- AcceleratedCompositingEnabled, | |
- DnsPrefetchEnabled | |
- }; | |
- | |
- enum FontFamily { | |
- StandardFont, | |
- FixedFont, | |
- SerifFont, | |
- SansSerifFont, | |
- CursiveFont, | |
- FantasyFont | |
- }; | |
- | |
- enum FontSizeType { | |
- MinimumFontSize, | |
- DefaultFontSize, | |
- DefaultFixedFontSize | |
- }; | |
- | |
- static QWebPreferences* createPreferences(QtWebPageProxy*); | |
- | |
- void setAttribute(WebAttribute attr, bool enable); | |
- bool testAttribute(WebAttribute attr) const; | |
- | |
- void setFontFamily(FontFamily which, const QString& family); | |
- QString fontFamily(FontFamily which) const; | |
- | |
- void setFontSize(FontSizeType type, unsigned size); | |
- unsigned fontSize(FontSizeType type) const; | |
- | |
- WKPreferencesRef preferencesRef() const; | |
- | |
- QtWebPageProxy* qtWebPageProxy; | |
- | |
- static QWebPreferencesPrivate* get(QWebPreferences*); | |
+ QString fixedFontFamily() const; | |
+ void setFixedFontFamily(const QString& family); | |
+ | |
+ QString serifFontFamily() const; | |
+ void setSerifFontFamily(const QString& family); | |
+ | |
+ QString sansSerifFontFamily() const; | |
+ void setSansSerifFontFamily(const QString& family); | |
+ | |
+ QString cursiveFontFamily() const; | |
+ void setCursiveFontFamily(const QString& family); | |
+ | |
+ QString fantasyFontFamily() const; | |
+ void setFantasyFontFamily(const QString& family); | |
+ | |
+ unsigned minimumFontSize() const; | |
+ void setMinimumFontSize(unsigned size); | |
+ | |
+ unsigned defaultFontSize() const; | |
+ void setDefaultFontSize(unsigned size); | |
+ | |
+ unsigned defaultFixedFontSize() const; | |
+ void setDefaultFixedFontSize(unsigned size); | |
+ | |
+Q_SIGNALS: | |
+ void autoLoadImagesChanged(); | |
+ void pluginsEnabledChanged(); | |
+ void javascriptEnabledChanged(); | |
+ void offlineWebApplicationCacheEnabledChanged(); | |
+ void localStorageEnabledChanged(); | |
+ void xssAuditingEnabledChanged(); | |
+ void privateBrowsingEnabledChanged(); | |
+ void dnsPrefetchEnabledChanged(); | |
+ void navigatorQtObjectEnabledChanged(); | |
+ | |
+ void standardFontFamilyChanged(); | |
+ void fixedFontFamilyChanged(); | |
+ void serifFontFamilyChanged(); | |
+ void sansSerifFontFamilyChanged(); | |
+ void cursiveFontFamilyChanged(); | |
+ void fantasyFontFamilyChanged(); | |
+ | |
+ void minimumFontSizeChanged(); | |
+ void defaultFontSizeChanged(); | |
+ void defaultFixedFontSizeChanged(); | |
+ | |
+private: | |
+ Q_DISABLE_COPY(QWebPreferences) | |
+ | |
+ QWebPreferences(); | |
+ | |
+ QWebPreferencesPrivate *d; | |
+ | |
+ friend class QWebPreferencesPrivate; | |
}; | |
+ | |
+#endif // qwebpreferences_p_h | |
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro | |
index 64037e4..59947b0 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro | |
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro | |
@@ -1,5 +1,6 @@ | |
include(../tests.pri) | |
+CONFIG += qtwebkit-private | |
CONFIG += warn_on testcase | |
QT -= testlib | |
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp | |
index 526644b..ec6fd45 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp | |
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp | |
@@ -20,8 +20,7 @@ | |
#include "config.h" | |
#include "../util.h" | |
-#include "qquickwebpage.h" | |
-#include "qquickwebview.h" | |
+#include "qquickwebpage_p.h" | |
#include "qquickwebview_p.h" | |
#include <QVarLengthArray> | |
@@ -33,7 +32,7 @@ public: | |
DesktopWebView(QQuickItem* parent = 0) | |
: QQuickWebView(parent) | |
{ | |
- QQuickWebViewPrivate::get(this)->setUseTraditionalDesktopBehaviour(true); | |
+ experimental()->setUseTraditionalDesktopBehaviour(true); | |
} | |
}; | |
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro | |
index e99c7f4..728521f 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro | |
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro | |
@@ -1 +1,2 @@ | |
include(../tests.pri) | |
+CONFIG += qtwebkit-private | |
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp | |
index eb49f2e..e43e665 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp | |
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp | |
@@ -22,8 +22,8 @@ | |
#include <QScopedPointer> | |
#include <QtTest/QtTest> | |
-#include <qquickwebpage.h> | |
-#include <qquickwebview.h> | |
+#include <qquickwebpage_p.h> | |
+#include <qquickwebview_p.h> | |
class tst_QQuickWebView : public QObject { | |
Q_OBJECT | |
diff --git a/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp b/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp | |
index 3f97fc6..10a40e2 100644 | |
--- a/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp | |
+++ b/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp | |
@@ -27,8 +27,8 @@ | |
#include "WKStringQt.h" | |
#include "WKURLQt.h" | |
#include "WebContext.h" | |
-#include "qwebdownloaditem.h" | |
#include "qwebdownloaditem_p.h" | |
+#include "qwebdownloaditem_p_p.h" | |
namespace WebKit { | |
diff --git a/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp b/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp | |
index 6d8329b..c096b1b 100644 | |
--- a/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp | |
+++ b/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp | |
@@ -22,10 +22,10 @@ | |
#include "QtViewInterface.h" | |
#include "QtWebError.h" | |
-#include "qquickwebpage.h" | |
#include "qquickwebpage_p.h" | |
-#include "qquickwebview.h" | |
+#include "qquickwebpage_p_p.h" | |
#include "qquickwebview_p.h" | |
+#include "qquickwebview_p_p.h" | |
#include <QtDeclarative/QDeclarativeEngine> | |
#include <QtDeclarative/QQuickView> | |
diff --git a/Source/WebKit2/UIProcess/qt/QtWebError.h b/Source/WebKit2/UIProcess/qt/QtWebError.h | |
index 91187e9..389b50f 100644 | |
--- a/Source/WebKit2/UIProcess/qt/QtWebError.h | |
+++ b/Source/WebKit2/UIProcess/qt/QtWebError.h | |
@@ -21,7 +21,7 @@ | |
#ifndef QtWebError_h | |
#define QtWebError_h | |
-#include "qwebdownloaditem.h" | |
+#include "qwebdownloaditem_p.h" | |
#include "qwebkitglobal.h" | |
#include <QtNetwork/QNetworkReply> | |
#include <WKError.h> | |
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp | |
index 3564dd6..2a66170 100644 | |
--- a/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp | |
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp | |
@@ -22,10 +22,10 @@ | |
#include "QtWebPageProxy.h" | |
#include "QtWebError.h" | |
-#include "qwebdownloaditem.h" | |
#include "qwebdownloaditem_p.h" | |
-#include "qwebpreferences.h" | |
+#include "qwebdownloaditem_p_p.h" | |
#include "qwebpreferences_p.h" | |
+#include "qwebpreferences_p_p.h" | |
#include "ClientImpl.h" | |
#include "DownloadProxy.h" | |
diff --git a/Source/api.pri b/Source/api.pri | |
index b128187..1519c6a 100644 | |
--- a/Source/api.pri | |
+++ b/Source/api.pri | |
@@ -161,15 +161,12 @@ contains(CONFIG, texmap) { | |
# ------------- Install rules ------------- | |
-modulefile.files = $${ROOT_WEBKIT_DIR}/Tools/qmake/mkspecs/modules/qt_webkit.pri | |
+modulefile.files = $$QT.webkit.modulefile | |
mkspecs = $$[QMAKE_MKSPECS] | |
mkspecs = $$split(mkspecs, :) | |
modulefile.path = $$last(mkspecs)/modules | |
INSTALLS += modulefile | |
-include($$first(modulefile.files)) | |
-VERSION = $${QT.webkit.VERSION} | |
- | |
# Syncqt has already run at this point, so we can use headers.pri | |
# as a basis for our install-rules | |
HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$$TARGET/headers.pri | |
diff --git a/Tools/MiniBrowser/qt/BrowserWindow.cpp b/Tools/MiniBrowser/qt/BrowserWindow.cpp | |
index f5613b6..58e5894 100644 | |
--- a/Tools/MiniBrowser/qt/BrowserWindow.cpp | |
+++ b/Tools/MiniBrowser/qt/BrowserWindow.cpp | |
@@ -29,7 +29,7 @@ | |
#include "BrowserWindow.h" | |
#include "config.h" | |
-#include "qquickwebpage.h" | |
+#include "qquickwebpage_p.h" | |
#include "qquickwebview_p.h" | |
#include "utils.h" | |
@@ -53,7 +53,7 @@ BrowserWindow::BrowserWindow(WindowOptions* options) | |
setSource(QUrl("qrc:/qml/BrowserWindow.qml")); | |
connect(rootObject(), SIGNAL(pageTitleChanged(QString)), this, SLOT(setWindowTitle(QString))); | |
if (!options->useTouchWebView()) | |
- QQuickWebViewPrivate::get(rootObject()->property("webview").value<QQuickWebView*>())->setUseTraditionalDesktopBehaviour(true); | |
+ webView()->experimental()->setUseTraditionalDesktopBehaviour(true); | |
if (options->startMaximized()) | |
setWindowState(Qt::WindowMaximized); | |
else | |
@@ -61,7 +61,7 @@ BrowserWindow::BrowserWindow(WindowOptions* options) | |
show(); | |
} | |
-QObject* BrowserWindow::webView() const | |
+QQuickWebView* BrowserWindow::webView() const | |
{ | |
return rootObject()->property("webview").value<QQuickWebView*>(); | |
} | |
diff --git a/Tools/MiniBrowser/qt/BrowserWindow.h b/Tools/MiniBrowser/qt/BrowserWindow.h | |
index 651ea07..769e97d 100644 | |
--- a/Tools/MiniBrowser/qt/BrowserWindow.h | |
+++ b/Tools/MiniBrowser/qt/BrowserWindow.h | |
@@ -33,6 +33,8 @@ | |
#include <QStringList> | |
#include <QtDeclarative/QQuickView> | |
+class QQuickWebView; | |
+ | |
class BrowserWindow : public QQuickView { | |
Q_OBJECT | |
@@ -40,7 +42,7 @@ public: | |
BrowserWindow(WindowOptions* = 0); | |
~BrowserWindow(); | |
void load(const QString& url); | |
- QObject* webView() const; | |
+ QQuickWebView* webView() const; | |
public slots: | |
BrowserWindow* newWindow(const QString& url = "about:blank"); | |
diff --git a/Tools/MiniBrowser/qt/UrlLoader.cpp b/Tools/MiniBrowser/qt/UrlLoader.cpp | |
index ebd670e..daf5628 100644 | |
--- a/Tools/MiniBrowser/qt/UrlLoader.cpp | |
+++ b/Tools/MiniBrowser/qt/UrlLoader.cpp | |
@@ -27,6 +27,7 @@ | |
*/ | |
#include "UrlLoader.h" | |
+#include "qquickwebview_p.h" | |
#include <QDebug> | |
#include <QFile> | |
diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp | |
index 9661b57..bad074d 100644 | |
--- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp | |
+++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp | |
@@ -27,8 +27,8 @@ | |
#include "config.h" | |
#include "PlatformWebView.h" | |
-#include "qquickwebview.h" | |
-#include "qquickwebpage.h" | |
+#include "qquickwebview_p.h" | |
+#include "qquickwebpage_p.h" | |
#include <QApplication> | |
#include <QDeclarativeProperty> | |
diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf | |
index c9493aa..82a3bbd 100644 | |
--- a/Tools/qmake/mkspecs/features/default_post.prf | |
+++ b/Tools/qmake/mkspecs/features/default_post.prf | |
@@ -37,7 +37,6 @@ DEPENDPATH += $$OUT_PWD | |
INCLUDEPATH += \ | |
$${ROOT_WEBKIT_DIR}/Source \ | |
- $${ROOT_BUILD_DIR}/include/QtWebKit \ | |
$$buildDirForSource(Source/include) \ | |
$${QT.script.includes} | |
diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf | |
index f8d8c7b..6dca683 100644 | |
--- a/Tools/qmake/mkspecs/features/default_pre.prf | |
+++ b/Tools/qmake/mkspecs/features/default_pre.prf | |
@@ -101,5 +101,9 @@ haveQt(5): { | |
} | |
} | |
+QT.webkit.modulefile = $${ROOT_WEBKIT_DIR}/Tools/qmake/mkspecs/modules/qt_webkit.pri | |
+include($$QT.webkit.modulefile) | |
+VERSION = $${QT.webkit.VERSION} | |
+ | |
# Set some defaults for specific platforms | |
CONFIG += include_webinspector | |
diff --git a/Tools/qmake/mkspecs/features/qtwebkit-private.prf b/Tools/qmake/mkspecs/features/qtwebkit-private.prf | |
new file mode 100644 | |
index 0000000..05c68d9 | |
--- /dev/null | |
+++ b/Tools/qmake/mkspecs/features/qtwebkit-private.prf | |
@@ -0,0 +1,12 @@ | |
+# ------------------------------------------------------------------- | |
+# This file is used by tools that rely on private APIs of | |
+# the QtWebKit library | |
+# | |
+# FIXME: Can we use the same way as client applications would use? | |
+# | |
+# See 'Tools/qmake/README' for an overview of the build system | |
+# ------------------------------------------------------------------- | |
+ | |
+config_step { | |
+ INCLUDEPATH += $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/$${QT.webkit.VERSION}/$${QT.webkit.name}/private | |
+} | |
diff --git a/Tools/qmake/mkspecs/features/qtwebkit.prf b/Tools/qmake/mkspecs/features/qtwebkit.prf | |
index a4320b3..90cbd6e 100644 | |
--- a/Tools/qmake/mkspecs/features/qtwebkit.prf | |
+++ b/Tools/qmake/mkspecs/features/qtwebkit.prf | |
@@ -24,5 +24,6 @@ config_step { | |
} | |
DEPENDPATH += $$ROOT_WEBKIT_DIR/Source/WebKit/qt/Api | |
+ INCLUDEPATH += $${ROOT_BUILD_DIR}/include/QtWebKit | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment