mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 07:56:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			50 lines
		
	
	
	
		
			894 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
	
		
			894 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#ifndef CSM_DOC_OPERATIONHOLDER_H
 | 
						|
#define CSM_DOC_OPERATIONHOLDER_H
 | 
						|
 | 
						|
#include <QObject>
 | 
						|
#include <QThread>
 | 
						|
 | 
						|
namespace CSMDoc
 | 
						|
{
 | 
						|
    class Operation;
 | 
						|
    struct Message;
 | 
						|
 | 
						|
    class OperationHolder : public QObject
 | 
						|
    {
 | 
						|
        Q_OBJECT
 | 
						|
 | 
						|
        QThread mThread;
 | 
						|
        Operation* mOperation;
 | 
						|
        bool mRunning;
 | 
						|
 | 
						|
    public:
 | 
						|
        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);
 | 
						|
 | 
						|
    signals:
 | 
						|
 | 
						|
        void progress(int current, int max, int type);
 | 
						|
 | 
						|
        void reportMessage(const CSMDoc::Message& message, int type);
 | 
						|
 | 
						|
        void done(int type, bool failed);
 | 
						|
 | 
						|
        void abortSignal();
 | 
						|
    };
 | 
						|
}
 | 
						|
 | 
						|
#endif
 |