CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxPluginTableModel.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  Library: CTK
16 
17  Copyright (c) German Cancer Research Center,
18  Division of Medical and Biological Informatics
19 
20  Licensed under the Apache License, Version 2.0 (the "License");
21  you may not use this file except in compliance with the License.
22  You may obtain a copy of the License at
23 
24  http://www.apache.org/licenses/LICENSE-2.0
25 
26  Unless required by applicable law or agreed to in writing, software
27  distributed under the License is distributed on an "AS IS" BASIS,
28  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  See the License for the specific language governing permissions and
30  limitations under the License.
31 
32 =============================================================================*/
33 
34 #ifndef CTKPLUGINTABLEMODEL_H
35 #define CTKPLUGINTABLEMODEL_H
36 
37 #include "cxGuiExport.h"
38 
39 #include <QAbstractTableModel>
40 
41 #include <QList>
42 
43 #include <ctkPlugin.h>
44 #include <ctkPluginEvent.h>
45 #include "cxPluginFramework.h"
46 
47 class ctkPluginContext;
48 
49 namespace cx
50 {
51 
52 class cxGui_EXPORT ctkPluginTableModel : public QAbstractTableModel
53 {
54 
55  Q_OBJECT
56 
57 public:
58 
59  ctkPluginTableModel(PluginFrameworkManagerPtr framework, QObject* parent = 0);
60 
61  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
62 
63  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
64 
65  int columnCount(const QModelIndex& parent = QModelIndex()) const;
66  int rowCount(const QModelIndex& parent = QModelIndex()) const;
67 
68 protected Q_SLOTS:
69 
70  void pluginChanged(const ctkPluginEvent& event);
71  void resetAll();
72 
73 private:
74  std::map<QString, ctkPluginPtr> mPlugins;
75  PluginFrameworkManagerPtr mFramework;
76 };
77 
78 }
79 
80 #endif // CTKPLUGINTABLEMODEL_H
boost::shared_ptr< class PluginFrameworkManager > PluginFrameworkManagerPtr
Namespace for all CustusX production code.