Linux multi-monitor fullscreen support
[ryzomcore.git] / studio / src / plugins / bnp_manager / bnp_manager_plugin.h
blob4736a4b99fae4caaf6aaf92ecb0d4f2f3b6e2658
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>
3 //
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.
8 //
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
20 // Project includes
21 #include "../../extension_system/iplugin.h"
22 #include "../core/icontext.h"
23 #include "bnp_manager_window.h"
25 // NeL includes
26 #include "nel/misc/app_context.h"
27 #include <nel/misc/debug.h>
29 // Qt includes
30 #include <QtCore/QObject>
31 #include <QtGui/QIcon>
33 namespace NLMISC
35 class CLibraryContext;
38 namespace ExtensionSystem
40 class IPluginSpec;
43 namespace BNPManager
45 class m_BnpManagerWindow;
47 class BNPManagerPlugin : public QObject, public ExtensionSystem::IPlugin
49 Q_OBJECT
50 Q_INTERFACES(ExtensionSystem::IPlugin)
52 public:
53 BNPManagerPlugin();
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);
63 protected:
65 NLMISC::CLibraryContext *m_libContext;
67 private:
69 ExtensionSystem::IPluginManager *m_plugMan;
70 QList<QObject *> m_autoReleaseObjects;
73 /**
74 * Implementation of the IContext interface
76 * \date 2011
79 class BNPManagerContext : public Core::IContext
81 Q_OBJECT
83 public:
84 // Constructor
85 BNPManagerContext(QObject *parent = 0) : IContext(parent)
87 // run new manager window app
88 m_BnpManagerWindow = new BNPManagerWindow();
91 // Destructor
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");
107 virtual void open()
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