OpenMW
|
00001 #ifndef CSV_DOC_VIEW_H 00002 #define CSV_DOC_VIEW_H 00003 00004 #include <vector> 00005 #include <map> 00006 00007 #include <QMainWindow> 00008 00009 #include "subviewfactory.hpp" 00010 00011 class QAction; 00012 class QDockWidget; 00013 00014 namespace CSMDoc 00015 { 00016 class Document; 00017 } 00018 00019 namespace CSMWorld 00020 { 00021 class UniversalId; 00022 } 00023 00024 namespace CSVDoc 00025 { 00026 class ViewManager; 00027 class Operations; 00028 00029 class View : public QMainWindow 00030 { 00031 Q_OBJECT 00032 00033 ViewManager& mViewManager; 00034 CSMDoc::Document *mDocument; 00035 int mViewIndex; 00036 int mViewTotal; 00037 QAction *mUndo; 00038 QAction *mRedo; 00039 QAction *mSave; 00040 QAction *mVerify; 00041 QAction *mShowStatusBar; 00042 std::vector<QAction *> mEditingActions; 00043 Operations *mOperations; 00044 SubViewFactoryManager mSubViewFactory; 00045 QMainWindow mSubViewWindow; 00046 00047 00048 // not implemented 00049 View (const View&); 00050 View& operator= (const View&); 00051 00052 private: 00053 00054 void closeEvent (QCloseEvent *event); 00055 00056 void setupFileMenu(); 00057 00058 void setupEditMenu(); 00059 00060 void setupViewMenu(); 00061 00062 void setupWorldMenu(); 00063 00064 void setupMechanicsMenu(); 00065 00066 void setupCharacterMenu(); 00067 00068 void setupAssetsMenu(); 00069 00070 void setupUi(); 00071 00072 void updateTitle(); 00073 00074 void updateActions(); 00075 00076 void exitApplication(); 00077 00078 void loadUserSettings(); 00079 00081 void resizeViewWidth (int width); 00082 00084 void resizeViewHeight (int height); 00085 00086 public: 00087 00088 View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews); 00089 00091 00092 virtual ~View(); 00093 00094 const CSMDoc::Document *getDocument() const; 00095 00096 CSMDoc::Document *getDocument(); 00097 00098 void setIndex (int viewIndex, int totalViews); 00099 00100 void updateDocumentState(); 00101 00102 void updateProgress (int current, int max, int type, int threads); 00103 00104 Operations *getOperations() const; 00105 00107 void updateEditorSetting (const QString &, const QString &); 00108 00109 signals: 00110 00111 void newGameRequest(); 00112 00113 void newAddonRequest(); 00114 00115 void loadDocumentRequest(); 00116 00117 void exitApplicationRequest (CSVDoc::View *view); 00118 00119 void editSettingsRequest(); 00120 00121 public slots: 00122 00123 void addSubView (const CSMWorld::UniversalId& id); 00124 00125 void abortOperation (int type); 00126 00127 private slots: 00128 00129 void newView(); 00130 00131 void save(); 00132 00133 void exit(); 00134 00135 void verify(); 00136 00137 void addGlobalsSubView(); 00138 00139 void addGmstsSubView(); 00140 00141 void addSkillsSubView(); 00142 00143 void addClassesSubView(); 00144 00145 void addFactionsSubView(); 00146 00147 void addRacesSubView(); 00148 00149 void addSoundsSubView(); 00150 00151 void addScriptsSubView(); 00152 00153 void addRegionsSubView(); 00154 00155 void addBirthsignsSubView(); 00156 00157 void addSpellsSubView(); 00158 00159 void addCellsSubView(); 00160 00161 void addReferenceablesSubView(); 00162 00163 void addReferencesSubView(); 00164 00165 void addRegionMapSubView(); 00166 00167 void addFiltersSubView(); 00168 00169 void addSceneSubView(); 00170 00171 void addTopicsSubView(); 00172 00173 void addJournalsSubView(); 00174 00175 void addTopicInfosSubView(); 00176 00177 void addJournalInfosSubView(); 00178 00179 void toggleShowStatusBar (bool show); 00180 }; 00181 } 00182 00183 #endif