OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
viewmanager.hpp
Go to the documentation of this file.
1 #ifndef CSV_DOC_VIEWMANAGER_H
2 #define CSV_DOC_VIEWMANAGER_H
3 
4 #include <vector>
5 
6 #include <QObject>
7 
8 #include "loader.hpp"
9 
10 namespace CSMDoc
11 {
12  class Document;
13  class DocumentManager;
14 }
15 
16 namespace CSVWorld
17 {
19 }
20 
21 namespace CSMWorld
22 {
23  class UniversalId;
24 }
25 
26 namespace CSVDoc
27 {
28  class View;
29 
30  class ViewManager : public QObject
31  {
32  Q_OBJECT
33 
35  std::vector<View *> mViews;
40 
41  // not implemented
42  ViewManager (const ViewManager&);
44 
45  void updateIndices();
46  bool notifySaveOnClose (View *view = 0);
49  bool removeDocument(View *view);
50 
51  public:
52 
53  ViewManager (CSMDoc::DocumentManager& documentManager);
54 
55  virtual ~ViewManager();
56 
57  View *addView (CSMDoc::Document *document);
59 
60  View *addView (CSMDoc::Document *document, const CSMWorld::UniversalId& id, const std::string& hint);
61 
62  int countViews (const CSMDoc::Document *document) const;
64 
65  bool closeRequest (View *view);
66  void removeDocAndView (CSMDoc::Document *document);
67 
68  signals:
69 
70  void newGameRequest();
71 
72  void newAddonRequest();
73 
74  void loadDocumentRequest();
75 
76  void closeMessageBox();
77 
78  void editSettingsRequest();
79 
80  void mergeDocument (CSMDoc::Document *document);
81 
82  public slots:
83 
84  void exitApplication (CSVDoc::View *view);
85 
86  private slots:
87 
88  void documentStateChanged (int state, CSMDoc::Document *document);
89 
90  void progress (int current, int max, int type, int threads, CSMDoc::Document *document);
91 
92  void onExitWarningHandler(int state, CSMDoc::Document* document);
93  };
94 
95 }
96 
97 #endif
Definition: viewmanager.hpp:30
View * addView(CSMDoc::Document *document)
The ownership of the returned view is not transferred.
Definition: viewmanager.cpp:152
virtual ~ViewManager()
Definition: viewmanager.cpp:144
static const struct @2 signals[]
bool closeRequest(View *view)
Definition: viewmanager.cpp:201
void mergeDocument(CSMDoc::Document *document)
bool showSaveInProgressMessageBox(View *view)
Definition: viewmanager.cpp:314
CSVWorld::CommandDelegateFactoryCollection * mDelegateFactories
Definition: viewmanager.hpp:36
bool showModifiedDocumentMessageBox(View *view)
Definition: viewmanager.cpp:259
Definition: documentmanager.hpp:33
ViewManager(const ViewManager &)
int countViews(const CSMDoc::Document *document) const
Return number of views for document.
Definition: viewmanager.cpp:190
void exitApplication(CSVDoc::View *view)
Definition: viewmanager.cpp:421
CSMDoc::DocumentManager & mDocumentManager
Definition: viewmanager.hpp:34
Use commands instead of manipulating the model directly.
Definition: util.hpp:65
void documentStateChanged(int state, CSMDoc::Document *document)
Definition: viewmanager.cpp:368
Definition: loader.hpp:68
void progress(int current, int max, int type, int threads, CSMDoc::Document *document)
Definition: viewmanager.cpp:375
void removeDocAndView(CSMDoc::Document *document)
Definition: viewmanager.cpp:226
bool mExitOnSaveStateChange
Definition: viewmanager.hpp:37
bool mUserWarned
Definition: viewmanager.hpp:38
void updateIndices()
Definition: viewmanager.cpp:29
Definition: view.hpp:36
bool removeDocument(View *view)
Definition: viewmanager.cpp:398
Definition: document.hpp:57
bool notifySaveOnClose(View *view=0)
Definition: viewmanager.cpp:243
ViewManager & operator=(const ViewManager &)
Loader mLoader
Definition: viewmanager.hpp:39
void onExitWarningHandler(int state, CSMDoc::Document *document)
Definition: viewmanager.cpp:382
std::vector< View * > mViews
Definition: viewmanager.hpp:35
Definition: universalid.hpp:12