SilentEye 0.4.1

modulemanager.h

Go to the documentation of this file.
00001 //  This file is part of SilentEye.
00002 //
00003 //  SilentEye is free software: you can redistribute it and/or modify
00004 //  it under the terms of the GNU General Public License as published by
00005 //  the Free Software Foundation, either version 3 of the License, or
00006 //  (at your option) any later version.
00007 //
00008 //  SilentEye is distributed in the hope that it will be useful,
00009 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //  GNU General Public License for more details.
00012 //
00013 //  You should have received a copy of the GNU General Public License
00014 //  along with SilentEye. If not, see <http://www.gnu.org/licenses/>.
00015 
00016 #ifndef MODULEMANAGER_H_
00017 #define MODULEMANAGER_H_
00018 
00019 #include <QtCore>
00020 #include <moduleinterface.h>
00021 #include <formatmoduleinterface.h>
00022 #include <cryptomoduleinterface.h>
00023 #include <logger.h>
00024 
00025 using namespace SilentEyeFramework;
00026 
00027 #ifdef QT_STATICPLUGIN
00028     Q_IMPORT_PLUGIN(secryptoaes)
00029     Q_IMPORT_PLUGIN(secryptoaes256)
00030     Q_IMPORT_PLUGIN(seformatbmp)
00031     Q_IMPORT_PLUGIN(seformatjpeg)
00032     Q_IMPORT_PLUGIN(seformatwav)
00033 #endif
00034 
00035 namespace SilentEye {
00036 
00038     class ModuleManager
00039     {
00040     public:
00041         enum Category{ IMAGEFORMAT, AUDIOFORMAT, VIDEOFORMAT, CRYPTO, C_UNDEF };
00042 
00043     private:
00044         static Logger m_logger;
00045         static QMap<Category, QMap<QString, ModuleInterface*> > m_modulesMap;
00046         static QMap<QString, ModuleInterface*> m_emptyMap;
00047         static QList<ModuleInterface*> m_modulesList;
00048 
00049     public:
00050         static QList<ModuleInterface*>& getList();
00051         static QMap<QString, ModuleInterface*>& get(Category cat);
00052         static ModuleInterface* get(Category cat, QString type);
00053 
00054         static Category getCategory(ModuleInterface*);
00055 
00056         static int count();
00057         static int count(Category cat);
00058 
00059         static void load();
00060 
00061     private:
00062         static void loadPlugin(QObject*, QString="Unknown");
00063 
00064     };
00065 }
00066 
00067 #endif