ctkDICOMServerNodeWidget.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 __ctkDICOMServerNodeWidget_h
  15. #define __ctkDICOMServerNodeWidget_h
  16. // Qt includes
  17. #include <QWidget>
  18. #include <QString>
  19. #include <QList>
  20. #include <QMap>
  21. #include "ctkDICOMWidgetsExport.h"
  22. class QTableWidgetItem;
  23. class ctkDICOMServerNodeWidgetPrivate;
  24. /// \ingroup DICOM_Widgets
  25. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMServerNodeWidget : public QWidget
  26. {
  27. Q_OBJECT;
  28. public:
  29. typedef QWidget Superclass;
  30. explicit ctkDICOMServerNodeWidget(QWidget* parent=0);
  31. virtual ~ctkDICOMServerNodeWidget();
  32. /// "FINDSCU" by default
  33. QString callingAETitle()const;
  34. /// "CTKSTORE" by default
  35. QString storageAETitle()const;
  36. /// 11112 by default
  37. int storagePort()const;
  38. /// Utility function that returns the callingAETitle, storageAETitle and
  39. /// storagePort in a map
  40. QMap<QString,QVariant> parameters()const;
  41. /// Return the list of server names
  42. QStringList serverNodes()const;
  43. /// Return the list of selected(checked) server names
  44. QStringList selectedServerNodes()const;
  45. /// Return all the information associated to a server defined by its name
  46. QMap<QString,QVariant> serverNodeParameters(const QString &serverNode)const;
  47. QMap<QString,QVariant> serverNodeParameters(int row)const;
  48. /// Add a server node with the given parameters
  49. /// Return the row index added into the table
  50. int addServerNode(const QMap<QString, QVariant>& parameters);
  51. public Q_SLOTS:
  52. /// Add an empty server node and make it current
  53. /// Return the row index added into the table
  54. int addServerNode();
  55. /// Remove the current row (different from the checked rows)
  56. void removeCurrentServerNode();
  57. void readSettings();
  58. void saveSettings();
  59. protected Q_SLOTS:
  60. void updateRemoveButtonEnableState();
  61. protected:
  62. QScopedPointer<ctkDICOMServerNodeWidgetPrivate> d_ptr;
  63. enum ServerColumns{
  64. NameColumn = 0,
  65. AETitleColumn,
  66. AddressColumn,
  67. PortColumn,
  68. CGETColumn
  69. };
  70. private:
  71. Q_DECLARE_PRIVATE(ctkDICOMServerNodeWidget);
  72. Q_DISABLE_COPY(ctkDICOMServerNodeWidget);
  73. };
  74. #endif