1// Copyright (C) 2015 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QABSTRACTWEBVIEW_P_H
5#define QABSTRACTWEBVIEW_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qwebviewinterface_p.h"
19#include "qnativeviewcontroller_p.h"
20
21QT_BEGIN_NAMESPACE
22
23class QWebView;
24class QWebViewLoadRequestPrivate;
25
26class Q_WEBVIEW_EXPORT QAbstractWebViewSettings : public QObject
27{
28 Q_OBJECT
29public:
30 virtual bool localStorageEnabled() const = 0;
31 virtual bool javascriptEnabled() const = 0;
32 virtual bool localContentCanAccessFileUrls() const = 0;
33 virtual bool allowFileAccess() const = 0;
34
35 virtual void setLocalContentCanAccessFileUrls(bool) = 0;
36 virtual void setJavascriptEnabled(bool) = 0;
37 virtual void setLocalStorageEnabled(bool) = 0;
38 virtual void setAllowFileAccess(bool) = 0;
39
40protected:
41 explicit QAbstractWebViewSettings(QObject *p = nullptr) : QObject(p) {}
42};
43
44class Q_WEBVIEW_EXPORT QAbstractWebView
45 : public QObject
46 , public QWebViewInterface
47 , public QNativeViewController
48{
49 Q_OBJECT
50
51public:
52 virtual QAbstractWebViewSettings *getSettings() const = 0;
53
54Q_SIGNALS:
55 void titleChanged(const QString &title);
56 void urlChanged(const QUrl &url);
57 void loadingChanged(const QWebViewLoadRequestPrivate &loadRequest);
58 void loadProgressChanged(int progress);
59 void javaScriptResult(int id, const QVariant &result);
60 void requestFocus(bool focus);
61 void httpUserAgentChanged(const QString &httpUserAgent);
62 void cookieAdded(const QString &domain, const QString &name);
63 void cookieRemoved(const QString &domain, const QString &name);
64
65protected:
66 explicit QAbstractWebView(QObject *p = nullptr) : QObject(p) { }
67};
68
69QT_END_NAMESPACE
70
71#endif // QABSTRACTWEBVIEW_P_H
72
73

source code of qtwebview/src/webview/qabstractwebview_p.h