summaryrefslogtreecommitdiffstats
path: root/src/webview/qwebviewsettings.cpp
blob: 2f0c0e30fd2110c799fd4ec2e73c8a23d3e1dae2 (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
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
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default

#include "qwebviewsettings.h"
#include "qwebview_p.h"

QT_BEGIN_NAMESPACE

// FIXME add c++ docs

QWebViewSettings::QWebViewSettings(QWebViewSettingsPrivate *settings) : d(settings)
{
    Q_ASSERT(settings != nullptr);
}

QWebViewSettings::~QWebViewSettings() { }

bool QWebViewSettings::localStorageEnabled() const
{
    return d->localStorageEnabled();
}

void QWebViewSettings::setLocalStorageEnabled(bool enabled)
{
    if (d->localStorageEnabled() == enabled)
        return;

    d->setLocalStorageEnabled(enabled);
    emit localStorageEnabledChanged();
}

bool QWebViewSettings::javaScriptEnabled() const
{
    return d->javaScriptEnabled();
}

void QWebViewSettings::setJavaScriptEnabled(bool enabled)
{
    if (d->javaScriptEnabled() == enabled)
        return;

    d->setJavaScriptEnabled(enabled);
    emit javaScriptEnabledChanged();
}

void QWebViewSettings::setAllowFileAccess(bool enabled)
{
    if (d->allowFileAccess() == enabled)
        return;

    d->setAllowFileAccess(enabled);
    emit allowFileAccessChanged();
}

bool QWebViewSettings::allowFileAccess() const
{
    return d->allowFileAccess();
}

bool QWebViewSettings::localContentCanAccessFileUrls() const
{
    return d->localContentCanAccessFileUrls();
}

void QWebViewSettings::setLocalContentCanAccessFileUrls(bool enabled)
{
    if (d->localContentCanAccessFileUrls() == enabled)
        return;

    d->setLocalContentCanAccessFileUrls(enabled);
    emit localContentCanAccessFileUrlsChanged();
}

QT_END_NAMESPACE