File: qwebenginepage.sip

package info (click to toggle)
pyqt5 5.11.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,956 kB
  • sloc: python: 93,806; cpp: 21,390; xml: 285; makefile: 266; sh: 31
file content (607 lines) | stat: -rw-r--r-- 15,867 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
// qwebenginepage.sip generated by MetaSIP
//
// This file is part of the QtWebEngineWidgets Python extension module.
//
// Copyright (c) 2018 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt5.
// 
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file.  Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
// 
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license.  For more information contact
// info@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


%If (Qt_5_4_0 -)

class QWebEnginePage : QObject
{
%TypeHeaderCode
#include <qwebenginepage.h>
%End

public:
    enum WebAction
    {
        NoWebAction,
        Back,
        Forward,
        Stop,
        Reload,
        Cut,
        Copy,
        Paste,
        Undo,
        Redo,
        SelectAll,
        ReloadAndBypassCache,
        PasteAndMatchStyle,
%If (Qt_5_6_0 -)
        OpenLinkInThisWindow,
%End
%If (Qt_5_6_0 -)
        OpenLinkInNewWindow,
%End
%If (Qt_5_6_0 -)
        OpenLinkInNewTab,
%End
%If (Qt_5_6_0 -)
        CopyLinkToClipboard,
%End
%If (Qt_5_6_0 -)
        DownloadLinkToDisk,
%End
%If (Qt_5_6_0 -)
        CopyImageToClipboard,
%End
%If (Qt_5_6_0 -)
        CopyImageUrlToClipboard,
%End
%If (Qt_5_6_0 -)
        DownloadImageToDisk,
%End
%If (Qt_5_6_0 -)
        CopyMediaUrlToClipboard,
%End
%If (Qt_5_6_0 -)
        ToggleMediaControls,
%End
%If (Qt_5_6_0 -)
        ToggleMediaLoop,
%End
%If (Qt_5_6_0 -)
        ToggleMediaPlayPause,
%End
%If (Qt_5_6_0 -)
        ToggleMediaMute,
%End
%If (Qt_5_6_0 -)
        DownloadMediaToDisk,
%End
%If (Qt_5_6_0 -)
        InspectElement,
%End
%If (Qt_5_6_0 -)
        ExitFullScreen,
%End
%If (Qt_5_6_0 -)
        RequestClose,
%End
%If (Qt_5_7_0 -)
        Unselect,
%End
%If (Qt_5_7_0 -)
        SavePage,
%End
%If (Qt_5_7_0 -)
        OpenLinkInNewBackgroundTab,
%End
%If (Qt_5_8_0 -)
        ViewSource,
%End
%If (Qt_5_10_0 -)
        ToggleBold,
%End
%If (Qt_5_10_0 -)
        ToggleItalic,
%End
%If (Qt_5_10_0 -)
        ToggleUnderline,
%End
%If (Qt_5_10_0 -)
        ToggleStrikethrough,
%End
%If (Qt_5_10_0 -)
        AlignLeft,
%End
%If (Qt_5_10_0 -)
        AlignCenter,
%End
%If (Qt_5_10_0 -)
        AlignRight,
%End
%If (Qt_5_10_0 -)
        AlignJustified,
%End
%If (Qt_5_10_0 -)
        Indent,
%End
%If (Qt_5_10_0 -)
        Outdent,
%End
%If (Qt_5_10_0 -)
        InsertOrderedList,
%End
%If (Qt_5_10_0 -)
        InsertUnorderedList,
%End
    };

    enum FindFlag
    {
        FindBackward,
        FindCaseSensitively,
    };

    typedef QFlags<QWebEnginePage::FindFlag> FindFlags;

    enum WebWindowType
    {
        WebBrowserWindow,
        WebBrowserTab,
        WebDialog,
%If (Qt_5_7_0 -)
        WebBrowserBackgroundTab,
%End
    };

    enum PermissionPolicy
    {
        PermissionUnknown,
        PermissionGrantedByUser,
        PermissionDeniedByUser,
    };

    enum Feature
    {
        Geolocation,
        MediaAudioCapture,
        MediaVideoCapture,
        MediaAudioVideoCapture,
%If (Qt_5_5_0 -)
        MouseLock,
%End
%If (Qt_5_10_0 -)
        DesktopVideoCapture,
%End
%If (Qt_5_10_0 -)
        DesktopAudioVideoCapture,
%End
    };

