blob: 1d4a83e23331b45445da2da66bcef0974642a745 (
plain)
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
|
#ifndef MAINWINDOW_HPP
#define MAINWINDOW_HPP
#include "permissionmanager.hpp"
#include <QtCore/QUrl>
#include <QtWebEngineCore/QWebEngineNotification>
#include <QtWebEngineCore/QWebEnginePage>
#include <QtWebEngineCore/QWebEngineProfile>
#include <QtWebEngineCore/QWebEngineSettings>
#include <QtWebEngineWidgets/QWebEngineView>
#include <QtWidgets/QMainWindow>
#include <functional>
class WebWindow : public QMainWindow
{
private:
QWebEngineProfile profile;
QWebEnginePage page;
QWebEngineView view;
PermissionManager perm;
void web_configure();
void permission_requested(const QUrl origin, QWebEnginePage::Feature feature);
void closeEvent(QCloseEvent *event);
public:
WebWindow(const QString &url);
void connect_icon_changed(std::function<void(const QIcon)> fn);
void connect_title_changed(std::function<void(const QString)> fn);
void connect_notification(std::function<void(std::unique_ptr<QWebEngineNotification>)> fn);
PermissionManager &permissions();
void reset_cookies();
void toggle_visibility();
void quit();
};
#endif
|