ctkDICOMAppWidget.h 3.4 KB

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