ctkDICOMQueryRetrieveWidget.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 __ctkDICOMQueryRetrieveWidget_h
  15. #define __ctkDICOMQueryRetrieveWidget_h
  16. #include "ctkDICOMWidgetsExport.h"
  17. // Qt includes
  18. #include <QWidget>
  19. #include <QItemSelection>
  20. #include <QMap>
  21. #include <QVariant>
  22. #include <QString>
  23. class ctkDICOMTableManager;
  24. // CTK includes
  25. #include <ctkDICOMDatabase.h>
  26. class ctkDICOMQueryRetrieveWidgetPrivate;
  27. /// \ingroup DICOM_Widgets
  28. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMQueryRetrieveWidget : public QWidget
  29. {
  30. Q_OBJECT;
  31. Q_PROPERTY(ctkDICOMTableManager* dicomTableManager READ dicomTableManager)
  32. public:
  33. typedef QWidget Superclass;
  34. explicit ctkDICOMQueryRetrieveWidget(QWidget* parent=0);
  35. virtual ~ctkDICOMQueryRetrieveWidget();
  36. QMap<QString,QVariant> getServerParameters();
  37. ctkDICOMTableManager* dicomTableManager();
  38. QSharedPointer<ctkDICOMDatabase> retrieveDatabase()const;
  39. /// enable or disable ctk progress bars
  40. void useProgressDialog(bool enable);
  41. public Q_SLOTS:
  42. void setRetrieveDatabase(QSharedPointer<ctkDICOMDatabase> retrieveDatabase);
  43. void query();
  44. void retrieve();
  45. void cancel();
  46. Q_SIGNALS:
  47. /// Signal emit when studies have been retrieved (user clicked on the
  48. /// "Retrieve" button) or when the widget is cancelled (user clicked on the
  49. /// "Cancel" button).
  50. void studiesRetrieved(QStringList);
  51. /// Signal to emit when cancel button pressed (after studiesRetrieved is emitted)
  52. void canceled();
  53. protected Q_SLOTS:
  54. void onQueryProgressChanged(int value);
  55. void updateRetrieveProgress(int value);
  56. protected:
  57. QScopedPointer<ctkDICOMQueryRetrieveWidgetPrivate> d_ptr;
  58. private:
  59. Q_DECLARE_PRIVATE(ctkDICOMQueryRetrieveWidget);
  60. Q_DISABLE_COPY(ctkDICOMQueryRetrieveWidget);
  61. };
  62. #endif