Messagelib

blockexternalresourcesurlinterceptor.h
1 /*
2  SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include "webengineviewer_export.h"
9 #include <QUrl>
10 #include <QWebEngineUrlRequestInfo>
11 #include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
12 namespace WebEngineViewer
13 {
14 class WEBENGINEVIEWER_EXPORT BlockExternalResourcesUrlInterceptor : public WebEngineViewer::NetworkPluginUrlInterceptorInterface
15 {
16  Q_OBJECT
17 public:
18  explicit BlockExternalResourcesUrlInterceptor(QObject *parent = nullptr);
19  ~BlockExternalResourcesUrlInterceptor() override;
20 
21  [[nodiscard]] bool interceptRequest(QWebEngineUrlRequestInfo &info) override;
22  // Used by autotest only
23  [[nodiscard]] bool
24  interceptRequest(const QUrl &url, QWebEngineUrlRequestInfo::ResourceType resourceType, QWebEngineUrlRequestInfo::NavigationType navigationType);
25  void setEnabled(bool enabled);
26 Q_SIGNALS:
27  void formSubmittedForbidden();
28 
29 private:
30  bool mEnabled = true;
31 };
32 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:55:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.