OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
operation.hpp
Go to the documentation of this file.
1 #ifndef CSM_DOC_OPERATION_H
2 #define CSM_DOC_OPERATION_H
3 
4 #include <vector>
5 #include <map>
6 
7 #include <QObject>
8 #include <QTimer>
9 #include <QStringList>
10 
11 #include "messages.hpp"
12 
13 namespace CSMWorld
14 {
15  class UniversalId;
16 }
17 
18 namespace CSMDoc
19 {
20  class Stage;
21 
22  class Operation : public QObject
23  {
24  Q_OBJECT
25 
26  int mType;
27  std::vector<std::pair<Stage *, int> > mStages; // stage, number of steps
28  std::vector<std::pair<Stage *, int> >::iterator mCurrentStage;
32  int mOrdered;
34  bool mError;
35  bool mConnected;
36  QTimer *mTimer;
37  bool mPrepared;
39 
40  void prepareStages();
41 
42  public:
43 
44  Operation (int type, bool ordered, bool finalAlways = false);
47 
48  virtual ~Operation();
49 
50  void appendStage (Stage *stage);
54 
56  void setDefaultSeverity (Message::Severity severity);
57 
58  bool hasError() const;
59 
60  signals:
61 
62  void progress (int current, int max, int type);
63 
64  void reportMessage (const CSMDoc::Message& message, int type);
65 
66  void done (int type, bool failed);
67 
68  public slots:
69 
70  void abort();
71 
72  void run();
73 
74  private slots:
75 
76  void executeStage();
77 
78  protected slots:
79 
80  virtual void operationDone();
81  };
82 }
83 
84 #endif
virtual ~Operation()
Definition: operation.cpp:37
bool mPrepared
Definition: operation.hpp:37
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
static const struct @2 signals[]
Definition: operation.hpp:22
QTimer * mTimer
Definition: operation.hpp:36
void reportMessage(const CSMDoc::Message &message, int type)
void run()
Definition: operation.cpp:43
void appendStage(Stage *stage)
Definition: operation.cpp:58
int mType
Definition: operation.hpp:26
int mCurrentStepTotal
Definition: operation.hpp:30
int mCurrentStep
Definition: operation.hpp:29
void progress(int current, int max, int type)
void prepareStages()
Definition: operation.cpp:13
Operation(int type, bool ordered, bool finalAlways=false)
Definition: operation.cpp:28
Definition: messages.hpp:13
bool hasError() const
Definition: operation.cpp:68
void abort()
Definition: operation.cpp:73
bool mFinalAlways
Definition: operation.hpp:33
int mTotalSteps
Definition: operation.hpp:31
Definition: stage.hpp:15
void executeStage()
Definition: operation.cpp:92
void setDefaultSeverity(Message::Severity severity)
Definition: operation.cpp:63
Severity
Definition: messages.hpp:15
int mOrdered
Definition: operation.hpp:32
Message::Severity mDefaultSeverity
Definition: operation.hpp:38
void done(int type, bool failed)
std::vector< std::pair< Stage *, int > >::iterator mCurrentStage
Definition: operation.hpp:28
bool mConnected
Definition: operation.hpp:35
bool mError
Definition: operation.hpp:34
std::vector< std::pair< Stage *, int > > mStages
Definition: operation.hpp:27
virtual void operationDone()
Definition: operation.cpp:135