2012-12-08 10:59:13 +00:00
|
|
|
#ifndef CSM_TOOLS_TOOLS_H
|
|
|
|
#define CSM_TOOLS_TOOLS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2012-12-11 14:35:47 +00:00
|
|
|
#include <map>
|
|
|
|
|
2012-12-08 22:27:59 +00:00
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class Data;
|
2012-12-11 14:35:47 +00:00
|
|
|
class UniversalId;
|
2012-12-08 22:27:59 +00:00
|
|
|
}
|
|
|
|
|
2012-12-08 10:59:13 +00:00
|
|
|
namespace CSMTools
|
|
|
|
{
|
|
|
|
class Verifier;
|
2012-12-08 16:00:58 +00:00
|
|
|
class Operation;
|
2012-12-11 14:35:47 +00:00
|
|
|
class ReportModel;
|
2012-12-08 10:59:13 +00:00
|
|
|
|
|
|
|
class Tools : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2012-12-08 22:27:59 +00:00
|
|
|
CSMWorld::Data& mData;
|
2012-12-08 10:59:13 +00:00
|
|
|
Verifier *mVerifier;
|
2012-12-11 14:35:47 +00:00
|
|
|
std::map<int, ReportModel *> mReports;
|
|
|
|
int mNextReportNumber;
|
|
|
|
std::map<int, int> mActiveReports; // type, report number
|
2012-12-08 10:59:13 +00:00
|
|
|
|
|
|
|
// not implemented
|
|
|
|
Tools (const Tools&);
|
|
|
|
Tools& operator= (const Tools&);
|
|
|
|
|
|
|
|
Verifier *getVerifier();
|
|
|
|
|
2012-12-08 16:00:58 +00:00
|
|
|
Operation *get (int type);
|
|
|
|
///< Returns a 0-pointer, if operation hasn't been used yet.
|
|
|
|
|
|
|
|
const Operation *get (int type) const;
|
|
|
|
///< Returns a 0-pointer, if operation hasn't been used yet.
|
|
|
|
|
2012-12-08 10:59:13 +00:00
|
|
|
public:
|
|
|
|
|
2012-12-08 22:27:59 +00:00
|
|
|
Tools (CSMWorld::Data& data);
|
2012-12-08 10:59:13 +00:00
|
|
|
|
|
|
|
virtual ~Tools();
|
|
|
|
|
2012-12-11 14:35:47 +00:00
|
|
|
CSMWorld::UniversalId runVerifier();
|
|
|
|
///< \return ID of the report for this verification run
|
2012-12-08 10:59:13 +00:00
|
|
|
|
|
|
|
void abortOperation (int type);
|
|
|
|
///< \attention The operation is not aborted immediately.
|
|
|
|
|
2012-12-08 16:00:58 +00:00
|
|
|
int getRunningOperations() const;
|
|
|
|
|
2012-12-11 14:35:47 +00:00
|
|
|
ReportModel *getReport (const CSMWorld::UniversalId& id);
|
|
|
|
///< The ownership of the returned report is not transferred.
|
|
|
|
|
2012-12-08 10:59:13 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void verifierDone();
|
|
|
|
|
2012-12-08 17:38:36 +00:00
|
|
|
void verifierMessage (const QString& message, int type);
|
|
|
|
|
2012-12-08 10:59:13 +00:00
|
|
|
signals:
|
|
|
|
|
|
|
|
void progress (int current, int max, int type);
|
|
|
|
|
|
|
|
void done (int type);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|