Messagelib

searchfullhashjob.h
1 /*
2  SPDX-FileCopyrightText: 2016-2020 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef SEARCHFULLHASHJOB_H
8 #define SEARCHFULLHASHJOB_H
9 
10 #include <QObject>
11 #include <QUrl>
12 #include <QNetworkReply>
13 #include "webengineviewer_export.h"
14 #include "checkphishingurlutil.h"
15 namespace WebEngineViewer {
16 class SearchFullHashJobPrivate;
17 /* https://developers.google.com/safe-browsing/v4/update-api */
22 class WEBENGINEVIEWER_EXPORT SearchFullHashJob : public QObject
23 {
24  Q_OBJECT
25 public:
26  explicit SearchFullHashJob(QObject *parent = nullptr);
28 
29  void start();
30  bool canStart() const;
31 
32  void setDatabaseState(const QStringList &hash);
33  void setSearchFullHashForUrl(const QUrl &url);
34 
35  QByteArray jsonRequest() const;
36  void parse(const QByteArray &replyStr);
37 
38  void setSearchHashs(const QHash<QByteArray, QByteArray> &hash);
39 Q_SIGNALS:
40  void result(WebEngineViewer::CheckPhishingUrlUtil::UrlStatus status, const QUrl &url);
41  void debugJson(const QByteArray &ba);
42 
43 private Q_SLOTS:
44  void slotSslErrors(QNetworkReply *reply, const QList<QSslError> &error);
45  void slotError(QNetworkReply::NetworkError error);
46  void slotCheckUrlFinished(QNetworkReply *reply);
47 private:
48  Q_DISABLE_COPY(SearchFullHashJob)
49  SearchFullHashJobPrivate *const d;
50 };
51 }
52 
53 #endif // SEARCHFULLHASHJOB_H
The SearchFullHashJob class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 23:14:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.