diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2013-08-28 14:19:14 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-11 14:20:07 +0200 |
commit | 3062467e7ae4ca68377216083e015846b307e5a0 (patch) | |
tree | 13250a49a7c925524a0d50aa807cc229fa95b1d4 /lib/web_contents_adapter_client.h | |
parent | 18e6f0ac27cf53bc21cf8c54887932de116648ff (diff) | |
download | qtwebengine-3062467e7ae4ca68377216083e015846b307e5a0.tar.gz |
Add preliminary context menu support
This is essentially the widgets part, with some tricks to get it to
honor the widget's context menu policy.
It enables c++11 for the widgets library for the convenience of using lambdas,
which admitedly we could do without, but seems reasonable considering our timeline
and the fact that we build chromium that way.
Change-Id: I6a632a78d2aa48fb0dfecfe491e92651d12407db
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'lib/web_contents_adapter_client.h')
-rw-r--r-- | lib/web_contents_adapter_client.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/web_contents_adapter_client.h b/lib/web_contents_adapter_client.h index 39968a8a5..8e92ead7c 100644 --- a/lib/web_contents_adapter_client.h +++ b/lib/web_contents_adapter_client.h @@ -47,12 +47,28 @@ #include <QString> #include <QUrl> - class RenderWidgetHostViewQt; class RenderWidgetHostViewQtDelegate; class WebContentsAdapter; class WebContentsDelegateQt; +// FIXME: make this ref-counted and implicitely shared and expose as public API maybe ? +class WebEngineContextMenuData { + +public: + QPoint pos; + QUrl linkUrl; + QString linkText; + QString selectedText; +// Some likely candidates for future additions as we add support for the related actions: +// bool isImageBlocked; +// bool isEditable; +// bool isSpellCheckingEnabled; +// QStringList spellCheckingSuggestions; +// <enum tbd> mediaType; +// ... +}; + class QWEBENGINE_EXPORT WebContentsAdapterClient { public: enum CompositingMode { @@ -87,6 +103,7 @@ public: virtual void loadFinished(bool success) = 0; virtual void focusContainer() = 0; virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition) = 0; + virtual bool contextMenuRequested(const WebEngineContextMenuData&) = 0; }; #endif // WEB_CONTENTS_ADAPTER_CLIENT_H |