ctkDICOMAppWidget.h 3.8 KB

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