KTextAddons

downloadlanguagejob.h
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8#include "libbergamot_private_export.h"
9#include <QCryptographicHash>
10#include <QObject>
11#include <QUrl>
12class QTemporaryFile;
13class LIBBERGAMOT_TESTS_EXPORT DownloadLanguageJob : public QObject
14{
15 Q_OBJECT
16public:
17 explicit DownloadLanguageJob(QObject *parent = nullptr);
18 ~DownloadLanguageJob() override;
19 void start();
20
21 [[nodiscard]] bool canStart() const;
22
23 [[nodiscard]] QUrl url() const;
24 void setUrl(const QUrl &newUrl);
25
26 [[nodiscard]] QString checkSum() const;
27 void setCheckSum(const QString &newCheckSum);
28
30 void errorText(const QString &str);
31 void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
32 void extractDone();
33
34private:
35 void slotExtractDone();
36 void extractLanguage();
37 QCryptographicHash *mHash = nullptr;
38 QUrl mUrl;
39 QString mCheckSum;
40 QTemporaryFile *mDestination = nullptr;
41};
Q_SCRIPTABLE Q_NOREPLY void start()
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.