Fix game:addSpawnShapesByZone
[ryzomcore.git] / studio / src / plugins / example / example_plugin.h
blobbfb400651e3e52aee95acafd9f23791640c695e2
1 #ifndef PLUGIN1_H
2 #define PLUGIN1_H
4 // Project includes
5 #include "../../extension_system/iplugin.h"
6 #include "../core/icontext.h"
7 #include "simple_viewer.h"
9 // NeL includes
10 #include "nel/misc/app_context.h"
12 // Qt includes
13 #include <QtCore/QObject>
14 #include <QtGui/QIcon>
16 namespace NLMISC
18 class CLibraryContext;
21 namespace Plugin
24 class ExamplePlugin : public QObject, public ExtensionSystem::IPlugin
26 Q_OBJECT
27 Q_INTERFACES(ExtensionSystem::IPlugin)
28 public:
29 ExamplePlugin();
30 virtual ~ExamplePlugin();
32 bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
33 void extensionsInitialized();
34 void setNelContext(NLMISC::INelContext *nelContext);
36 void addAutoReleasedObject(QObject *obj);
38 protected:
39 NLMISC::CLibraryContext *m_LibContext;
41 private:
42 ExtensionSystem::IPluginManager *m_plugMan;
43 QList<QObject *> m_autoReleaseObjects;
46 class ExampleContext: public Core::IContext
48 Q_OBJECT
49 public:
50 ExampleContext(QObject *parent = 0): IContext(parent)
52 m_simpleViewer = new SimpleViewer();
55 virtual ~ExampleContext() {}
57 virtual QString id() const
59 return QLatin1String("ExampleContext");
61 virtual QString trName() const
63 return tr("SimpleViewer");
65 virtual QIcon icon() const
67 return QIcon();
69 virtual QWidget *widget()
71 return m_simpleViewer;
74 virtual QUndoStack *undoStack()
76 return m_simpleViewer->m_undoStack;
79 virtual void open()
83 SimpleViewer *m_simpleViewer;
86 } // namespace Plugin
88 #endif // PLUGIN1_H