summaryrefslogtreecommitdiffstats
path: root/src/webview/qwebview_p_p.h
diff options
context:
space:
mode:
authorChristian Strømme <[email protected]>2015-01-16 11:04:58 +0100
committerChristian Stromme <[email protected]>2015-02-09 16:35:06 +0000
commit56da39587414f127774e1b5e9f88a84f8f27db08 (patch)
tree5d7bcc9e60df41ca8c70b3ae1ad1adeff4bc5669 /src/webview/qwebview_p_p.h
parentea443a6960316d5070c1a3a5dbe21037a96ff7e4 (diff)
Refactor QWebView code.
In an attempt to make the code more future proof, this patch tries to improve the abstraction between the native WebViews/View controllers and the public APIs. This should make it easier to add new platforms and alternative public interfaces, e.g., a Window/Widget API. It should also make it easier to implement a plugin system if needed. In addition the following changes were done: - reload() implementation in the android controller. - reload() calls the native reload function on both Android and iOS. - loadProgress() calls the native getProgress() directly on Android. - isLoading() calls loading() on the UIWebView (iOS) - runJavaScript() will now only pass the script and an id to the platform implementation to avoid creating a strong coupling to QJSValue. Change-Id: I3cbd81c7fd8d93bacf9134be32ad061d1f9e1183 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Diffstat (limited to 'src/webview/qwebview_p_p.h')
-rw-r--r--src/webview/qwebview_p_p.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/webview/qwebview_p_p.h b/src/webview/qwebview_p_p.h
new file mode 100644
index 0000000..e0b8431
--- /dev/null
+++ b/src/webview/qwebview_p_p.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWebView 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 QWEBVIEW_P_P_H
+#define QWEBVIEW_P_P_H
+
+#include "qwebviewinterface_p.h"
+#include "qnativeviewcontroller_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWebView;
+
+class Q_WEBVIEW_EXPORT QWebViewPrivate
+ : public QObject
+ , public QWebViewInterface
+ , public QNativeViewController
+{
+ Q_OBJECT
+public:
+ static QWebViewPrivate *create(QWebView *q);
+
+Q_SIGNALS:
+ void titleChanged();
+ void urlChanged();
+ void loadingChanged();
+ void loadProgressChanged();
+ void javaScriptResult(int id, const QVariant &result);
+ void requestFocus(bool focus);
+
+protected:
+ explicit QWebViewPrivate(QObject *p = 0) : QObject(p) { }
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBVIEW_P_P_H
+