OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
view.hpp
Go to the documentation of this file.
1 #ifndef CSV_DOC_VIEW_H
2 #define CSV_DOC_VIEW_H
3 
4 #include <vector>
5 #include <map>
6 
7 #include <QMainWindow>
8 
9 #include "subviewfactory.hpp"
10 
11 class QAction;
12 class QDockWidget;
13 class QScrollArea;
14 
15 namespace CSMDoc
16 {
17  class Document;
18 }
19 
20 namespace CSMWorld
21 {
22  class UniversalId;
23 }
24 
25 namespace CSMPrefs
26 {
27  class Setting;
28 }
29 
30 namespace CSVDoc
31 {
32  class ViewManager;
33  class Operations;
34  class GlobalDebugProfileMenu;
35 
36  class View : public QMainWindow
37  {
38  Q_OBJECT
39 
44  QList<SubView *> mSubViews;
52  std::vector<QAction *> mEditingActions;
55  QMainWindow mSubViewWindow;
59 
60 
61  // not implemented
62  View (const View&);
63  View& operator= (const View&);
64 
65  private:
66 
67  void closeEvent (QCloseEvent *event);
68 
69  void setupFileMenu();
70 
71  void setupEditMenu();
72 
73  void setupViewMenu();
74 
75  void setupWorldMenu();
76 
77  void setupMechanicsMenu();
78 
79  void setupCharacterMenu();
80 
81  void setupAssetsMenu();
82 
83  void setupDebugMenu();
84 
85  void setupUi();
86 
87  void setupShortcut(const char* name, QAction* action);
88 
89  void updateActions();
90 
91  void exitApplication();
92 
94  void resizeViewWidth (int width);
95 
97  void resizeViewHeight (int height);
98 
99  void updateScrollbar();
100  void updateWidth(bool isGrowLimit, int minSubViewWidth);
101  void createScrollArea();
102  public:
103 
104  View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews);
105 
107 
108  virtual ~View();
109 
110  const CSMDoc::Document *getDocument() const;
111 
113 
114  void setIndex (int viewIndex, int totalViews);
115 
116  void updateDocumentState();
117 
118  void updateProgress (int current, int max, int type, int threads);
119 
120  void toggleStatusBar(bool checked);
121 
122  Operations *getOperations() const;
123 
124  signals:
125 
126  void newGameRequest();
127 
128  void newAddonRequest();
129 
130  void loadDocumentRequest();
131 
133 
134  void editSettingsRequest();
135 
136  void mergeDocument (CSMDoc::Document *document);
137 
138  public slots:
139 
140  void addSubView (const CSMWorld::UniversalId& id, const std::string& hint = "");
143 
144  void abortOperation (int type);
145 
146  void updateTitle();
147 
148  // called when subviews are added or removed
149  void updateSubViewIndices (SubView *view = NULL);
150 
151  private slots:
152 
153  void settingChanged (const CSMPrefs::Setting *setting);
154 
155  void newView();
156 
157  void save();
158 
159  void exit();
160 
161  void verify();
162 
163  void addGlobalsSubView();
164 
165  void addGmstsSubView();
166 
167  void addSkillsSubView();
168 
169  void addClassesSubView();
170 
171  void addFactionsSubView();
172 
173  void addRacesSubView();
174 
175  void addSoundsSubView();
176 
177  void addScriptsSubView();
178 
179  void addRegionsSubView();
180 
181  void addBirthsignsSubView();
182 
183  void addSpellsSubView();
184 
185  void addCellsSubView();
186 
188 
189  void addReferencesSubView();
190 
191  void addRegionMapSubView();
192 
193  void addFiltersSubView();
194 
195  void addTopicsSubView();
196 
197  void addJournalsSubView();
198 
199  void addTopicInfosSubView();
200 
201  void addJournalInfosSubView();
202 
203  void addEnchantmentsSubView();
204 
205  void addBodyPartsSubView();
206 
207  void addSoundGensSubView();
208 
209  void addMagicEffectsSubView();
210 
211  void addMeshesSubView();
212 
213  void addIconsSubView();
214 
215  void addMusicsSubView();
216 
217  void addSoundsResSubView();
218 
219  void addTexturesSubView();
220 
221  void addVideosSubView();
222 
224 
225  void addRunLogSubView();
226 
227  void addPathgridSubView();
228 
229  void addStartScriptsSubView();
230 
231  void addSearchSubView();
232 
233  void addMetaDataSubView();
234 
235  void toggleShowStatusBar (bool show);
236 
237  void loadErrorLog();
238 
239  void run (const std::string& profile, const std::string& startupInstruction = "");
240 
241  void stop();
242 
243  void closeRequest (SubView *subView);
244 
245  void moveScrollBarToEnd(int min, int max);
246 
247  void merge();
248  };
249 }
250 
251 #endif
void merge()
Definition: view.cpp:985
void closeEvent(QCloseEvent *event)
Definition: view.cpp:35
QScrollArea * mScroll
Definition: view.hpp:57
Definition: viewmanager.hpp:30
void addMetaDataSubView()
Definition: view.cpp:887
void addJournalInfosSubView()
Definition: view.cpp:807
void loadDocumentRequest()
static const struct @2 signals[]
void addMeshesSubView()
Definition: view.cpp:827
void setupDebugMenu()
Definition: view.cpp:330
void addTopicInfosSubView()
Definition: view.cpp:802
void save()
Definition: view.cpp:702
void addRacesSubView()
Definition: view.cpp:737
void setupUi()
Definition: view.cpp:363
void addIconsSubView()
Definition: view.cpp:832
void addReferencesSubView()
Definition: view.cpp:777
Definition: subviewfactory.hpp:33
void closeRequest(SubView *subView)
Definition: view.cpp:949
void mergeDocument(CSMDoc::Document *document)
QAction * mVerify
Definition: view.hpp:48
std::vector< QAction * > mEditingActions
Definition: view.hpp:52
void addFactionsSubView()
Definition: view.cpp:732
Operations * mOperations
Definition: view.hpp:53
void addFiltersSubView()
Definition: view.cpp:787
Operations * getOperations() const
Definition: view.cpp:898
Definition: globaldebugprofilemenu.hpp:16
Definition: operations.hpp:14
void resizeViewHeight(int height)
User preference function.
Definition: view.cpp:914
QAction * mShowStatusBar
Definition: view.hpp:49
void addBodyPartsSubView()
Definition: view.cpp:817
void addScriptsSubView()
Definition: view.cpp:747
QAction * mSave
Definition: view.hpp:47
void exitApplication()
void addPathgridSubView()
Definition: view.cpp:872
void addClassesSubView()
Definition: view.cpp:727
void addReferenceablesSubView()
Definition: view.cpp:772
void loadErrorLog()
Definition: view.cpp:934
void addStartScriptsSubView()
Definition: view.cpp:877
void run(const std::string &profile, const std::string &startupInstruction="")
Definition: view.cpp:939
void addTopicsSubView()
Definition: view.cpp:792
void settingChanged(const CSMPrefs::Setting *setting)
Definition: view.cpp:661
void updateTitle()
Definition: view.cpp:381
virtual ~View()
Definition: view.cpp:505
void setupCharacterMenu()
Definition: view.cpp:228
QAction * mMerge
Definition: view.hpp:51
void addSpellsSubView()
Definition: view.cpp:762
void setupFileMenu()
Definition: view.cpp:46
int mViewTotal
Definition: view.hpp:43
GlobalDebugProfileMenu * mGlobalDebugProfileMenu
Definition: view.hpp:56
void stop()
Definition: view.cpp:944
void setupShortcut(const char *name, QAction *action)
Definition: view.cpp:375
bool mScrollbarOnly
Definition: view.hpp:58
void createScrollArea()
Definition: view.cpp:1020
void updateSubViewIndices(SubView *view=NULL)
Definition: view.cpp:404
QList< SubView * > mSubViews
Definition: view.hpp:44
void addDebugProfilesSubView()
Definition: view.cpp:862
void addRunLogSubView()
Definition: view.cpp:867
void updateActions()
Definition: view.cpp:440
void addRegionsSubView()
Definition: view.cpp:752
ViewManager & mViewManager
Definition: view.hpp:40
void setIndex(int viewIndex, int totalViews)
Definition: view.cpp:519
void setupViewMenu()
Definition: view.cpp:127
Definition: view.hpp:36
Definition: subview.hpp:23
void newGameRequest()
void abortOperation(int type)
Definition: view.cpp:892
Definition: setting.hpp:22
void verify()
Definition: view.cpp:707
void addSoundsResSubView()
Definition: view.cpp:842
void addCellsSubView()
Definition: view.cpp:767
void moveScrollBarToEnd(int min, int max)
Definition: view.cpp:650
void exitApplicationRequest(CSVDoc::View *view)
void toggleShowStatusBar(bool show)
Definition: view.cpp:920
void addGlobalsSubView()
Definition: view.cpp:712
Definition: document.hpp:57
void exit()
Definition: view.cpp:903
QMainWindow mSubViewWindow
Definition: view.hpp:55
QAction * mRedo
Definition: view.hpp:46
void addMagicEffectsSubView()
Definition: view.cpp:847
void addSoundsSubView()
Definition: view.cpp:742
void addTexturesSubView()
Definition: view.cpp:852
void setupAssetsMenu()
Definition: view.cpp:283
QAction * mUndo
Definition: view.hpp:45
int mViewIndex
Definition: view.hpp:42
void updateWidth(bool isGrowLimit, int minSubViewWidth)
Definition: view.cpp:990
void addMusicsSubView()
Definition: view.cpp:837
void addSoundGensSubView()
Definition: view.cpp:822
const CSMDoc::Document * getDocument() const
Definition: view.cpp:509
void editSettingsRequest()
void addSubView(const CSMWorld::UniversalId &id, const std::string &hint="")
Definition: view.cpp:555
void setupWorldMenu()
Definition: view.cpp:151
CSMDoc::Document * mDocument
Definition: view.hpp:41
void addBirthsignsSubView()
Definition: view.cpp:757
void addGmstsSubView()
Definition: view.cpp:717
void toggleStatusBar(bool checked)
Definition: view.cpp:929
void resizeViewWidth(int width)
User preference function.
Definition: view.cpp:908
void setupEditMenu()
Definition: view.cpp:104
void newView()
Definition: view.cpp:697
void addJournalsSubView()
Definition: view.cpp:797
void addSkillsSubView()
Definition: view.cpp:722
View & operator=(const View &)
void updateScrollbar()
Definition: view.cpp:962
void updateProgress(int current, int max, int type, int threads)
Definition: view.cpp:550
QAction * mStopDebug
Definition: view.hpp:50
SubViewFactoryManager mSubViewFactory
Definition: view.hpp:54
void newAddonRequest()
void addRegionMapSubView()
Definition: view.cpp:782
void setupMechanicsMenu()
Definition: view.cpp:188
void addVideosSubView()
Definition: view.cpp:857
void updateDocumentState()
Definition: view.cpp:526
View(const View &)
void addSearchSubView()
Definition: view.cpp:882
void addEnchantmentsSubView()
Definition: view.cpp:812
const char * name
Definition: crashcatcher.cpp:59
Definition: universalid.hpp:12