@@ -27,26 +27,28 @@ class QCEFVIEW_EXPORT QCefView : public QWidget
27
27
QScopedPointer<QCefViewPrivate> d_ptr;
28
28
29
29
public:
30
+ // / <summary>
31
+ // / The main frame identity
32
+ // / </summary>
30
33
static const qint64 MainFrameID = 0 ;
31
34
32
- public:
33
35
// / <summary>
34
- // /
36
+ // / Represents the CEF popup windows open disposition
35
37
// / </summary>
36
- enum WindowOpenDisposition
38
+ enum CefWindowOpenDisposition
37
39
{
38
- WOD_UNKNOWN ,
39
- WOD_CURRENT_TAB ,
40
- WOD_SINGLETON_TAB ,
41
- WOD_NEW_FOREGROUND_TAB ,
42
- WOD_NEW_BACKGROUND_TAB ,
43
- WOD_NEW_POPUP ,
44
- WOD_NEW_WINDOW ,
45
- WOD_SAVE_TO_DISK ,
46
- WOD_OFF_THE_RECORD ,
47
- WOD_IGNORE_ACTION
40
+ CefWindowOpenDispositionUnknown ,
41
+ CefWindowOpenDispositionCurrentTab ,
42
+ CefWindowOpenDispositionSingletonTab ,
43
+ CefWindowOpenDispositionNewForeGroundTab ,
44
+ CefWindowOpenDispositionNewBackgroundTab ,
45
+ CefWindowOpenDispositionNewPopup ,
46
+ CefWindowOpenDispositionNewWindow ,
47
+ CefWindowOpenDispositionSaveToDisk ,
48
+ CefWindowOpenDispositionOffTheRecord ,
49
+ CefWindowOpenDispositionIgnoreAction,
48
50
};
49
- Q_ENUM (WindowOpenDisposition )
51
+ Q_ENUM (CefWindowOpenDisposition )
50
52
51
53
public:
52
54
// / <summary>
@@ -205,10 +207,22 @@ class QCEFVIEW_EXPORT QCefView : public QWidget
205
207
// / The preference value, if this value is QVariant::UnknownType or QVariant::Invalid, the
206
208
// / preference will be restored to default value
207
209
// / </param>
208
- // / <param name="error">The error message populated on failure</param> <returns>True
209
- // / on successful; otherwise false</returns>
210
+ // / <param name="error">The error message populated on failure</param>
211
+ // <returns>True on successful; otherwise false</returns>
210
212
bool setPreference (const QString& name, const QVariant& value, const QString& error);
211
213
214
+ // / <summary>
215
+ // / Sets whether to disable the context menu for popup browser
216
+ // / </summary>
217
+ // / <param name="disable">True to disable; otherwise false</param>
218
+ void setDisablePopupContextMenu (bool disable);
219
+
220
+ // / <summary>
221
+ // / Gets whether to disable the context menu for popup browser
222
+ // / </summary>
223
+ // / <returns>True to disable; otherwise false</returns>
224
+ bool isPopupContextMenuDisabled ();
225
+
212
226
signals:
213
227
// / <summary>
214
228
// / Gets called on loading state changed
@@ -344,7 +358,7 @@ public slots:
344
358
virtual void onBrowserWindowCreated (QWindow* win);
345
359
346
360
// / <summary>
347
- // / Gets called before the pop-up browser created
361
+ // / Gets called before the popup browser created
348
362
// / </summary>
349
363
// / <param name="frameId">The source frame id</param>
350
364
// / <param name="targetUrl">The target URL</param>
@@ -356,12 +370,12 @@ public slots:
356
370
virtual bool onBeforePopup (qint64 frameId,
357
371
const QString& targetUrl,
358
372
const QString& targetFrameName,
359
- QCefView::WindowOpenDisposition targetDisposition,
373
+ QCefView::CefWindowOpenDisposition targetDisposition,
360
374
QCefSetting& settings,
361
375
bool & DisableJavascriptAccess);
362
376
363
377
// / <summary>
364
- // / Gets called right after the pop-up browser was created
378
+ // / Gets called right after the popup browser was created
365
379
// / </summary>
366
380
// / <param name="wnd">The host window of new created browser</param>
367
381
virtual void onPopupCreated (QWindow* wnd);
@@ -449,6 +463,8 @@ public slots:
449
463
// / Please refer to QWidget::wheelEvent
450
464
// / </summary>
451
465
void wheelEvent (QWheelEvent* event) override ;
466
+
467
+ void contextMenuEvent (QContextMenuEvent* event) override ;
452
468
#pragma endregion
453
469
};
454
470
0 commit comments