ctkCmdLineModuleDescription.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 2010 Brigham and Women's Hospital (BWH) All Rights Reserved.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =============================================================================*/
  14. #ifndef __ctkCmdLineModuleDescription_h
  15. #define __ctkCmdLineModuleDescription_h
  16. #include <ctkCommandLineModulesCoreExport.h>
  17. #include <QList>
  18. #include <QSharedDataPointer>
  19. class QIcon;
  20. class QIODevice;
  21. class QTextStream;
  22. struct ctkCmdLineModuleDescriptionPrivate;
  23. class ctkCmdLineModuleParameterGroup;
  24. class ctkCmdLineModuleParameter;
  25. /**
  26. * \ingroup CommandLineModulesCore
  27. *
  28. * Description of the parameters of a command line module.
  29. *
  30. * The parameters can be used for automated GUI generation or execution
  31. * of the module.
  32. */
  33. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleDescription
  34. {
  35. public:
  36. ctkCmdLineModuleDescription(const ctkCmdLineModuleDescription& description);
  37. ~ctkCmdLineModuleDescription();
  38. ctkCmdLineModuleDescription& operator=(const ctkCmdLineModuleDescription& other);
  39. static ctkCmdLineModuleDescription parse(QIODevice* input);
  40. QString category() const;
  41. QString title() const;
  42. QString description() const;
  43. QString version() const;
  44. QString documentationURL() const;
  45. QString license() const;
  46. QString acknowledgements() const;
  47. QString contributor() const;
  48. QIcon logo() const;
  49. QList<ctkCmdLineModuleParameterGroup> parameterGroups() const;
  50. bool hasParameter(const QString& name) const;
  51. ctkCmdLineModuleParameter parameter(const QString& name) const;
  52. // Does the module have any simple (primitive) return types?
  53. bool hasReturnParameters() const;
  54. private:
  55. friend class ctkCmdLineModuleXmlParser;
  56. friend class ctkCmdLineModuleReferencePrivate;
  57. ctkCmdLineModuleDescription();
  58. QSharedDataPointer<ctkCmdLineModuleDescriptionPrivate> d;
  59. };
  60. CTK_CMDLINEMODULECORE_EXPORT QTextStream & operator<<(QTextStream& os, const ctkCmdLineModuleDescription& module);
  61. #endif