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

252 lines
5.4 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;
class QScrollArea;
2012-11-22 13:30:02 +01:00
namespace CSMDoc
{
class Document;
}
namespace CSMWorld
{
class UniversalId;
}
namespace CSMPrefs
{
class Setting;
}
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;
class GlobalDebugProfileMenu;
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;
QList<SubView *> mSubViews;
QAction *mUndo;
QAction *mRedo;
QAction *mSave;
QAction *mVerify;
2013-07-25 14:29:56 +02:00
QAction *mShowStatusBar;
QAction *mStopDebug;
QAction *mMerge;
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;
GlobalDebugProfileMenu *mGlobalDebugProfileMenu;
QScrollArea *mScroll;
bool mScrollbarOnly;
2013-03-06 06:41:33 -06:00
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();
2014-08-04 13:36:01 +02:00
void setupDebugMenu();
void setupUi();
void setupShortcut(const char* name, QAction* action);
void updateActions();
void exitApplication();
/// User preference function
void resizeViewWidth (int width);
/// User preference function
void resizeViewHeight (int height);
void updateScrollbar();
void updateWidth(bool isGrowLimit, int minSubViewWidth);
void createScrollArea();
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
void toggleStatusBar(bool checked);
2013-03-06 06:41:33 -06:00
Operations *getOperations() const;
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();
void mergeDocument (CSMDoc::Document *document);
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);
void updateTitle();
// called when subviews are added or removed
void updateSubViewIndices (SubView *view = NULL);
private slots:
void settingChanged (const CSMPrefs::Setting *setting);
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();
2014-06-30 20:40:34 +02:00
void addEnchantmentsSubView();
2014-07-01 12:37:22 +02:00
void addBodyPartsSubView();
2014-09-23 13:21:54 +02:00
void addSoundGensSubView();
2014-09-26 13:12:17 +02:00
void addMagicEffectsSubView();
2014-07-05 15:51:17 +02:00
void addMeshesSubView();
void addIconsSubView();
void addMusicsSubView();
void addSoundsResSubView();
void addTexturesSubView();
void addVideosSubView();
2014-08-04 13:36:01 +02:00
void addDebugProfilesSubView();
2014-09-05 13:49:34 +02:00
void addRunLogSubView();
2014-10-02 15:16:19 +02:00
void addPathgridSubView();
2015-03-03 14:32:12 +01:00
void addStartScriptsSubView();
void addSearchSubView();
2015-06-26 16:11:00 +02:00
void addMetaDataSubView();
2013-07-25 14:29:56 +02:00
void toggleShowStatusBar (bool show);
2014-05-10 12:04:36 +02:00
void loadErrorLog();
2014-09-02 10:21:17 +02:00
void run (const std::string& profile, const std::string& startupInstruction = "");
2014-09-02 10:21:17 +02:00
void stop();
void closeRequest (SubView *subView);
void moveScrollBarToEnd(int min, int max);
void merge();
2012-11-22 13:30:02 +01:00
};
}
#endif