ctkXnatResource.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*=============================================================================
  2. Library: XNAT/Core
  3. Copyright (c) University College London,
  4. Centre for Medical Image Computing
  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 ctkXnatResource_h
  16. #define ctkXnatResource_h
  17. #include "ctkXNATCoreExport.h"
  18. #include "ctkXnatObject.h"
  19. #include "ctkXnatDefaultSchemaTypes.h"
  20. class ctkXnatResourcePrivate;
  21. /**
  22. * @ingroup XNAT_Core
  23. */
  24. class CTK_XNAT_CORE_EXPORT ctkXnatResource : public ctkXnatObject
  25. {
  26. public:
  27. ctkXnatResource(ctkXnatObject* parent = 0,
  28. const QString& schemaType = ctkXnatDefaultSchemaTypes::XSI_RESOURCE);
  29. virtual ~ctkXnatResource();
  30. virtual QString resourceUri() const;
  31. virtual QString id() const;
  32. virtual void setId(const QString &id);
  33. virtual QString name() const;
  34. virtual void setName(const QString &name);
  35. /// Gets the label of the object.
  36. QString label() const;
  37. /// Sets the label of the object.
  38. void setLabel(const QString& label);
  39. void setFormat(const QString& format);
  40. QString format() const;
  41. void setTags(const QString& tags);
  42. QString tags() const;
  43. void setContent(const QString& content);
  44. QString content() const;
  45. void reset();
  46. void saveImpl(bool overwrite);
  47. static const QString ID;
  48. static const QString TAGS;
  49. static const QString FORMAT;
  50. static const QString CONTENT;
  51. private:
  52. friend class qRestResult;
  53. virtual void fetchImpl();
  54. virtual void downloadImpl(const QString&);
  55. Q_DECLARE_PRIVATE(ctkXnatResource)
  56. };
  57. #endif