ctkCmdLineModuleReference.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 CTKCMDLINEMODULEREFERENCE_H
  16. #define CTKCMDLINEMODULEREFERENCE_H
  17. #include <ctkCommandLineModulesCoreExport.h>
  18. #include <QSharedDataPointer>
  19. #include <QMetaType>
  20. struct ctkCmdLineModuleBackend;
  21. class ctkCmdLineModuleDescription;
  22. struct ctkCmdLineModuleReferencePrivate;
  23. /**
  24. * \class ctkCmdLineModuleReference
  25. * \brief Defines a reference or handle to a module, including location,
  26. * XML, description and access to the backend.
  27. * \ingroup CommandLineModulesCore
  28. */
  29. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleReference
  30. {
  31. public:
  32. ctkCmdLineModuleReference();
  33. ~ctkCmdLineModuleReference();
  34. ctkCmdLineModuleReference(const ctkCmdLineModuleReference& ref);
  35. ctkCmdLineModuleReference& operator=(const ctkCmdLineModuleReference& ref);
  36. operator bool() const;
  37. ctkCmdLineModuleDescription description() const;
  38. QByteArray rawXmlDescription() const;
  39. QString xmlValidationErrorString() const;
  40. QUrl location() const;
  41. ctkCmdLineModuleBackend* backend() const;
  42. private:
  43. friend class ctkCmdLineModuleManager;
  44. friend uint CTK_CMDLINEMODULECORE_EXPORT qHash(const ctkCmdLineModuleReference&);
  45. QSharedDataPointer<ctkCmdLineModuleReferencePrivate> d;
  46. };
  47. Q_DECLARE_METATYPE(ctkCmdLineModuleReference)
  48. uint CTK_CMDLINEMODULECORE_EXPORT qHash(const ctkCmdLineModuleReference& moduleRef);
  49. #endif // CTKCMDLINEMODULEREFERENCE_H