ctkDICOMAppWidget.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 ctkThumbnailWidget;
  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 slots:
  38. void setDatabaseDirectory(const QString& directory);
  39. void onAddToDatabase();
  40. void openImportDialog();
  41. void openExportDialog();
  42. void openQueryDialog();
  43. signals:
  44. /// Emited when directory is changed
  45. void databaseDirectoryChanged(const QString&);
  46. protected:
  47. QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;
  48. protected slots:
  49. void onImportDirectory(QString directory);
  50. void onModelSelected(const QModelIndex& index);
  51. /// To be called when a thumbnail in thumbnail list widget is selected
  52. void onThumbnailSelected(const ctkThumbnailWidget& widget);
  53. /// To be called when a thumbnail in thumbnail list widget is double-clicked
  54. void onThumbnailDoubleClicked(const ctkThumbnailWidget& widget);
  55. /// To be called when previous and next buttons are clicked
  56. void onNextImage();
  57. void onPreviousImage();
  58. void onNextSeries();
  59. void onPreviousSeries();
  60. void onNextStudy();
  61. void onPreviousStudy();
  62. /// To be called when an entry of the tree list is collapsed
  63. void onTreeCollapsed(const QModelIndex& index);
  64. /// To be called when an entry of the tree list is expanded
  65. void onTreeExpanded(const QModelIndex& index);
  66. /// To be called when auto-play checkbox state changed
  67. void onAutoPlayCheckboxStateChanged(int state);
  68. /// Called by timer for auto-play functionality
  69. void onAutoPlayTimer();
  70. /// To be called when the value of thumbnail size slider bar is changed
  71. void onThumbnailWidthSliderValueChanged(int val);
  72. /// To be called when search parameters in query widget changed
  73. void onSearchParameterChanged();
  74. /// To be called after image preview displayed an image
  75. void onImagePreviewDisplayed(int imageID, int count);
  76. private slots:
  77. void onSearchPopUpButtonClicked();
  78. void onSearchWidgetTopLevelChanged(bool topLevel);
  79. private:
  80. Q_DECLARE_PRIVATE(ctkDICOMAppWidget);
  81. Q_DISABLE_COPY(ctkDICOMAppWidget);
  82. };
  83. #endif