mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 10:49:57 +00:00
57 lines
1.1 KiB
C++
57 lines
1.1 KiB
C++
|
#ifndef CSM_DOC_OPERATIONHOLDER_H
|
||
|
#define CSM_DOC_OPERATIONHOLDER_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QThread>
|
||
|
|
||
|
namespace CSMWorld
|
||
|
{
|
||
|
class UniversalId;
|
||
|
}
|
||
|
|
||
|
namespace CSMDoc
|
||
|
{
|
||
|
class Operation;
|
||
|
|
||
|
class OperationHolder : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
QThread mThread;
|
||
|
Operation *mOperation;
|
||
|
bool mRunning;
|
||
|
|
||
|
public:
|
||
|
|
||
|
OperationHolder (Operation *operation = 0);
|
||
|
|
||
|
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);
|
||
|
|
||
|
signals:
|
||
|
|
||
|
void progress (int current, int max, int type);
|
||
|
|
||
|
void reportMessage (const CSMWorld::UniversalId& id, const std::string& message,
|
||
|
const std::string& hint, int type);
|
||
|
|
||
|
void done (int type, bool failed);
|
||
|
|
||
|
void abortSignal();
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|