itom
Loading...
Searching...
No Matches
AppManagement.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom.
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 itom is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17 General Public Licence for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with itom. If not, see <http://www.gnu.org/licenses/>.
21*********************************************************************** */
22
23#ifndef APPMANAGEMENT_H
24#define APPMANAGEMENT_H
25
26//#include <qstring.h>
27#include <qobject.h>
28#include <qmutex.h>
29
30namespace ito
31{
32
33/* content */
34
36// without causing many circular includes.
38{
39 public:
40 static QString getSettingsFile();
41
42 inline static QObject* getScriptEditorOrganizer() { QMutexLocker locker(&m_mutex); return m_sew; }
43 inline static QObject* getPythonEngine() { QMutexLocker locker(&m_mutex); return m_pe; }
44 inline static QObject* getPythonStatePublisher() { QMutexLocker locker(&m_mutex); return m_psp; }
46 inline static QObject* getPaletteOrganizer() { QMutexLocker locker(&m_mutex); return m_plo; }
47 inline static QObject* getDesignerWidgetOrganizer() { QMutexLocker locker(&m_mutex); return m_dwo; }
49 inline static QObject* getMainApplication() { QMutexLocker locker (&m_mutex); return m_app; }
50 inline static QObject* getAddInManager() { QMutexLocker locker(&m_mutex); return m_addInManager; }
51 inline static QObject* getMainWindow() { QMutexLocker locker (&m_mutex); return m_mainWin; }
52 inline static QObject* getUiOrganizer() { QMutexLocker locker (&m_mutex); return m_uiOrganizer; }
53 inline static QObject* getProcessOrganizer() { QMutexLocker locker (&m_mutex); return m_processOrganizer; }
54 inline static QObject* getUserOrganizer() { QMutexLocker locker (&m_mutex); return m_userOrganizer; }
55 inline static QObject* getCoutStream() { QMutexLocker locker (&m_mutex); return m_coutStream; }
56 inline static QObject* getCerrStream() { QMutexLocker locker (&m_mutex); return m_cerrStream; }
57 inline static QObject* getLogger() { QMutexLocker locker (&m_mutex); return m_logger; }
58
59
60 static void setScriptEditorOrganizer(QObject* scriptEditorOrganizer)
61 {
62 QMutexLocker locker(&m_mutex);
63 m_sew = scriptEditorOrganizer;
64 }
65
66 static void setAddInManager(QObject* addInManager)
67 {
68 QMutexLocker locker(&m_mutex);
69 m_addInManager = addInManager;
70 }
71
72 static void setPythonEngine(QObject* pythonEngine)
73 {
74 QMutexLocker locker(&m_mutex);
75 m_pe = pythonEngine;
76 }
77
78 static void setPythonStatePublisher(QObject* pythonStatePublisher)
79 {
80 QMutexLocker locker(&m_mutex);
81 m_psp = pythonStatePublisher;
82 }
83
84 static void setPaletteOrganizer(QObject* paletteOrganizer)
85 {
86 QMutexLocker locker(&m_mutex);
87 m_plo = paletteOrganizer;
88 }
89
90 static void setDesignerWidgetOrganizer(QObject* designerWidgetOrganizer)
91 {
92 QMutexLocker locker(&m_mutex);
93 m_dwo = designerWidgetOrganizer;
94 }
95
96 static void setMainApplication(QObject* mainApplication)
97 {
98 QMutexLocker locker(&m_mutex);
99 m_app = mainApplication;
100 }
101
102 static void setMainWindow(QObject* mainWindow)
103 {
104 QMutexLocker locker(&m_mutex);
105 m_mainWin = mainWindow;
106 }
107
108 static void setUiOrganizer(QObject* uiOrganizer)
109 {
110 QMutexLocker locker(&m_mutex);
111 m_uiOrganizer = uiOrganizer;
112 }
113
114 static void setProcessOrganizer(QObject* processOrganizer)
115 {
116 QMutexLocker locker(&m_mutex);
117 m_processOrganizer = processOrganizer;
118 }
119
120 static void setUserOrganizer(QObject* userOrganizer)
121 {
122 QMutexLocker locker(&m_mutex);
123 m_userOrganizer = userOrganizer;
124 }
125
126 static void setStdCoutCerrStreamRedirections(QObject* coutStream, QObject* cerrStream)
127 {
128 QMutexLocker locker(&m_mutex);
129 m_coutStream = coutStream;
130 m_cerrStream = cerrStream;
131 }
132
133 static void setLogger(QObject* logger)
134 {
135 QMutexLocker locker(&m_mutex);
136 m_logger = logger;
137 }
138
139 struct Timeouts
140 {
141 int pluginInitClose;
142 int pluginGeneral;
143 int pluginFileSaveLoad;
144 };
145
146 static Timeouts timeouts;
147
148 private:
149 static QObject* m_sew;
150 static QObject* m_pe;
151 static QObject* m_psp;
152 static QObject* m_dwo;
153 static QObject* m_plo;
154 static QObject* m_app;
155 static QObject* m_mainWin;
156 static QObject* m_addInManager;
157 static QObject* m_uiOrganizer;
158 static QObject* m_processOrganizer;
159 static QObject *m_userOrganizer;
160 static QObject* m_coutStream;
161 static QObject* m_cerrStream;
162 static QObject* m_logger;
164 static QMutex m_mutex;
166};
167
168} //end namespace ito
169
170#endif // APPMANAGEMENT_H
< AppManagement (in order to provide access to basic organizers, managers and other main components t...
Definition AppManagement.h:38
static QObject * m_sew
Definition AppManagement.h:149
static void setPaletteOrganizer(QObject *paletteOrganizer)
Definition AppManagement.h:84
static QObject * getPythonStatePublisher()
Definition AppManagement.h:44
static QObject * m_psp
Definition AppManagement.h:151
static void setAddInManager(QObject *addInManager)
Definition AppManagement.h:66
static QMutex m_mutex
Definition AppManagement.h:164
static void setScriptEditorOrganizer(QObject *scriptEditorOrganizer)
Definition AppManagement.h:60
static QObject * getScriptEditorOrganizer()
Definition AppManagement.h:42
static QObject * m_userOrganizer
Definition AppManagement.h:159
static QObject * m_coutStream
Definition AppManagement.h:160
static QObject * getPaletteOrganizer()
Definition AppManagement.h:46
static QObject * m_pe
Definition AppManagement.h:150
static QObject * getPythonEngine()
Definition AppManagement.h:43
static QObject * m_processOrganizer
Definition AppManagement.h:158
static void setPythonEngine(QObject *pythonEngine)
Definition AppManagement.h:72
static void setDesignerWidgetOrganizer(QObject *designerWidgetOrganizer)
Definition AppManagement.h:90
static QObject * getUiOrganizer()
Definition AppManagement.h:52
static QObject * m_app
Definition AppManagement.h:154
static QObject * getDesignerWidgetOrganizer()
Definition AppManagement.h:47
static QObject * m_plo
Definition AppManagement.h:153
static QObject * m_logger
Definition AppManagement.h:162
static void setPythonStatePublisher(QObject *pythonStatePublisher)
Definition AppManagement.h:78
static QObject * m_uiOrganizer
Definition AppManagement.h:157
static QObject * getProcessOrganizer()
Definition AppManagement.h:53
static QObject * m_dwo
Definition AppManagement.h:152
static QObject * m_cerrStream
Definition AppManagement.h:161
Definition apiFunctionsGraph.cpp:40
Definition AppManagement.h:140