File indexing completed on 2025-01-26 04:57:25

0001 /*
0002    SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KMessageWidget>
0010 
0011 #include "webengineviewer_export.h"
0012 
0013 #include <QMap>
0014 #include <QPointer>
0015 
0016 #include <WebEngineViewer/BlockTrackingUrlInterceptor>
0017 
0018 namespace WebEngineViewer
0019 {
0020 class TrackingDetailsDialog;
0021 class WEBENGINEVIEWER_EXPORT TrackingWarningWidget : public KMessageWidget
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit TrackingWarningWidget(QWidget *parent = nullptr);
0026     ~TrackingWarningWidget() override;
0027     void addTracker(const WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList &);
0028     void hideAndClear();
0029 
0030 private:
0031     WEBENGINEVIEWER_NO_EXPORT void slotShowDetails(const QString &content);
0032     [[nodiscard]] WEBENGINEVIEWER_NO_EXPORT QString generateDetails() const;
0033 
0034     struct blackListFound {
0035         QString url;
0036         int number = 1;
0037     };
0038     QMap<QString, blackListFound> mBackLists;
0039     QPointer<TrackingDetailsDialog> mMailTrackingDetailDialog;
0040 };
0041 }