Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerExtensionsLocalWidget.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 __qSlicerExtensionsLocalWidget_h
22 #define __qSlicerExtensionsLocalWidget_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 qSlicerExtensionsLocalWidgetPrivate;
34 
35 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerExtensionsLocalWidget
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 qSlicerExtensionsLocalWidget(QWidget* parent = nullptr);
46 
48  ~qSlicerExtensionsLocalWidget() override;
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  // Refresh after application settings changed (server URL, autoupdate settings)
63  void refresh();
64 
65 protected slots:
66  void addBookmark(const QString& extensionName);
67  void removeBookmark(const QString& extensionName);
68  void installExtension(const QString& extensionName);
69  void setExtensionEnabled(const QString& extensionName);
70  void setExtensionDisabled(const QString& extensionName);
71  void setExtensionUpdateAvailable(const QString& extensionName);
72  void scheduleExtensionForUninstall(const QString& extensionName);
73  void cancelExtensionScheduledForUninstall(const QString& extensionName);
74  void scheduleExtensionForUpdate(const QString& extensionName);
75  void cancelExtensionScheduledForUpdate(const QString& extensionName);
76  void onModelUpdated();
77  void onIconDownloadComplete(const QString& extensionName);
78  void onLinkActivated(const QString& link);
79  void onExtensionInstalled(const QString& extensionName);
80  void onExtensionUninstalled(const QString& extensionName);
81  void onExtensionMetadataUpdated(const QString& extensionName);
82  void onExtensionBookmarkedChanged(const QString& extensionName, bool bookmarked);
83  void onExtensionScheduledForUninstall(const QString& extensionName);
84  void onExtensionCancelledScheduleForUninstall(const QString& extensionName);
85  void setExtensionUpdateScheduled(const QString& extensionName);
86  void setExtensionUpdateCanceled(const QString& extensionName);
87  void setExtensionUpdateDownloadProgress(
88  const QString& extensionName, qint64 received, qint64 total);
89  void setExtensionInstallDownloadProgress(
90  const QString& extensionName, qint64 received, qint64 total);
91  void onModelExtensionEnabledChanged(const QString& extensionName, bool enabled);
92 
93 protected:
94  QScopedPointer<qSlicerExtensionsLocalWidgetPrivate> d_ptr;
95 
96 private:
97  Q_DECLARE_PRIVATE(qSlicerExtensionsLocalWidget);
98  Q_DISABLE_COPY(qSlicerExtensionsLocalWidget);
99 
100  friend class qSlicerExtensionsItemDelegate;
101 };
102 
103 #endif
Class querying and storing extensions data.
QListWidget Superclass
Superclass typedef.
QScopedPointer< qSlicerExtensionsLocalWidgetPrivate > d_ptr