itom 2.0.0
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 #include "python/pythonEngineInc.h"
00027 #include "organizer/scriptEditorOrganizer.h"
00028 #include "organizer/paletteOrganizer.h"
00029 #include "organizer/uiOrganizer.h"
00030 #include "organizer/processOrganizer.h"
00031 #include "organizer/designerWidgetOrganizer.h"
00032 //
00033 #include "widgets/mainWindow.h"
00034 
00035 #include <qtranslator.h>
00036 
00037 //using namespace ito;
00038 class QSplashScreen;
00039 
00040 namespace ito
00041 {
00042 
00043 class MainApplication : public QObject
00044 {
00045     Q_OBJECT
00046 
00047     public:
00048         enum tGuiType { standard, console, none };          
00050         MainApplication(tGuiType guiType = standard);
00051         ~MainApplication();
00052 
00053         int loadSettings(const QString userName = "");
00054         void setupApplication();
00055         void finalizeApplication();
00056 
00057         int exec();
00058         int execPipManagerOnly();
00059 
00060         inline ScriptEditorOrganizer* getScriptEditorOrganizer() { return m_scriptEditorOrganizer; } 
00062         static MainApplication* instance();
00063 
00064     protected:
00065         void registerMetaObjects();
00066 
00067     private:
00068         tGuiType m_guiType;                                   
00070         QThread* m_pyThread;                                  
00071         PythonEngine* m_pyEngine;                             
00073         ScriptEditorOrganizer* m_scriptEditorOrganizer;       
00074         MainWindow* m_mainWin;                                
00076         static MainApplication* mainApplicationInstance;      
00077         PaletteOrganizer* m_paletteOrganizer;                 
00078         UiOrganizer* m_uiOrganizer;                           
00079         DesignerWidgetOrganizer* m_designerWidgetOrganizer;   
00081         ito::ProcessOrganizer* m_processOrganizer;            
00082 //        bool m_hasGIL;                                        /*!< python global interpreter lock GIL */
00083 
00084         QTranslator m_Translator;                             
00085         QTranslator m_qtTranslator;
00086         QTranslator m_commonQtTranslator;
00087 
00088         QSplashScreen *m_splashScreen;
00089 
00090     signals:
00091         void propertiesChanged();
00092 
00093     private slots:
00094 
00095     public slots:
00096         void _propertiesChanged() { emit propertiesChanged(); }
00097         void mainWindowCloseRequest();
00098 };
00099 
00100 } //end namespace ito
00101 
00102 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends