1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 05:49:56 +00:00
openmw-tes3mp/apps/opencs/model/doc/document.hpp

86 lines
2.2 KiB
C++
Raw Normal View History

2012-11-22 12:30:02 +00:00
#ifndef CSM_DOC_DOCUMENT_H
#define CSM_DOC_DOCUMENT_H
2012-11-21 16:31:18 +00:00
2012-11-23 13:05:49 +00:00
#include <string>
2012-11-22 14:54:31 +00:00
#include <QUndoStack>
#include <QObject>
#include <QTimer>
2012-11-22 14:54:31 +00:00
#include "../world/data.hpp"
2012-11-21 16:31:18 +00:00
namespace CSMDoc
{
class Document : public QObject
2012-11-21 16:31:18 +00:00
{
Q_OBJECT
public:
enum State
{
State_Modified = 1,
State_Locked = 2,
State_Saving = 4,
State_Verifying = 8,
State_Compiling = 16, // not implemented yet
State_Searching = 32 // not implemented yet
};
private:
2012-11-23 13:05:49 +00:00
std::string mName; ///< \todo replace name with ESX list
2012-11-22 14:54:31 +00:00
QUndoStack mUndoStack;
CSMWorld::Data mData;
2012-11-22 14:54:31 +00:00
int mSaveCount; ///< dummy implementation -> remove when proper save is implemented.
QTimer mSaveTimer; ///< dummy implementation -> remove when proper save is implemented.
int mVerifyCount; ///< dummy implementation -> remove when proper verify is implemented.
QTimer mVerifyTimer; ///< dummy implementation -> remove when proper verify is implemented.
2012-11-22 12:30:02 +00:00
// not implemented
2012-11-21 16:31:18 +00:00
Document (const Document&);
Document& operator= (const Document&);
public:
2012-11-23 13:05:49 +00:00
Document (const std::string& name);
///< \todo replace name with ESX list
2012-11-22 14:54:31 +00:00
QUndoStack& getUndoStack();
int getState() const;
2012-11-23 13:05:49 +00:00
const std::string& getName() const;
///< \todo replace with ESX list
void save();
void verify();
2012-11-23 11:20:35 +00:00
void abortOperation (int type);
const CSMWorld::Data& getData() const;
CSMWorld::Data& getData();
signals:
void stateChanged (int state, CSMDoc::Document *document);
2012-11-23 11:20:35 +00:00
void progress (int current, int max, int type, int threads, CSMDoc::Document *document);
2012-11-23 09:25:34 +00:00
private slots:
void modificationStateChanged (bool clean);
void saving();
///< dummy implementation -> remove when proper save is implemented.
void verifying();
///< dummy implementation -> remove when proper verify is implemented.
2012-11-21 16:31:18 +00:00
};
}
#endif