qtprojectgeneratorfactory.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef QTPROJECTGENERATORFACTORY_H
  2. #define QTPROJECTGENERATORFACTORY_H
  3. #include <QList>
  4. #include <QString>
  5. #include "generatoroutputview.h"
  6. #include "iqtprojectgenerator.h"
  7. #define DYN_BUILDTARGET "_DynBuild_"
  8. /**
  9. * This POV can tell about a platform (its name) and whether
  10. * it is the default platform to generate projects for.
  11. */
  12. struct PlatformInfo
  13. {
  14. /**
  15. * Meant to be used as a short menu item name.
  16. */
  17. QString m_platformName;
  18. /**
  19. * Meant to be used as a slightly more descriptive text for
  20. * the item.
  21. */
  22. QString m_shortDescription;
  23. /**
  24. * Meant to be used to set the user data for a QAction,
  25. * identifying the platform. All IDs shall start with the
  26. * string defined by DYN_BUILDTARGET, therefore all dynamically
  27. * created QAction instances dealing with building can be
  28. * identified as such.
  29. */
  30. QString m_platformId;
  31. /**
  32. * Whether the platform denoted by this platform info is
  33. * the default build target.
  34. */
  35. bool m_isDefault;
  36. // ignore this - for internal use only
  37. void * m_opaque;
  38. };
  39. /**
  40. * Manages IQtProjectGenerator types (static "plugins").
  41. */
  42. class QtProjectGeneratorFactory
  43. {
  44. private:
  45. //
  46. // private member variables
  47. //
  48. QList<PlatformInfo> m_supportedPlatforms;
  49. public:
  50. //
  51. // lifetime management
  52. //
  53. QtProjectGeneratorFactory();
  54. /**
  55. * @return the list of platforms (<platform-name, is-default> tuples) supported.
  56. */
  57. QList<PlatformInfo> supportedPlatforms() const;
  58. /**
  59. * @return a newly created instance of a project generator with
  60. * given name, or NULL on failure.
  61. *
  62. * @platformName the name of the platform to create project generator for
  63. */
  64. IQtProjectGenerator * createProjectGenerator(const QString & platformName,
  65. GeneratorOutputView & outputView,
  66. QObject * parent = NULL) const;
  67. };
  68. #endif // QTPROJECTGENERATORFACTORY_H