CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkCmdLineModuleExplorerMainWindow.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: CTK
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef CTKCLIPLUGINEXPLORERMAINWINDOW_H
23 #define CTKCLIPLUGINEXPLORERMAINWINDOW_H
24 
27 #include <ctkCmdLineModuleFuture.h>
28 #include <ctkSettings.h>
29 
30 #include <QMainWindow>
31 #include <QTimer>
32 #include <QFutureWatcher>
33 
37 class ctkSettingsDialog;
39 
40 namespace Ui {
41 class ctkCmdLineModuleExplorerMainWindow;
42 }
43 
48 class ctkCLModuleExplorerMainWindow : public QMainWindow
49 {
50  Q_OBJECT
51 
52 public:
53  explicit ctkCLModuleExplorerMainWindow(QWidget *parent = 0);
55 
56  void addModule(const QUrl &location);
57 
58 protected:
59 
60  void closeEvent(QCloseEvent* event);
61 
62 protected Q_SLOTS:
63 
64  void on_actionRun_triggered();
65  void on_actionPause_toggled(bool toggled);
66  void on_actionCancel_triggered();
67  void on_actionOptions_triggered();
68  void on_actionLoad_triggered();
69  void on_actionQuit_triggered();
70 
71  void on_actionReset_triggered();
72  void on_actionClear_Cache_triggered();
73  void on_actionReload_Modules_triggered();
74 
75  void checkModulePaused();
76  void currentModuleResumed();
77  void currentModuleCanceled();
78  void currentModuleFinished();
79 
80  void moduleTabActivated(ctkCmdLineModuleFrontend* module);
81  void checkXMLPressed();
82 
83 private:
84 
85  QScopedPointer<Ui::ctkCmdLineModuleExplorerMainWindow> ui;
86  QScopedPointer<ctkCmdLineModuleExplorerTabList> tabList;
87 
88  ctkCmdLineModuleFrontendFactory* defaultModuleFrontendFactory;
89  QList<ctkCmdLineModuleFrontendFactory*> moduleFrontendFactories;
90  QList<ctkCmdLineModuleBackend*> moduleBackends;
91 
92  ctkCmdLineModuleManager moduleManager;
93 
94  QTimer pollPauseTimer;
95  QFutureWatcher<ctkCmdLineModuleResult> currentFutureWatcher;
97 
98  ctkCmdLineModuleDirectoryWatcher directoryWatcher;
99 
100  ctkSettings settings;
101  ctkSettingsDialog* settingsDialog;
102  ctkCmdLineModuleBackendXMLChecker* xmlCheckerBackEnd;
103 };
104 
105 #endif // CTKCLIPLUGINEXPLORERMAINWINDOW_H
Describes a reported result of a command line module.
Abstract base class for all front-end command line module implementations.A module front-end represen...
Provides directory scanning and file watching via QFileSystemWatcher to automatically load new module...
Factory class to create new front-ends.Front-end implementors are advised to create and export a sub-...
Provides a ctkCmdLineModuleBackend implementation to pretend to run a command line process...
Main manager class to handle loading and unloading of modules.
Defines a reference or handle to a module, including location, XML, description and access to the ass...