ctkDICOMAppWidget.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkDICOMAppWidget_h
  15. #define __ctkDICOMAppWidget_h
  16. // Qt includes
  17. #include <QWidget>
  18. #include "ctkDICOMWidgetsExport.h"
  19. class QModelIndex;
  20. class ctkDICOMAppWidgetPrivate;
  21. class ctkDICOMThumbnailWidget;
  22. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMAppWidget : public QWidget
  23. {
  24. Q_OBJECT
  25. Q_PROPERTY(QString databaseDirectory READ databaseDirectory WRITE setDatabaseDirectory)
  26. public:
  27. typedef QWidget Superclass;
  28. explicit ctkDICOMAppWidget(QWidget* parent=0);
  29. virtual ~ctkDICOMAppWidget();
  30. QString databaseDirectory() const;
  31. public slots:
  32. void setDatabaseDirectory(const QString& directory);
  33. void onAddToDatabase();
  34. void openImportDialog();
  35. void openExportDialog();
  36. void openQueryDialog();
  37. signals:
  38. /// Emited when directory is changed
  39. void databaseDirectoryChanged(const QString&);
  40. protected:
  41. QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;
  42. protected slots:
  43. void onImportDirectory(QString directory);
  44. void onModelSelected(const QModelIndex& index);
  45. /// To be called when a thumbnail in thumbnail list widget is selected
  46. void onThumbnailSelected(const ctkDICOMThumbnailWidget& widget);
  47. /// To be called when a thumbnail in thumbnail list widget is double-clicked
  48. void onThumbnailDoubleClicked(const ctkDICOMThumbnailWidget& widget);
  49. /// To be called when previous and next buttons are clicked
  50. void onNextImage();
  51. void onPreviousImage();
  52. void onNextSeries();
  53. void onPreviousSeries();
  54. void onNextStudy();
  55. void onPreviousStudy();
  56. /// To be called when an entry of the tree list is collapsed
  57. void onTreeCollapsed(const QModelIndex& index);
  58. /// To be called when an entry of the tree list is expanded
  59. void onTreeExpanded(const QModelIndex& index);
  60. private:
  61. Q_DECLARE_PRIVATE(ctkDICOMAppWidget);
  62. Q_DISABLE_COPY(ctkDICOMAppWidget);
  63. };
  64. #endif