OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
tools.hpp
Go to the documentation of this file.
1 #ifndef CSM_TOOLS_TOOLS_H
2 #define CSM_TOOLS_TOOLS_H
3 
4 #include <memory>
5 #include <map>
6 
8 
9 #include <QObject>
10 
11 #include <boost/filesystem/path.hpp>
12 
13 #include "../doc/operationholder.hpp"
14 
15 namespace CSMWorld
16 {
17  class Data;
18  class UniversalId;
19 }
20 
21 namespace CSMDoc
22 {
23  class Operation;
24  class Document;
25 }
26 
27 namespace CSMTools
28 {
29  class ReportModel;
30  class Search;
31  class SearchOperation;
32  class MergeOperation;
33 
34  class Tools : public QObject
35  {
36  Q_OBJECT
37 
46  std::map<int, ReportModel *> mReports;
48  std::map<int, int> mActiveReports; // type, report number
50 
51  // not implemented
52  Tools (const Tools&);
53  Tools& operator= (const Tools&);
54 
56 
57  CSMDoc::OperationHolder *get (int type);
59 
60  const CSMDoc::OperationHolder *get (int type) const;
62 
63  public:
64 
65  Tools (CSMDoc::Document& document, ToUTF8::FromType encoding);
66 
67  virtual ~Tools();
68 
74 
77 
78  void runSearch (const CSMWorld::UniversalId& searchId, const Search& search);
79 
80  void runMerge (std::auto_ptr<CSMDoc::Document> target);
81 
82  void abortOperation (int type);
84 
85  int getRunningOperations() const;
86 
89 
90  private slots:
91 
92  void verifierMessage (const CSMDoc::Message& message, int type);
93 
94  signals:
95 
96  void progress (int current, int max, int type);
97 
98  void done (int type, bool failed);
99 
102  void mergeDone (CSMDoc::Document *document);
103  };
104 }
105 
106 #endif
void verifierMessage(const CSMDoc::Message &message, int type)
Definition: tools.cpp:274
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
Tools(const Tools &)
CSMDoc::Operation * mVerifierOperation
Definition: tools.hpp:40
static const struct @2 signals[]
Definition: operation.hpp:22
CSMDoc::OperationHolder mVerifier
Definition: tools.hpp:41
Definition: searchoperation.hpp:17
void done(int type, bool failed)
SearchOperation * mSearchOperation
Definition: tools.hpp:42
Definition: messages.hpp:13
virtual ~Tools()
Definition: tools.cpp:158
Definition: reportmodel.hpp:15
CSMWorld::Data & mData
Definition: tools.hpp:39
void progress(int current, int max, int type)
CSMDoc::OperationHolder * getVerifier()
Definition: tools.cpp:53
CSMWorld::UniversalId newSearch()
Return ID of the report for this search.
Definition: tools.cpp:197
int getRunningOperations() const
Definition: tools.cpp:244
int mNextReportNumber
Definition: tools.hpp:47
MWWorld::Ptr searchId(MWWorld::CellRefList< T > &list, const std::string &id, MWWorld::ContainerStore *store)
Definition: containerstore.cpp:42
void runMerge(std::auto_ptr< CSMDoc::Document > target)
Definition: tools.cpp:219
CSMDoc::OperationHolder mMerge
Definition: tools.hpp:45
Definition: mergeoperation.hpp:19
void abortOperation(int type)
Definition: tools.cpp:238
ReportModel * getReport(const CSMWorld::UniversalId &id)
The ownership of the returned report is not transferred.
Definition: tools.cpp:264
Definition: data.hpp:77
CSMWorld::UniversalId runVerifier(const CSMWorld::UniversalId &reportId=CSMWorld::UniversalId())
Definition: tools.cpp:182
FromType
Definition: to_utf8.hpp:11
void runSearch(const CSMWorld::UniversalId &searchId, const Search &search)
Definition: tools.cpp:204
CSMDoc::OperationHolder mSearch
Definition: tools.hpp:43
void mergeDone(CSMDoc::Document *document)
std::map< int, int > mActiveReports
Definition: tools.hpp:48
Definition: document.hpp:57
MergeOperation * mMergeOperation
Definition: tools.hpp:44
std::map< int, ReportModel * > mReports
Definition: tools.hpp:46
ToUTF8::FromType mEncoding
Definition: tools.hpp:49
Tools & operator=(const Tools &)
CSMDoc::Document & mDocument
Definition: tools.hpp:38
Definition: tools.hpp:34
Definition: operationholder.hpp:18
Definition: search.hpp:26
Definition: universalid.hpp:12