2012-11-22 13:30:02 +01:00
|
|
|
#ifndef CSV_DOC_VIEW_H
|
|
|
|
#define CSV_DOC_VIEW_H
|
|
|
|
|
2012-11-23 00:51:04 +01:00
|
|
|
#include <vector>
|
2012-11-26 12:29:22 +01:00
|
|
|
#include <map>
|
2012-11-23 00:51:04 +01:00
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
#include <QMainWindow>
|
|
|
|
|
2012-12-11 13:22:43 +01:00
|
|
|
#include "subviewfactory.hpp"
|
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
class QAction;
|
2013-02-22 21:53:32 -06:00
|
|
|
class QDockWidget;
|
2012-11-22 13:30:02 +01:00
|
|
|
|
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
2012-11-24 13:17:21 +01:00
|
|
|
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
|
|
|
|
2012-11-22 14:49:58 +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;
|
2012-11-23 00:51:04 +01:00
|
|
|
QAction *mUndo;
|
|
|
|
QAction *mRedo;
|
2012-11-23 10:52:46 +01:00
|
|
|
QAction *mSave;
|
2012-11-23 13:15:45 +01:00
|
|
|
QAction *mVerify;
|
2013-07-25 14:29:56 +02:00
|
|
|
QAction *mShowStatusBar;
|
2012-11-23 00:51:04 +01:00
|
|
|
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);
|
|
|
|
|
2012-11-23 00:36:01 +01:00
|
|
|
void setupFileMenu();
|
|
|
|
|
2012-11-22 15:54:31 +01:00
|
|
|
void setupEditMenu();
|
|
|
|
|
|
|
|
void setupViewMenu();
|
|
|
|
|
2012-11-23 13:15:45 +01:00
|
|
|
void setupWorldMenu();
|
|
|
|
|
2013-07-20 13:46:56 +02:00
|
|
|
void setupMechanicsMenu();
|
|
|
|
|
2013-10-21 18:04:40 +02:00
|
|
|
void setupCharacterMenu();
|
|
|
|
|
2013-07-20 13:46:56 +02:00
|
|
|
void setupAssetsMenu();
|
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
void setupUi();
|
|
|
|
|
2012-11-22 15:09:04 +01:00
|
|
|
void updateTitle();
|
|
|
|
|
2012-11-23 00:51:04 +01:00
|
|
|
void updateActions();
|
|
|
|
|
2013-03-12 06:28:13 -05:00
|
|
|
void exitApplication();
|
|
|
|
|
2013-06-15 06:40:18 -05:00
|
|
|
void loadUserSettings();
|
|
|
|
|
2013-06-20 18:06:25 -05:00
|
|
|
/// User preference function
|
|
|
|
void resizeViewWidth (int width);
|
|
|
|
|
|
|
|
/// User preference function
|
|
|
|
void resizeViewHeight (int height);
|
|
|
|
|
2012-11-22 13:30:02 +01:00
|
|
|
public:
|
|
|
|
|
2013-03-02 09:22:44 -06:00
|
|
|
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
|
|
|
|
2012-11-26 12:29:22 +01:00
|
|
|
virtual ~View();
|
|
|
|
|
2012-11-22 14:10:23 +01:00
|
|
|
const CSMDoc::Document *getDocument() const;
|
|
|
|
|
|
|
|
CSMDoc::Document *getDocument();
|
2012-11-22 14:49:58 +01:00
|
|
|
|
2012-11-22 15:09:04 +01:00
|
|
|
void setIndex (int viewIndex, int totalViews);
|
|
|
|
|
2012-11-22 23:42:17 +01:00
|
|
|
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;
|
2013-02-22 21:53:32 -06:00
|
|
|
|
2013-06-20 18:06:25 -05:00
|
|
|
/// Function called by view manager when user preferences are updated
|
2013-06-15 06:40:18 -05:00
|
|
|
void updateEditorSetting (const QString &, const QString &);
|
|
|
|
|
2012-11-23 14:05:49 +01:00
|
|
|
signals:
|
|
|
|
|
2013-09-08 12:06:28 +02:00
|
|
|
void newGameRequest();
|
|
|
|
|
|
|
|
void newAddonRequest();
|
2012-11-23 14:05:49 +01:00
|
|
|
|
2013-02-02 16:14:58 +01:00
|
|
|
void loadDocumentRequest();
|
|
|
|
|
2013-03-12 06:28:13 -05:00
|
|
|
void exitApplicationRequest (CSVDoc::View *view);
|
2013-03-06 06:41:33 -06:00
|
|
|
|
2013-09-08 09:33:45 +02:00
|
|
|
void editSettingsRequest();
|
|
|
|
|
2012-12-12 22:36:20 +01:00
|
|
|
public slots:
|
|
|
|
|
2014-03-02 13:29:02 +01:00
|
|
|
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).
|
2012-12-12 22:36:20 +01:00
|
|
|
|
2013-03-02 07:57:41 -06:00
|
|
|
void abortOperation (int type);
|
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void newView();
|
2012-11-22 16:00:23 +01:00
|
|
|
|
2012-11-23 00:36:01 +01:00
|
|
|
void save();
|
2012-11-23 13:15:45 +01:00
|
|
|
|
2013-03-12 06:28:13 -05:00
|
|
|
void exit();
|
|
|
|
|
2012-11-23 13:15:45 +01:00
|
|
|
void verify();
|
2012-11-24 13:17:21 +01:00
|
|
|
|
2012-11-26 12:29:22 +01:00
|
|
|
void addGlobalsSubView();
|
2013-02-08 09:58:19 +01:00
|
|
|
|
|
|
|
void addGmstsSubView();
|
2013-02-22 21:53:32 -06:00
|
|
|
|
2013-03-21 14:31:32 +01:00
|
|
|
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
|
|
|
|
2013-05-11 17:01:16 +02:00
|
|
|
void addReferenceablesSubView();
|
2013-05-19 14:59:01 +02:00
|
|
|
|
2013-07-06 17:03:18 +02:00
|
|
|
void addReferencesSubView();
|
|
|
|
|
2013-07-08 13:12:50 +02:00
|
|
|
void addRegionMapSubView();
|
|
|
|
|
2013-07-22 21:18:47 +02:00
|
|
|
void addFiltersSubView();
|
|
|
|
|
2013-09-28 09:25:54 +02:00
|
|
|
void addSceneSubView();
|
|
|
|
|
2013-10-20 17:13:31 +02:00
|
|
|
void addTopicsSubView();
|
|
|
|
|
|
|
|
void addJournalsSubView();
|
|
|
|
|
2013-10-29 13:18:22 +01:00
|
|
|
void addTopicInfosSubView();
|
|
|
|
|
|
|
|
void addJournalInfosSubView();
|
|
|
|
|
2013-07-25 14:29:56 +02:00
|
|
|
void toggleShowStatusBar (bool show);
|
2012-11-22 13:30:02 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-22 21:53:32 -06:00
|
|
|
#endif
|