New lua versions
[ryzomcore.git] / studio / src / plugins / mission_compiler / mission_compiler_plugin.h
blobcc2cac47c03784e031887758c65def0f342d241c
1 #ifndef MISSION_COMPILER_PLUGIN_H
2 #define MISSION_COMPILER_PLUGIN_H
4 // Project includes
5 #include "../../extension_system/iplugin.h"
6 #include "../core/icontext.h"
7 #include "mission_compiler_main_window.h"
9 // NeL includes
10 #include <nel/misc/app_context.h>
11 #include <nel/misc/singleton.h>
13 // Qt includes
14 #include <QtCore/QObject>
15 #include <QtGui/QIcon>
17 namespace NLMISC
19 class CLibraryContext;
22 namespace ExtensionSystem
24 class IPluginSpec;
27 namespace MissionCompiler
30 class MissionCompilerPlugin : public QObject, public ExtensionSystem::IPlugin
32 Q_OBJECT
33 Q_INTERFACES(ExtensionSystem::IPlugin)
34 public:
36 virtual ~MissionCompilerPlugin();
38 bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
39 void extensionsInitialized();
40 void setNelContext(NLMISC::INelContext *nelContext);
42 void addAutoReleasedObject(QObject *obj);
44 protected:
45 NLMISC::CLibraryContext *m_LibContext;
47 private:
48 ExtensionSystem::IPluginManager *m_plugMan;
49 QList<QObject *> m_autoReleaseObjects;
52 class CMissionCompilerContext: public Core::IContext
54 Q_OBJECT
55 public:
56 CMissionCompilerContext(QObject *parent = 0): IContext(parent)
58 m_missionCompilerMainWindow = new MissionCompilerMainWindow();
60 virtual ~CMissionCompilerContext() {}
62 virtual QString id() const
64 return QLatin1String("MissionCompilerContext");
66 virtual QString trName() const
68 return tr("Mission Compiler");
70 virtual QIcon icon() const
72 return QIcon();
74 virtual QWidget *widget()
76 return m_missionCompilerMainWindow;
79 virtual QUndoStack *undoStack()
81 return m_missionCompilerMainWindow->getUndoStack();
83 virtual void open() {}
86 void onActivated()
88 m_missionCompilerMainWindow->onActivated();
92 MissionCompilerMainWindow *m_missionCompilerMainWindow;
95 } // namespace MissionCompiler
97 #endif // MISSION_COMPILER_PLUGIN_H