21 #ifndef __qSlicerCoreApplication_h 22 #define __qSlicerCoreApplication_h 25 #include <QApplication> 27 #include <QProcessEnvironment> 28 #include <QStringList> 32 #include <ctkVTKObject.h> 35 #include "vtkSlicerConfigure.h" 36 #include "qSlicerBaseQTCoreExport.h" 38 #ifdef Slicer_BUILD_DICOM_SUPPORT 39 class ctkDICOMDatabase;
44 class qSlicerCoreApplicationPrivate;
46 #ifdef Slicer_USE_PYTHONQT 48 class ctkPythonConsole;
50 #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT 66 Q_PROPERTY(QString slicerHome READ slicerHome CONSTANT)
70 Q_PROPERTY(QString defaultScenePath READ defaultScenePath WRITE setDefaultScenePath)
71 Q_PROPERTY(QString slicerSharePath READ slicerSharePath CONSTANT)
72 Q_PROPERTY(QString temporaryPath READ temporaryPath WRITE setTemporaryPath)
73 Q_PROPERTY(QString launcherExecutableFilePath READ launcherExecutableFilePath CONSTANT)
74 Q_PROPERTY(QString launcherSettingsFilePath READ launcherSettingsFilePath CONSTANT)
75 Q_PROPERTY(QString slicerDefaultSettingsFilePath READ slicerDefaultSettingsFilePath CONSTANT)
76 Q_PROPERTY(QString slicerUserSettingsFilePath READ slicerUserSettingsFilePath CONSTANT)
77 Q_PROPERTY(QString slicerRevisionUserSettingsFilePath READ slicerRevisionUserSettingsFilePath CONSTANT)
78 Q_PROPERTY(QString extensionsInstallPath READ extensionsInstallPath WRITE setExtensionsInstallPath)
79 Q_PROPERTY(QString intDir READ intDir CONSTANT)
80 Q_PROPERTY(
bool isInstalled READ isInstalled CONSTANT)
81 Q_PROPERTY(
bool isRelease READ isRelease CONSTANT)
82 Q_PROPERTY(QString releaseType READ releaseType CONSTANT)
83 Q_PROPERTY(QString repositoryUrl READ repositoryUrl CONSTANT)
84 Q_PROPERTY(QString repositoryBranch READ repositoryBranch CONSTANT)
85 Q_PROPERTY(QString repositoryRevision READ repositoryRevision CONSTANT)
86 Q_PROPERTY(
int majorVersion READ majorVersion CONSTANT)
87 Q_PROPERTY(
int minorVersion READ minorVersion CONSTANT)
88 Q_PROPERTY(QString platform READ platform CONSTANT)
89 Q_PROPERTY(QString arch READ arch CONSTANT)
90 Q_PROPERTY(QString os READ os CONSTANT)
98 static qSlicerCoreApplication* application();
104 AA_DisablePython = 1000,
130 Q_INVOKABLE QProcessEnvironment startupEnvironment()
const;
142 Q_INVOKABLE QProcessEnvironment environment()
const;
148 void setEnvironmentVariable(
const QString& key,
const QString& value);
151 bool isEnvironmentVariableValueSet(
const QString& key,
const QString& value);
155 void prependEnvironmentVariable(
const QString& key,
const QString& value, QChar separator =
';');
159 void appendEnvironmentVariable(
const QString& key,
const QString& value, QChar separator =
';');
163 void parseArguments(
bool& exitWhenDone);
166 ExitNotRequested = -1,
167 ExitSuccess = EXIT_SUCCESS,
168 ExitFailure = EXIT_FAILURE
175 int returnCode()
const;
185 QString slicerHome()
const;
191 QString defaultScenePath()
const;
194 void setDefaultScenePath(
const QString& path);
202 QString slicerSharePath()
const;
206 bool isEmbeddedModule(
const QString& moduleFileName)
const;
209 QString defaultTemporaryPath()
const;
212 QString temporaryPath()
const;
215 void setTemporaryPath(
const QString& path);
218 QString launcherExecutableFilePath()
const;
221 QString launcherSettingsFilePath()
const;
224 QString launcherRevisionSpecificUserSettingsFilePath()
const;
228 QString slicerDefaultSettingsFilePath()
const;
232 QString slicerUserSettingsFilePath()
const;
236 QString slicerRevisionUserSettingsFilePath()
const;
239 QString defaultExtensionsInstallPath()
const;
242 QString extensionsInstallPath()
const;
245 void setExtensionsInstallPath(
const QString& path);
249 QString intDir()
const;
252 bool isInstalled()
const;
257 QString releaseType()
const;
264 bool isRelease()
const;
270 Q_INVOKABLE
void addModuleAssociatedNodeType(
const QString& nodeClassName,
const QString& moduleName);
273 Q_INVOKABLE
void removeModuleAssociatedNodeType(
const QString& nodeClassName,
const QString& moduleName);
276 Q_INVOKABLE QStringList modulesAssociatedWithNodeType(
const QString& nodeClassName)
const;
279 Q_INVOKABLE QStringList allModuleAssociatedNodeTypes()
const;
281 #ifdef Slicer_USE_PYTHONQT 290 ctkPythonConsole* pythonConsole()
const;
296 void setPythonConsole(ctkPythonConsole* pythonConsole);
300 #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT 328 Q_INVOKABLE QSettings* defaultSettings()
const;
333 Q_INVOKABLE QSettings* userSettings()
const;
338 Q_INVOKABLE QSettings* settings()
const;
343 Q_INVOKABLE QSettings* revisionUserSettings()
const;
346 virtual QString copyrights()
const;
349 virtual QString acknowledgment()
const;
352 virtual QString libraries()
const;
356 QString repositoryUrl()
const;
360 QString repositoryBranch()
const;
364 QString repositoryRevision()
const;
367 int majorVersion()
const;
370 int minorVersion()
const;
374 QString platform()
const;
384 #ifdef Slicer_BUILD_DICOM_SUPPORT 385 Q_INVOKABLE ctkDICOMDatabase* dicomDatabase()
const;
390 Q_INVOKABLE
void setDICOMDatabase(ctkDICOMDatabase* dicomDatabase);
393 static void loadTranslations(
const QString& dir);
395 static void loadLanguage();
401 static bool loadCaCertificates(
const QString& slicerHome);
403 Q_INVOKABLE
int registerResource(
const QByteArray& data);
409 static void restart();
411 bool unregisterResource(
int handle);
415 virtual void handlePreApplicationCommandLineArguments();
424 virtual void handleCommandLineArguments();
425 virtual void onSlicerApplicationLogicModified();
426 void onSlicerApplicationLogicRequest(vtkObject*,
void* ,
unsigned long);
427 void processAppLogicModified();
428 void processAppLogicReadData();
429 void processAppLogicWriteData();
438 void requestInvokeEvent(vtkObject* caller,
void* callData);
443 void scheduleInvokeEvent(
unsigned int delay,
void* caller,
unsigned long event,
void* callData);
456 void invokeEventRequested(
unsigned int delay,
void* caller,
457 unsigned long event,
void* callData);
461 QScopedPointer<qSlicerCoreApplicationPrivate>
d_ptr;
A set of MRML Nodes that supports serialization and undo/redo.
QScopedPointer< qSlicerCoreApplicationPrivate > d_ptr