Messagelib

blockexternalresourcesurlinterceptor.h
1 /*
2  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
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  Q_REQUIRED_RESULT bool interceptRequest(QWebEngineUrlRequestInfo &info) override;
22  // Used by autotest only
23  Q_REQUIRED_RESULT 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-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.