ctkDicomHostService_p.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKDICOMHOSTSERVICE_P_H
  16. #define CTKDICOMHOSTSERVICE_P_H
  17. // CTK includes
  18. #include <ctkDicomHostInterface.h>
  19. #include <ctkDicomExchangeService.h>
  20. class ctkDicomHostService : public ctkDicomExchangeService, public ctkDicomHostInterface
  21. {
  22. Q_OBJECT
  23. Q_INTERFACES(ctkDicomHostInterface)
  24. public:
  25. ctkDicomHostService(ushort port, QString path);
  26. virtual ~ctkDicomHostService();
  27. /**
  28. * Returns a newly created DICOM UID that the Hosted Application might use, e.g., to create new data
  29. * objects and structures.
  30. */
  31. virtual QString generateUID();
  32. /**
  33. * The Hosted Application supplies its preferred screen size in the appPreferredScreen parameter. The
  34. * Hosting System may utilize this information as a hint, but may return a window location and size that best
  35. * suits the Hosting System's GUI.
  36. */
  37. virtual QRect getAvailableScreen(const QRect& preferredScreen);
  38. /**
  39. * This method returns a URI that a Hosted Application may use to store output that it may provide back to
  40. * the Hosting System (e.g. in response to a getData() call).
  41. * \return a URI that a Hosted Application may use to store output.
  42. */
  43. virtual QString getOutputLocation(const QStringList& preferredProtocols);
  44. /**
  45. * The Hosted Application shall invoke this method each time the Hosted Application successfully transitions
  46. * to a new state. The new state is passed in the state parameter.
  47. */
  48. virtual void notifyStateChanged(ctkDicomAppHosting::State state);
  49. /**
  50. * Method used by the Hosted Application to inform the Hosting System of notable events that occur during execution.
  51. * The Hosted Application invoks this method, passing the information in the status parameter.
  52. */
  53. virtual void notifyStatus(const ctkDicomAppHosting::Status& status);
  54. // Exchange methods implemented in ctkDicomExchangeService
  55. /**
  56. * The source of the data calls this method with descriptions of the available data that it can provide to the
  57. * recipient. If the source of the data expects that additional data will become available, it shall pass FALSE
  58. * in the lastData parameter. Otherwise, it shall pass TRUE.
  59. * \return TRUE if the recipient of the data successfully received the AvailableData list.
  60. */
  61. virtual bool notifyDataAvailable(const ctkDicomAppHosting::AvailableData& data, bool lastData);
  62. virtual QList<ctkDicomAppHosting::ObjectLocator> getData(
  63. const QList<QUuid>& objectUUIDs,
  64. const QList<QString>& acceptableTransferSyntaxUIDs,
  65. bool includeBulkData);
  66. /**
  67. * The recipient of data invokes this method to release access to binary data provided by the source of the
  68. * data through a getData() call. The ArrayOfUUID identifies the data streams that the recipient is releasing.
  69. */
  70. virtual void releaseData(const QList<QUuid>& objectUUIDs);
  71. };
  72. #endif // CTKDICOMHOSTSERVICE_P_H