1 // Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2011 Roland WINKLMEIER <roland.m.winklmeier@gmail.com>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef BNP_MANAGER_PLUGIN_H
18 #define BNP_MANAGER_PLUGIN_H
21 #include "../../extension_system/iplugin.h"
22 #include "../core/icontext.h"
23 #include "bnp_manager_window.h"
26 #include "nel/misc/app_context.h"
27 #include <nel/misc/debug.h>
30 #include <QtCore/QObject>
31 #include <QtGui/QIcon>
35 class CLibraryContext
;
38 namespace ExtensionSystem
45 class m_BnpManagerWindow
;
47 class BNPManagerPlugin
: public QObject
, public ExtensionSystem::IPlugin
50 Q_INTERFACES(ExtensionSystem::IPlugin
)
54 virtual ~BNPManagerPlugin();
56 virtual bool initialize(ExtensionSystem::IPluginManager
*pluginManager
, QString
*errorString
);
57 virtual void extensionsInitialized();
58 virtual void shutdown();
59 virtual void setNelContext(NLMISC::INelContext
*nelContext
);
61 void addAutoReleasedObject(QObject
*obj
);
65 NLMISC::CLibraryContext
*m_libContext
;
69 ExtensionSystem::IPluginManager
*m_plugMan
;
70 QList
<QObject
*> m_autoReleaseObjects
;
74 * Implementation of the IContext interface
79 class BNPManagerContext
: public Core::IContext
85 BNPManagerContext(QObject
*parent
= 0) : IContext(parent
)
87 // run new manager window app
88 m_BnpManagerWindow
= new BNPManagerWindow();
92 virtual ~BNPManagerContext() {}
94 virtual QString
id() const
96 return QLatin1String("BNPManagerContext");
98 virtual QString
trName() const
100 return tr("BNP Manager");
102 virtual QIcon
icon() const
104 return QIcon(":/images/ic_nel_bnp_make.png");
109 m_BnpManagerWindow
->open();
112 virtual QUndoStack
*undoStack()
114 return m_BnpManagerWindow
->m_undoStack
;
117 virtual QWidget
*widget()
119 return m_BnpManagerWindow
;
122 BNPManagerWindow
*m_BnpManagerWindow
;
126 } // namespace Plugin
130 #endif // BNP_MANAGER_PLUGIN_H