diff options
author | 2021-04-05 02:11:25 +0530 | |
---|---|---|
committer | 2021-04-05 02:11:25 +0530 | |
commit | 9ea334d08f42f3c362e86499dc3c0ed658bb428c (patch) | |
tree | 85eb15c519bcff8a5e3c4f8406f068b7c412b789 /src/webenginepage.h | |
parent | e79b447b31ad9ab1ed42fd232f8789fad38d780b (diff) | |
download | whatsie-9ea334d08f42f3c362e86499dc3c0ed658bb428c.tar.gz whatsie-9ea334d08f42f3c362e86499dc3c0ed658bb428c.zip |
src init
Diffstat (limited to 'src/webenginepage.h')
-rw-r--r-- | src/webenginepage.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/webenginepage.h b/src/webenginepage.h new file mode 100644 index 0000000..7ec1a69 --- /dev/null +++ b/src/webenginepage.h @@ -0,0 +1,49 @@ +#ifndef WEBENGINEPAGE_H +#define WEBENGINEPAGE_H + + +#include <QFileDialog> +#include <QWebEngineFullScreenRequest> +#include <QWebEngineNotification> +#include <QWebEngineProfile> + +#include <QWebEnginePage> +#include <QDesktopServices> +#include <QMessageBox> +#include <QImageReader> +#include <QWebEngineCertificateError> +#include <QAuthenticator> + +#include <QWebEngineRegisterProtocolHandlerRequest> +#include <QWebEngineFullScreenRequest> + +#include "ui_certificateerrordialog.h" +#include "ui_passworddialog.h" + +class WebEnginePage : public QWebEnginePage +{ + Q_OBJECT +public: + WebEnginePage(QWebEngineProfile *profile, QObject *parent = nullptr); + +protected: + bool acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) override; + QWebEnginePage* createWindow(QWebEnginePage::WebWindowType type) override; + bool certificateError(const QWebEngineCertificateError &error) override; + QStringList chooseFiles(FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes); + +public slots: + void handleFeaturePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature feature); + void handleLoadFinished(bool ok); + +private slots: + void handleAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth); + void handleProxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth, const QString &proxyHost); + void handleRegisterProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request); +#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) + void handleSelectClientCertificate(QWebEngineClientCertificateSelection clientCertSelection); +#endif + void fullScreenRequestedByPage(QWebEngineFullScreenRequest request); +}; + +#endif // WEBENGINEPAGE_H |