1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/apps/opencs/model/doc/document.hpp

86 lines
2.2 KiB
C++
Raw Normal View History

2012-11-22 13:30:02 +01:00
#ifndef CSM_DOC_DOCUMENT_H
#define CSM_DOC_DOCUMENT_H
2012-11-21 17:31:18 +01:00
2012-11-23 14:05:49 +01:00
#include <string>
2012-11-22 15:54:31 +01:00
#include <QUndoStack>
#include <QObject>
#include <QTimer>
2012-11-22 15:54:31 +01:00
#include "../world/data.hpp"
2012-11-21 17:31:18 +01:00
namespace CSMDoc
{
class Document : public QObject
2012-11-21 17:31:18 +01: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 14:05:49 +01:00
std::string mName; ///< \todo replace name with ESX list
2012-11-22 15:54:31 +01:00
QUndoStack mUndoStack;
CSMWorld::Data mData;
2012-11-22 15:54:31 +01: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 13:30:02 +01:00
// not implemented
2012-11-21 17:31:18 +01:00
Document (const Document&);
Document& operator= (const Document&);
public:
2012-11-23 14:05:49 +01:00
Document (const std::string& name);
///< \todo replace name with ESX list
2012-11-22 15:54:31 +01:00
QUndoStack& getUndoStack();
int getState() const;
2012-11-23 14:05:49 +01:00
const std::string& getName() const;
///< \todo replace with ESX list
void save();
void verify();
2012-11-23 12:20:35 +01:00
void abortOperation (int type);
const CSMWorld::Data& getData() const;
CSMWorld::Data& getData();
signals:
void stateChanged (int state, CSMDoc::Document *document);
2012-11-23 12:20:35 +01:00
void progress (int current, int max, int type, int threads, CSMDoc::Document *document);
2012-11-23 10:25:34 +01: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 17:31:18 +01:00
};
}
#endif