forked from gm-vm/openfortivpn-webview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
38 lines (31 loc) · 954 Bytes
/
mainwindow.h
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QNetworkCookie>
#include <QRegularExpression>
#include <QWebEngineView>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(const bool keepOpen,
const QRegularExpression& urlToWaitForRegex,
QWidget *parent = nullptr);
~MainWindow();
void loadUrl(const QString &url);
private slots:
void onCookieAdded(const QNetworkCookie &cookie);
void onCookieRemoved(const QNetworkCookie &cookie);
void updateTitle(const QString &title);
void handleUrlChange(const QUrl &url);
private:
QWebEngineProfile *webEngineProfile;
QWebEngineView *webEngine;
const QRegularExpression& urlToWaitForRegex;
const bool keepOpen;
QString svpncookie;
bool didSeeUrlToWaitFor = false;
void createMenuBar();
void closeEvent(QCloseEvent *);
};
#endif // MAINWINDOW_H