1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 04:49:54 +00:00
openmw-tes3mp/apps/opencs/view/doc/view.hpp

104 lines
2 KiB
C++
Raw Normal View History

2012-11-22 12:30:02 +00:00
#ifndef CSV_DOC_VIEW_H
#define CSV_DOC_VIEW_H
#include <vector>
#include <map>
#include <QMainWindow>
class QAction;
2012-11-22 12:30:02 +00:00
namespace CSMDoc
{
class Document;
}
namespace CSMWorld
{
class UniversalId;
}
namespace CSVWorld
{
struct SubViewFactoryBase;
}
2012-11-22 12:30:02 +00:00
namespace CSVDoc
{
2012-11-22 13:10:23 +00:00
class ViewManager;
2012-11-23 11:20:35 +00:00
class Operations;
2012-11-22 13:10:23 +00:00
class View : public QMainWindow
2012-11-22 12:30:02 +00:00
{
Q_OBJECT
2012-11-22 13:10:23 +00:00
ViewManager& mViewManager;
2012-11-22 12:30:02 +00:00
CSMDoc::Document *mDocument;
2012-11-22 14:09:04 +00:00
int mViewIndex;
int mViewTotal;
QAction *mUndo;
QAction *mRedo;
QAction *mSave;
QAction *mVerify;
std::vector<QAction *> mEditingActions;
2012-11-23 11:20:35 +00:00
Operations *mOperations;
std::map<CSMWorld::UniversalId, CSVWorld::SubViewFactoryBase *> mSubViewFactories;
2012-11-22 12:30:02 +00:00
// not implemented
View (const View&);
View& operator= (const View&);
2012-11-22 13:10:23 +00:00
private:
void closeEvent (QCloseEvent *event);
void setupFileMenu();
2012-11-22 14:54:31 +00:00
void setupEditMenu();
void setupViewMenu();
void setupWorldMenu();
void setupUi();
2012-11-22 14:09:04 +00:00
void updateTitle();
void updateActions();
2012-11-22 12:30:02 +00:00
public:
2012-11-22 14:09:04 +00:00
View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews);
2012-11-22 12:30:02 +00:00
///< The ownership of \a document is not transferred to *this.
2012-11-22 13:10:23 +00:00
virtual ~View();
2012-11-22 13:10:23 +00:00
const CSMDoc::Document *getDocument() const;
CSMDoc::Document *getDocument();
2012-11-22 14:09:04 +00:00
void setIndex (int viewIndex, int totalViews);
void updateDocumentState();
2012-11-23 11:20:35 +00:00
void updateProgress (int current, int max, int type, int threads);
2012-11-23 09:25:34 +00:00
void addSubView (const CSMWorld::UniversalId& id);
2012-11-23 13:05:49 +00:00
signals:
void newDocumentRequest();
private slots:
void newView();
2012-11-22 15:00:23 +00:00
void save();
void verify();
void addGlobalsSubView();
2012-11-22 12:30:02 +00:00
};
}
#endif