Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerExtensionsManageWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerExtensionsManageWidget_h
22 #define __qSlicerExtensionsManageWidget_h
23 
24 // Qt includes
25 #include <QListWidget>
26 #include <QUrl>
27 
28 // QtGUI includes
29 #include "qSlicerBaseQTGUIExport.h"
30 
31 class qSlicerExtensionsItemDelegate;
33 class qSlicerExtensionsManageWidgetPrivate;
34 
35 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerExtensionsManageWidget
36  : public QListWidget
37 {
38  Q_OBJECT
39  Q_PROPERTY(QString searchText READ searchText WRITE setSearchText)
40 public:
42  typedef QListWidget Superclass;
43 
45  explicit qSlicerExtensionsManageWidget(QWidget* parent = nullptr);
46 
49 
50  Q_INVOKABLE qSlicerExtensionsManagerModel* extensionsManagerModel()const;
51  Q_INVOKABLE void setExtensionsManagerModel(qSlicerExtensionsManagerModel* model);
52 
54  QString searchText()const;
55 
56 signals:
57  void linkActivated(const QUrl& link);
58 
59 public slots:
60  void displayExtensionDetails(const QString& extensionName);
61  void setSearchText(const QString& newText);
62 
63 protected slots:
64  void setExtensionEnabled(const QString& extensionName);
65  void setExtensionDisabled(const QString& extensionName);
66  void setExtensionUpdateAvailable(const QString& extensionName);
67  void scheduleExtensionForUninstall(const QString& extensionName);
68  void cancelExtensionScheduledForUninstall(const QString& extensionName);
69  void scheduleExtensionForUpdate(const QString& extensionName);
70  void cancelExtensionScheduledForUpdate(const QString& extensionName);
71  void onModelUpdated();
72  void onIconDownloadComplete(const QString& extensionName);
73  void onLinkActivated(const QString& link);
74  void onExtensionInstalled(const QString& extensionName);
75  void onExtensionScheduledForUninstall(const QString& extensionName);
76  void onExtensionCancelledScheduleForUninstall(const QString& extensionName);
77  void setExtensionUpdateScheduled(const QString& extensionName);
78  void setExtensionUpdateCanceled(const QString& extensionName);
79  void setExtensionUpdateDownloadProgress(
80  const QString& extensionName, qint64 received, qint64 total);
81  void onModelExtensionEnabledChanged(const QString& extensionName, bool enabled);
82 
83 protected:
84  QScopedPointer<qSlicerExtensionsManageWidgetPrivate> d_ptr;
85 
86 private:
87  Q_DECLARE_PRIVATE(qSlicerExtensionsManageWidget);
88  Q_DISABLE_COPY(qSlicerExtensionsManageWidget);
89 
90  friend class qSlicerExtensionsItemDelegate;
91 };
92 
93 #endif
94 
QScopedPointer< qSlicerExtensionsManageWidgetPrivate > d_ptr
QListWidget Superclass
Superclass typedef.