ctkDICOMAppWidget.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. /// Updates schema of loaded database to match the one
  34. /// coded by the current version of ctkDICOMDatabase.
  35. /// Also provides a dialog box for progress
  36. void updateDatabaseSchemaIfNeeded();
  37. /// Setting search widget pop-up mode
  38. /// Default value is false. Setting it to true will make
  39. /// search widget to be displayed as pop-up widget
  40. void setSearchWidgetPopUpMode(bool flag);
  41. bool searchWidgetPopUpMode();
  42. public Q_SLOTS:
  43. void setDatabaseDirectory(const QString& directory);
  44. void onAddToDatabase();
  45. void openImportDialog();
  46. void openExportDialog();
  47. void openQueryDialog();
  48. void onRemoveAction();
  49. void suspendModel();
  50. void resumeModel();
  51. void resetModel();
  52. void onProgress(int);
  53. Q_SIGNALS:
  54. /// Emited when directory is changed
  55. void databaseDirectoryChanged(const QString&);
  56. /// Emited when query/retrieve operation has happened
  57. void queryRetrieveFinished();
  58. /// Emited when the directory import operation has completed
  59. void directoryImported();
  60. protected:
  61. QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;
  62. protected Q_SLOTS:
  63. void onImportDirectory(QString directory);
  64. void onModelSelected(const QModelIndex& index);
  65. /// To be called when a thumbnail in thumbnail list widget is selected
  66. void onThumbnailSelected(const ctkThumbnailLabel& widget);
  67. /// To be called when a thumbnail in thumbnail list widget is double-clicked
  68. void onThumbnailDoubleClicked(const ctkThumbnailLabel& widget);
  69. /// To be called when previous and next buttons are clicked
  70. void onNextImage();
  71. void onPreviousImage();
  72. void onNextSeries();
  73. void onPreviousSeries();
  74. void onNextStudy();
  75. void onPreviousStudy();
  76. /// To be called when dialog finishes
  77. void onQueryRetrieveFinished();
  78. /// To be called when an entry of the tree list is collapsed
  79. void onTreeCollapsed(const QModelIndex& index);
  80. /// To be called when an entry of the tree list is expanded
  81. void onTreeExpanded(const QModelIndex& index);
  82. /// To be called when auto-play checkbox state changed
  83. void onAutoPlayCheckboxStateChanged(int state);
  84. /// Called by timer for auto-play functionality
  85. void onAutoPlayTimer();
  86. /// To be called when the value of thumbnail size slider bar is changed
  87. void onThumbnailWidthSliderValueChanged(int val);
  88. /// To be called when search parameters in query widget changed
  89. void onSearchParameterChanged();
  90. /// To be called after image preview displayed an image
  91. void onImagePreviewDisplayed(int imageID, int count);
  92. private Q_SLOTS:
  93. void onSearchPopUpButtonClicked();
  94. void onSearchWidgetTopLevelChanged(bool topLevel);
  95. private:
  96. Q_DECLARE_PRIVATE(ctkDICOMAppWidget);
  97. Q_DISABLE_COPY(ctkDICOMAppWidget);
  98. };
  99. #endif