ctkDICOMServerNodeWidget.h 2.7 KB

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