Fix game:addSpawnShapesByZone
[ryzomcore.git] / studio / src / plugins / core / main_window.h
blobba31aece4ef0de0a845db8a0565e0af3920d0a0c
1 // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Winch Gate Property Limited
6 // Copyright (C) 2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
7 //
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef MAIN_WINDOW_H
22 #define MAIN_WINDOW_H
24 // Project includes
25 #include "../../extension_system/iplugin_manager.h"
26 #include "plugin_view_dialog.h"
28 // STL includes
30 // Qt includes
31 #include <QtGui/QMainWindow>
32 #include <QtGui/QUndoGroup>
33 #include <QtCore/QSettings>
35 namespace Core
37 class CSettingsDialog;
38 class CorePlugin;
39 class IContext;
40 class MenuManager;
41 class ContextManager;
42 class CoreImpl;
44 class MainWindow : public QMainWindow
46 Q_OBJECT
48 public:
49 MainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget *parent = 0);
50 ~MainWindow();
52 bool initialize(QString *errorString);
53 void extensionsInitialized();
55 MenuManager *menuManager() const;
56 ContextManager *contextManager() const;
57 QSettings *settings() const;
58 QUndoGroup *undoGroup() const;
60 ExtensionSystem::IPluginManager *pluginManager() const;
62 void addContextObject(IContext *context);
63 void removeContextObject(IContext *context);
65 public Q_SLOTS:
66 bool showOptionsDialog(const QString &group = QString(),
67 const QString &page = QString(),
68 QWidget *parent = 0);
69 void updateContext(Core::IContext *context);
71 private Q_SLOTS:
72 void open();
73 void newFile();
74 void save();
75 void saveAs();
76 void saveAll();
77 void closeDocument();
78 void cut();
79 void copy();
80 void paste();
81 void del();
82 void find();
83 void gotoPos();
84 void setFullScreen(bool enabled);
85 void about();
87 protected:
88 virtual void closeEvent(QCloseEvent *event);
90 private:
91 void createActions();
92 void createMenus();
93 void createStatusBar();
94 void createDialogs();
96 void readSettings();
97 void writeSettings();
99 ExtensionSystem::IPluginManager *m_pluginManager;
100 PluginView *m_pluginView;
101 MenuManager *m_menuManager;
102 ContextManager *m_contextManager;
103 CoreImpl *m_coreImpl;
105 QPalette m_originalPalette;
106 QString m_lastDir;
108 QDockWidget *m_dockWidget;
109 QUndoGroup *m_undoGroup;
110 QSettings *m_settings;
112 QTimer *m_mainTimer;
113 QTimer *m_statusBarTimer;
115 QTabWidget *m_tabWidget;
117 QMenu *m_fileMenu;
118 QMenu *m_recentFilesMenu;
119 QMenu *m_editMenu;
120 QMenu *m_viewMenu;
121 QMenu *m_toolsMenu;
122 QMenu *m_helpMenu;
123 QMenuBar *m_menuBar;
124 QMenu *m_sheetMenu;
126 QAction *m_newAction;
127 QAction *m_openAction;
128 QAction *m_saveAction;
129 QAction *m_saveAsAction;
130 QAction *m_saveAllAction;
131 QAction *m_closeAction;
132 QAction *m_exitAction;
133 QAction *m_cutAction;
134 QAction *m_copyAction;
135 QAction *m_pasteAction;
136 QAction *m_delAction;
137 QAction *m_selectAllAction;
138 QAction *m_findAction;
139 QAction *m_gotoAction;
140 QAction *m_fullscreenAction;
141 QAction *m_settingsAction;
142 QAction *m_pluginViewAction;
143 QAction *m_aboutAction;
144 QAction *m_aboutQtAction;
146 };/* class MainWindow */
148 } /* namespace Core */
150 #endif // MAIN_WINDOW_H