CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkDICOMTableManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkDICOMTableManager_h
22 #define __ctkDICOMTableManager_h
23 
24 #include "ctkDICOMWidgetsExport.h"
25 #include "ctkDICOMDatabase.h"
26 
27 // Qt includes
28 #include <QWidget>
29 #include <QSharedPointer>
30 
31 class ctkDICOMTableManagerPrivate;
32 class ctkDICOMDatabase;
33 
34 class QItemSelection;
35 class QModelIndex;
36 
38 
39 class CTK_DICOM_WIDGETS_EXPORT ctkDICOMTableManager : public QWidget
40 {
41  Q_OBJECT
42 
46  Q_PROPERTY(Qt::Orientation tableOrientation READ tableOrientation WRITE setTableOrientation)
51  Q_PROPERTY(bool dynamicTableLayout READ dynamicTableLayout WRITE setDynamicTableLayout)
52 
53  Q_ENUMS(DisplayDensity)
59  Q_PROPERTY(ctkDICOMTableManager::DisplayDensity displayDensity READ displayDensity WRITE setDisplayDensity);
60 
61 public:
62  typedef QWidget Superclass;
63 
64  explicit ctkDICOMTableManager(QWidget* parent = 0);
65  ctkDICOMTableManager(ctkDICOMDatabase* db, QWidget* parent = 0);
66  virtual ~ctkDICOMTableManager();
67 
72  void setDICOMDatabase(ctkDICOMDatabase* db);
73 
74  void setTableOrientation(const Qt::Orientation&) const;
75  Qt::Orientation tableOrientation();
76 
81  QStringList currentPatientsSelection();
82  QStringList currentStudiesSelection();
83  QStringList currentSeriesSelection();
84 
85  void setDynamicTableLayout(bool);
86  bool dynamicTableLayout() const;
87 
88  void updateTableViews();
89 
91  {
92  Compact = 0,
93  Cozy = 1,
94  Comfortable = 2
95  };
96 
97  DisplayDensity displayDensity();
98  void setDisplayDensity(DisplayDensity density);
99 
100 public Q_SLOTS:
101 
102  void onPatientsQueryChanged(const QStringList&);
103  void onStudiesQueryChanged(const QStringList&);
104  void onPatientsSelectionChanged(const QStringList&);
105  void onStudiesSelectionChanged(const QStringList&);
106 
107 Q_SIGNALS:
109  void patientsSelectionChanged(const QItemSelection&, const QItemSelection&);
110  void studiesSelectionChanged(const QItemSelection&, const QItemSelection&);
111  void seriesSelectionChanged(const QItemSelection&, const QItemSelection&);
112 
113  void patientsSelectionChanged(const QStringList &uids);
114  void studiesSelectionChanged(const QStringList &uids);
115  void seriesSelectionChanged(const QStringList &uids);
116 
117  void patientsDoubleClicked( const QModelIndex&);
118  void studiesDoubleClicked( const QModelIndex&);
119  void seriesDoubleClicked(const QModelIndex&);
120 
121  // signals to propagate the context menu requests from
122  // the individual tables
123  void patientsRightClicked(const QPoint&);
124  void studiesRightClicked(const QPoint&);
125  void seriesRightClicked(const QPoint&);
126 
127 
128 protected:
129 
130  virtual void resizeEvent(QResizeEvent *);
131 
132  QScopedPointer<ctkDICOMTableManagerPrivate> d_ptr;
133 
134 private:
135 
136  Q_DECLARE_PRIVATE(ctkDICOMTableManager)
137  Q_DISABLE_COPY(ctkDICOMTableManager)
138 };
139 
140 #endif // __ctkDICOMTableManager_h
QScopedPointer< ctkDICOMTableManagerPrivate > d_ptr