itom 1.3.0
D:/git-itom/sources/itom/Qitom/AppManagement.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 APPMANAGEMENT_H
00024 #define APPMANAGEMENT_H
00025 
00026 //#include <qstring.h>
00027 #include <qobject.h>
00028 #include <qmutex.h>
00029 
00030 namespace ito
00031 {
00032 
00033 /* content */
00034 
00036 //   without causing many circular includes.
00037 class AppManagement
00038 {
00039     public:
00040         static QString getSettingsFile();
00041 
00042         inline static QObject* getScriptEditorOrganizer() { QMutexLocker locker(&m_mutex); return m_sew; } 
00043         inline static QObject* getPythonEngine() { QMutexLocker locker(&m_mutex); return m_pe; }           
00045         inline static QObject* getPaletteOrganizer() { QMutexLocker locker(&m_mutex); return m_plo; }        
00046         inline static QObject* getDesignerWidgetOrganizer() { QMutexLocker locker(&m_mutex); return m_dwo; }        
00048         inline static QObject* getMainApplication() { QMutexLocker locker (&m_mutex); return m_app; }
00049         static QObject* getAddInManager();
00050         inline static QObject* getMainWindow() { QMutexLocker locker (&m_mutex); return m_mainWin; }
00051         inline static QObject* getUiOrganizer() { QMutexLocker locker (&m_mutex); return m_uiOrganizer; }  
00052         inline static QObject* getProcessOrganizer() { QMutexLocker locker (&m_mutex); return m_processOrganizer; }  
00053         inline static QObject* getUserOrganizer() { QMutexLocker locker (&m_mutex); return m_userOrganizer; }
00054 
00055 
00056         static void setScriptEditorOrganizer(QObject* scriptEditorOrganizer)                                
00057         {
00058             QMutexLocker locker(&m_mutex);
00059             m_sew = scriptEditorOrganizer;
00060         }
00061 
00062         static void setPythonEngine(QObject* pythonEngine)                                                  
00063         {
00064             QMutexLocker locker(&m_mutex);
00065             m_pe = pythonEngine;
00066         }
00067 
00068         static void setPaletteOrganizer(QObject* paletteOrganizer)                                          
00069         {
00070             QMutexLocker locker(&m_mutex);
00071             m_plo = paletteOrganizer;
00072         }
00073 
00074         static void setDesignerWidgetOrganizer(QObject* designerWidgetOrganizer)                            
00075         {
00076             QMutexLocker locker(&m_mutex);
00077             m_dwo = designerWidgetOrganizer;
00078         }
00079 
00080         static void setMainApplication(QObject* mainApplication)
00081         {
00082             QMutexLocker locker(&m_mutex);
00083             m_app = mainApplication;
00084         }
00085 
00086         static void setMainWindow(QObject* mainWindow)
00087         {
00088             QMutexLocker locker(&m_mutex);
00089             m_mainWin = mainWindow;
00090         }    
00091 
00092         static void setUiOrganizer(QObject* uiOrganizer)
00093         {
00094             QMutexLocker locker(&m_mutex);
00095             m_uiOrganizer = uiOrganizer;
00096         }
00097 
00098         static void setProcessOrganizer(QObject* processOrganizer)
00099         {
00100             QMutexLocker locker(&m_mutex);
00101             m_processOrganizer = processOrganizer;
00102         }
00103 
00104         static void setUserOrganizer(QObject* userOrganizer)
00105         {
00106             QMutexLocker locker(&m_mutex);
00107             m_userOrganizer = userOrganizer;
00108         }
00109 
00110         struct Timeouts
00111         {
00112             int pluginInitClose;
00113             int pluginGeneral;
00114         };
00115 
00116         static Timeouts timeouts;
00117 
00118     private:
00119         static QObject* m_sew;  
00120         static QObject* m_pe;   
00121         static QObject* m_dwo;   
00122         static QObject* m_plo;   
00123         static QObject* m_app;  
00124         static QObject* m_mainWin;
00125         static QObject* m_uiOrganizer; 
00126         static QObject* m_processOrganizer; 
00127         static QObject *m_userOrganizer;    
00128         static QMutex m_mutex;  
00130 };
00131 
00132 } //end namespace ito
00133 
00134 #endif // APPMANAGEMENT_H
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends