From 0cc881b5bf8a4a6da8277d5166da92a1675f4654 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 29 Jun 2015 11:55:06 +0200 Subject: Add WebAction to QML api Adds WebActions matching QWebEnginePage to QQuickWebEngineView, this makes it possible to support copy/paste on OS X, and makes it possible to do rich text copy to clipboard on all platforms. Change-Id: If43c1b2e8ae0496423f830cfe6b86e0fa1b8126e Task-number: QTBUG-44289 Reviewed-by: Andras Becsi --- src/webengine/api/qquickwebengineview_p.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/webengine/api/qquickwebengineview_p.h') diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index 462278571..95a9b2a2e 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -73,7 +73,7 @@ private: bool m_toggleOn; }; -#define LATEST_WEBENGINEVIEW_REVISION 2 +#define LATEST_WEBENGINEVIEW_REVISION 3 class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem { Q_OBJECT @@ -105,6 +105,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem { Q_ENUMS(Feature); Q_ENUMS(JavaScriptConsoleMessageLevel); Q_FLAGS(FindFlags); + Q_ENUMS(WebAction); public: QQuickWebEngineView(QQuickItem *parent = 0); @@ -173,6 +174,27 @@ public: Geolocation }; + enum WebAction { + NoWebAction = - 1, + Back, + Forward, + Stop, + Reload, + + Cut, + Copy, + Paste, + + Undo, + Redo, + SelectAll, + ReloadAndBypassCache, + + PasteAndMatchStyle, + + WebActionCount + }; + // must match WebContentsAdapterClient::JavaScriptConsoleMessageLevel enum JavaScriptConsoleMessageLevel { InfoMessageLevel = 0, @@ -218,6 +240,7 @@ public Q_SLOTS: Q_REVISION(1) void fullScreenCancelled(); Q_REVISION(1) void grantFeaturePermission(const QUrl &securityOrigin, Feature, bool granted); Q_REVISION(2) void setActiveFocusOnPress(bool arg); + Q_REVISION(3) void triggerWebAction(WebAction action); Q_SIGNALS: void titleChanged(); -- cgit v1.2.3