File indexing completed on 2025-03-09 04:54:38
0001 /* 0002 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 0006 */ 0007 0008 #pragma once 0009 0010 #include "messageviewer_export.h" 0011 #include <QObject> 0012 #include <QVariant> 0013 #include <memory> 0014 class QWebEnginePage; 0015 namespace MessageViewer 0016 { 0017 class ScamDetectionWebEnginePrivate; 0018 /** 0019 * @brief The ScamDetectionWebEngine class 0020 * @author Laurent Montel <montel@kde.org> 0021 */ 0022 class MESSAGEVIEWER_EXPORT ScamDetectionWebEngine : public QObject 0023 { 0024 Q_OBJECT 0025 public: 0026 explicit ScamDetectionWebEngine(QObject *parent = nullptr); 0027 ~ScamDetectionWebEngine() override; 0028 0029 void scanPage(QWebEnginePage *page); 0030 0031 public Q_SLOTS: 0032 void showDetails(); 0033 0034 private Q_SLOTS: 0035 MESSAGEVIEWER_NO_EXPORT void handleScanPage(const QVariant &result); 0036 0037 Q_SIGNALS: 0038 void messageMayBeAScam(); 0039 void resultScanDetection(bool foundScam); 0040 0041 private: 0042 std::unique_ptr<ScamDetectionWebEnginePrivate> const d; 0043 }; 0044 }