ctkXnatObject.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #ifndef ctkXnatObject_h
  16. #define ctkXnatObject_h
  17. #include "ctkXNATCoreExport.h"
  18. #include <QList>
  19. #include <QObject>
  20. #include <QString>
  21. class ctkXnatConnection;
  22. class ctkXnatObjectPrivate;
  23. class CTK_XNAT_CORE_EXPORT ctkXnatObject : public QObject
  24. {
  25. Q_OBJECT
  26. public:
  27. explicit ctkXnatObject(ctkXnatObject* parent = 0);
  28. virtual ~ctkXnatObject();
  29. QString getName() const;
  30. ctkXnatObject* getParent() const;
  31. int parentIndex();
  32. const QList<ctkXnatObject*>& getChildren() const;
  33. QString childName(int childIndex) const;
  34. void addChild(const QString& name, ctkXnatObject* child);
  35. virtual void fetch(ctkXnatConnection* connection);
  36. void removeChild(int parentIndex);
  37. virtual void download(ctkXnatConnection* connection, const QString& zipFilename);
  38. virtual void upload(ctkXnatConnection* connection, const QString& zipFilename);
  39. virtual void add(ctkXnatConnection* connection, const QString& name);
  40. virtual void remove(ctkXnatConnection* connection);
  41. virtual QString getKind() const;
  42. virtual QString getModifiableChildKind() const;
  43. virtual QString getModifiableParentName() const;
  44. virtual bool isFile() const;
  45. virtual bool holdsFiles() const;
  46. virtual bool receivesFiles() const;
  47. virtual bool isModifiable(int childIndex) const;
  48. virtual bool isDeletable() const;
  49. virtual bool isModifiable() const;
  50. private:
  51. void setParent(ctkXnatObject* parent);
  52. void setParentIndex(int index);
  53. QScopedPointer<ctkXnatObjectPrivate> d_ptr;
  54. Q_DECLARE_PRIVATE(ctkXnatObject);
  55. Q_DISABLE_COPY(ctkXnatObject);
  56. };
  57. #endif