Messagelib

searchfullhashjob.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 SearchFullHashJobPrivate;
17/* https://developers.google.com/safe-browsing/v4/update-api */
18/**
19 * @brief The SearchFullHashJob class
20 * @author Laurent Montel <montel@kde.org>
21 */
22class WEBENGINEVIEWER_EXPORT SearchFullHashJob : public QObject
23{
24 Q_OBJECT
25public:
26 explicit SearchFullHashJob(QObject *parent = nullptr);
27 ~SearchFullHashJob() override;
28
29 void start();
30 [[nodiscard]] bool canStart() const;
31
32 void setDatabaseState(const QStringList &hash);
33 void setSearchFullHashForUrl(const QUrl &url);
34
35 [[nodiscard]] QByteArray jsonRequest() const;
36 void parse(const QByteArray &replyStr);
37
38 void setSearchHashs(const QHash<QByteArray, QByteArray> &hash);
39Q_SIGNALS:
40 void result(WebEngineViewer::CheckPhishingUrlUtil::UrlStatus status, const QUrl &url);
41 void debugJson(const QByteArray &ba);
42
43private:
44 WEBENGINEVIEWER_NO_EXPORT void slotSslErrors(QNetworkReply *reply, const QList<QSslError> &error);
45 WEBENGINEVIEWER_NO_EXPORT void slotError(QNetworkReply::NetworkError error);
46 WEBENGINEVIEWER_NO_EXPORT void slotCheckUrlFinished(QNetworkReply *reply);
47
48 Q_DISABLE_COPY(SearchFullHashJob)
49 std::unique_ptr<SearchFullHashJobPrivate> const d;
50};
51}
The SearchFullHashJob 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.