CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxPluginBrowser.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 // Based on a class from CTK:
13 /*=============================================================================
14 
15 
16  Library: CTK
17 
18  Copyright (c) German Cancer Research Center,
19  Division of Medical and Biological Informatics
20 
21  Licensed under the Apache License, Version 2.0 (the "License");
22  you may not use this file except in compliance with the License.
23  You may obtain a copy of the License at
24 
25  http://www.apache.org/licenses/LICENSE-2.0
26 
27  Unless required by applicable law or agreed to in writing, software
28  distributed under the License is distributed on an "AS IS" BASIS,
29  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30  See the License for the specific language governing permissions and
31  limitations under the License.
32 
33 =============================================================================*/
34 
35 #ifndef CXPLUGINBROWSER_H
36 #define CXPLUGINBROWSER_H
37 
38 #include "cxGuiExport.h"
39 
40 #include <QMainWindow>
41 
42 #include <ctkServiceEvent.h>
43 #include <ctkPluginEvent.h>
44 #include <ctkPluginFrameworkEvent.h>
45 #include <ctkPlugin.h>
46 #include <QModelIndex>
47 #include "cxPluginFramework.h"
48 #include "cxMultiFileInputWidget.h"
49 
50 class QTableView;
51 class ctkPluginFramework;
52 class cxtServiceEvent;
53 
54 namespace cx
55 {
56 class ctkPluginTableModel;
57 
58 class cxGui_EXPORT ctkPluginBrowser : public QMainWindow
59 {
60  Q_OBJECT
61 
62 public:
63 
65  virtual ~ctkPluginBrowser();
66 
67 private Q_SLOTS:
68 
69  void pluginSelected(const QModelIndex& index);
70  void resizePluginsTableView();
71 
72  void frameworkEvent(const ctkPluginFrameworkEvent& event);
73  void pluginEvent(const ctkPluginEvent& event);
74  void serviceEvent(const ctkServiceEvent& event);
75 
76  void startPlugin();
77  void startPluginNow();
78  void stopPlugin();
79  void toggleInstallPlugin();
80  void searchPathChanged();
81 
82 private:
83 
84 // void closeEvent(QCloseEvent* closeEvent);
85  void setupUi();
86  PluginData getSelectedPlugin();
87 
88  void updatePluginToolbar();
89  void startPlugin(ctkPlugin::StartOptions options);
90  void wrapInDockWidget(QWidget* widget);
91 
92 
93  PluginFrameworkManagerPtr framework;
94  ctkPluginTableModel* mPluginTableModel;
95 
96  QAction* startPluginNowAction;
97  QAction* startPluginAction;
98  QAction* stopPluginAction;
99  QAction* toggleInstallPluginAction;
100 
101  cx::MultiFileInputWidget* searchPathSelectWidget;
102 
103  QTableView* pluginsTableView;
104  QToolBar* pluginToolBar;
105  QTextEdit* mPluginInfoWidget;
106  void updatePluginInfo();
107 
108  QString mSettingsMainWindowStateTag;
109  QString mSettingsMainWindowGeometryTag;
110  QMap<ctkPluginEvent::Type, QString> pluginEventTypeToString;
111 
112 };
113 
114 } //namespace cx
115 
116 
117 #endif // CXPLUGINBROWSER_H
std::pair< QString, ctkPluginPtr > PluginData
boost::shared_ptr< class PluginFrameworkManager > PluginFrameworkManagerPtr
Namespace for all CustusX production code.