ctkXnatSession.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 CTKXNATSESSION_H
  16. #define CTKXNATSESSION_H
  17. #include "ctkXNATCoreExport.h"
  18. #include <QScopedPointer>
  19. #include <QString>
  20. #include <QObject>
  21. #include <QVariantMap>
  22. #include <QUuid>
  23. class ctkXnatSessionPrivate;
  24. class ctkXnatDataModel;
  25. class ctkXnatExperiment;
  26. class ctkXnatFile;
  27. class ctkXnatObject;
  28. class ctkXnatProject;
  29. class ctkXnatReconstruction;
  30. class ctkXnatReconstructionFolder;
  31. class ctkXnatReconstructionResource;
  32. class ctkXnatRoot;
  33. class ctkXnatScan;
  34. class ctkXnatScanFolder;
  35. class ctkXnatScanResource;
  36. class ctkXnatSubject;
  37. class CTK_XNAT_CORE_EXPORT ctkXnatSession
  38. {
  39. public:
  40. //********
  41. // Add ctkXnatLoginProfile argument
  42. ctkXnatSession();
  43. ~ctkXnatSession();
  44. // **********
  45. // Remove ?
  46. // For Qt singal/slots; should go into the constructor or private impl.
  47. void createConnections();
  48. // **********
  49. // Remove / replase
  50. QString profileName() const;
  51. void setProfileName(const QString& profileName);
  52. QString url() const;
  53. void setUrl(const QString& url);
  54. QString userName() const;
  55. void setUserName(const QString& userName);
  56. QString password() const;
  57. void setPassword(const QString& password);
  58. ctkXnatDataModel* dataModel() const;
  59. // **********
  60. // Should these methods still be moved to the subclasses?
  61. void fetch(ctkXnatDataModel* server);
  62. void fetch(ctkXnatProject* project);
  63. void fetch(ctkXnatSubject* subject);
  64. void fetch(ctkXnatExperiment* experiment);
  65. void fetch(ctkXnatScanFolder* scanFolder);
  66. void fetch(ctkXnatScan* scan);
  67. void fetch(ctkXnatScanResource* scanResource);
  68. void fetch(ctkXnatReconstructionFolder* reconstructionFolder);
  69. void fetch(ctkXnatReconstruction* reconstruction);
  70. void fetch(ctkXnatReconstructionResource* reconstructionResource);
  71. bool exists(const ctkXnatObject* object);
  72. void save(ctkXnatObject* object);
  73. void remove(ctkXnatObject* object);
  74. void download(ctkXnatFile* file, const QString& fileName);
  75. // void downloadScanFiles(ctkXnatExperiment* experiment, const QString& zipFileName);
  76. // void downloadReconstructionFiles(ctkXnatExperiment* experiment, const QString& zipFileName);
  77. // void download(ctkXnatScan* scan, const QString& zipFileName);
  78. void download(ctkXnatScanResource* scanResource, const QString& zipFileName);
  79. void download(ctkXnatReconstructionResource* reconstructionResource, const QString& zipFileName);
  80. // void downloadReconstruction(ctkXnatReconstruction* reconstruction, const QString& zipFilename);
  81. // void downloadReconstructionResourceFiles(ctkXnatReconstructionResource* reconstructionResource, const QString& zipFilename);
  82. // void download(ctkXnatReconstructionResourceFile* reconstructionResourceFile, const QString& zipFileName);
  83. public slots:
  84. void processResult(QUuid queryId, QList<QVariantMap> parameters);
  85. void progress(QUuid queryId, double progress);
  86. protected:
  87. QScopedPointer<ctkXnatSessionPrivate> d_ptr;
  88. private:
  89. Q_DECLARE_PRIVATE(ctkXnatSession)
  90. Q_DISABLE_COPY(ctkXnatSession)
  91. };
  92. #endif