1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/opencs/model/doc/operationholder.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
894 B
C++
Raw Normal View History

#ifndef CSM_DOC_OPERATIONHOLDER_H
#define CSM_DOC_OPERATIONHOLDER_H
#include <QObject>
#include <QThread>
namespace CSMDoc
{
class Operation;
2022-10-19 17:02:00 +00:00
struct Message;
class OperationHolder : public QObject
{
Q_OBJECT
QThread mThread;
Operation* mOperation;
bool mRunning;
2022-09-22 18:26:05 +00:00
public:
2020-11-13 07:39:47 +00:00
OperationHolder(Operation* operation = nullptr);
void setOperation(Operation* operation);
bool isRunning() const;
void start();
void abort();
// Abort and wait until thread has finished.
void abortAndWait();
private slots:
void doneSlot(int type, bool failed);
2022-09-22 18:26:05 +00:00
signals:
void progress(int current, int max, int type);
void reportMessage(const CSMDoc::Message& message, int type);
void done(int type, bool failed);
2022-09-22 18:26:05 +00:00
void abortSignal();
};
}
#endif