summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp26
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.h25
-rw-r--r--src/webenginewidgets/api/qwebenginecertificateerror.cpp26
-rw-r--r--src/webenginewidgets/api/qwebenginecertificateerror.h26
-rw-r--r--src/webenginewidgets/api/qwebenginecontextmenudata.cpp199
-rw-r--r--src/webenginewidgets/api/qwebenginecontextmenudata.h92
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp64
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.h35
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem_p.h26
-rw-r--r--src/webenginewidgets/api/qwebenginefullscreenrequest.cpp25
-rw-r--r--src/webenginewidgets/api/qwebenginefullscreenrequest.h25
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.cpp25
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.h25
-rw-r--r--src/webenginewidgets/api/qwebenginehistory_p.h25
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp455
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h69
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h38
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp48
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.h30
-rw-r--r--src/webenginewidgets/api/qwebengineprofile_p.h25
-rw-r--r--src/webenginewidgets/api/qwebenginescript.cpp25
-rw-r--r--src/webenginewidgets/api/qwebenginescript.h25
-rw-r--r--src/webenginewidgets/api/qwebenginescriptcollection.cpp29
-rw-r--r--src/webenginewidgets/api/qwebenginescriptcollection.h25
-rw-r--r--src/webenginewidgets/api/qwebenginescriptcollection_p.h31
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.cpp36
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.h67
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp111
-rw-r--r--src/webenginewidgets/api/qwebengineview.h34
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h26
-rw-r--r--src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp10
-rw-r--r--src/webenginewidgets/doc/snippets/simple/main.cpp57
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc10
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc10
-rw-r--r--src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc10
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc99
-rw-r--r--src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc14
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc19
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp25
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h25
-rw-r--r--src/webenginewidgets/ui/messagebubblewidget.cpp25
-rw-r--r--src/webenginewidgets/ui/messagebubblewidget_p.h25
-rw-r--r--src/webenginewidgets/webenginewidgets.pro8
43 files changed, 1535 insertions, 520 deletions
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
index 5ebb8b546..e47f135e8 100644
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,6 +40,7 @@
#include "qtwebenginewidgetsglobal.h"
#include <QCoreApplication>
+#include <QOpenGLContext>
namespace QtWebEngineCore
{
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
index 26d1b6b4f..128704578 100644
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.cpp b/src/webenginewidgets/api/qwebenginecertificateerror.cpp
index f470e8f0b..289bb7ec0 100644
--- a/src/webenginewidgets/api/qwebenginecertificateerror.cpp
+++ b/src/webenginewidgets/api/qwebenginecertificateerror.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -100,6 +103,7 @@ QWebEngineCertificateError::~QWebEngineCertificateError()
\value CertificateNonUniqueName The host name specified in the certificate is not unique.
\value CertificateWeakKey The certificate contains a weak key.
\value CertificateNameConstraintViolation The certificate claimed DNS names that are in violation of name constraints.
+ \value CertificateValidityTooLong The certificate has a validity period that is too long. (Added in Qt 5.7)
*/
/*!
diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.h b/src/webenginewidgets/api/qwebenginecertificateerror.h
index 7706ea32d..7cb6341bc 100644
--- a/src/webenginewidgets/api/qwebenginecertificateerror.h
+++ b/src/webenginewidgets/api/qwebenginecertificateerror.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -66,6 +69,7 @@ public:
CertificateNonUniqueName = -210,
CertificateWeakKey = -211,
CertificateNameConstraintViolation = -212,
+ CertificateValidityTooLong = -213,
};
Error error() const;
diff --git a/src/webenginewidgets/api/qwebenginecontextmenudata.cpp b/src/webenginewidgets/api/qwebenginecontextmenudata.cpp
new file mode 100644
index 000000000..4d72071e5
--- /dev/null
+++ b/src/webenginewidgets/api/qwebenginecontextmenudata.cpp
@@ -0,0 +1,199 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwebenginecontextmenudata.h"
+
+#include "web_contents_adapter_client.h"
+
+QT_BEGIN_NAMESPACE
+
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeNone, QWebEngineContextMenuData::MediaTypeNone)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeImage, QWebEngineContextMenuData::MediaTypeImage)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeAudio, QWebEngineContextMenuData::MediaTypeAudio)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeVideo, QWebEngineContextMenuData::MediaTypeVideo)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeCanvas, QWebEngineContextMenuData::MediaTypeCanvas)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeFile, QWebEngineContextMenuData::MediaTypeFile)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypePlugin, QWebEngineContextMenuData::MediaTypePlugin)
+
+/*!
+ \class QWebEngineContextMenuData
+ \since 5.7
+ \brief The QWebEngineContextMenuData class provides context data for populating or extending a context menu with actions.
+
+ \inmodule QtWebEngineWidgets
+
+ QWebEngineContextMenuData is returned by QWebEnginePage::contextMenuData() after a context menu event,
+ and contains information about where the context menu event took place. This is also in the context
+ in which any context specific QWebEnginePage::WebAction will be performed.
+*/
+
+/*!
+ \enum QWebEngineContextMenuData::MediaType
+
+ This enum describes the media type of the context if any.
+
+ \value MediaTypeNone The context is not a media type.
+ \value MediaTypeImage The context is an image element.
+ \value MediaTypeVideo The context is a video element.
+ \value MediaTypeAudio The context is an audio element.
+ \value MediaTypeCanvas The context is a canvas element.
+ \value MediaTypeFile The context is a file.
+ \value MediaTypePlugin The context is a plugin element.
+*/
+
+/*!
+ Constructs null context menu data.
+*/
+QWebEngineContextMenuData::QWebEngineContextMenuData() : d(nullptr)
+{
+}
+
+/*!
+ Constructs context menu data from \a other.
+*/
+QWebEngineContextMenuData::QWebEngineContextMenuData(const QWebEngineContextMenuData &other)
+{
+ d = new QtWebEngineCore::WebEngineContextMenuData(*other.d);
+}
+
+/*!
+ Assigns the \a other context menu data to this.
+*/
+QWebEngineContextMenuData &QWebEngineContextMenuData::operator=(const QWebEngineContextMenuData &other)
+{
+ delete d;
+ d = new QtWebEngineCore::WebEngineContextMenuData(*other.d);
+ return *this;
+}
+
+/*!
+ Destroys the context menu data.
+*/
+QWebEngineContextMenuData::~QWebEngineContextMenuData()
+{
+ delete d;
+}
+
+/*!
+ Returns \c true if the context data is valid; otherwise returns \c false.
+*/
+bool QWebEngineContextMenuData::isValid() const
+{
+ return d;
+}
+
+/*!
+ Resets the context data, making it invalid.
+ \internal
+
+ \sa isValid()
+*/
+void QWebEngineContextMenuData::reset()
+{
+ delete d;
+ d = nullptr;
+}
+
+/*!
+ Returns the position of the context, usually the mouse position where the context menu event was triggered.
+*/
+QPoint QWebEngineContextMenuData::position() const
+{
+ return d ? d->pos : QPoint();
+}
+
+/*!
+ Returns the text of a link if the context is a link.
+*/
+QString QWebEngineContextMenuData::linkText() const
+{
+ return d ? d->linkText : QString();
+}
+
+/*!
+ Returns the URL of a link if the context is a link.
+*/
+QUrl QWebEngineContextMenuData::linkUrl() const
+{
+ return d ? d->linkUrl : QUrl();
+}
+
+/*!
+ Returns the selected text of the context.
+*/
+QString QWebEngineContextMenuData::selectedText() const
+{
+ return d ? d->selectedText : QString();
+}
+
+/*!
+ If the context is a media element, returns the URL of that media.
+*/
+QUrl QWebEngineContextMenuData::mediaUrl() const
+{
+ return d ? d->mediaUrl : QUrl();
+}
+
+/*!
+ Returns the type of the media element or \c MediaTypeNone if the context is not a media element.
+*/
+QWebEngineContextMenuData::MediaType QWebEngineContextMenuData::mediaType() const
+{
+ return d ? static_cast<QWebEngineContextMenuData::MediaType>(d->mediaType) : MediaTypeNone;
+}
+
+/*!
+ Returns \c true if the content is editable by the user; otherwise returns \c false.
+*/
+bool QWebEngineContextMenuData::isContentEditable() const
+{
+ return d ? d->isEditable : false;
+}
+
+/*!
+ \internal
+*/
+QWebEngineContextMenuData &QWebEngineContextMenuData::operator=(const QWebEngineContextDataPrivate &priv)
+{
+ delete d;
+ d = new QtWebEngineCore::WebEngineContextMenuData(priv);
+ return *this;
+}
+
+QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginecontextmenudata.h b/src/webenginewidgets/api/qwebenginecontextmenudata.h
new file mode 100644
index 000000000..8e85fee16
--- /dev/null
+++ b/src/webenginewidgets/api/qwebenginecontextmenudata.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWEBENGINECONTEXTDATA_H
+#define QWEBENGINECONTEXTDATA_H
+
+#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qurl.h>
+
+namespace QtWebEngineCore {
+class WebEngineContextMenuData;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWEBENGINEWIDGETS_EXPORT QWebEngineContextMenuData {
+public:
+ QWebEngineContextMenuData();
+ QWebEngineContextMenuData(const QWebEngineContextMenuData &other);
+ QWebEngineContextMenuData &operator=(const QWebEngineContextMenuData &other);
+ ~QWebEngineContextMenuData();
+
+ enum MediaType {
+ MediaTypeNone,
+ MediaTypeImage,
+ MediaTypeVideo,
+ MediaTypeAudio,
+ MediaTypeCanvas,
+ MediaTypeFile,
+ MediaTypePlugin
+ };
+ bool isValid() const;
+
+ QPoint position() const;
+ QString selectedText() const;
+ QString linkText() const;
+ QUrl linkUrl() const;
+ QUrl mediaUrl() const;
+ MediaType mediaType() const;
+ bool isContentEditable() const;
+
+private:
+ void reset();
+ typedef QtWebEngineCore::WebEngineContextMenuData QWebEngineContextDataPrivate;
+ QWebEngineContextMenuData &operator=(const QWebEngineContextDataPrivate &priv);
+ const QWebEngineContextDataPrivate *d;
+
+ friend class QWebEnginePagePrivate;
+ friend class QWebEnginePage;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINECONTEXTDATA_H
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
index bb5fed8af..bfb0dd0e8 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -76,6 +79,7 @@ QWebEngineDownloadItemPrivate::QWebEngineDownloadItemPrivate(QWebEngineProfilePr
, downloadFinished(false)
, downloadId(-1)
, downloadState(QWebEngineDownloadItem::DownloadCancelled)
+ , savePageFormat(QWebEngineDownloadItem::MimeHtmlSaveFormat)
, downloadUrl(url)
, totalBytes(-1)
, receivedBytes(0)
@@ -200,6 +204,20 @@ quint32 QWebEngineDownloadItem::id() const
*/
/*!
+ \enum QWebEngineDownloadItem::SavePageFormat
+ \since 5.7
+
+ This enum describes the format that is used to save a web page.
+
+ \value UnknownSaveFormat This is not a request for downloading a complete web page.
+ \value SingleHtmlSaveFormat The page is saved as a single HTML page. Resources such as images
+ are not saved.
+ \value CompleteHtmlSaveFormat The page is saved as a complete HTML page, for example a directory
+ containing the single HTML page and the resources.
+ \value MimeHtmlSaveFormat The page is saved as a complete web page in the MIME HTML format.
+*/
+
+/*!
Returns the download item's current state.
\sa QWebEngineDownloadItem::DownloadState
@@ -300,6 +318,30 @@ bool QWebEngineDownloadItem::isFinished() const
return d->downloadFinished;
}
+/*!
+ Returns the format the web page will be saved in if this is a download request for a web page.
+ \since 5.7
+
+ \sa setSavePageFormat()
+*/
+QWebEngineDownloadItem::SavePageFormat QWebEngineDownloadItem::savePageFormat() const
+{
+ Q_D(const QWebEngineDownloadItem);
+ return d->savePageFormat;
+}
+
+/*!
+ Sets the \a format the web page will be saved in if this is a download request for a web page.
+ \since 5.7
+
+ \sa savePageFormat()
+*/
+void QWebEngineDownloadItem::setSavePageFormat(QWebEngineDownloadItem::SavePageFormat format)
+{
+ Q_D(QWebEngineDownloadItem);
+ d->savePageFormat = format;
+}
+
QWebEngineDownloadItem::QWebEngineDownloadItem(QWebEngineDownloadItemPrivate *p, QObject *parent)
: QObject(parent)
, d_ptr(p)
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.h b/src/webenginewidgets/api/qwebenginedownloaditem.h
index 648b91ec9..80b5c06c5 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.h
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -61,6 +64,14 @@ public:
};
Q_ENUM(DownloadState)
+ enum SavePageFormat {
+ UnknownSaveFormat = -1,
+ SingleHtmlSaveFormat,
+ CompleteHtmlSaveFormat,
+ MimeHtmlSaveFormat
+ };
+ Q_ENUM(SavePageFormat)
+
quint32 id() const;
DownloadState state() const;
qint64 totalBytes() const;
@@ -70,6 +81,8 @@ public:
QString path() const;
void setPath(QString path);
bool isFinished() const;
+ SavePageFormat savePageFormat() const;
+ void setSavePageFormat(SavePageFormat format);
public Q_SLOTS:
void accept();
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem_p.h b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
index 2c7bbf985..ddb3b443a 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem_p.h
+++ b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -68,6 +71,7 @@ public:
bool downloadFinished;
quint32 downloadId;
QWebEngineDownloadItem::DownloadState downloadState;
+ QWebEngineDownloadItem::SavePageFormat savePageFormat;
QString downloadPath;
const QUrl downloadUrl;
QString mimeType;
diff --git a/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp b/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
index 3fe73b707..bcf2d5d22 100644
--- a/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
+++ b/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginefullscreenrequest.h b/src/webenginewidgets/api/qwebenginefullscreenrequest.h
index ba14e6f1a..e5f2b7b19 100644
--- a/src/webenginewidgets/api/qwebenginefullscreenrequest.h
+++ b/src/webenginewidgets/api/qwebenginefullscreenrequest.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginehistory.cpp b/src/webenginewidgets/api/qwebenginehistory.cpp
index 05efb131d..41de8c90b 100644
--- a/src/webenginewidgets/api/qwebenginehistory.cpp
+++ b/src/webenginewidgets/api/qwebenginehistory.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginehistory.h b/src/webenginewidgets/api/qwebenginehistory.h
index 81dd3fb34..21ebbf41d 100644
--- a/src/webenginewidgets/api/qwebenginehistory.h
+++ b/src/webenginewidgets/api/qwebenginehistory.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginehistory_p.h b/src/webenginewidgets/api/qwebenginehistory_p.h
index e45023177..8f7001967 100644
--- a/src/webenginewidgets/api/qwebenginehistory_p.h
+++ b/src/webenginewidgets/api/qwebenginehistory_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index df96f4c17..df4031712 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -40,6 +43,8 @@
#include "authentication_dialog_controller.h"
#include "browser_context_adapter.h"
#include "certificate_error_controller.h"
+#include "color_chooser_controller.h"
+#include "favicon_manager.h"
#include "file_picker_controller.h"
#include "javascript_dialog_controller.h"
#include "qwebenginefullscreenrequest.h"
@@ -63,6 +68,7 @@
#include <QApplication>
#include <QAuthenticator>
#include <QClipboard>
+#include <QColorDialog>
#include <QContextMenuEvent>
#include <QFileDialog>
#include <QKeyEvent>
@@ -88,8 +94,9 @@ static QWebEnginePage::WebWindowType toWindowType(WebContentsAdapterClient::Wind
{
switch (disposition) {
case WebContentsAdapterClient::NewForegroundTabDisposition:
- case WebContentsAdapterClient::NewBackgroundTabDisposition:
return QWebEnginePage::WebBrowserTab;
+ case WebContentsAdapterClient::NewBackgroundTabDisposition:
+ return QWebEnginePage::WebBrowserBackgroundTab;
case WebContentsAdapterClient::NewPopupDisposition:
return QWebEnginePage::WebDialog;
case WebContentsAdapterClient::NewWindowDisposition:
@@ -127,11 +134,12 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile)
, settings(new QWebEngineSettings(profile->settings()))
, view(0)
, isLoading(false)
- , scriptCollection(new QWebEngineScriptCollectionPrivate(browserContextAdapter()->userScriptController(), adapter))
+ , scriptCollection(new QWebEngineScriptCollectionPrivate(browserContextAdapter()->userResourceController(), adapter))
, m_isBeingAdopted(false)
, m_backgroundColor(Qt::white)
, fullscreenMode(false)
, webChannel(nullptr)
+ , webChannelWorldId(QWebEngineScript::MainWorld)
{
memset(actions, 0, sizeof(actions));
}
@@ -163,7 +171,11 @@ void QWebEnginePagePrivate::urlChanged(const QUrl &url)
void QWebEnginePagePrivate::iconChanged(const QUrl &url)
{
Q_Q(QWebEnginePage);
- Q_EMIT q->iconUrlChanged(url);
+ if (iconUrl == url)
+ return;
+ iconUrl = url;
+ Q_EMIT q->iconUrlChanged(iconUrl);
+ Q_EMIT q->iconChanged(adapter->faviconManager()->getIcon());
}
void QWebEnginePagePrivate::loadProgressChanged(int progress)
@@ -184,6 +196,12 @@ void QWebEnginePagePrivate::selectionChanged()
Q_EMIT q->selectionChanged();
}
+void QWebEnginePagePrivate::recentlyAudibleChanged(bool recentlyAudible)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
+}
+
QRectF QWebEnginePagePrivate::viewportRect() const
{
return view ? view->rect() : QRectF();
@@ -315,7 +333,8 @@ void QWebEnginePagePrivate::adoptNewWindowImpl(QWebEnginePage *newPage,
// If the constructor of the QWebEnginePage descendant set a web channel,
// set it on the new adapter.
- newWebContents->setWebChannel(newPage->d_func()->webChannel);
+ newWebContents->setWebChannel(newPage->d_func()->webChannel
+ , newPage->d_func()->webChannelWorldId);
// Page has finished the adoption process.
newPage->d_func()->m_isBeingAdopted = false;
@@ -357,6 +376,11 @@ void QWebEnginePagePrivate::didFindText(quint64 requestId, int matchCount)
m_callbacks.invoke(requestId, matchCount > 0);
}
+void QWebEnginePagePrivate::didPrintPage(quint64 requestId, const QByteArray &result)
+{
+ m_callbacks.invoke(requestId, result);
+}
+
void QWebEnginePagePrivate::passOnFocus(bool reverse)
{
if (view)
@@ -383,6 +407,20 @@ void QWebEnginePagePrivate::authenticationRequired(QSharedPointer<Authentication
controller->accept(networkAuth.user(), networkAuth.password());
}
+void QWebEnginePagePrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
+{
+ QColorDialog *dialog = new QColorDialog(controller.data()->initialColor(), view);
+
+ QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), controller.data(), SLOT(accept(QColor)));
+ QColorDialog::connect(dialog, SIGNAL(rejected()), controller.data(), SLOT(reject()));
+
+ // Delete when done
+ QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), dialog, SLOT(deleteLater()));
+ QColorDialog::connect(dialog, SIGNAL(rejected()), dialog, SLOT(deleteLater()));
+
+ dialog->open();
+}
+
void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags requestFlags)
{
Q_Q(QWebEnginePage);
@@ -478,11 +516,23 @@ void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input)
adapter = std::move(newWebContents);
adapter->initialize(this);
if (webChannel)
- adapter->setWebChannel(webChannel);
+ adapter->setWebChannel(webChannel, webChannelWorldId);
scriptCollection.d->rebindToContents(adapter);
}
}
+void QWebEnginePagePrivate::updateScrollPosition(const QPointF &position)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->scrollPositionChanged(position);
+}
+
+void QWebEnginePagePrivate::updateContentsSize(const QSizeF &size)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->contentsSizeChanged(size);
+}
+
void QWebEnginePagePrivate::setFullScreenMode(bool fullscreen)
{
if (fullscreenMode != fullscreen) {
@@ -496,6 +546,11 @@ QSharedPointer<BrowserContextAdapter> QWebEnginePagePrivate::browserContextAdapt
return profile->d_ptr->browserContext();
}
+WebContentsAdapter *QWebEnginePagePrivate::webContentsAdapter()
+{
+ return adapter.data();
+}
+
const QObject *QWebEnginePagePrivate::holdingQObject() const
{
Q_Q(const QWebEnginePage);
@@ -552,6 +607,59 @@ QWebEnginePage::QWebEnginePage(QObject* parent)
*/
/*!
+ \property QWebEnginePage::scrollPosition
+ \since 5.7
+
+ \brief The scroll position of the page contents.
+*/
+
+/*!
+ \property QWebEnginePage::contentsSize
+ \since 5.7
+
+ The size of the page contents.
+*/
+
+/*!
+ \fn void QWebEnginePage::audioMutedChanged(bool muted)
+ \since 5.7
+
+ This signal is emitted when the page's \a muted state changes.
+ \note Not to be confused with a specific HTML5 audio or video element being muted.
+*/
+
+/*!
+ \fn void QWebEnginePage::recentlyAudibleChanged(bool recentlyAudible);
+ \since 5.7
+
+ This signal is emitted when the page's audible state, \a recentlyAudible, changes, because
+ the audio is played or stopped.
+
+ \note The signal is also emitted when calling the setAudioMuted() method.
+ Also, if the audio is paused, this signal is emitted with an approximate \b{two-second
+ delay}, from the moment the audio is paused.
+*/
+
+/*!
+ \fn void QWebEnginePage::iconUrlChanged(const QUrl &url)
+
+ This signal is emitted when the URL of the icon ("favicon") associated with the
+ page is changed. The new URL is specified by \a url.
+
+ \sa iconUrl(), icon(), iconChanged()
+*/
+
+/*!
+ \fn void QWebEnginePage::iconChanged(const QIcon &icon)
+ \since 5.7
+
+ This signal is emitted when the icon ("favicon") associated with the
+ page is changed. The new icon is specified by \a icon.
+
+ \sa icon(), iconUrl(), iconUrlChanged()
+*/
+
+/*!
Constructs an empty web engine page in the web engine profile \a profile with the parent
\a parent.
@@ -593,7 +701,7 @@ QWebEngineSettings *QWebEnginePage::settings() const
* that is exposed in the JavaScript context of this page as \c qt.webChannelTransport.
*
* \since 5.5
- * \sa QWebChannel
+ * \sa setWebChannel
*/
QWebChannel *QWebEnginePage::webChannel() const
{
@@ -602,22 +710,44 @@ QWebChannel *QWebEnginePage::webChannel() const
}
/*!
+ * \overload
+ *
+ * Sets the web channel instance to be used by this page to \a channel and installs
+ * it in the main JavaScript world.
+ *
+ * With this method the web channel can be accessed by web page content. If the content
+ * is not under your control and might be hostile, this could be a security issue and
+ * you should consider installing it in a private JavaScript world.
+ *
+ * \since 5.5
+ * \sa QWebEngineScript::MainWorld
+ */
+
+void QWebEnginePage::setWebChannel(QWebChannel *channel)
+{
+ setWebChannel(channel, QWebEngineScript::MainWorld);
+}
+
+/*!
* Sets the web channel instance to be used by this page to \a channel and connects it to
* web engine's transport using Chromium IPC messages. The transport is exposed in the JavaScript
- * context of this page as
+ * world \a worldId as
* \c qt.webChannelTransport, which should be used when using the \l{Qt WebChannel JavaScript API}.
*
* \note The page does not take ownership of the channel object.
+ * \note Only one web channel can be installed per page, setting one even in another JavaScript
+ * world uninstalls any already installed web channel.
*
- * \since 5.5
+ * \since 5.7
+ * \sa QWebEngineScript::ScriptWorldId
*/
-
-void QWebEnginePage::setWebChannel(QWebChannel *channel)
+void QWebEnginePage::setWebChannel(QWebChannel *channel, uint worldId)
{
Q_D(QWebEnginePage);
- if (d->webChannel != channel) {
+ if (d->webChannel != channel || d->webChannelWorldId != worldId) {
d->webChannel = channel;
- d->adapter->setWebChannel(channel);
+ d->webChannelWorldId = worldId;
+ d->adapter->setWebChannel(channel, worldId);
}
}
@@ -648,6 +778,44 @@ void QWebEnginePage::setBackgroundColor(const QColor &color)
d->adapter->backgroundColorChanged();
}
+/*!
+ \property QWebEnginePage::audioMuted
+ \brief whether the current page audio is muted.
+ \since 5.7
+
+ The default value is \c false.
+ \sa recentlyAudible
+*/
+bool QWebEnginePage::isAudioMuted() const {
+ const Q_D(QWebEnginePage);
+ return d->adapter->isAudioMuted();
+}
+
+void QWebEnginePage::setAudioMuted(bool muted) {
+ Q_D(QWebEnginePage);
+ bool _isAudioMuted = isAudioMuted();
+ d->adapter->setAudioMuted(muted);
+ if (_isAudioMuted != muted) {
+ Q_EMIT audioMutedChanged(muted);
+ }
+}
+
+
+/*!
+ \property QWebEnginePage::recentlyAudible
+ \brief the current page's \e {audible state}, that is, whether audio was recently played
+ or not.
+ \since 5.7
+
+ The default value is \c false.
+ \sa audioMuted
+*/
+bool QWebEnginePage::recentlyAudible() const
+{
+ const Q_D(QWebEnginePage);
+ return d->adapter->recentlyAudible();
+}
+
void QWebEnginePage::setView(QWidget *view)
{
QWebEngineViewPrivate::bind(qobject_cast<QWebEngineView*>(view), this);
@@ -744,6 +912,9 @@ QAction *QWebEnginePage::action(WebAction action) const
case OpenLinkInNewTab:
text = tr("Open Link in New Tab");
break;
+ case OpenLinkInNewBackgroundTab:
+ text = tr("Open Link in New Background Tab");
+ break;
case CopyLinkToClipboard:
text = tr("Copy Link URL");
break;
@@ -786,6 +957,12 @@ QAction *QWebEnginePage::action(WebAction action) const
case RequestClose:
text = tr("Close Page");
break;
+ case Unselect:
+ text = tr("Unselect");
+ break;
+ case SavePage:
+ text = tr("Save &Page");
+ break;
case NoWebAction:
case WebActionCount:
Q_UNREACHABLE();
@@ -808,6 +985,7 @@ QAction *QWebEnginePage::action(WebAction action) const
void QWebEnginePage::triggerAction(WebAction action, bool)
{
Q_D(QWebEnginePage);
+ const QtWebEngineCore::WebEngineContextMenuData &menuData = *d->contextData.d;
switch (action) {
case Back:
d->adapter->navigateToOffset(-1);
@@ -845,115 +1023,126 @@ void QWebEnginePage::triggerAction(WebAction action, bool)
case PasteAndMatchStyle:
d->adapter->pasteAndMatchStyle();
break;
+ case Unselect:
+ d->adapter->unselect();
+ break;
case OpenLinkInThisWindow:
- if (d->m_menuData.linkUrl.isValid())
- setUrl(d->m_menuData.linkUrl);
+ if (menuData.linkUrl.isValid())
+ setUrl(menuData.linkUrl);
break;
case OpenLinkInNewWindow:
- if (d->m_menuData.linkUrl.isValid()) {
+ if (menuData.linkUrl.isValid()) {
QWebEnginePage *newPage = createWindow(WebBrowserWindow);
if (newPage)
- newPage->setUrl(d->m_menuData.linkUrl);
+ newPage->setUrl(menuData.linkUrl);
}
break;
case OpenLinkInNewTab:
- if (d->m_menuData.linkUrl.isValid()) {
+ if (menuData.linkUrl.isValid()) {
QWebEnginePage *newPage = createWindow(WebBrowserTab);
if (newPage)
- newPage->setUrl(d->m_menuData.linkUrl);
+ newPage->setUrl(menuData.linkUrl);
+ }
+ break;
+ case OpenLinkInNewBackgroundTab:
+ if (menuData.linkUrl.isValid()) {
+ QWebEnginePage *newPage = createWindow(WebBrowserBackgroundTab);
+ if (newPage)
+ newPage->setUrl(menuData.linkUrl);
}
break;
case CopyLinkToClipboard:
- if (d->m_menuData.linkUrl.isValid()) {
- QString urlString = d->m_menuData.linkUrl.toString(QUrl::FullyEncoded);
- QString title = d->m_menuData.linkText.toHtmlEscaped();
+ if (menuData.linkUrl.isValid()) {
+ QString urlString = menuData.linkUrl.toString(QUrl::FullyEncoded);
+ QString title = menuData.linkText.toHtmlEscaped();
QMimeData *data = new QMimeData();
data->setText(urlString);
QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\">") + title + QStringLiteral("</a>");
data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->m_menuData.linkUrl);
+ data->setUrls(QList<QUrl>() << menuData.linkUrl);
qApp->clipboard()->setMimeData(data);
}
break;
case DownloadLinkToDisk:
- if (d->m_menuData.linkUrl.isValid())
- d->adapter->download(d->m_menuData.linkUrl, d->m_menuData.suggestedFileName);
+ if (menuData.linkUrl.isValid())
+ d->adapter->download(menuData.linkUrl, menuData.suggestedFileName);
break;
case CopyImageToClipboard:
- if (d->m_menuData.hasImageContent &&
- (d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeImage ||
- d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeCanvas))
+ if (menuData.hasImageContent &&
+ (menuData.mediaType == WebEngineContextMenuData::MediaTypeImage ||
+ menuData.mediaType == WebEngineContextMenuData::MediaTypeCanvas))
{
- d->adapter->copyImageAt(d->m_menuData.pos);
+ d->adapter->copyImageAt(menuData.pos);
}
break;
case CopyImageUrlToClipboard:
- if (d->m_menuData.mediaUrl.isValid() && d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeImage) {
- QString urlString = d->m_menuData.mediaUrl.toString(QUrl::FullyEncoded);
- QString title = d->m_menuData.linkText;
+ if (menuData.mediaUrl.isValid() && menuData.mediaType == WebEngineContextMenuData::MediaTypeImage) {
+ QString urlString = menuData.mediaUrl.toString(QUrl::FullyEncoded);
+ QString title = menuData.linkText;
if (!title.isEmpty())
title = QStringLiteral(" alt=\"%1\"").arg(title.toHtmlEscaped());
QMimeData *data = new QMimeData();
data->setText(urlString);
QString html = QStringLiteral("<img src=\"") + urlString + QStringLiteral("\"") + title + QStringLiteral("></img>");
data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->m_menuData.mediaUrl);
+ data->setUrls(QList<QUrl>() << menuData.mediaUrl);
qApp->clipboard()->setMimeData(data);
}
break;
case DownloadImageToDisk:
case DownloadMediaToDisk:
- if (d->m_menuData.mediaUrl.isValid())
- d->adapter->download(d->m_menuData.mediaUrl, d->m_menuData.suggestedFileName);
+ if (menuData.mediaUrl.isValid())
+ d->adapter->download(menuData.mediaUrl, menuData.suggestedFileName);
break;
case CopyMediaUrlToClipboard:
- if (d->m_menuData.mediaUrl.isValid() &&
- (d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
- d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
+ if (menuData.mediaUrl.isValid() &&
+ (menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
+ menuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
{
- QString urlString = d->m_menuData.mediaUrl.toString(QUrl::FullyEncoded);
+ QString urlString = menuData.mediaUrl.toString(QUrl::FullyEncoded);
QMimeData *data = new QMimeData();
data->setText(urlString);
- if (d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio)
+ if (menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio)
data->setHtml(QStringLiteral("<audio src=\"") + urlString + QStringLiteral("\"></audio>"));
else
data->setHtml(QStringLiteral("<video src=\"") + urlString + QStringLiteral("\"></video>"));
- data->setUrls(QList<QUrl>() << d->m_menuData.mediaUrl);
+ data->setUrls(QList<QUrl>() << menuData.mediaUrl);
qApp->clipboard()->setMimeData(data);
}
break;
case ToggleMediaControls:
- if (d->m_menuData.mediaUrl.isValid() && d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
- bool enable = !(d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaControls);
- d->adapter->executeMediaPlayerActionAt(d->m_menuData.pos, WebContentsAdapter::MediaPlayerControls, enable);
+ if (menuData.mediaUrl.isValid() && menuData.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
+ bool enable = !(menuData.mediaFlags & WebEngineContextMenuData::MediaControls);
+ d->adapter->executeMediaPlayerActionAt(menuData.pos, WebContentsAdapter::MediaPlayerControls, enable);
}
break;
case ToggleMediaLoop:
- if (d->m_menuData.mediaUrl.isValid() &&
- (d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
- d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
+ if (menuData.mediaUrl.isValid() &&
+ (menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
+ menuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
{
- bool enable = !(d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaLoop);
- d->adapter->executeMediaPlayerActionAt(d->m_menuData.pos, WebContentsAdapter::MediaPlayerLoop, enable);
+ bool enable = !(menuData.mediaFlags & WebEngineContextMenuData::MediaLoop);
+ d->adapter->executeMediaPlayerActionAt(menuData.pos, WebContentsAdapter::MediaPlayerLoop, enable);
}
break;
case ToggleMediaPlayPause:
- if (d->m_menuData.mediaUrl.isValid() &&
- (d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
- d->m_menuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
+ if (menuData.mediaUrl.isValid() &&
+ (menuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
+ menuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
{
- bool enable = (d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaPaused);
- d->adapter->executeMediaPlayerActionAt(d->m_menuData.pos, WebContentsAdapter::MediaPlayerPlay, enable);
+ bool enable = (menuData.mediaFlags & WebEngineContextMenuData::MediaPaused);
+ d->adapter->executeMediaPlayerActionAt(menuData.pos, WebContentsAdapter::MediaPlayerPlay, enable);
}
break;
case ToggleMediaMute:
- if (d->m_menuData.mediaUrl.isValid() && d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
- bool enable = !(d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaMuted);
- d->adapter->executeMediaPlayerActionAt(d->m_menuData.pos, WebContentsAdapter::MediaPlayerMute, enable);
+ if (menuData.mediaUrl.isValid() && menuData.mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
+ // Make sure to negate the value, so that toggling actually works.
+ bool enable = !(menuData.mediaFlags & WebEngineContextMenuData::MediaMuted);
+ d->adapter->executeMediaPlayerActionAt(menuData.pos, WebContentsAdapter::MediaPlayerMute, enable);
}
break;
case InspectElement:
- d->adapter->inspectElementAt(d->m_menuData.pos);
+ d->adapter->inspectElementAt(menuData.pos);
break;
case ExitFullScreen:
d->adapter->exitFullScreen();
@@ -961,6 +1150,9 @@ void QWebEnginePage::triggerAction(WebAction action, bool)
case RequestClose:
d->adapter->requestClose();
break;
+ case SavePage:
+ d->adapter->save();
+ break;
case NoWebAction:
break;
case WebActionCount:
@@ -1004,16 +1196,17 @@ bool QWebEnginePagePrivate::contextMenuRequested(const WebEngineContextMenuData
if (!view || !view->d_func()->m_pendingContextMenuEvent)
return false;
- m_menuData = WebEngineContextMenuData();
+ contextData.reset();
QContextMenuEvent event(QContextMenuEvent::Mouse, data.pos, view->mapToGlobal(data.pos));
switch (view->contextMenuPolicy()) {
case Qt::PreventContextMenu:
return false;
case Qt::DefaultContextMenu:
- m_menuData = data;
+ contextData = data;
view->contextMenuEvent(&event);
break;
case Qt::CustomContextMenu:
+ contextData = data;
Q_EMIT view->customContextMenuRequested(data.pos);
break;
case Qt::ActionsContextMenu:
@@ -1133,6 +1326,13 @@ void QWebEnginePagePrivate::requestGeometryChange(const QRect &geometry)
Q_EMIT q->geometryChangeRequested(geometry);
}
+void QWebEnginePagePrivate::startDragging(const content::DropData &dropData,
+ Qt::DropActions allowedActions, const QPixmap &pixmap,
+ const QPoint &offset)
+{
+ adapter->startDragging(view, dropData, allowedActions, pixmap, offset);
+}
+
bool QWebEnginePagePrivate::isEnabled() const
{
const Q_Q(QWebEnginePage);
@@ -1145,9 +1345,13 @@ bool QWebEnginePagePrivate::isEnabled() const
QMenu *QWebEnginePage::createStandardContextMenu()
{
Q_D(QWebEnginePage);
+ if (!d->contextData.d)
+ return nullptr;
+
QMenu *menu = new QMenu(d->view);
QAction *action = 0;
- WebEngineContextMenuData contextMenuData(d->m_menuData);
+ const WebEngineContextMenuData &contextMenuData = *d->contextData.d;
+
if (!contextMenuData.linkText.isEmpty() && contextMenuData.linkUrl.isValid()) {
action = QWebEnginePage::action(OpenLinkInThisWindow);
action->setText(tr("Follow Link"));
@@ -1170,6 +1374,7 @@ QMenu *QWebEnginePage::createStandardContextMenu()
menu->addAction(action);
} else {
menu->addAction(QWebEnginePage::action(Copy));
+ menu->addAction(QWebEnginePage::action(Unselect));
}
if (!contextMenuData.linkText.isEmpty() && contextMenuData.linkUrl.isValid()) {
@@ -1191,9 +1396,9 @@ QMenu *QWebEnginePage::createStandardContextMenu()
menu->addAction(QWebEnginePage::action(CopyMediaUrlToClipboard));
menu->addAction(QWebEnginePage::action(ToggleMediaPlayPause));
menu->addAction(QWebEnginePage::action(ToggleMediaLoop));
- if (d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaHasAudio)
+ if (contextMenuData.mediaFlags & WebEngineContextMenuData::MediaHasAudio)
menu->addAction(QWebEnginePage::action(ToggleMediaMute));
- if (d->m_menuData.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls)
+ if (contextMenuData.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls)
menu->addAction(QWebEnginePage::action(ToggleMediaControls));
break;
default:
@@ -1332,10 +1537,39 @@ QUrl QWebEnginePage::requestedUrl() const
return d->adapter->requestedUrl();
}
+/*!
+ \property QWebEnginePage::iconUrl
+ \brief the URL of the icon associated with the page currently viewed
+
+ By default, this property contains an empty URL.
+
+ \sa iconUrlChanged(), icon(), iconChanged()
+*/
QUrl QWebEnginePage::iconUrl() const
{
Q_D(const QWebEnginePage);
- return d->adapter->iconUrl();
+ return d->iconUrl;
+}
+
+/*!
+ \property QWebEnginePage::icon
+ \brief the icon associated with the page currently viewed
+ \since 5.7
+
+ By default, this property contains a null icon. If the web page specifies more than one icon,
+ the \c{icon} property encapsulates the available candidate icons in a single,
+ scalable \c{QIcon}.
+
+ \sa iconChanged(), iconUrl(), iconUrlChanged()
+*/
+QIcon QWebEnginePage::icon() const
+{
+ Q_D(const QWebEnginePage);
+
+ if (d->iconUrl.isEmpty())
+ return QIcon();
+
+ return d->adapter->faviconManager()->getIcon();
}
qreal QWebEnginePage::zoomFactor() const
@@ -1353,13 +1587,26 @@ void QWebEnginePage::setZoomFactor(qreal factor)
void QWebEnginePage::runJavaScript(const QString &scriptSource)
{
Q_D(QWebEnginePage);
- d->adapter->runJavaScript(scriptSource);
+ d->adapter->runJavaScript(scriptSource, QWebEngineScript::MainWorld);
}
void QWebEnginePage::runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback)
{
Q_D(QWebEnginePage);
- quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource);
+ quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, QWebEngineScript::MainWorld);
+ d->m_callbacks.registerCallback(requestId, resultCallback);
+}
+
+void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId)
+{
+ Q_D(QWebEnginePage);
+ d->adapter->runJavaScript(scriptSource, worldId);
+}
+
+void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback)
+{
+ Q_D(QWebEnginePage);
+ quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, worldId);
d->m_callbacks.registerCallback(requestId, resultCallback);
}
@@ -1479,6 +1726,64 @@ bool QWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType typ
return true;
}
+QPointF QWebEnginePage::scrollPosition() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->lastScrollOffset();
+}
+
+QSizeF QWebEnginePage::contentsSize() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->lastContentsSize();
+}
+
+/*!
+ Renders the current content of the page into a PDF document and saves it in the location specified in \a filePath.
+ The page size and orientation of the produced PDF document are taken from the values specified in \a pageLayout.
+
+ If a file already exists at the provided file path, it will be overwritten.
+ \since 5.7
+*/
+void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &pageLayout)
+{
+ Q_D(const QWebEnginePage);
+ d->adapter->printToPDF(pageLayout, filePath);
+}
+
+
+/*!
+ \fn void QWebEnginePage::printToPdf(FunctorOrLambda resultCallback, const QPageLayout &pageLayout)
+ Renders the current content of the page into a PDF document and returns a byte array containing the PDF data
+ as parameter to \a resultCallback.
+ The page size and orientation of the produced PDF document are taken from the values specified in \a pageLayout.
+
+ The \a resultCallback must take a const reference to a QByteArray as parameter. If printing was successful, this byte array
+ will contain the PDF data, otherwise, the byte array will be empty.
+
+ \since 5.7
+*/
+void QWebEnginePage::printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &pageLayout)
+{
+ Q_D(QWebEnginePage);
+ quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout);
+ d->m_callbacks.registerCallback(requestId, resultCallback);
+}
+
+/*!
+ \since 5.7
+
+ Returns additional data about the current context menu. It is only guaranteed to be valid during the call to the QWebEngineView::contextMenuEvent()
+ handler of the associated QWebEngineView.
+
+ \sa createStandardContextMenu()
+*/
+const QWebEngineContextMenuData &QWebEnginePage::contextMenuData() const
+{
+ Q_D(const QWebEnginePage);
+ return d->contextData;
+}
+
QT_END_NAMESPACE
#include "moc_qwebenginepage.cpp"
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index 911bfe917..2ac8e0f3e 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -44,12 +47,14 @@
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
+#include <QtGui/qpagelayout.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtWidgets/qwidget.h>
QT_BEGIN_NAMESPACE
class QMenu;
class QWebChannel;
+class QWebEngineContextMenuData;
class QWebEngineFullScreenRequest;
class QWebEngineHistory;
class QWebEnginePage;
@@ -68,8 +73,13 @@ class QWEBENGINEWIDGETS_EXPORT QWebEnginePage : public QObject {
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
- Q_PROPERTY(QUrl iconUrl READ iconUrl)
+ Q_PROPERTY(QUrl iconUrl READ iconUrl NOTIFY iconUrlChanged)
+ Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
+ Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged)
+ Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged)
+ Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged)
+ Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged)
public:
enum WebAction {
@@ -110,7 +120,9 @@ public:
InspectElement,
ExitFullScreen,
RequestClose,
-
+ Unselect,
+ SavePage,
+ OpenLinkInNewBackgroundTab,
WebActionCount
};
@@ -123,7 +135,8 @@ public:
enum WebWindowType {
WebBrowserWindow,
WebBrowserTab,
- WebDialog
+ WebDialog,
+ WebBrowserBackgroundTab
};
enum PermissionPolicy {
@@ -222,24 +235,45 @@ public:
QUrl url() const;
QUrl requestedUrl() const;
QUrl iconUrl() const;
+ QIcon icon() const;
qreal zoomFactor() const;
void setZoomFactor(qreal factor);
+ QPointF scrollPosition() const;
+ QSizeF contentsSize() const;
+
void runJavaScript(const QString& scriptSource);
+ void runJavaScript(const QString& scriptSource, quint32 worldId);
#ifdef Q_QDOC
void runJavaScript(const QString& scriptSource, FunctorOrLambda resultCallback);
+ void runJavaScript(const QString& scriptSource, quint32 worldId, FunctorOrLambda resultCallback);
#else
void runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback);
+ void runJavaScript(const QString& scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback);
#endif
QWebEngineScriptCollection &scripts();
QWebEngineSettings *settings() const;
QWebChannel *webChannel() const;
void setWebChannel(QWebChannel *);
+ void setWebChannel(QWebChannel *, uint worldId);
QColor backgroundColor() const;
void setBackgroundColor(const QColor &color);
+ bool isAudioMuted() const;
+ void setAudioMuted(bool muted);
+ bool recentlyAudible() const;
+
+ void printToPdf(const QString &filePath, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
+#ifdef Q_QDOC
+ void printToPdf(FunctorOrLambda resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
+#else
+ void printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
+#endif
+
+ const QWebEngineContextMenuData &contextMenuData() const;
+
Q_SIGNALS:
void loadStarted();
void loadProgress(int progress);
@@ -262,8 +296,13 @@ Q_SIGNALS:
// Ex-QWebFrame signals
void titleChanged(const QString &title);
void urlChanged(const QUrl &url);
- // Was iconChanged() in QWebFrame
void iconUrlChanged(const QUrl &url);
+ void iconChanged(const QIcon &icon);
+
+ void scrollPositionChanged(const QPointF &position);
+ void contentsSizeChanged(const QSizeF &size);
+ void audioMutedChanged(bool muted);
+ void recentlyAudibleChanged(bool recentlyAudible);
protected:
virtual QWebEnginePage *createWindow(WebWindowType type);
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
index 27f582c30..96640a63a 100644
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ b/src/webenginewidgets/api/qwebenginepage_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -51,6 +54,7 @@
#include "qwebenginepage.h"
#include "qwebenginecallback_p.h"
+#include "qwebenginecontextmenudata.h"
#include "qwebenginescriptcollection.h"
#include "web_contents_adapter_client.h"
#include <QtCore/qcompilerdetection.h>
@@ -86,6 +90,7 @@ public:
virtual void loadProgressChanged(int progress) Q_DECL_OVERRIDE;
virtual void didUpdateTargetURL(const QUrl&) Q_DECL_OVERRIDE;
virtual void selectionChanged() Q_DECL_OVERRIDE;
+ virtual void recentlyAudibleChanged(bool recentlyAudible) Q_DECL_OVERRIDE;
virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
virtual qreal dpiScale() const Q_DECL_OVERRIDE;
virtual QColor backgroundColor() const Q_DECL_OVERRIDE;
@@ -108,10 +113,12 @@ public:
virtual bool isFullScreenMode() const Q_DECL_OVERRIDE;
virtual void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) Q_DECL_OVERRIDE;
virtual void runFileChooser(QtWebEngineCore::FilePickerController *controller) Q_DECL_OVERRIDE;
+ virtual void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) Q_DECL_OVERRIDE;
virtual void didRunJavaScript(quint64 requestId, const QVariant& result) Q_DECL_OVERRIDE;
virtual void didFetchDocumentMarkup(quint64 requestId, const QString& result) Q_DECL_OVERRIDE;
virtual void didFetchDocumentInnerText(quint64 requestId, const QString& result) Q_DECL_OVERRIDE;
virtual void didFindText(quint64 requestId, int matchCount) Q_DECL_OVERRIDE;
+ virtual void didPrintPage(quint64 requestId, const QByteArray &result) Q_DECL_OVERRIDE;
virtual void passOnFocus(bool reverse) Q_DECL_OVERRIDE;
virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE;
virtual void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) Q_DECL_OVERRIDE;
@@ -129,10 +136,15 @@ public:
virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus,
int exitCode) Q_DECL_OVERRIDE;
virtual void requestGeometryChange(const QRect &geometry) Q_DECL_OVERRIDE;
+ virtual void updateScrollPosition(const QPointF &position) Q_DECL_OVERRIDE;
+ virtual void updateContentsSize(const QSizeF &size) Q_DECL_OVERRIDE;
+ void startDragging(const content::DropData &dropData, Qt::DropActions allowedActions,
+ const QPixmap &pixmap, const QPoint &offset) Q_DECL_OVERRIDE;
virtual bool isEnabled() const Q_DECL_OVERRIDE;
const QObject *holdingQObject() const Q_DECL_OVERRIDE;
virtual QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContextAdapter() Q_DECL_OVERRIDE;
+ QtWebEngineCore::WebContentsAdapter *webContentsAdapter() Q_DECL_OVERRIDE;
void updateAction(QWebEnginePage::WebAction) const;
void updateNavigationActions();
@@ -152,13 +164,15 @@ public:
QWebEngineSettings *settings;
QWebEngineView *view;
QUrl explicitUrl;
- QtWebEngineCore::WebEngineContextMenuData m_menuData;
+ QWebEngineContextMenuData contextData;
bool isLoading;
QWebEngineScriptCollection scriptCollection;
bool m_isBeingAdopted;
QColor m_backgroundColor;
bool fullscreenMode;
QWebChannel *webChannel;
+ unsigned int webChannelWorldId;
+ QUrl iconUrl;
mutable QtWebEngineCore::CallbackDirectory m_callbacks;
mutable QAction *actions[QWebEnginePage::WebActionCount];
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 913ec8317..664323034 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -45,11 +48,17 @@
#include "qwebenginescriptcollection_p.h"
#include "browser_context_adapter.h"
+#include <qtwebenginecoreglobal.h>
#include "web_engine_visited_links_manager.h"
#include "web_engine_settings.h"
QT_BEGIN_NAMESPACE
+ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::UnknownSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::UnknownSavePageFormat)
+ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::SingleHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::SingleHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::CompleteHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::CompleteHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::MimeHtmlSaveFormat)
+
using QtWebEngineCore::BrowserContextAdapter;
/*!
@@ -97,6 +106,7 @@ using QtWebEngineCore::BrowserContextAdapter;
\value MemoryHttpCache Use an in-memory cache. This is the only setting possible if
\c off-the-record is set or no cache path is available.
\value DiskHttpCache Use a disk cache. This is the default.
+ \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
*/
/*!
@@ -132,7 +142,7 @@ using QtWebEngineCore::BrowserContextAdapter;
QWebEngineProfilePrivate::QWebEngineProfilePrivate(QSharedPointer<BrowserContextAdapter> browserContext)
: m_settings(new QWebEngineSettings())
- , m_scriptCollection(new QWebEngineScriptCollection(new QWebEngineScriptCollectionPrivate(browserContext->userScriptController())))
+ , m_scriptCollection(new QWebEngineScriptCollection(new QWebEngineScriptCollectionPrivate(browserContext->userResourceController())))
, m_browserContextRef(browserContext)
{
m_browserContextRef->addClient(this);
@@ -173,6 +183,7 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
itemPrivate->downloadState = QWebEngineDownloadItem::DownloadRequested;
itemPrivate->downloadPath = info.path;
itemPrivate->mimeType = info.mimeType;
+ itemPrivate->savePageFormat = static_cast<QWebEngineDownloadItem::SavePageFormat>(info.savePageFormat);
QWebEngineDownloadItem *download = new QWebEngineDownloadItem(itemPrivate, q);
@@ -183,6 +194,8 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
QWebEngineDownloadItem::DownloadState state = download->state();
info.path = download->path();
+ info.savePageFormat = static_cast<QtWebEngineCore::BrowserContextAdapterClient::SavePageFormat>(
+ download->savePageFormat());
info.accepted = state != QWebEngineDownloadItem::DownloadCancelled;
if (state == QWebEngineDownloadItem::DownloadRequested) {
@@ -645,4 +658,15 @@ void QWebEngineProfile::destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler *ob
removeUrlSchemeHandler(obj);
}
+/*!
+ \since 5.7
+
+ Removes the profile's cache entries.
+*/
+void QWebEngineProfile::clearHttpCache()
+{
+ Q_D(QWebEngineProfile);
+ d->browserContext()->clearHttpCache();
+}
+
QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h
index be420c62f..d981fa5bb 100644
--- a/src/webenginewidgets/api/qwebengineprofile.h
+++ b/src/webenginewidgets/api/qwebengineprofile.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -66,7 +69,8 @@ public:
enum HttpCacheType {
MemoryHttpCache,
- DiskHttpCache
+ DiskHttpCache,
+ NoCache
};
enum PersistentCookiesPolicy {
@@ -115,6 +119,8 @@ public:
void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
void removeAllUrlSchemeHandlers();
+ void clearHttpCache();
+
static QWebEngineProfile *defaultProfile();
Q_SIGNALS:
diff --git a/src/webenginewidgets/api/qwebengineprofile_p.h b/src/webenginewidgets/api/qwebengineprofile_p.h
index 0190d37d9..4d31c5a81 100644
--- a/src/webenginewidgets/api/qwebengineprofile_p.h
+++ b/src/webenginewidgets/api/qwebengineprofile_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginescript.cpp b/src/webenginewidgets/api/qwebenginescript.cpp
index 6585ff559..73dd5075e 100644
--- a/src/webenginewidgets/api/qwebenginescript.cpp
+++ b/src/webenginewidgets/api/qwebenginescript.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginescript.h b/src/webenginewidgets/api/qwebenginescript.h
index a3cc66179..34c13e4b7 100644
--- a/src/webenginewidgets/api/qwebenginescript.h
+++ b/src/webenginewidgets/api/qwebenginescript.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp
index 1ba16db9d..4b77b4699 100644
--- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp
+++ b/src/webenginewidgets/api/qwebenginescriptcollection.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,7 +40,7 @@
#include "qwebenginescriptcollection.h"
#include "qwebenginescriptcollection_p.h"
-#include "user_script_controller_host.h"
+#include "user_resource_controller_host.h"
using QtWebEngineCore::UserScript;
@@ -164,7 +167,7 @@ QList<QWebEngineScript> QWebEngineScriptCollection::toList() const
}
-QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *controller, QSharedPointer<QtWebEngineCore::WebContentsAdapter> webContents)
+QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *controller, QSharedPointer<QtWebEngineCore::WebContentsAdapter> webContents)
: m_scriptController(controller)
, m_contents(webContents)
{
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.h b/src/webenginewidgets/api/qwebenginescriptcollection.h
index 40196b478..e68dfce8f 100644
--- a/src/webenginewidgets/api/qwebenginescriptcollection.h
+++ b/src/webenginewidgets/api/qwebenginescriptcollection.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection_p.h b/src/webenginewidgets/api/qwebenginescriptcollection_p.h
index 911764868..fa4b4d790 100644
--- a/src/webenginewidgets/api/qwebenginescriptcollection_p.h
+++ b/src/webenginewidgets/api/qwebenginescriptcollection_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -57,13 +60,13 @@
#include <QtCore/QSharedPointer>
namespace QtWebEngineCore {
-class UserScriptControllerHost;
+class UserResourceControllerHost;
} // namespace
QT_BEGIN_NAMESPACE
class QWebEngineScriptCollectionPrivate {
public:
- QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *, QSharedPointer<QtWebEngineCore::WebContentsAdapter> = QSharedPointer<QtWebEngineCore::WebContentsAdapter>());
+ QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *, QSharedPointer<QtWebEngineCore::WebContentsAdapter> = QSharedPointer<QtWebEngineCore::WebContentsAdapter>());
int count() const;
bool contains(const QWebEngineScript &) const;
@@ -78,7 +81,7 @@ public:
void reserve(int);
private:
- QtWebEngineCore::UserScriptControllerHost *m_scriptController;
+ QtWebEngineCore::UserResourceControllerHost *m_scriptController;
QSharedPointer<QtWebEngineCore::WebContentsAdapter> m_contents;
};
diff --git a/src/webenginewidgets/api/qwebenginesettings.cpp b/src/webenginewidgets/api/qwebenginesettings.cpp
index 430d64185..dfca16287 100644
--- a/src/webenginewidgets/api/qwebenginesettings.cpp
+++ b/src/webenginewidgets/api/qwebenginesettings.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -76,6 +79,16 @@ static WebEngineSettings::Attribute toWebEngineAttribute(QWebEngineSettings::Web
return WebEngineSettings::PluginsEnabled;
case QWebEngineSettings::FullScreenSupportEnabled:
return WebEngineSettings::FullScreenSupportEnabled;
+ case QWebEngineSettings::ScreenCaptureEnabled:
+ return WebEngineSettings::ScreenCaptureEnabled;
+ case QWebEngineSettings::WebGLEnabled:
+ return WebEngineSettings::WebGLEnabled;
+ case QWebEngineSettings::Accelerated2dCanvasEnabled:
+ return WebEngineSettings::Accelerated2dCanvasEnabled;
+ case QWebEngineSettings::AutoLoadIconsForPage:
+ return WebEngineSettings::AutoLoadIconsForPage;
+ case QWebEngineSettings::TouchIconsEnabled:
+ return WebEngineSettings::TouchIconsEnabled;
default:
return WebEngineSettings::UnsupportedInCoreSettings;
}
@@ -115,6 +128,7 @@ ASSERT_ENUMS_MATCH(WebEngineSettings::SerifFont, QWebEngineSettings::SerifFont)
ASSERT_ENUMS_MATCH(WebEngineSettings::SansSerifFont, QWebEngineSettings::SansSerifFont)
ASSERT_ENUMS_MATCH(WebEngineSettings::CursiveFont, QWebEngineSettings::CursiveFont)
ASSERT_ENUMS_MATCH(WebEngineSettings::FantasyFont, QWebEngineSettings::FantasyFont)
+ASSERT_ENUMS_MATCH(WebEngineSettings::PictographFont, QWebEngineSettings::PictographFont)
void QWebEngineSettings::setFontFamily(QWebEngineSettings::FontFamily which, const QString &family)
{
diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h
index 53c38ef2b..8eda50ee2 100644
--- a/src/webenginewidgets/api/qwebenginesettings.h
+++ b/src/webenginewidgets/api/qwebenginesettings.h
@@ -1,22 +1,41 @@
-/*
- Copyright (C) 2015 The Qt Company Ltd.
- Copyright (C) 2008 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) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#ifndef QWEBENGINESETTINGS_H
#define QWEBENGINESETTINGS_H
@@ -43,7 +62,8 @@ public:
SerifFont,
SansSerifFont,
CursiveFont,
- FantasyFont
+ FantasyFont,
+ PictographFont
};
enum WebAttribute {
AutoLoadImages,
@@ -60,7 +80,12 @@ public:
ScrollAnimatorEnabled,
ErrorPageEnabled,
PluginsEnabled,
- FullScreenSupportEnabled
+ FullScreenSupportEnabled,
+ ScreenCaptureEnabled,
+ WebGLEnabled,
+ Accelerated2dCanvasEnabled,
+ AutoLoadIconsForPage,
+ TouchIconsEnabled
};
enum FontSize {
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 2029a9819..8b4053e73 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -48,6 +51,7 @@
#include <QMenu>
#include <QContextMenuEvent>
#include <QStackedLayout>
+#include <QPageLayout>
QT_BEGIN_NAMESPACE
@@ -82,6 +86,7 @@ void QWebEngineViewPrivate::bind(QWebEngineView *view, QWebEnginePage *page)
QObject::connect(page, &QWebEnginePage::titleChanged, view, &QWebEngineView::titleChanged);
QObject::connect(page, &QWebEnginePage::urlChanged, view, &QWebEngineView::urlChanged);
QObject::connect(page, &QWebEnginePage::iconUrlChanged, view, &QWebEngineView::iconUrlChanged);
+ QObject::connect(page, &QWebEnginePage::iconChanged, view, &QWebEngineView::iconChanged);
QObject::connect(page, &QWebEnginePage::loadStarted, view, &QWebEngineView::loadStarted);
QObject::connect(page, &QWebEnginePage::loadProgress, view, &QWebEngineView::loadProgress);
QObject::connect(page, &QWebEnginePage::loadFinished, view, &QWebEngineView::loadFinished);
@@ -102,6 +107,7 @@ static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *obje
QWebEngineViewPrivate::QWebEngineViewPrivate()
: page(0)
, m_pendingContextMenuEvent(false)
+ , m_dragEntered(false)
{
#ifndef QT_NO_ACCESSIBILITY
QAccessible::installFactory(&webAccessibleFactory);
@@ -117,12 +123,23 @@ QWebEngineViewPrivate::QWebEngineViewPrivate()
with which the process terminated.
*/
+/*!
+ \fn void QWebEngineView::iconChanged(const QIcon &icon)
+ \since 5.7
+
+ This signal is emitted when the icon ("favicon") associated with the
+ view is changed. The new icon is specified by \a icon.
+
+ \sa icon(), iconUrl(), iconUrlChanged()
+*/
+
QWebEngineView::QWebEngineView(QWidget *parent)
: QWidget(parent)
, d_ptr(new QWebEngineViewPrivate)
{
Q_D(QWebEngineView);
d->q_ptr = this;
+ setAcceptDrops(true);
// This causes the child RenderWidgetHostViewQtDelegateWidgets to fill this widget.
setLayout(new QStackedLayout);
@@ -193,6 +210,20 @@ QUrl QWebEngineView::iconUrl() const
return page()->iconUrl();
}
+/*!
+ \property QWebEngineView::icon
+ \brief the icon associated with the page currently viewed
+ \since 5.7
+
+ By default, this property contains a null icon.
+
+ \sa iconChanged(), iconUrl(), iconUrlChanged()
+*/
+QIcon QWebEngineView::icon() const
+{
+ return page()->icon();
+}
+
bool QWebEngineView::hasSelection() const
{
return page()->hasSelection();
@@ -259,7 +290,6 @@ QWebEngineView *QWebEngineView::createWindow(QWebEnginePage::WebWindowType type)
return 0;
}
-
qreal QWebEngineView::zoomFactor() const
{
return page()->zoomFactor();
@@ -314,6 +344,63 @@ void QWebEngineView::hideEvent(QHideEvent *event)
page()->d_ptr->wasHidden();
}
+/*!
+ \reimp
+*/
+void QWebEngineView::dragEnterEvent(QDragEnterEvent *e)
+{
+ Q_D(QWebEngineView);
+ e->accept();
+ if (d->m_dragEntered)
+ d->page->d_ptr->adapter->leaveDrag();
+ d->page->d_ptr->adapter->enterDrag(e, mapToGlobal(e->pos()));
+ d->m_dragEntered = true;
+}
+
+/*!
+ \reimp
+*/
+void QWebEngineView::dragLeaveEvent(QDragLeaveEvent *e)
+{
+ Q_D(QWebEngineView);
+ if (!d->m_dragEntered)
+ return;
+ e->accept();
+ d->page->d_ptr->adapter->leaveDrag();
+ d->m_dragEntered = false;
+}
+
+/*!
+ \reimp
+*/
+void QWebEngineView::dragMoveEvent(QDragMoveEvent *e)
+{
+ Q_D(QWebEngineView);
+ if (!d->m_dragEntered)
+ return;
+ QtWebEngineCore::WebContentsAdapter *adapter = d->page->d_ptr->adapter.data();
+ Qt::DropAction dropAction = adapter->updateDragPosition(e, mapToGlobal(e->pos()));
+ if (Qt::IgnoreAction == dropAction) {
+ e->ignore();
+ } else {
+ e->setDropAction(dropAction);
+ e->accept();
+ }
+}
+
+/*!
+ \reimp
+*/
+void QWebEngineView::dropEvent(QDropEvent *e)
+{
+ Q_D(QWebEngineView);
+ if (!d->m_dragEntered)
+ return;
+ e->accept();
+ d->page->d_ptr->adapter->endDragging(e->pos(), mapToGlobal(e->pos()));
+ d->m_dragEntered = false;
+}
+
#ifndef QT_NO_ACCESSIBILITY
int QWebEngineViewAccessible::childCount() const
{
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index 34eb6177c..cb66bb75f 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -55,7 +58,8 @@ class QWEBENGINEWIDGETS_EXPORT QWebEngineView : public QWidget {
Q_OBJECT
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
- Q_PROPERTY(QUrl iconUrl READ iconUrl)
+ Q_PROPERTY(QUrl iconUrl READ iconUrl NOTIFY iconUrlChanged)
+ Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
Q_PROPERTY(QString selectedText READ selectedText)
Q_PROPERTY(bool hasSelection READ hasSelection)
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
@@ -77,6 +81,7 @@ public:
void setUrl(const QUrl &url);
QUrl url() const;
QUrl iconUrl() const;
+ QIcon icon() const;
bool hasSelection() const;
QString selectedText() const;
@@ -113,6 +118,7 @@ Q_SIGNALS:
void selectionChanged();
void urlChanged(const QUrl&);
void iconUrlChanged(const QUrl&);
+ void iconChanged(const QIcon&);
void renderProcessTerminated(QWebEnginePage::RenderProcessTerminationStatus terminationStatus,
int exitCode);
@@ -122,6 +128,10 @@ protected:
virtual bool event(QEvent*) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
virtual void hideEvent(QHideEvent *) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
+ void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
+ void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
+ void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(QWebEngineView)
diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
index af8bc70ac..45b3e266e 100644
--- a/src/webenginewidgets/api/qwebengineview_p.h
+++ b/src/webenginewidgets/api/qwebengineview_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -68,6 +71,7 @@ public:
QWebEnginePage *page;
bool m_pendingContextMenuEvent;
+ bool m_dragEntered;
};
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp b/src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
index ba9aec8fe..b948fa597 100644
--- a/src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
+++ b/src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/webenginewidgets/doc/snippets/simple/main.cpp b/src/webenginewidgets/doc/snippets/simple/main.cpp
index bebdeff11..666ef3f65 100644
--- a/src/webenginewidgets/doc/snippets/simple/main.cpp
+++ b/src/webenginewidgets/doc/snippets/simple/main.cpp
@@ -1,21 +1,42 @@
-/*
- Copyright (C) 2014 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) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#include <QApplication>
#include <QUrl>
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
index 77596a370..59d7bc5d1 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
index a9ef6ad8c..d0f2fd930 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
index 5822f41b7..7bc7ff48d 100644
--- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 0900765fc..539e809d4 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -51,8 +51,9 @@
The title of an HTML page can be accessed with the title() property.
Additionally, a page may also specify an icon, which can be accessed
- using the iconUrl() property. If the title or the icon changes, the
- corresponding titleChanged() and iconUrlChanged() signals will be emitted.
+ using the icon() or its URL using the iconUrl() property.
+ If the title or the icon changes, the corresponding titleChanged(), iconChanged()
+ and iconUrlChanged() signals will be emitted.
The zoomFactor() property enables zooming the contents of the web page by a
scale factor.
@@ -78,6 +79,14 @@
security origin, and can access each other's resources. Local resources are by default
restricted from accessing remote content, which means that \c file:// will not be able to
access \c http://domain.com/foo.html.
+
+ Scripts can be executed on the web page by using runJavaScript(), either in the main
+ JavaScript \e world, along with the rest of the JavaScript coming from the web contents, or in
+ their own isolated world. While the DOM of the page can be accessed from any world, JavaScript
+ variables of a function defined in one world are not accessible from a different one.
+ QWebEngineScript::ScriptWorldId provides some predefined IDs for this purpose. Using the
+ \c runJavaScript() version without the world ID is the same as running the script in the
+ \c MainWorld.
*/
/*!
@@ -117,6 +126,7 @@
\value OpenLinkInThisWindow Open the current link in the current window. (Added in Qt 5.6)
\value OpenLinkInNewWindow Open the current link in a new window. (Added in Qt 5.6)
\value OpenLinkInNewTab Open the current link in a new tab. (Added in Qt 5.6)
+ \value OpenLinkInNewBackgroundTab Open the current link in a new background tab. (Added in Qt 5.7)
\value CopyLinkToClipboard Copy the current link to the clipboard. (Added in Qt 5.6)
\value CopyImageToClipboard Copy the clicked image to the clipboard. (Added in Qt 5.6)
@@ -139,6 +149,9 @@
\value RequestClose Request to close the web page. If defined, the \c{window.onbeforeunload}
handler is run, and the user can confirm or reject to close the page. If the close
request is confirmed, \c windowCloseRequested is emitted. (Added in Qt 5.6)
+ \value Unselect Clear the current selection. (Added in Qt 5.7)
+ \value SavePage Save the current page to disk. MHTML is the default format that is used to store
+ the web page on disk. (Added in Qt 5.7)
\omitvalue WebActionCount
@@ -155,6 +168,8 @@
A web browser tab.
\value WebDialog
A window without decoration.
+ \value WebBrowserBackgroundTab
+ A web browser tab without hiding the current visible WebEngineView. (Added in Qt 5.7)
*/
/*!
@@ -266,6 +281,9 @@
the user clicks on the web page with the right mouse button. It is
called from the default \l{QWidget::}{contextMenuEvent()} handler. The popup menu's
ownership is transferred to the caller.
+
+ Returns \c nullptr if the context menu data is not initialized, for example when it
+ is called when there is actually no context menu requested.
*/
/*!
@@ -396,14 +414,14 @@
\fn void QWebEnginePage::findText(const QString &subString, FindFlags options)
Finds the specified string, \a subString, in the page, using the given \a options.
- To clear the selection, just pass an empty string.
+ To clear the search highlight, just pass an empty string.
*/
/*!
\fn void QWebEnginePage::findText(const QString &subString, FindFlags options, FunctorOrLambda resultCallback)
Finds the specified string, \a subString, in the page, using the given \a options.
- To clear the selection, just pass an empty string.
+ To clear the search highlight, just pass an empty string.
The \a resultCallback must take a boolean parameter. It will be called with a value of \c true
if the \a subString was found; otherwise the callback value will be \c false.
@@ -558,13 +576,6 @@
*/
/*!
- \property QWebEnginePage::iconUrl
- \brief the URL of the icon associated with the page currently viewed.
-
- \sa iconUrlChanged()
-*/
-
-/*!
\property QWebEnginePage::requestedUrl
\brief the URL that was originally requested to be loaded by the page
that is currently viewed
@@ -641,31 +652,61 @@
*/
/*!
+ \fn void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId, FunctorOrLambda resultCallback)
+ \since 5.7
+
+ Runs the JavaScript code contained in \a scriptSource in the world specified by \a worldId.
+ The world ID values are the same as provided by QWebEngineScript::ScriptWorldId. Using the
+ \e runJavaScript() versions without the world ID is the same as running the script in the
+ \c MainWorld.
+
+ When the script has been executed, \a resultCallback is called with the result of the last
+ executed statement. \c resultCallback can be any of a function pointer, a functor or a lambda,
+ and it is expected to take a QVariant parameter. For example:
+
+ \code
+ page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
+ \endcode
+
+ \warning Do not execute lengthy routines in the callback function, because it might block the
+ rendering of the web engine page.
+
+ See scripts() for an alternative API to inject scripts.
+
+ \sa QWebEngineScript::ScriptWorldId
+*/
+
+/*!
+ \fn void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId)
+ \since 5.7
+ \overload runJavaScript()
+
+ This convenience function runs the JavaScript code contained in \a scriptSource in the world
+ specified by \a worldId.
+*/
+
+/*!
\fn void QWebEnginePage::runJavaScript(const QString& scriptSource)
\overload runJavaScript()
- This convenience function runs the JavaScript code contained in \a scriptSource.
+ This convenience function runs the JavaScript code contained in \a scriptSource in the same
+ world as other scripts that are part of the loaded site.
+
+ \sa QWebEngineScript::MainWorld
*/
/*!
\fn void QWebEnginePage::runJavaScript(const QString& scriptSource, FunctorOrLambda resultCallback)
+ \overload runJavaScript()
Runs the JavaScript code contained in \a scriptSource.
- The script will run in the same \e world as other scripts that are part of the loaded site.
-
- When the script has been executed, \a resultCallback is called with the result of the last executed statement.
- \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a
- QVariant parameter. For example:
+ The script will run in the same world as other scripts that are part of the loaded site.
- \code
- page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
- \endcode
+ When the script has been executed, \a resultCallback is called with the result of the last
+ executed statement.
- \warning Do not execute lengthy routines in the callback function, because it might block the
- rendering of the web engine page.
-
- See scripts() for an alternative API to inject scripts.
+ \sa QWebEngineScript::MainWorld
*/
/*!
@@ -716,13 +757,3 @@
\sa url()
*/
-
-/*!
- \fn void QWebEnginePage::iconUrlChanged(const QUrl &url)
-
- This signal is emitted when the icon ("favicon") associated with the page is
- found or changed. The new URL is specified by \a url.
-
-
- \sa iconUrl()
-*/
diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
index c19e3491e..07c4965d0 100644
--- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
@@ -66,6 +66,8 @@
\value SansSerifFont
\value CursiveFont
\value FantasyFont
+ \value PictographFont
+ (added in Qt 5.7)
*/
/*!
@@ -133,6 +135,18 @@
See also \l{Pepper Plugin API}. (Added in Qt 5.6)
\value FullScreenSupportEnabled
Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6)
+ \value ScreenCaptureEnabled
+ Enables screen capture in an application. Disabled by default. (Added in Qt 5.7)
+ \value WebGLEnabled
+ Enables support for HTML 5 WebGL. Enabled by default if available. (Added in Qt 5.7)
+ \value Accelerated2dCanvasEnabled
+ Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer.
+ This makes many painting operations faster, but slows down pixel access. Enabled by default if available. (Added in Qt 5.7)
+ \value AutoLoadIconsForPage
+ Automatically downloads icons for web pages. Enabled by default. (Added in Qt 5.7)
+ \value TouchIconsEnabled
+ Enables support for touch icons and precomposed touch icons
+ Disabled by default. (Added in Qt 5.7)
*/
/*!
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index d03d64a1c..5a4c1b52b 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -59,9 +59,11 @@
The title of an HTML document can be accessed with the title() property.
Additionally, a web site may specify an icon, which can be accessed
- using the iconUrl() property. If the title or the icon changes, the corresponding
- titleChanged() and iconUrlChanged() signals will be emitted. The
- zoomFactor() property enables zooming the contents of the web page by a scale factor.
+ using the icon() or its URL using the iconUrl() property.
+ If the title or the icon changes, the corresponding titleChanged(), iconChanged()
+ and iconUrlChanged() signals will be emitted.
+ The zoomFactor() property enables zooming the contents of the web page by a
+ scale factor.
If you require a custom context menu, you can implement it by reimplementing
\l{QWidget::}{contextMenuEvent()} and populating your QMenu with the actions
@@ -189,9 +191,11 @@
/*!
\property QWebEngineView::iconUrl
- \brief the URL of the icon associated with the web page currently viewed
+ \brief the URL of the icon associated with the page currently viewed
- \sa iconUrlChanged()
+ By default, this property contains an empty URL.
+
+ \sa iconUrlChanged(), icon(), iconChanged()
*/
/*!
@@ -331,9 +335,10 @@
/*!
\fn void QWebEngineView::iconUrlChanged(const QUrl &url)
- This signal is emitted whenever the icon \a url of the view changes.
+ This signal is emitted when the URL of the icon ("favicon") associated with the
+ view is changed. The new URL is specified by \a url.
- \sa iconUrl()
+ \sa iconUrl(), icon(), iconChanged()
*/
/*!
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
index 5bc1671df..23a203eab 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
index ecf2d2d33..7307bcd55 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/ui/messagebubblewidget.cpp b/src/webenginewidgets/ui/messagebubblewidget.cpp
index 490e2a8f8..4a53a421f 100644
--- a/src/webenginewidgets/ui/messagebubblewidget.cpp
+++ b/src/webenginewidgets/ui/messagebubblewidget.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/ui/messagebubblewidget_p.h b/src/webenginewidgets/ui/messagebubblewidget_p.h
index 28ccf1b13..8815d1ba4 100644
--- a/src/webenginewidgets/ui/messagebubblewidget_p.h
+++ b/src/webenginewidgets/ui/messagebubblewidget_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro
index cc48f1198..279ec79f8 100644
--- a/src/webenginewidgets/webenginewidgets.pro
+++ b/src/webenginewidgets/webenginewidgets.pro
@@ -11,6 +11,7 @@ INCLUDEPATH += $$PWD api ../core ../core/api ../webengine/api
SOURCES = \
api/qtwebenginewidgetsglobal.cpp \
api/qwebenginecertificateerror.cpp \
+ api/qwebenginecontextmenudata.cpp \
api/qwebenginedownloaditem.cpp \
api/qwebenginefullscreenrequest.cpp \
api/qwebenginehistory.cpp \
@@ -24,9 +25,10 @@ SOURCES = \
HEADERS = \
api/qtwebenginewidgetsglobal.h \
+ api/qwebenginecertificateerror.h \
+ api/qwebenginecontextmenudata.h \
api/qwebenginedownloaditem.h \
api/qwebenginedownloaditem_p.h \
- api/qwebenginecertificateerror.h \
api/qwebenginefullscreenrequest.h \
api/qwebenginehistory.h \
api/qwebenginepage.h \
@@ -46,4 +48,8 @@ HEADERS = \
DEFINES += QT_UI_DELEGATES
}
+!contains(WEBENGINE_CONFIG, no_spellcheck) {
+ DEFINES += ENABLE_SPELLCHECK
+}
+
load(qt_module)