itom 1.0.14
D:/git-itom/sources/itom/Qitom/mainApplication.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut für Technische Optik (ITO),
00005     Universität Stuttgart, Germany
00006 
00007     This file is part of itom.
00008   
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013 
00014     itom is distributed in the hope that it will be useful, but
00015     WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017     General Public Licence for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with itom. If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************** */
00022 
00023 #ifndef MAINAPPLICATION_H
00024 #define MAINAPPLICATION_H
00025 
00026 
00027 
00028 #include "python/pythonEngineInc.h"
00029 #include "organizer/scriptEditorOrganizer.h"
00030 #include "organizer/paletteOrganizer.h"
00031 #include "organizer/uiOrganizer.h"
00032 #include "organizer/processOrganizer.h"
00033 #include "organizer/designerWidgetOrganizer.h"
00034 //
00035 #include "widgets/mainWindow.h"
00036 
00037 #include <qtranslator.h>
00038 
00039 //using namespace ito;
00040 class QSplashScreen;
00041 
00042 class MainApplication : public QObject
00043 {
00044     Q_OBJECT
00045 
00046     public:
00047         enum tGuiType { standard, console, none };          
00049         MainApplication(tGuiType guiType = standard);
00050         ~MainApplication();
00051 
00052         int loadSettings(const QString userName = "");
00053         void setupApplication();
00054         void finalizeApplication();
00055 
00056         int exec();
00057 
00058         inline ScriptEditorOrganizer* getScriptEditorOrganizer() { return m_scriptEditorOrganizer; } 
00060         static MainApplication* instance();
00061 
00062     protected:
00063 
00064     private:
00065         tGuiType m_guiType;                                   
00067         QThread* m_pyThread;                                  
00068         PythonEngine* m_pyEngine;                             
00070         ScriptEditorOrganizer* m_scriptEditorOrganizer;       
00071         MainWindow* m_mainWin;                                
00073         static MainApplication* mainApplicationInstance;      
00074         PaletteOrganizer* m_paletteOrganizer;                 
00075         UiOrganizer* m_uiOrganizer;                           
00076         DesignerWidgetOrganizer* m_designerWidgetOrganizer;   
00078         ito::ProcessOrganizer* m_processOrganizer;            
00079 //        bool m_hasGIL;                                        /*!< python global interpreter lock GIL */
00080 
00081         QTranslator m_Translator;                             
00082         QTranslator m_qtTranslator;
00083 
00084         QSplashScreen *m_splashScreen;
00085 
00086     signals:
00087         void propertiesChanged();
00088 
00089 
00090     private slots:
00091 
00092     public slots:
00093         void _propertiesChanged() { emit propertiesChanged(); }
00094         void mainWindowCloseRequest();
00095 };
00096 
00097 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends