-
Notifications
You must be signed in to change notification settings - Fork 0
/
browser.h
83 lines (66 loc) · 1.63 KB
/
browser.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
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
#ifndef BROWSER_H
#define BROWSER_H
#include <QMainWindow>
#include <QSettings>
#include <QFileInfo>
#include <QTextCodec>
#include <QDir>
#include <QWebEngineUrlRequestInterceptor>
#include <QWebEngineProfile>
#include <QWebEngineSettings>
#include <QDateTime>
#include <QStandardPaths>
#include <QTimer>
#include <QPrinterInfo>
#include "interfacehttp.h"
#include "udp.h"
#include "global.h"
namespace Ui {
class Browser;
}
class EventEater : public QObject {
Q_OBJECT
public:
QDateTime lastAction;
qint32 timeout;
public:
explicit EventEater(qint32 _timeout);
protected:
bool eventFilter(QObject *obj, QEvent *event);
};
class WebUrlRequestInterceptor : public QWebEngineUrlRequestInterceptor {
Q_OBJECT
public:
QStringList allow, deny;
public:
WebUrlRequestInterceptor(QObject *p = Q_NULLPTR);
void interceptRequest(QWebEngineUrlRequestInfo &info);
};
class Browser : public QMainWindow, public MainWindowInterface {
Q_OBJECT
public:
explicit Browser(QWidget *parent = 0);
~Browser();
public:
QString home;
EventEater *eventEater;
private:
qint16 ticketWidth;
bool doPrint;
protected:
void timerEvent(QTimerEvent *event);
public slots:
void setUrl(QString url = "");
void action();
void urlChanged();
void urlChanged(const QUrl &url);
void loadStarted();
void loadProgress(int);
void loadFinished(bool);
void print(qint8 action = 1);
void incomingMessage(const QString &log);
void incomingData(const QString &ip, quint16 port, const QString &destination, const QList<QVariant> &valeurs);
private:
Ui::Browser *ui;
};
#endif // BROWSER_H