itom 1.0.14
|
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 /* content */ 00031 00033 // without causing many circular includes. 00034 class AppManagement 00035 { 00036 public: 00037 static QString getSettingsFile(); 00038 00039 inline static QObject* getScriptEditorOrganizer() { QMutexLocker locker(&m_mutex); return m_sew; } 00040 inline static QObject* getPythonEngine() { QMutexLocker locker(&m_mutex); return m_pe; } 00042 inline static QObject* getPaletteOrganizer() { QMutexLocker locker(&m_mutex); return m_plo; } 00043 inline static QObject* getDesignerWidgetOrganizer() { QMutexLocker locker(&m_mutex); return m_dwo; } 00045 inline static QObject* getMainApplication() { QMutexLocker locker (&m_mutex); return m_app; } 00046 static QObject* getAddinManager(); 00047 inline static QObject* getMainWindow() { QMutexLocker locker (&m_mutex); return m_mainWin; } 00048 inline static QObject* getUiOrganizer() { QMutexLocker locker (&m_mutex); return m_uiOrganizer; } 00049 inline static QObject* getProcessOrganizer() { QMutexLocker locker (&m_mutex); return m_processOrganizer; } 00050 inline static QObject* getUserOrganizer() { QMutexLocker locker (&m_mutex); return m_userOrganizer; } 00051 00052 00053 static void setScriptEditorOrganizer(QObject* scriptEditorOrganizer) 00054 { 00055 QMutexLocker locker(&m_mutex); 00056 m_sew = scriptEditorOrganizer; 00057 } 00058 00059 static void setPythonEngine(QObject* pythonEngine) 00060 { 00061 QMutexLocker locker(&m_mutex); 00062 m_pe = pythonEngine; 00063 } 00064 00065 static void setPaletteOrganizer(QObject* paletteOrganizer) 00066 { 00067 QMutexLocker locker(&m_mutex); 00068 m_plo = paletteOrganizer; 00069 } 00070 00071 static void setDesignerWidgetOrganizer(QObject* designerWidgetOrganizer) 00072 { 00073 QMutexLocker locker(&m_mutex); 00074 m_dwo = designerWidgetOrganizer; 00075 } 00076 00077 static void setMainApplication(QObject* mainApplication) 00078 { 00079 QMutexLocker locker(&m_mutex); 00080 m_app = mainApplication; 00081 } 00082 00083 static void setMainWindow(QObject* mainWindow) 00084 { 00085 QMutexLocker locker(&m_mutex); 00086 m_mainWin = mainWindow; 00087 } 00088 00089 static void setUiOrganizer(QObject* uiOrganizer) 00090 { 00091 QMutexLocker locker(&m_mutex); 00092 m_uiOrganizer = uiOrganizer; 00093 } 00094 00095 static void setProcessOrganizer(QObject* processOrganizer) 00096 { 00097 QMutexLocker locker(&m_mutex); 00098 m_processOrganizer = processOrganizer; 00099 } 00100 00101 static void setUserOrganizer(QObject* userOrganizer) 00102 { 00103 QMutexLocker locker(&m_mutex); 00104 m_userOrganizer = userOrganizer; 00105 } 00106 00107 private: 00108 static QObject* m_sew; 00109 static QObject* m_pe; 00110 static QObject* m_dwo; 00111 static QObject* m_plo; 00112 static QObject* m_app; 00113 static QObject* m_mainWin; 00114 static QObject* m_uiOrganizer; 00115 static QObject* m_processOrganizer; 00116 static QObject *m_userOrganizer; 00117 static QMutex m_mutex; 00119 }; 00120 00121 #endif // APPMANAGEMENT_H