New lua versions
[ryzomcore.git] / studio / src / plugins / translation_manager / translation_manager_plugin.h
blob0b3fb1f1e42078f4347f08f82954e965ceb4a2c2
1 // Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2011 Emanuel COSTEA <cemycc@gmail.com>
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Winch Gate Property Limited
6 // Copyright (C) 2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
7 //
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef TRANSLATION_MANAGER_PLUGIN_H
22 #define TRANSLATION_MANAGER_PLUGIN_H
24 // Project includes
25 #include "../../extension_system/iplugin.h"
26 #include "../core/icontext.h"
27 #include "translation_manager_main_window.h"
29 // NeL includes
30 #include "nel/misc/app_context.h"
32 // Qt includes
33 #include <QtCore/QObject>
34 #include <QtGui/QIcon>
36 using namespace std;
38 namespace NLMISC
40 class CLibraryContext;
43 namespace ExtensionSystem
45 class IPluginSpec;
48 namespace TranslationManager
51 class CTranslationManagerContext;
53 class TranslationManagerPlugin : public QObject, public ExtensionSystem::IPlugin
55 Q_OBJECT
56 Q_INTERFACES(ExtensionSystem::IPlugin)
57 public:
58 virtual ~TranslationManagerPlugin();
60 bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
61 void extensionsInitialized();
63 void setNelContext(NLMISC::INelContext *nelContext);
64 void addAutoReleasedObject(QObject *obj);
66 protected:
67 NLMISC::CLibraryContext *_LibContext;
69 private:
70 ExtensionSystem::IPluginManager *_plugMan;
71 QList<QObject *> _autoReleaseObjects;
74 class CTranslationManagerContext: public Core::IContext
76 Q_OBJECT
78 public:
79 CTranslationManagerContext(CMainWindow *mainWindow, QObject *parent = 0): IContext(parent)
81 m_MainWindow = mainWindow;
84 virtual ~CTranslationManagerContext() {}
86 virtual QString id() const
88 return QLatin1String("TranslationManagerContext");
90 virtual QString trName() const
92 return tr("Translation Manager");
94 virtual QIcon icon() const
96 return QIcon();
98 virtual QWidget *widget()
100 return m_MainWindow;
102 virtual QUndoStack *undoStack()
104 return m_MainWindow->m_undoStack;
106 virtual void open()
111 CMainWindow *m_MainWindow;
116 #endif // TRANSLATION_MANAGER_PLUGIN_H