From d9a18d3caaf80e83abec7a52229be603d5011ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Fri, 26 Jun 2015 12:20:14 +0200 Subject: Mark all private headers as private. Since these classes won't be part of the public API any time soon, it's better that we just make them as private. Change-Id: Id3c1aeb0ad537a1630a04f669a2d4feb09d8b2e1 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/imports/webview.cpp | 4 +- src/webview/qnativeviewcontroller_p.h | 11 +++ src/webview/qquickwebview.cpp | 4 +- src/webview/qquickwebview.h | 120 ------------------------------- src/webview/qquickwebview_p.h | 120 +++++++++++++++++++++++++++++++ src/webview/qquickwebviewloadrequest.cpp | 2 +- src/webview/qquickwebviewloadrequest.h | 71 ------------------ src/webview/qquickwebviewloadrequest_p.h | 82 +++++++++++++++++++++ src/webview/qwebview_p_p.h | 11 +++ src/webview/qwebviewloadrequest_p.h | 11 +++ src/webview/webview-lib.pri | 4 +- 11 files changed, 242 insertions(+), 198 deletions(-) delete mode 100644 src/webview/qquickwebview.h create mode 100644 src/webview/qquickwebview_p.h delete mode 100644 src/webview/qquickwebviewloadrequest.h create mode 100644 src/webview/qquickwebviewloadrequest_p.h diff --git a/src/imports/webview.cpp b/src/imports/webview.cpp index b02f15c..c10e790 100644 --- a/src/imports/webview.cpp +++ b/src/imports/webview.cpp @@ -42,8 +42,8 @@ # include # include #else -# include -# include +# include +# include #endif // QT_WEBVIEW_WEBENGINE_BACKEND QT_BEGIN_NAMESPACE diff --git a/src/webview/qnativeviewcontroller_p.h b/src/webview/qnativeviewcontroller_p.h index 92c9d96..0abf32d 100644 --- a/src/webview/qnativeviewcontroller_p.h +++ b/src/webview/qnativeviewcontroller_p.h @@ -37,6 +37,17 @@ #ifndef QNATIVEVIEWCONTROLLER_P_H #define QNATIVEVIEWCONTROLLER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qwebview_global.h" #include #include diff --git a/src/webview/qquickwebview.cpp b/src/webview/qquickwebview.cpp index 270da36..4d0045d 100644 --- a/src/webview/qquickwebview.cpp +++ b/src/webview/qquickwebview.cpp @@ -34,8 +34,8 @@ ** ****************************************************************************/ -#include "qquickwebview.h" -#include "qquickwebviewloadrequest.h" +#include "qquickwebview_p.h" +#include "qquickwebviewloadrequest_p.h" #include #include #include diff --git a/src/webview/qquickwebview.h b/src/webview/qquickwebview.h deleted file mode 100644 index 236a06e..0000000 --- a/src/webview/qquickwebview.h +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWebView module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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 -** 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. -** -** 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. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKWEBVIEW_H -#define QQUICKWEBVIEW_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickWebViewLoadRequest; -class QWebViewLoadRequestPrivate; - -class Q_WEBVIEW_EXPORT QQuickWebView : public QQuickViewController, public QWebViewInterface -{ - Q_OBJECT - Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) - Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged REVISION 1) - Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged) - Q_PROPERTY(QString title READ title NOTIFY titleChanged) - Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY loadingChanged) - Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY loadingChanged) - Q_ENUMS(LoadStatus) - -public: - enum LoadStatus { // Changes here needs to be done in QWebView as well - LoadStartedStatus, - LoadStoppedStatus, - LoadSucceededStatus, - LoadFailedStatus - }; - - QQuickWebView(QQuickItem *parent = 0); - ~QQuickWebView(); - - QUrl url() const Q_DECL_OVERRIDE; - void setUrl(const QUrl &url) Q_DECL_OVERRIDE; - int loadProgress() const Q_DECL_OVERRIDE; - QString title() const Q_DECL_OVERRIDE; - bool canGoBack() const Q_DECL_OVERRIDE; - bool isLoading() const Q_DECL_OVERRIDE; - bool canGoForward() const Q_DECL_OVERRIDE; - -public Q_SLOTS: - void goBack() Q_DECL_OVERRIDE; - void goForward() Q_DECL_OVERRIDE; - void reload() Q_DECL_OVERRIDE; - void stop() Q_DECL_OVERRIDE; - Q_REVISION(1) void loadHtml(const QString &html, const QUrl &baseUrl = QUrl()) Q_DECL_OVERRIDE; - Q_REVISION(1) void runJavaScript(const QString& script, - const QJSValue &callback = QJSValue()); - -Q_SIGNALS: - void titleChanged(); - void urlChanged(); - Q_REVISION(1) void loadingChanged(QQuickWebViewLoadRequest *loadRequest); - void loadProgressChanged(); - -protected: - void runJavaScriptPrivate(const QString& script, - int callbackId) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void onRunJavaScriptResult(int id, const QVariant &variant); - void onFocusRequest(bool focus); - void onLoadingChanged(const QWebViewLoadRequestPrivate &loadRequest); - -private: - QWebView* m_webView; -}; - -QT_END_NAMESPACE - -#endif // QQUICKWEBVIEW_H diff --git a/src/webview/qquickwebview_p.h b/src/webview/qquickwebview_p.h new file mode 100644 index 0000000..236a06e --- /dev/null +++ b/src/webview/qquickwebview_p.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebView module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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 +** 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. +** +** 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. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKWEBVIEW_H +#define QQUICKWEBVIEW_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickWebViewLoadRequest; +class QWebViewLoadRequestPrivate; + +class Q_WEBVIEW_EXPORT QQuickWebView : public QQuickViewController, public QWebViewInterface +{ + Q_OBJECT + Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) + Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged REVISION 1) + Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged) + Q_PROPERTY(QString title READ title NOTIFY titleChanged) + Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY loadingChanged) + Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY loadingChanged) + Q_ENUMS(LoadStatus) + +public: + enum LoadStatus { // Changes here needs to be done in QWebView as well + LoadStartedStatus, + LoadStoppedStatus, + LoadSucceededStatus, + LoadFailedStatus + }; + + QQuickWebView(QQuickItem *parent = 0); + ~QQuickWebView(); + + QUrl url() const Q_DECL_OVERRIDE; + void setUrl(const QUrl &url) Q_DECL_OVERRIDE; + int loadProgress() const Q_DECL_OVERRIDE; + QString title() const Q_DECL_OVERRIDE; + bool canGoBack() const Q_DECL_OVERRIDE; + bool isLoading() const Q_DECL_OVERRIDE; + bool canGoForward() const Q_DECL_OVERRIDE; + +public Q_SLOTS: + void goBack() Q_DECL_OVERRIDE; + void goForward() Q_DECL_OVERRIDE; + void reload() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; + Q_REVISION(1) void loadHtml(const QString &html, const QUrl &baseUrl = QUrl()) Q_DECL_OVERRIDE; + Q_REVISION(1) void runJavaScript(const QString& script, + const QJSValue &callback = QJSValue()); + +Q_SIGNALS: + void titleChanged(); + void urlChanged(); + Q_REVISION(1) void loadingChanged(QQuickWebViewLoadRequest *loadRequest); + void loadProgressChanged(); + +protected: + void runJavaScriptPrivate(const QString& script, + int callbackId) Q_DECL_OVERRIDE; + +private Q_SLOTS: + void onRunJavaScriptResult(int id, const QVariant &variant); + void onFocusRequest(bool focus); + void onLoadingChanged(const QWebViewLoadRequestPrivate &loadRequest); + +private: + QWebView* m_webView; +}; + +QT_END_NAMESPACE + +#endif // QQUICKWEBVIEW_H diff --git a/src/webview/qquickwebviewloadrequest.cpp b/src/webview/qquickwebviewloadrequest.cpp index 3e614a3..b504560 100644 --- a/src/webview/qquickwebviewloadrequest.cpp +++ b/src/webview/qquickwebviewloadrequest.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "qquickwebviewloadrequest.h" +#include "qquickwebviewloadrequest_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/webview/qquickwebviewloadrequest.h b/src/webview/qquickwebviewloadrequest.h deleted file mode 100644 index 1d8731e..0000000 --- a/src/webview/qquickwebviewloadrequest.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWebView module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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 -** 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. -** -** 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. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKWEBVIEWREQUEST_H -#define QQUICKWEBVIEWREQUEST_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QWebViewLoadRequestPrivate; - -class Q_WEBVIEW_EXPORT QQuickWebViewLoadRequest : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl url READ url) - Q_PROPERTY(QQuickWebView::LoadStatus status READ status) - Q_PROPERTY(QString errorString READ errorString) - -public: - ~QQuickWebViewLoadRequest(); - - QUrl url() const; - QQuickWebView::LoadStatus status() const; - QString errorString() const; - -private: - friend class QQuickWebView; - explicit QQuickWebViewLoadRequest(const QWebViewLoadRequestPrivate &d); - Q_DECLARE_PRIVATE(QWebViewLoadRequest) - QScopedPointer d_ptr; -}; - -QT_END_NAMESPACE - -#endif // QQUICKWEBVIEWREQUEST_H diff --git a/src/webview/qquickwebviewloadrequest_p.h b/src/webview/qquickwebviewloadrequest_p.h new file mode 100644 index 0000000..4a16567 --- /dev/null +++ b/src/webview/qquickwebviewloadrequest_p.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebView module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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 +** 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. +** +** 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. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKWEBVIEWREQUEST_H +#define QQUICKWEBVIEWREQUEST_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QWebViewLoadRequestPrivate; + +class Q_WEBVIEW_EXPORT QQuickWebViewLoadRequest : public QObject +{ + Q_OBJECT + Q_PROPERTY(QUrl url READ url) + Q_PROPERTY(QQuickWebView::LoadStatus status READ status) + Q_PROPERTY(QString errorString READ errorString) + +public: + ~QQuickWebViewLoadRequest(); + + QUrl url() const; + QQuickWebView::LoadStatus status() const; + QString errorString() const; + +private: + friend class QQuickWebView; + explicit QQuickWebViewLoadRequest(const QWebViewLoadRequestPrivate &d); + Q_DECLARE_PRIVATE(QWebViewLoadRequest) + QScopedPointer d_ptr; +}; + +QT_END_NAMESPACE + +#endif // QQUICKWEBVIEWREQUEST_H diff --git a/src/webview/qwebview_p_p.h b/src/webview/qwebview_p_p.h index a369729..45a352b 100644 --- a/src/webview/qwebview_p_p.h +++ b/src/webview/qwebview_p_p.h @@ -37,6 +37,17 @@ #ifndef QWEBVIEW_P_P_H #define QWEBVIEW_P_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qwebviewinterface_p.h" #include "qnativeviewcontroller_p.h" diff --git a/src/webview/qwebviewloadrequest_p.h b/src/webview/qwebviewloadrequest_p.h index 2e1a8a0..bbe1fb1 100644 --- a/src/webview/qwebviewloadrequest_p.h +++ b/src/webview/qwebviewloadrequest_p.h @@ -38,6 +38,17 @@ #ifndef QWEBVIEWLOADREQUESTPRIVATE_H #define QWEBVIEWLOADREQUESTPRIVATE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include #include diff --git a/src/webview/webview-lib.pri b/src/webview/webview-lib.pri index 9506a79..320e947 100644 --- a/src/webview/webview-lib.pri +++ b/src/webview/webview-lib.pri @@ -11,12 +11,12 @@ PUBLIC_HEADERS += \ COMMON_HEADERS += \ qwebview_p.h \ qwebviewinterface_p.h \ - qquickwebview.h \ + qquickwebview_p.h \ qnativeviewcontroller_p.h \ qwebview_p_p.h \ qquickviewcontroller_p.h \ qwebviewloadrequest_p.h \ - qquickwebviewloadrequest.h + qquickwebviewloadrequest_p.h COMMON_SOURCES += \ qwebview.cpp \ -- cgit v1.2.3