ctkDICOMAppWidget.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.apache.org/licenses/LICENSE-2.0.txt
  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 ctkDICOMAppWidgetPrivate;
  20. class ctkThumbnailLabel;
  21. class QModelIndex;
  22. /// \ingroup DICOM_Widgets
  23. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMAppWidget : public QWidget
  24. {
  25. Q_OBJECT
  26. Q_PROPERTY(QString databaseDirectory READ databaseDirectory WRITE setDatabaseDirectory)
  27. Q_PROPERTY(bool searchWidgetPopUpMode READ searchWidgetPopUpMode WRITE setSearchWidgetPopUpMode)
  28. public:
  29. typedef QWidget Superclass;
  30. explicit ctkDICOMAppWidget(QWidget* parent=0);
  31. virtual ~ctkDICOMAppWidget();
  32. QString databaseDirectory() const;
  33. /// Setting search widget pop-up mode
  34. /// Default value is false. Setting it to true will make
  35. /// search widget to be displayed as pop-up widget
  36. void setSearchWidgetPopUpMode(bool flag);
  37. bool searchWidgetPopUpMode();
  38. public Q_SLOTS:
  39. void setDatabaseDirectory(const QString& directory);
  40. void onAddToDatabase();
  41. void openImportDialog();
  42. void openExportDialog();
  43. void openQueryDialog();
  44. void onRemoveAction();
  45. void suspendModel();
  46. void resumeModel();
  47. void resetModel();
  48. Q_SIGNALS:
  49. /// Emited when directory is changed
  50. void databaseDirectoryChanged(const QString&);
  51. /// Emited when query/retrieve operation has happened
  52. void queryRetrieveFinished();
  53. protected:
  54. QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;
  55. protected Q_SLOTS:
  56. void onImportDirectory(QString directory);
  57. void onModelSelected(const QModelIndex& index);
  58. /// To be called when a thumbnail in thumbnail list widget is selected
  59. void onThumbnailSelected(const ctkThumbnailLabel& widget);
  60. /// To be called when a thumbnail in thumbnail list widget is double-clicked
  61. void onThumbnailDoubleClicked(const ctkThumbnailLabel& widget);
  62. /// To be called when previous and next buttons are clicked
  63. void onNextImage();
  64. void onPreviousImage();
  65. void onNextSeries();
  66. void onPreviousSeries();
  67. void onNextStudy();
  68. void onPreviousStudy();
  69. /// To be called when dialog finishes
  70. void onQueryRetrieveFinished();
  71. /// To be called when an entry of the tree list is collapsed
  72. void onTreeCollapsed(const QModelIndex& index);
  73. /// To be called when an entry of the tree list is expanded
  74. void onTreeExpanded(const QModelIndex& index);
  75. /// To be called when auto-play checkbox state changed
  76. void onAutoPlayCheckboxStateChanged(int state);
  77. /// Called by timer for auto-play functionality
  78. void onAutoPlayTimer();
  79. /// To be called when the value of thumbnail size slider bar is changed
  80. void onThumbnailWidthSliderValueChanged(int val);
  81. /// To be called when search parameters in query widget changed
  82. void onSearchParameterChanged();
  83. /// To be called after image preview displayed an image
  84. void onImagePreviewDisplayed(int imageID, int count);
  85. private Q_SLOTS:
  86. void onSearchPopUpButtonClicked();
  87. void onSearchWidgetTopLevelChanged(bool topLevel);
  88. private:
  89. Q_DECLARE_PRIVATE(ctkDICOMAppWidget);
  90. Q_DISABLE_COPY(ctkDICOMAppWidget);
  91. };
  92. #endif