2023-07-10 10:18:33 +08:00
|
|
|
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
#ifndef JOBSERVICE_H
|
|
|
|
#define JOBSERVICE_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2023-07-12 10:35:27 +08:00
|
|
|
#include <QFuture>
|
|
|
|
#include <QVariant>
|
2023-07-10 10:18:33 +08:00
|
|
|
|
|
|
|
class JobService : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-07-17 14:49:35 +08:00
|
|
|
~JobService() override;
|
2023-07-10 10:18:33 +08:00
|
|
|
|
|
|
|
Q_PROPERTY(QString Status READ status)
|
|
|
|
QString status() const;
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void Cancel();
|
|
|
|
void Pause();
|
|
|
|
void Resume();
|
2023-07-12 10:35:27 +08:00
|
|
|
|
|
|
|
private:
|
2023-07-17 14:49:35 +08:00
|
|
|
explicit JobService(const QFuture<QVariant>& job);
|
|
|
|
QFuture<QVariant> m_job;
|
2023-07-10 10:18:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|