ctkXnatScanResourceFile.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*=============================================================================
  2. Plugin: org.commontk.xnat
  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. #include "ctkXnatScanResourceFile.h"
  16. #include "ctkXnatConnection.h"
  17. class ctkXnatScanResourceFilePrivate
  18. {
  19. public:
  20. QString name;
  21. QString size;
  22. QString uri;
  23. QString collection;
  24. QString fileTags;
  25. QString fileFormat;
  26. QString fileContent;
  27. QString categoryId;
  28. };
  29. ctkXnatScanResourceFile::ctkXnatScanResourceFile(ctkXnatObject* parent)
  30. : ctkXnatObject(parent)
  31. {
  32. }
  33. ctkXnatScanResourceFile::~ctkXnatScanResourceFile()
  34. {
  35. }
  36. const QString& ctkXnatScanResourceFile::name() const
  37. {
  38. Q_D(const ctkXnatScanResourceFile);
  39. return d->name;
  40. }
  41. void ctkXnatScanResourceFile::setName(const QString& name)
  42. {
  43. Q_D(ctkXnatScanResourceFile);
  44. d->name = name;
  45. }
  46. const QString& ctkXnatScanResourceFile::size() const
  47. {
  48. Q_D(const ctkXnatScanResourceFile);
  49. return d->size;
  50. }
  51. void ctkXnatScanResourceFile::setSize(const QString& size)
  52. {
  53. Q_D(ctkXnatScanResourceFile);
  54. d->size = size;
  55. }
  56. const QString& ctkXnatScanResourceFile::uri() const
  57. {
  58. Q_D(const ctkXnatScanResourceFile);
  59. return d->uri;
  60. }
  61. void ctkXnatScanResourceFile::setUri(const QString& uri)
  62. {
  63. Q_D(ctkXnatScanResourceFile);
  64. d->uri = uri;
  65. }
  66. const QString& ctkXnatScanResourceFile::collection() const
  67. {
  68. Q_D(const ctkXnatScanResourceFile);
  69. return d->collection;
  70. }
  71. void ctkXnatScanResourceFile::setCollection(const QString& collection)
  72. {
  73. Q_D(ctkXnatScanResourceFile);
  74. d->collection = collection;
  75. }
  76. const QString& ctkXnatScanResourceFile::fileTags() const
  77. {
  78. Q_D(const ctkXnatScanResourceFile);
  79. return d->fileTags;
  80. }
  81. void ctkXnatScanResourceFile::setFileTags(const QString& fileTags)
  82. {
  83. Q_D(ctkXnatScanResourceFile);
  84. d->fileTags = fileTags;
  85. }
  86. const QString& ctkXnatScanResourceFile::fileFormat() const
  87. {
  88. Q_D(const ctkXnatScanResourceFile);
  89. return d->fileFormat;
  90. }
  91. void ctkXnatScanResourceFile::setFileFormat(const QString& fileFormat)
  92. {
  93. Q_D(ctkXnatScanResourceFile);
  94. d->fileFormat = fileFormat;
  95. }
  96. const QString& ctkXnatScanResourceFile::fileContent() const
  97. {
  98. Q_D(const ctkXnatScanResourceFile);
  99. return d->fileContent;
  100. }
  101. void ctkXnatScanResourceFile::setFileContent(const QString& fileContent)
  102. {
  103. Q_D(ctkXnatScanResourceFile);
  104. d->fileContent = fileContent;
  105. }
  106. const QString& ctkXnatScanResourceFile::categoryId() const
  107. {
  108. Q_D(const ctkXnatScanResourceFile);
  109. return d->categoryId;
  110. }
  111. void ctkXnatScanResourceFile::setCategoryId(const QString& categoryId)
  112. {
  113. Q_D(ctkXnatScanResourceFile);
  114. d->categoryId = categoryId;
  115. }
  116. void ctkXnatScanResourceFile::download(ctkXnatConnection* connection, const QString& fileName)
  117. {
  118. connection->download(this, fileName);
  119. }
  120. bool ctkXnatScanResourceFile::isFile() const
  121. {
  122. return true;
  123. }
  124. bool ctkXnatScanResourceFile::isDeletable() const
  125. {
  126. return true;
  127. }