Messagelib

blocktrackingurlinterceptor.h
1/*
2 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "webengineviewer_export.h"
10#include <QDebug>
11#include <QList>
12#include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
13namespace WebEngineViewer
14{
15/**
16 * @brief The BlockMailTrackingUrlInterceptor class
17 * @author Laurent Montel <montel@kde.org>
18 */
20{
21 Q_OBJECT
22public:
23 struct TrackerBlackList {
24 TrackerBlackList() = default;
25 TrackerBlackList(const QString &company, const QString &pattern, const QString &url)
26 : mCompanyName(company)
27 , mCompanyUrl(url)
28 , mPattern(pattern)
29 {
30 }
31
32 QString mCompanyName;
33 QString mCompanyUrl;
34 QString mPattern;
35 };
36
37 explicit BlockTrackingUrlInterceptor(QObject *parent = nullptr);
39 [[nodiscard]] bool interceptRequest(QWebEngineUrlRequestInfo &info) override;
40
41 [[nodiscard]] bool enabledMailTrackingInterceptor() const;
42 void setEnabledMailTrackingInterceptor(bool enabledMailTrackingInterceptor);
43
44Q_SIGNALS:
45 void trackingFound(const WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList &);
46
47private:
48 WEBENGINEVIEWER_NO_EXPORT void initializeList();
50 bool mEnabledMailTrackingInterceptor = false;
51};
52}
53Q_DECLARE_TYPEINFO(WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList, Q_RELOCATABLE_TYPE);
54Q_DECLARE_METATYPE(WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList)
55WEBENGINEVIEWER_EXPORT QDebug operator<<(QDebug d, const WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList &t);
The BlockMailTrackingUrlInterceptor class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:49:08 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.