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-18 15:55:29 +08:00
|
|
|
JobService(const JobService &) = delete;
|
|
|
|
JobService(JobService &&) = delete;
|
|
|
|
JobService &operator=(const JobService &) = delete;
|
|
|
|
JobService &operator=(JobService &&) = delete;
|
2023-07-10 10:18:33 +08:00
|
|
|
|
|
|
|
Q_PROPERTY(QString Status READ status)
|
|
|
|
QString status() const;
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void Cancel();
|
2023-07-18 15:55:29 +08:00
|
|
|
void Suspend();
|
2023-07-10 10:18:33 +08:00
|
|
|
void Resume();
|
2023-07-12 10:35:27 +08:00
|
|
|
|
|
|
|
private:
|
2023-07-18 15:55:29 +08:00
|
|
|
friend class JobManager1Service;
|
|
|
|
explicit JobService(const QFuture<QVariantList>& job);
|
|
|
|
QFuture<QVariantList> m_job;
|
2023-07-10 10:18:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|