1 #ifndef MISSION_COMPILER_PLUGIN_H
2 #define MISSION_COMPILER_PLUGIN_H
5 #include "../../extension_system/iplugin.h"
6 #include "../core/icontext.h"
7 #include "mission_compiler_main_window.h"
10 #include <nel/misc/app_context.h>
11 #include <nel/misc/singleton.h>
14 #include <QtCore/QObject>
15 #include <QtGui/QIcon>
19 class CLibraryContext
;
22 namespace ExtensionSystem
27 namespace MissionCompiler
30 class MissionCompilerPlugin
: public QObject
, public ExtensionSystem::IPlugin
33 Q_INTERFACES(ExtensionSystem::IPlugin
)
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
);
45 NLMISC::CLibraryContext
*m_LibContext
;
48 ExtensionSystem::IPluginManager
*m_plugMan
;
49 QList
<QObject
*> m_autoReleaseObjects
;
52 class CMissionCompilerContext
: public Core::IContext
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
74 virtual QWidget
*widget()
76 return m_missionCompilerMainWindow
;
79 virtual QUndoStack
*undoStack()
81 return m_missionCompilerMainWindow
->getUndoStack();
83 virtual void open() {}
88 m_missionCompilerMainWindow
->onActivated();
92 MissionCompilerMainWindow
*m_missionCompilerMainWindow
;
95 } // namespace MissionCompiler
97 #endif // MISSION_COMPILER_PLUGIN_H