summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview_p.h
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-07-25 15:53:07 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-08-06 17:20:17 +0200
commitca30d0374020752d3ac367fdffef88a5c1fe4a48 (patch)
treed93bb8ca51657febaee379e86c422d91b905a68b /src/webengine/api/qquickwebengineview_p.h
parent7d90b44187cfa8f93df6a6341da41cf8192d18ad (diff)
Add QQuick API for intercepting navigation requests
Add missing navigationRequested API to be able to intercept navigation requests. This is useful for ignoring requests for example in kiosk-like applications that want to restrinct navigation to a specific url or domain, or want to disable specific types of navigation requests (e.g. reloading, clicking links, form submissions). Change-Id: Ie375e635a3c3566527972d05f5d99b39489c5ca8 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/webengine/api/qquickwebengineview_p.h')
-rw-r--r--src/webengine/api/qquickwebengineview_p.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 12b9ee163..59349954f 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
class QQuickWebEngineViewExperimental;
class QQuickWebEngineViewPrivate;
class QQuickWebEngineLoadRequest;
+class QQuickWebEngineNavigationRequest;
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_OBJECT
@@ -60,6 +61,8 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
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(NavigationRequestAction);
+ Q_ENUMS(NavigationType);
Q_ENUMS(LoadStatus);
Q_ENUMS(ErrorDomain);
Q_ENUMS(NewViewDestination);
@@ -80,6 +83,24 @@ public:
QQuickWebEngineViewExperimental *experimental() const;
+ // must match WebContentsAdapterClient::NavigationRequestAction
+ enum NavigationRequestAction {
+ AcceptRequest,
+ // Make room in the valid range of the enum so
+ // we can expose extra actions in experimental.
+ IgnoreRequest = 0xFF
+ };
+
+ // must match WebContentsAdapterClient::NavigationType
+ enum NavigationType {
+ LinkClickedNavigation,
+ TypedNavigation,
+ FormSubmittedNavigation,
+ BackForwardNavigation,
+ ReloadNavigation,
+ OtherNavigation
+ };
+
enum LoadStatus {
LoadStartedStatus,
LoadStoppedStatus,
@@ -124,6 +145,7 @@ Q_SIGNALS:
void loadingChanged(QQuickWebEngineLoadRequest *loadRequest);
void loadProgressChanged();
void linkHovered(const QUrl &hoveredUrl);
+ void navigationRequested(QQuickWebEngineNavigationRequest *request);
void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID);
protected: