Fix game:addSpawnShapesByZone
[ryzomcore.git] / studio / src / plugins / core / context_manager.h
bloba4c15957e6b41602ead450916f59ea116abb3a3c
1 // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
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 CONTEXT_MANAGER_H
22 #define CONTEXT_MANAGER_H
24 // Project includes
25 #include "core_global.h"
27 // Qt includes
28 #include <QtCore/QObject>
30 QT_BEGIN_NAMESPACE
31 class QTabWidget;
32 class QUndoStack;
33 QT_END_NAMESPACE
35 namespace Core
37 class IContext;
38 class MainWindow;
39 struct ContextManagerPrivate;
41 class CORE_EXPORT ContextManager : public QObject
43 Q_OBJECT
45 public:
46 explicit ContextManager(Core::MainWindow *mainWindow, QTabWidget *tabWidget);
47 virtual ~ContextManager();
49 Core::IContext *currentContext() const;
50 Core::IContext *context(const QString &id) const;
52 // temporary solution for multiple undo stacks per context
53 void registerUndoStack(QUndoStack *stack);
54 void unregisterUndoStack(QUndoStack *stack);
56 Q_SIGNALS:
57 void currentContextChanged(Core::IContext *context);
59 public Q_SLOTS:
60 void activateContext(const QString &id);
61 void updateCurrentContext();
63 private Q_SLOTS:
64 void objectAdded(QObject *obj);
65 void aboutToRemoveObject(QObject *obj);
66 void addContextObject(IContext *context);
67 void removeContextObject(IContext *context);
68 void currentTabChanged(int index);
70 private:
71 int indexOf(const QString &id) const;
73 ContextManagerPrivate *d;
76 } // namespace Core
78 #endif // CONTEXT_MANAGER_H