    enum FileSelectionMode
    {
        FileSelectOpen,
        FileSelectOpenMultiple,
    };

    enum JavaScriptConsoleMessageLevel
    {
        InfoMessageLevel,
        WarningMessageLevel,
        ErrorMessageLevel,
    };

    explicit QWebEnginePage(QObject *parent /TransferThis/ = 0);
%If (Qt_5_5_0 -)
    QWebEnginePage(QWebEngineProfile *profile, QObject *parent /TransferThis/ = 0);
%End
    virtual ~QWebEnginePage();
    QWebEngineHistory *history() const;
    void setView(QWidget *view);
    QWidget *view() const;
    bool hasSelection() const;
    QString selectedText() const;
    QAction *action(QWebEnginePage::WebAction action) const;
    virtual void triggerAction(QWebEnginePage::WebAction action, bool checked = false);
    virtual bool event(QEvent *);
    void findText(const QString &subString, QWebEnginePage::FindFlags options = QWebEnginePage::FindFlags(), SIP_PYCALLABLE resultCallback /AllowNone,TypeHint="Callable[[bool], None]"/ = 0);
%MethodCode
        // Make sure any callable doesn't get garbage collected.
        Py_XINCREF(a2);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->findText(*a0, *a1, [a2](bool arg) {
            if (a2)
            {
                SIP_BLOCK_THREADS
                
                PyObject *res;
        
                res = PyObject_CallFunctionObjArgs(a2, (arg ? Py_True : Py_False), NULL);
        
                Py_DECREF(a2);
        
                if (!res)
                    pyqt5_qtwebenginewidgets_err_print();
                else
                    Py_DECREF(res);
        
                SIP_UNBLOCK_THREADS
            }
        });
        
        Py_END_ALLOW_THREADS
%End

    QMenu *createStandardContextMenu() /Factory/;
    void setFeaturePermission(const QUrl &securityOrigin, QWebEnginePage::Feature feature, QWebEnginePage::PermissionPolicy policy);
    void load(const QUrl &url);
%If (Qt_5_9_0 -)
    void load(const QWebEngineHttpRequest &request);
%End
    void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
    void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
    void toHtml(SIP_PYCALLABLE resultCallback /TypeHint="Callable[[QString], None]"/) const;
%MethodCode
        // Make sure the callable doesn't get garbage collected.
        Py_INCREF(a0);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->toHtml([a0](const QString &arg) {
            SIP_BLOCK_THREADS
            
            PyObject *res;
        
            res = sipCallMethod(NULL, a0, "N", new QString(arg), sipType_QString, NULL);
        
            Py_DECREF(a0);
            
            if (!res)
                pyqt5_qtwebenginewidgets_err_print();
            else
                Py_DECREF(res);
            
            SIP_UNBLOCK_THREADS
        });
        
        Py_END_ALLOW_THREADS
%End

    void toPlainText(SIP_PYCALLABLE resultCallback /TypeHint="Callable[[QString], None]"/) const;
%MethodCode
        // Make sure the callable doesn't get garbage collected.
        Py_INCREF(a0);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->toPlainText([a0](const QString &arg) {
            SIP_BLOCK_THREADS
            
            PyObject *res;
        
            res = sipCallMethod(NULL, a0, "N", new QString(arg), sipType_QString, NULL);
        
            Py_DECREF(a0);
            
            if (!res)
                pyqt5_qtwebenginewidgets_err_print();
            else
                Py_DECREF(res);
            
            SIP_UNBLOCK_THREADS
        });
        
        Py_END_ALLOW_THREADS
%End

    QString title() const;
    void setUrl(const QUrl &url);
    QUrl url() const;
    QUrl requestedUrl() const;
    QUrl iconUrl() const;
    qreal zoomFactor() const;
    void setZoomFactor(qreal factor);
%If (Qt_5_7_0 -)
    void runJavaScript(const QString &scriptSource, quint32 worldId);
%End
%If (Qt_5_7_0 -)
    void runJavaScript(const QString &scriptSource, quint32 worldId, SIP_PYCALLABLE resultCallback);
%MethodCode
        // Make sure the callable doesn't get garbage collected.
        Py_INCREF(a2);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->runJavaScript(*a0, a1, [a2](const QVariant &arg) {
            SIP_BLOCK_THREADS
            
            PyObject *res;
        
            res = sipCallMethod(NULL, a2, "N", new QVariant(arg), sipType_QVariant, NULL);
        
            Py_DECREF(a2);
        
            if (!res)
                pyqt5_qtwebenginewidgets_err_print();
            else
                Py_DECREF(res);
        
            SIP_UNBLOCK_THREADS
        });
        
