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 
65  void on_actionPause_toggled(bool toggled);
70 
74 
79 
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
void moduleTabActivated(ctkCmdLineModuleFrontend *module)
void addModule(const QUrl &location)
void closeEvent(QCloseEvent *event)
ctkCLModuleExplorerMainWindow(QWidget *parent=0)
void on_actionPause_toggled(bool toggled)
Provides a ctkCmdLineModuleBackend implementation to pretend to run a command line process,...
Provides directory scanning and file watching via QFileSystemWatcher to automatically load new module...
Abstract base class for all front-end command line module implementations.
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...
Describes a reported result of a command line module.
Factory class to create new front-ends.