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-22 14:54:31 +00:00
|
|
|
#include <QUndoStack>
|
2012-11-22 22:42:17 +00:00
|
|
|
#include <QObject>
|
2012-11-22 23:36:01 +00:00
|
|
|
#include <QTimer>
|
2012-11-22 14:54:31 +00:00
|
|
|
|
2012-11-21 16:31:18 +00:00
|
|
|
namespace CSMDoc
|
|
|
|
{
|
2012-11-22 22:42:17 +00:00
|
|
|
class Document : public QObject
|
2012-11-21 16:31:18 +00:00
|
|
|
{
|
2012-11-22 22:42:17 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum State
|
|
|
|
{
|
2012-11-22 23:36:01 +00:00
|
|
|
State_Modified = 1,
|
|
|
|
State_Locked = 2,
|
2012-11-23 09:52:46 +00:00
|
|
|
State_Saving = 4
|
2012-11-22 22:42:17 +00:00
|
|
|
};
|
|
|
|
|
2012-11-22 14:54:31 +00:00
|
|
|
QUndoStack mUndoStack;
|
|
|
|
|
2012-11-22 23:36:01 +00:00
|
|
|
int mSaveCount; ///< dummy implementation -> remove when proper save is implemented.
|
|
|
|
QTimer mSaveTimer; ///< dummy implementation -> remove when proper save 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:
|
|
|
|
|
|
|
|
Document();
|
2012-11-22 14:54:31 +00:00
|
|
|
|
|
|
|
QUndoStack& getUndoStack();
|
2012-11-22 22:42:17 +00:00
|
|
|
|
|
|
|
int getState() const;
|
|
|
|
|
2012-11-22 23:36:01 +00:00
|
|
|
void save();
|
|
|
|
|
2012-11-23 11:20:35 +00:00
|
|
|
void abortOperation (int type);
|
2012-11-22 23:36:01 +00:00
|
|
|
|
2012-11-22 22:42:17 +00:00
|
|
|
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
|
|
|
|
2012-11-22 22:42:17 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void modificationStateChanged (bool clean);
|
2012-11-22 23:36:01 +00:00
|
|
|
|
|
|
|
void saving();
|
|
|
|
///< dummy implementation -> remove when proper save is implemented.
|
2012-11-21 16:31:18 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|