OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
operationholder.hpp
Go to the documentation of this file.
1 #ifndef CSM_DOC_OPERATIONHOLDER_H
2 #define CSM_DOC_OPERATIONHOLDER_H
3 
4 #include <QObject>
5 #include <QThread>
6 
7 #include "messages.hpp"
8 
9 namespace CSMWorld
10 {
11  class UniversalId;
12 }
13 
14 namespace CSMDoc
15 {
16  class Operation;
17 
18  class OperationHolder : public QObject
19  {
20  Q_OBJECT
21 
22  QThread mThread;
24  bool mRunning;
25 
26  public:
27 
28  OperationHolder (Operation *operation = 0);
29 
30  void setOperation (Operation *operation);
31 
32  bool isRunning() const;
33 
34  void start();
35 
36  void abort();
37 
38  // Abort and wait until thread has finished.
39  void abortAndWait();
40 
41  private slots:
42 
43  void doneSlot (int type, bool failed);
44 
45  signals:
46 
47  void progress (int current, int max, int type);
48 
49  void reportMessage (const CSMDoc::Message& message, int type);
50 
51  void done (int type, bool failed);
52 
53  void abortSignal();
54  };
55 }
56 
57 #endif
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
QThread mThread
Definition: operationholder.hpp:22
static const struct @2 signals[]
Definition: operation.hpp:22
bool mRunning
Definition: operationholder.hpp:24
void done(int type, bool failed)
Definition: messages.hpp:13
void abortAndWait()
Definition: operationholder.cpp:52
void reportMessage(const CSMDoc::Message &message, int type)
void doneSlot(int type, bool failed)
Definition: operationholder.cpp:61
OperationHolder(Operation *operation=0)
Definition: operationholder.cpp:5
void setOperation(Operation *operation)
Definition: operationholder.cpp:13
bool isRunning() const
Definition: operationholder.cpp:35
void start()
Definition: operationholder.cpp:40
Definition: operationholder.hpp:18
Operation * mOperation
Definition: operationholder.hpp:23
void abort()
Definition: operationholder.cpp:46
void progress(int current, int max, int type)