Messagelib

webengineviewer/src/urlinterceptor/loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.h
1 /*
2  SPDX-FileCopyrightText: 2016-2023 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 <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
10 namespace WebEngineViewer
11 {
12 class WEBENGINEVIEWER_EXPORT LoadExternalReferencesUrlInterceptor : public WebEngineViewer::NetworkPluginUrlInterceptorInterface
13 {
14  Q_OBJECT
15 public:
16  explicit LoadExternalReferencesUrlInterceptor(QObject *parent = nullptr);
17  ~LoadExternalReferencesUrlInterceptor() override;
18 
19  Q_REQUIRED_RESULT bool interceptRequest(QWebEngineUrlRequestInfo &info) override;
20  void setAllowExternalContent(bool b);
21  Q_REQUIRED_RESULT bool allowExternalContent() const;
22 
23 Q_SIGNALS:
24  void urlBlocked(const QUrl &url);
25 
26 protected:
27  Q_REQUIRED_RESULT virtual bool urlIsAuthorized(const QUrl &requestedUrl);
28  Q_REQUIRED_RESULT virtual bool urlIsBlocked(const QUrl &requestedUrl);
29 
30 private:
31  bool mAllowLoadExternalReference = false;
32 };
33 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:08:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.