1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

184 lines
3.8 KiB
C++
Raw Normal View History

2012-11-22 13:30:02 +01:00
#ifndef CSV_DOC_VIEW_H
#define CSV_DOC_VIEW_H
#include <vector>
#include <map>
#include <QMainWindow>
2012-12-11 13:22:43 +01:00
#include "subviewfactory.hpp"
class QAction;
class QDockWidget;
2012-11-22 13:30:02 +01:00
namespace CSMDoc
{
class Document;
}
namespace CSMWorld
{
class UniversalId;
}
2012-11-22 13:30:02 +01:00
namespace CSVDoc
{
2012-11-22 14:10:23 +01:00
class ViewManager;
2012-11-23 12:20:35 +01:00
class Operations;
2012-11-22 14:10:23 +01:00
class View : public QMainWindow
2012-11-22 13:30:02 +01:00
{
Q_OBJECT
2012-11-22 14:10:23 +01:00
ViewManager& mViewManager;
2012-11-22 13:30:02 +01:00
CSMDoc::Document *mDocument;
2012-11-22 15:09:04 +01:00
int mViewIndex;
int mViewTotal;
QAction *mUndo;
QAction *mRedo;
QAction *mSave;
QAction *mVerify;
2013-07-25 14:29:56 +02:00
QAction *mShowStatusBar;
std::vector<QAction *> mEditingActions;
2012-11-23 12:20:35 +01:00
Operations *mOperations;
2012-12-11 13:22:43 +01:00
SubViewFactoryManager mSubViewFactory;
2013-03-06 06:41:33 -06:00
QMainWindow mSubViewWindow;
2012-11-22 13:30:02 +01:00
// not implemented
View (const View&);
View& operator= (const View&);
2012-11-22 14:10:23 +01:00
private:
void closeEvent (QCloseEvent *event);
void setupFileMenu();
2012-11-22 15:54:31 +01:00
void setupEditMenu();
void setupViewMenu();
void setupWorldMenu();
2013-07-20 13:46:56 +02:00
void setupMechanicsMenu();
void setupCharacterMenu();
2013-07-20 13:46:56 +02:00
void setupAssetsMenu();
void setupUi();
2012-11-22 15:09:04 +01:00
void updateTitle();
void updateActions();
void exitApplication();
void loadUserSettings();
/// User preference function
void resizeViewWidth (int width);
/// User preference function
void resizeViewHeight (int height);
2012-11-22 13:30:02 +01:00
public:
View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews);
2013-03-06 06:41:33 -06:00
2012-11-22 13:30:02 +01:00
///< The ownership of \a document is not transferred to *this.
2012-11-22 14:10:23 +01:00
virtual ~View();
2012-11-22 14:10:23 +01:00
const CSMDoc::Document *getDocument() const;
CSMDoc::Document *getDocument();
2012-11-22 15:09:04 +01:00
void setIndex (int viewIndex, int totalViews);
void updateDocumentState();
2012-11-23 12:20:35 +01:00
void updateProgress (int current, int max, int type, int threads);
2012-11-23 10:25:34 +01:00
2013-03-06 06:41:33 -06:00
Operations *getOperations() const;
/// Function called by view manager when user preferences are updated
void updateEditorSetting (const QString &, const QString &);
2012-11-23 14:05:49 +01:00
signals:
void newGameRequest();
void newAddonRequest();
2012-11-23 14:05:49 +01:00
2013-02-02 16:14:58 +01:00
void loadDocumentRequest();
void exitApplicationRequest (CSVDoc::View *view);
2013-03-06 06:41:33 -06:00
void editSettingsRequest();
public slots:
void addSubView (const CSMWorld::UniversalId& id, const std::string& hint = "");
///< \param hint Suggested view point (e.g. coordinates in a 3D scene or a line number
/// in a script).
2013-03-02 07:57:41 -06:00
void abortOperation (int type);
private slots:
void newView();
2012-11-22 16:00:23 +01:00
void save();
void exit();
void verify();
void addGlobalsSubView();
2013-02-08 09:58:19 +01:00
void addGmstsSubView();
void addSkillsSubView();
2013-03-25 13:22:06 +01:00
void addClassesSubView();
2013-04-02 12:00:45 +02:00
void addFactionsSubView();
2013-04-04 14:34:39 +02:00
void addRacesSubView();
2013-04-06 21:21:10 +02:00
void addSoundsSubView();
2013-04-07 15:17:35 +02:00
void addScriptsSubView();
2013-04-07 16:32:06 +02:00
void addRegionsSubView();
2013-04-07 20:26:39 +02:00
void addBirthsignsSubView();
2013-04-09 11:40:36 +02:00
void addSpellsSubView();
2013-04-14 17:04:55 +02:00
void addCellsSubView();
2013-05-07 20:33:42 -05:00
void addReferenceablesSubView();
2013-07-06 17:03:18 +02:00
void addReferencesSubView();
void addRegionMapSubView();
2013-07-22 21:18:47 +02:00
void addFiltersSubView();
2013-10-20 17:13:31 +02:00
void addTopicsSubView();
void addJournalsSubView();
void addTopicInfosSubView();
void addJournalInfosSubView();
2013-07-25 14:29:56 +02:00
void toggleShowStatusBar (bool show);
2012-11-22 13:30:02 +01:00
};
}
#endif