ctkCmdLineModuleExplorerMainWindow.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKCLIPLUGINEXPLORERMAINWINDOW_H
  16. #define CTKCLIPLUGINEXPLORERMAINWINDOW_H
  17. #include <ctkCmdLineModuleManager.h>
  18. #include <ctkCmdLineModuleDirectoryWatcher.h>
  19. #include <ctkCmdLineModuleFuture.h>
  20. #include <ctkSettings.h>
  21. #include <QMainWindow>
  22. #include <QTimer>
  23. #include <QFutureWatcher>
  24. class ctkCmdLineModuleExplorerTabList;
  25. class ctkCmdLineModuleReference;
  26. class ctkCmdLineModuleResult;
  27. class ctkSettingsDialog;
  28. class ctkCmdLineModuleBackendXMLChecker;
  29. namespace Ui {
  30. class ctkCmdLineModuleExplorerMainWindow;
  31. }
  32. /**
  33. * \class ctkCLModuleExplorerMainWindow
  34. * \brief Example application main window.
  35. */
  36. class ctkCLModuleExplorerMainWindow : public QMainWindow
  37. {
  38. Q_OBJECT
  39. public:
  40. explicit ctkCLModuleExplorerMainWindow(QWidget *parent = 0);
  41. ~ctkCLModuleExplorerMainWindow();
  42. void addModule(const QUrl &location);
  43. protected:
  44. void closeEvent(QCloseEvent* event);
  45. protected Q_SLOTS:
  46. void on_actionRun_triggered();
  47. void on_actionPause_toggled(bool toggled);
  48. void on_actionCancel_triggered();
  49. void on_actionOptions_triggered();
  50. void on_actionLoad_triggered();
  51. void on_actionQuit_triggered();
  52. void on_actionReset_triggered();
  53. void on_actionClear_Cache_triggered();
  54. void on_actionReload_Modules_triggered();
  55. void checkModulePaused();
  56. void currentModuleResumed();
  57. void currentModuleCanceled();
  58. void currentModuleFinished();
  59. void moduleTabActivated(ctkCmdLineModuleFrontend* module);
  60. void checkXMLPressed();
  61. private:
  62. QScopedPointer<Ui::ctkCmdLineModuleExplorerMainWindow> ui;
  63. QScopedPointer<ctkCmdLineModuleExplorerTabList> tabList;
  64. ctkCmdLineModuleFrontendFactory* defaultModuleFrontendFactory;
  65. QList<ctkCmdLineModuleFrontendFactory*> moduleFrontendFactories;
  66. QList<ctkCmdLineModuleBackend*> moduleBackends;
  67. ctkCmdLineModuleManager moduleManager;
  68. QTimer pollPauseTimer;
  69. QFutureWatcher<ctkCmdLineModuleResult> currentFutureWatcher;
  70. QHash<ctkCmdLineModuleFrontend*, QByteArray> frontendToOutputMap;
  71. ctkCmdLineModuleDirectoryWatcher directoryWatcher;
  72. ctkSettings settings;
  73. ctkSettingsDialog* settingsDialog;
  74. ctkCmdLineModuleBackendXMLChecker* xmlCheckerBackEnd;
  75. };
  76. #endif // CTKCLIPLUGINEXPLORERMAINWINDOW_H