        Py_END_ALLOW_THREADS
%End

%End
    void runJavaScript(const QString &scriptSource);
    void runJavaScript(const QString &scriptSource, SIP_PYCALLABLE resultCallback /TypeHint="Callable[[Any], None]"/);
%MethodCode
        // Make sure the callable doesn't get garbage collected.
        Py_INCREF(a1);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->runJavaScript(*a0, [a1](const QVariant &arg) {
            SIP_BLOCK_THREADS
            
            PyObject *res;
        
            res = sipCallMethod(NULL, a1, "N", new QVariant(arg), sipType_QVariant, NULL);
        
            Py_DECREF(a1);
        
            if (!res)
                pyqt5_qtwebenginewidgets_err_print();
            else
                Py_DECREF(res);
        
            SIP_UNBLOCK_THREADS
        });
        
        Py_END_ALLOW_THREADS
%End

    QWebEngineSettings *settings() const;

signals:
    void loadStarted();
    void loadProgress(int progress);
    void loadFinished(bool ok);
    void linkHovered(const QString &url);
    void selectionChanged();
    void geometryChangeRequested(const QRect &geom);
    void windowCloseRequested();
    void featurePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
    void featurePermissionRequestCanceled(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
    void authenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator);
    void proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost);
    void titleChanged(const QString &title);
    void urlChanged(const QUrl &url);
    void iconUrlChanged(const QUrl &url);

protected:
    virtual QWebEnginePage *createWindow(QWebEnginePage::WebWindowType type);
    virtual QStringList chooseFiles(QWebEnginePage::FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes);
    virtual void javaScriptAlert(const QUrl &securityOrigin, const QString &msg);
    virtual bool javaScriptConfirm(const QUrl &securityOrigin, const QString &msg);
    virtual bool javaScriptPrompt(const QUrl &securityOrigin, const QString &msg, const QString &defaultValue, QString *result /Out/);
    virtual void javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID);
    virtual bool certificateError(const QWebEngineCertificateError &certificateError /NoCopy/);

public:
%If (Qt_5_5_0 -)

    enum NavigationType
    {
        NavigationTypeLinkClicked,
        NavigationTypeTyped,
        NavigationTypeFormSubmitted,
        NavigationTypeBackForward,
        NavigationTypeReload,
        NavigationTypeOther,
    };

%End
%If (Qt_5_5_0 -)
    QWebEngineProfile *profile() const;
%End
%If (Qt_5_5_0 -)
    QWebEngineScriptCollection &scripts();
%End
%If (Qt_5_5_0 -)
    QWebChannel *webChannel() const;
%End
%If (Qt_5_5_0 -)
    void setWebChannel(QWebChannel *);
%End
%If (Qt_5_7_0 -)
    void setWebChannel(QWebChannel *, uint worldId);
%End

protected:
%If (Qt_5_5_0 -)
    virtual bool acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame);
%End

public:
%If (Qt_5_6_0 -)

    enum RenderProcessTerminationStatus
    {
        NormalTerminationStatus,
        AbnormalTerminationStatus,
        CrashedTerminationStatus,
        KilledTerminationStatus,
    };

%End
%If (Qt_5_6_0 -)
    QColor backgroundColor() const;
%End
%If (Qt_5_6_0 -)
    void setBackgroundColor(const QColor &color);
%End

signals:
%If (Qt_5_6_0 -)
    void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
%End
%If (Qt_5_6_0 -)
    void renderProcessTerminated(QWebEnginePage::RenderProcessTerminationStatus terminationStatus /ScopesStripped=1/, int exitCode);
%End

public:
%If (Qt_5_7_0 -)
    QIcon icon() const;
%End
%If (Qt_5_7_0 -)
    QPointF scrollPosition() const;
%End
%If (Qt_5_7_0 -)
    QSizeF contentsSize() const;
