Dekko
Loading...
Searching...
No Matches
DekkoWebContext.h
1#ifndef DEKKOWEBCONTEXT_H
2#define DEKKOWEBCONTEXT_H
3
4#include "DekkoWebEngineUrlRequestInterceptor.h"
5#include "DekkoWebEngineUrlSchemeHandler.h"
6#include <QString>
7#include <QUrl>
8#include <QQuickWebEngineProfile>
9
10class DekkoWebContext : public QQuickWebEngineProfile
11{
12 Q_OBJECT
13 Q_PROPERTY(QString messageUid READ getMessageUid WRITE setMessageUid NOTIFY messageUidChanged)
14 Q_PROPERTY(bool remoteContentAllowed READ isRemoteContentAllowed WRITE setRemoteContentAllowed NOTIFY remoteContentAllowedChanged)
15 Q_PROPERTY(QString cacheLocation READ cacheLocation NOTIFY cacheLocationChanged)
16 Q_PROPERTY(QString dataLocation READ dataLocation NOTIFY dataLocationChanged)
17 Q_PROPERTY(int cacheSizeHint READ cacheSizeHint NOTIFY cacheSizeHintChanged)
18 Q_PROPERTY(QObject * qmlEngineInjector READ qmlEngineInjector WRITE setQmlEngineInjector NOTIFY qmlEngineInjectorChanged)
19
20public:
21 explicit DekkoWebContext(QQuickWebEngineProfile *parent = Q_NULLPTR);
23 }
24
25 void setMessageUid(QString messageUid);
26 void setRemoteContentAllowed(bool allowed);
27 QString getMessageUid() const;
28 bool isRemoteContentAllowed() const;
29
30 QString cacheLocation() const;
31 QString dataLocation() const;
32 int cacheSizeHint() const;
33
34 void setQmlEngineInjector(QObject * dummy);
35 QObject * qmlEngineInjector() const;
36
37signals:
38 void remoteContentBlocked();
39 void messageUidChanged();
40 void remoteContentAllowedChanged();
41
42 void cacheLocationChanged();
43 void dataLocationChanged();
44 void cacheSizeHintChanged();
45 void qmlEngineInjectorChanged();
46
47public slots:
48 void onInterceptedRemoteRequest(bool wasBlocked);
49
50private:
51 DekkoWebEngineUrlRequestInterceptor urlRequestInterceptor;
52 DekkoWebEngineUrlSchemeHandler urlSchemeHandler;
53};
54
55#endif