ctkCmdLineModuleParameter.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 __ctkCmdLineModuleParameter_h
  15. #define __ctkCmdLineModuleParameter_h
  16. #include "ctkCommandLineModulesCoreExport.h"
  17. #include <QSharedDataPointer>
  18. class QTextStream;
  19. class QStringList;
  20. class ctkCmdLineModuleParameterPrivate;
  21. /**
  22. * \ingroup CommandLineModulesCore
  23. *
  24. * \brief Single parameter to a module, like a threshold of a filter.
  25. *
  26. * ctkCmdLineModuleParameter describes a single parameters to a
  27. * module. Information on the parameter type, name, flag, label,
  28. * description, channel, index, default, and constraints can be
  29. * stored.
  30. *
  31. */
  32. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleParameter
  33. {
  34. public:
  35. ctkCmdLineModuleParameter(const ctkCmdLineModuleParameter& other);
  36. ~ctkCmdLineModuleParameter();
  37. ctkCmdLineModuleParameter& operator=(const ctkCmdLineModuleParameter& other);
  38. QString tag() const;
  39. // QString cppType() const;
  40. QString type() const;
  41. QString reference() const;
  42. bool hidden() const;
  43. // Simple return types are parameters on output channel with no
  44. // flags and without a specified index
  45. bool isReturnParameter() const;
  46. // Has a flag or a long flag?
  47. bool isFlagParameter() const;
  48. // Is an index type?
  49. bool isIndexParameter() const;
  50. QString argType() const;
  51. //void setStringToType(const QString& stringToType);
  52. //QString stringToType() const;
  53. QString name() const;
  54. QString longFlag() const;
  55. QString longFlagAliasesAsString() const;
  56. QStringList longFlagAliases() const;
  57. QString deprecatedLongFlagAliasesAsString() const;
  58. QStringList deprecatedLongFlagAliases() const;
  59. QString label() const;
  60. bool constraints() const;
  61. QString maximum() const;
  62. QString minimum() const;
  63. QString step() const;
  64. QString description() const;
  65. QString channel() const;
  66. int index() const;
  67. QString defaultValue() const;
  68. QString flag() const;
  69. QString flagAliasesAsString() const;
  70. QStringList flagAliases() const;
  71. QString deprecatedFlagAliasesAsString() const;
  72. QStringList deprecatedFlagAliases() const;
  73. bool multiple() const;
  74. QString aggregate() const;
  75. QString fileExtensionsAsString() const;
  76. QStringList fileExtensions() const;
  77. QString coordinateSystem() const;
  78. QStringList elements() const;
  79. private:
  80. friend class ctkCmdLineModuleParameterParser;
  81. friend class ctkCmdLineModuleXmlParser;
  82. ctkCmdLineModuleParameter();
  83. QSharedDataPointer<ctkCmdLineModuleParameterPrivate> d;
  84. };
  85. CTK_CMDLINEMODULECORE_EXPORT QTextStream& operator<<(QTextStream& os, const ctkCmdLineModuleParameter& parameter);
  86. #endif