New lua versions
[ryzomcore.git] / studio / src / plugins / object_viewer / object_viewer_plugin.h
blob5018501bf22cbd357f1d0d8aba2a5cb0221b37c5
1 #ifndef OBJECT_VIEWER_PLUGIN_H
2 #define OBJECT_VIEWER_PLUGIN_H
4 // Project includes
5 #include "../../extension_system/iplugin.h"
6 #include "../core/icontext.h"
8 // NeL includes
9 #include "nel/misc/app_context.h"
11 // Qt includes
12 #include <QtCore/QObject>
13 #include <QtGui/QIcon>
15 namespace NLMISC
17 class CLibraryContext;
20 namespace ExtensionSystem
22 class IPluginSpec;
25 namespace NLQT
28 class ObjectViewerPlugin : public QObject, public ExtensionSystem::IPlugin
30 Q_OBJECT
31 Q_INTERFACES(ExtensionSystem::IPlugin)
32 public:
34 virtual ~ObjectViewerPlugin();
36 bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
37 void extensionsInitialized();
38 void shutdown();
39 void setNelContext(NLMISC::INelContext *nelContext);
41 void addAutoReleasedObject(QObject *obj);
43 protected:
44 NLMISC::CLibraryContext *_LibContext;
46 private:
47 ExtensionSystem::IPluginManager *_plugMan;
48 QList<QObject *> _autoReleaseObjects;
51 class CObjectViewerContext: public Core::IContext
53 Q_OBJECT
54 public:
55 CObjectViewerContext(QObject *parent = 0): IContext(parent) {}
56 virtual ~CObjectViewerContext() {}
58 virtual QString id() const
60 return QLatin1String("ObjectViewer");
63 virtual QString trName() const
65 return tr("Object Viewer");
68 virtual QIcon icon() const
70 return QIcon(":/icons/ic_nel_pill.png");
73 virtual QUndoStack *undoStack();
75 virtual void open();
77 virtual QWidget *widget();
80 } // namespace NLQT
82 #endif // OBJECT_VIEWER_PLUGIN_H