1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 09:23:53 +00:00
openmw/apps/opencs/view/doc/view.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

277 lines
5.6 KiB
C++
Raw Normal View History

2012-11-22 12:30:02 +00:00
#ifndef CSV_DOC_VIEW_H
#define CSV_DOC_VIEW_H
2022-10-19 17:02:00 +00:00
#include <string>
#include <vector>
2022-10-19 17:02:00 +00:00
#include <QList>
#include <QMainWindow>
2022-10-19 17:02:00 +00:00
#include <apps/opencs/model/world/universalid.hpp>
2012-12-11 12:22:43 +00:00
#include "subviewfactory.hpp"
class QAction;
2022-10-19 17:02:00 +00:00
class QCloseEvent;
class QMenu;
class QObject;
class QScrollArea;
2012-11-22 12:30:02 +00:00
namespace CSMDoc
{
class Document;
}
namespace CSMPrefs
{
class Setting;
}
2012-11-22 12:30:02 +00:00
namespace CSVDoc
{
2012-11-22 13:10:23 +00:00
class ViewManager;
2022-10-19 17:02:00 +00:00
class SubView;
2012-11-23 11:20:35 +00:00
class Operations;
class GlobalDebugProfileMenu;
2012-11-22 13:10:23 +00:00
class View : public QMainWindow
2012-11-22 12:30:02 +00:00
{
2013-07-25 12:29:56 +00:00
Q_OBJECT
2012-11-22 12:30:02 +00:00
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;
2012-11-22 12:30:02 +00:00
int mViewTotal;
QList<SubView*> mSubViews;
QAction* mUndo;
2012-11-22 12:30:02 +00:00
QAction* mRedo;
QAction* mSave;
QAction* mVerify;
2013-07-25 12:29:56 +00:00
QAction* mShowStatusBar;
QAction* mStopDebug;
QAction* mMerge;
2012-11-22 12:30:02 +00:00
std::vector<QAction*> mEditingActions;
Operations* mOperations;
SubViewFactoryManager mSubViewFactory;
2013-03-06 12:41:33 +00:00
QMainWindow mSubViewWindow;
GlobalDebugProfileMenu* mGlobalDebugProfileMenu;
QScrollArea* mScroll;
bool mScrollbarOnly;
2012-11-22 12:30:02 +00:00
2012-11-22 13:10:23 +00:00
// not implemented
View(const View&);
2012-11-22 13:10:23 +00:00
View& operator=(const View&);
2022-09-22 18:26:05 +00:00
private:
void closeEvent(QCloseEvent* event) override;
2012-11-22 13:10:23 +00:00
QAction* createMenuEntry(CSMWorld::UniversalId::Type type, QMenu* menu, const char* shortcutName);
QAction* createMenuEntry(
const std::string& title, const std::string& iconName, QMenu* menu, const char* shortcutName);
void setupFileMenu();
2012-11-22 14:54:31 +00:00
void setupEditMenu();
void setupViewMenu();
void setupWorldMenu();
2013-07-20 11:46:56 +00:00
void setupMechanicsMenu();
void setupCharacterMenu();
2013-07-20 11:46:56 +00:00
void setupAssetsMenu();
2014-08-04 11:36:01 +00:00
void setupDebugMenu();
2018-12-21 12:17:09 +00:00
void setupHelpMenu();
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 12:30:02 +00:00
2022-09-22 18:26:05 +00:00
public:
View(ViewManager& viewManager, CSMDoc::Document* document, int totalViews);
2013-03-06 12:41:33 +00:00
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
~View() override;
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 toggleStatusBar(bool checked);
2013-03-06 12:41:33 +00:00
Operations* getOperations() const;
2012-11-23 13:05:49 +00:00
signals:
void newGameRequest();
void newAddonRequest();
2012-11-23 13:05:49 +00:00
2013-02-02 15:14:58 +00:00
void loadDocumentRequest();
void exitApplicationRequest(CSVDoc::View* view);
2013-03-06 12:41:33 +00:00
void editSettingsRequest();
void mergeDocument(CSMDoc::Document* document);
void requestFocus(const std::string& id);
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 13:57:41 +00:00
void abortOperation(int type);
void updateTitle();
// called when subviews are added or removed
2018-10-09 06:21:12 +00:00
void updateSubViewIndices(SubView* view = nullptr);
private slots:
void settingChanged(const CSMPrefs::Setting* setting);
void undoActionChanged();
void redoActionChanged();
void newView();
2012-11-22 15:00:23 +00:00
void save();
void exit();
static void openHelp();
static void tutorial();
2018-12-21 12:17:09 +00:00
void infoAbout();
void infoAboutQt();
void verify();
void addGlobalsSubView();
2013-02-08 08:58:19 +00:00
void addGmstsSubView();
void addSkillsSubView();
2013-03-25 12:22:06 +00:00
void addClassesSubView();
2013-04-02 10:00:45 +00:00
void addFactionsSubView();
2013-04-04 12:34:39 +00:00
void addRacesSubView();
2013-04-06 19:21:10 +00:00
void addSoundsSubView();
2013-04-07 13:17:35 +00:00
void addScriptsSubView();
2013-04-07 14:32:06 +00:00
void addRegionsSubView();
2013-04-07 18:26:39 +00:00
void addBirthsignsSubView();
2013-04-09 09:40:36 +00:00
void addSpellsSubView();
2013-04-14 15:04:55 +00:00
void addCellsSubView();
2013-05-08 01:33:42 +00:00
void addReferenceablesSubView();
2013-07-06 15:03:18 +00:00
void addReferencesSubView();
void addRegionMapSubView();
2013-07-22 19:18:47 +00:00
void addFiltersSubView();
2013-10-20 15:13:31 +00:00
void addTopicsSubView();
void addJournalsSubView();
void addTopicInfosSubView();
void addJournalInfosSubView();
2014-06-30 18:40:34 +00:00
void addEnchantmentsSubView();
2014-07-01 10:37:22 +00:00
void addBodyPartsSubView();
2014-09-23 11:21:54 +00:00
void addSoundGensSubView();
2014-09-26 11:12:17 +00:00
void addMagicEffectsSubView();
2014-07-05 13:51:17 +00:00
void addMeshesSubView();
void addIconsSubView();
void addMusicsSubView();
void addSoundsResSubView();
void addTexturesSubView();
void addVideosSubView();
2014-08-04 11:36:01 +00:00
void addDebugProfilesSubView();
2014-09-05 11:49:34 +00:00
void addRunLogSubView();
2017-08-24 21:12:15 +00:00
void addLandsSubView();
void addLandTexturesSubView();
2014-10-02 13:16:19 +00:00
void addPathgridSubView();
2015-03-03 13:32:12 +00:00
void addStartScriptsSubView();
void addSearchSubView();
2015-06-26 14:11:00 +00:00
void addMetaDataSubView();
2013-07-25 12:29:56 +00:00
void toggleShowStatusBar(bool show);
2014-05-10 10:04:36 +00:00
void loadErrorLog();
2014-09-02 08:21:17 +00:00
void run(const std::string& profile, const std::string& startupInstruction = "");
2014-09-02 08:21:17 +00:00
void stop();
void closeRequest(SubView* subView);
void moveScrollBarToEnd(int min, int max);
void merge();
void onRequestFocus(const std::string& id);
2012-11-22 12:30:02 +00:00
};
}
#endif