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>
14 namespace WebEngineViewer
15 {
16 class 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  */
23 class WEBENGINEVIEWER_EXPORT CheckPhishingUrlJob : public QObject
24 {
25  Q_OBJECT
26 public:
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 
38 Q_SIGNALS:
39  void result(WebEngineViewer::CheckPhishingUrlUtil::UrlStatus status, const QUrl &url, uint verifyCacheAfterThisTime = 0);
40  void debugJson(const QByteArray &ba);
41 
42 private:
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 }
Q_SCRIPTABLE Q_NOREPLY void start()
Q_SCRIPTABLE CaptureState status()
The CheckPhishingUrlJob class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:55:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.