5 #include "../../extension_system/iplugin.h"
6 #include "../core/icontext.h"
7 #include "simple_viewer.h"
10 #include "nel/misc/app_context.h"
13 #include <QtCore/QObject>
14 #include <QtGui/QIcon>
18 class CLibraryContext
;
24 class ExamplePlugin
: public QObject
, public ExtensionSystem::IPlugin
27 Q_INTERFACES(ExtensionSystem::IPlugin
)
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
);
39 NLMISC::CLibraryContext
*m_LibContext
;
42 ExtensionSystem::IPluginManager
*m_plugMan
;
43 QList
<QObject
*> m_autoReleaseObjects
;
46 class ExampleContext
: public Core::IContext
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
69 virtual QWidget
*widget()
71 return m_simpleViewer
;
74 virtual QUndoStack
*undoStack()
76 return m_simpleViewer
->m_undoStack
;
83 SimpleViewer
*m_simpleViewer
;