Messagelib

checkphishingurljob.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "checkphishingurlutil.h"
10#include "webengineviewer_export.h"
11#include <QNetworkReply>
12#include <QObject>
13#include <QUrl>
14namespace WebEngineViewer
15{
16class CheckPhishingUrlJobPrivate;
17/* https://developers.google.com/safe-browsing/v4/lookup-api */
18/* example http://malware.testing.google.test/testing/malware/ */
19/**
20 * @brief The CheckPhishingUrlJob class
21 * @author Laurent Montel <montel@kde.org>
22 */
23class WEBENGINEVIEWER_EXPORT CheckPhishingUrlJob : public QObject
24{
25 Q_OBJECT
26public:
27 explicit CheckPhishingUrlJob(QObject *parent = nullptr);
28 ~CheckPhishingUrlJob() override;
29
30 void setUrl(const QUrl &url);
31
32 void start();
33 [[nodiscard]] bool canStart() const;
34
35 [[nodiscard]] QByteArray jsonRequest() const;
36 void parse(const QByteArray &replyStr);
37
38Q_SIGNALS:
39 void result(WebEngineViewer::CheckPhishingUrlUtil::UrlStatus status, const QUrl &url, uint verifyCacheAfterThisTime = 0);
40 void debugJson(const QByteArray &ba);
41
42private:
43 WEBENGINEVIEWER_NO_EXPORT void slotSslErrors(QNetworkReply *reply, const QList<QSslError> &error);
44 WEBENGINEVIEWER_NO_EXPORT void slotError(QNetworkReply::NetworkError error);
45 WEBENGINEVIEWER_NO_EXPORT void slotCheckUrlFinished(QNetworkReply *reply);
46 std::unique_ptr<CheckPhishingUrlJobPrivate> const d;
47};
48}
The CheckPhishingUrlJob class.
Q_SCRIPTABLE CaptureState status()
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.