defuze.me  Client
guicore.hpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010
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 GuiCore;
00013 }
00014 
00015 #ifndef GUICORE_HPP
00016 #define GUICORE_HPP
00017 
00018 #include "core.hpp"
00019 #include "mainwindow.hpp"
00020 #include "parameterizable.hpp"
00021 #include "uiconfiguration.hpp"
00022 #include "modulefactory.hpp"
00023 #include "about.hpp"
00024 #include <QtCore/QList>
00025 
00026 
00027 namespace Gui
00028 {
00029     class ParametersModule;
00030 
00034     class GuiCore : public Params::Parameterizable, public Core
00035     {
00036         Q_OBJECT
00037         friend void Module::submitForDisplay();
00038 
00039         enum TAB_INDEX
00040         {
00041             BROADCAST = 0,
00042             SCHEDUELING = 1,
00043             SOCIAL = 2
00044         };
00045 
00046     public:
00047         GuiCore(QStringList &arguments);
00048         ~GuiCore();
00049         void                    init(Cores *cores);
00050         void                    aboutToQuit();
00051         void                    popup(QWidget* window);                                             
00052         MainWindow*             getMainWindow();
00053         ParametersModule*       getParametersModule() const;
00054         void                    toogleParametersModule();
00055         void                    showAll();
00056         About*                  getAboutDialog() const;
00057 
00058     signals:
00059         void                    showPopups();
00060 
00061     private:
00062         void                    addModule(Module *module);
00063         void                    addPendingModules();
00064 
00065         void                    addTab(const QString &title, const QString &icon, bool active = false);
00066         Tab*                    currentTab() const;
00067         Tab*                    getTab(TAB_INDEX tabIndex) const;
00068         QList<Tab*>             tabs;
00069 
00070         MainWindow              *mainWindow;                                                        
00071         About                   *aboutDialog;
00072         UiConfiguration         *uiConfiguration;                                                   
00073         bool                    readyToAddModules;
00074         QList<Module*>          pendingModules;
00075         ParametersModule        *parametersModule;
00076 
00077         void                    defineParams();
00078     };
00079 }
00080 
00081 #endif // GUICORE_HPP