Messagelib

checkphishingurljob.h
1 /*
2  SPDX-FileCopyrightText: 2016-2023 Laurent Montel <[email protected]>
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 <[email protected]>
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  Q_REQUIRED_RESULT bool canStart() const;
34 
35  Q_REQUIRED_RESULT 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  void slotSslErrors(QNetworkReply *reply, const QList<QSslError> &error);
44  void slotError(QNetworkReply::NetworkError error);
45  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-2023 The KDE developers.
Generated on Wed Mar 22 2023 04:07:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.