Messagelib

webenginepage.h
1 /*
2  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef WEBENGINEPAGE_H
8 #define WEBENGINEPAGE_H
9 
10 #include <QWebEnginePage>
11 #include "webengineviewer_export.h"
12 class QWebEngineProfile;
13 class QWebEngineDownloadItem;
14 class QPrinter;
15 namespace WebEngineViewer {
16 class WebHitTest;
21 class WEBENGINEVIEWER_EXPORT WebEnginePage : public QWebEnginePage
22 {
23  Q_OBJECT
24 public:
36  explicit WebEnginePage(QObject *parent = nullptr);
37 
50 #ifndef WEBENGINEVIEWER_NO_DEPRECATED
51  explicit WEBENGINEVIEWER_DEPRECATED WebEnginePage(QWebEngineProfile *profile, QObject *parent = nullptr);
52 #endif
53 
58  virtual ~WebEnginePage() override = default;
59 
60  WebEngineViewer::WebHitTest *hitTestContent(const QPoint &pos);
61 
62  void saveHtml(QWebEngineDownloadItem *download);
63  Q_REQUIRED_RESULT bool execPrintPreviewPage(QPrinter *printer, int timeout);
64 
65  QPoint mapToViewport(const QPoint &pos) const;
66 Q_SIGNALS:
67  void urlClicked(const QUrl &url);
68  void showConsoleMessage(const QString &message);
69 
70 protected:
71  bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override;
72  void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID) override;
73 
74 private:
75  void init();
76 };
77 }
78 
79 #endif // WEBENGINEPAGE_H
The WebEnginePage class.
Definition: webenginepage.h:21
The WebHitTest class.
Definition: webhittest.h:21
QCA_EXPORT void init()
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 23:19:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.