defuze.me  Client
modulefactory.hpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010-2011
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 namespace Gui {
00012     class ModuleFactory;
00013 }
00014 
00015 #ifndef MODULEFACTORY_HPP
00016 #define MODULEFACTORY_HPP
00017 
00018 #include <QtCore/QHash>
00019 #include <QWidget>
00020 #include "module.hpp"
00021 
00022 namespace Gui
00023 {
00028     class ModuleFactory
00029     {
00030         friend class GuiCore;
00031         friend class Module;
00032 
00033     public:
00034         static Module*                  create(const QString uniqName,
00035                                                QPoint position,
00036                                                ModuleWidget *widget,
00037                                                int tabIndex = 0);
00038         static Module*                  getModule(const QString& uniqId);
00039 
00040     private:
00041         ModuleFactory();
00042         static void                     initModuleFactory(GuiCore *_guiCore);
00043         static QHash<QString, Module*>  modules;
00044         static GuiCore*                 guiCore;
00045     };
00046 }
00047 
00048 #endif // MODULEFACTORY_HPP