%End
%If (Qt_5_7_0 -)
    bool isAudioMuted() const;
%End
%If (Qt_5_7_0 -)
    void setAudioMuted(bool muted);
%End
%If (Qt_5_7_0 -)
    bool recentlyAudible() const;
%End
%If (Qt_5_7_0 -)
    void printToPdf(const QString &filePath, const QPageLayout &pageLayout = QPageLayout(QPageSize(QPageSize::PageSizeId::A4), QPageLayout::Orientation::Portrait, QMarginsF()));
%End
%If (Qt_5_7_0 -)
    void printToPdf(SIP_PYCALLABLE resultCallback /TypeHint="Callable[[QByteArray], None]"/, const QPageLayout &pageLayout = QPageLayout(QPageSize(QPageSize::PageSizeId::A4), QPageLayout::Orientation::Portrait, QMarginsF()));
%MethodCode
        // Make sure the callable doesn't get garbage collected.
        Py_INCREF(a0);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->printToPdf([a0](const QByteArray &arg) {
            SIP_BLOCK_THREADS
            
            PyObject *res;
        
            res = sipCallMethod(NULL, a0, "N", new QByteArray(arg), sipType_QByteArray, NULL);
        
            Py_DECREF(a0);
        
            if (!res)
                pyqt5_qtwebenginewidgets_err_print();
            else
                Py_DECREF(res);
        
            SIP_UNBLOCK_THREADS
        }, *a1);
        
        Py_END_ALLOW_THREADS
%End

%End
%If (Qt_5_7_0 -)
    const QWebEngineContextMenuData &contextMenuData() const;
%End

signals:
%If (Qt_5_7_0 -)
    void iconChanged(const QIcon &icon);
%End
%If (Qt_5_7_0 -)
    void scrollPositionChanged(const QPointF &position);
%End
%If (Qt_5_7_0 -)
    void contentsSizeChanged(const QSizeF &size);
%End
%If (Qt_5_7_0 -)
    void audioMutedChanged(bool muted);
%End
%If (Qt_5_7_0 -)
    void recentlyAudibleChanged(bool recentlyAudible);
%End
%If (Qt_5_9_0 -)
    void pdfPrintingFinished(const QString &filePath, bool success);
%End

public:
%If (Qt_5_8_0 -)
    void replaceMisspelledWord(const QString &replacement);
%End
%If (Qt_5_8_0 -)
    void save(const QString &filePath, QWebEngineDownloadItem::SavePageFormat format = QWebEngineDownloadItem::MimeHtmlSaveFormat) const /ReleaseGIL/;
%End
%If (Qt_5_8_0 -)
%If (Py_v3)
%If (PyQt_Printer)
    void print(QPrinter *printer, SIP_PYCALLABLE resultCallback /TypeHint="Callable[[bool], None]"/);
%MethodCode
        // Make sure the callable doesn't get garbage collected.
        Py_INCREF(a1);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->print(a0, [a1](bool arg) {
            SIP_BLOCK_THREADS
            
            PyObject *res;
        
            res = sipCallMethod(NULL, a1, "b", arg);
        
            Py_DECREF(a1);
        
            if (!res)
                pyqt5_qtwebenginewidgets_err_print();
            else
                Py_DECREF(res);
        
            SIP_UNBLOCK_THREADS
        });
        
        Py_END_ALLOW_THREADS
%End

%End
%End
%End
%If (Qt_5_10_0 -)
    void download(const QUrl &url, const QString &filename = QString());
%End
%If (Qt_5_11_0 -)
    void setInspectedPage(QWebEnginePage *page);
%End
%If (Qt_5_11_0 -)
    QWebEnginePage *inspectedPage() const;
%End
%If (Qt_5_11_0 -)
    void setDevToolsPage(QWebEnginePage *page);
%End
%If (Qt_5_11_0 -)
    QWebEnginePage *devToolsPage() const;
%End

signals:
%If (Qt_5_11_0 -)
    void quotaRequested(QWebEngineQuotaRequest quotaRequest);
%End
%If (Qt_5_11_0 -)
    void registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request);
%End
};

%End
%If (Qt_5_11_0 -)
QFlags<QWebEnginePage::FindFlag> operator|(QWebEnginePage::FindFlag f1, QFlags<QWebEnginePage::FindFlag> f2);
%End