PythonBindingsInterface.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. * its licensors.
  4. *
  5. * For complete copyright and license terms please see the LICENSE at the root of this
  6. * distribution (the "License"). All use of this software is governed by the License,
  7. * or, if provided, by the license below or the license accompanying this file. Do not
  8. * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. *
  11. */
  12. #pragma once
  13. #include <AzCore/EBus/EBus.h>
  14. #include <AzCore/Interface/Interface.h>
  15. #include <AzCore/std/string/string.h>
  16. #include <AzCore/std/containers/vector.h>
  17. #include <AzCore/Outcome/Outcome.h>
  18. #include <EngineInfo.h>
  19. #include <GemCatalog/GemInfo.h>
  20. #include <ProjectInfo.h>
  21. #include <ProjectTemplateInfo.h>
  22. namespace O3DE::ProjectManager
  23. {
  24. //! Interface used to interact with the o3de cli python functions
  25. class IPythonBindings
  26. {
  27. public:
  28. AZ_RTTI(O3DE::ProjectManager::IPythonBindings, "{C2B72CA4-56A9-4601-A584-3B40E83AA17C}");
  29. AZ_DISABLE_COPY_MOVE(IPythonBindings);
  30. IPythonBindings() = default;
  31. virtual ~IPythonBindings() = default;
  32. // Engine
  33. /**
  34. * Get info about the engine
  35. * @return an outcome with EngineInfo on success
  36. */
  37. virtual AZ::Outcome<EngineInfo> GetEngineInfo() = 0;
  38. /**
  39. * Set info about the engine
  40. * @param engineInfo an EngineInfo object
  41. */
  42. virtual bool SetEngineInfo(const EngineInfo& engineInfo) = 0;
  43. // Gems
  44. /**
  45. * Get info about a Gem
  46. * @param path the absolute path to the Gem
  47. * @return an outcome with GemInfo on success
  48. */
  49. virtual AZ::Outcome<GemInfo> GetGem(const QString& path) = 0;
  50. /**
  51. * Get info about all known Gems
  52. * @return an outcome with GemInfos on success
  53. */
  54. virtual AZ::Outcome<QVector<GemInfo>> GetGems() = 0;
  55. // Projects
  56. /**
  57. * Create a project
  58. * @param projectTemplate the project template to use
  59. * @param projectInfo the project info to use
  60. * @return an outcome with ProjectInfo on success
  61. */
  62. virtual AZ::Outcome<ProjectInfo> CreateProject(const ProjectTemplateInfo& projectTemplate, const ProjectInfo& projectInfo) = 0;
  63. /**
  64. * Get info about a project
  65. * @param path the absolute path to the project
  66. * @return an outcome with ProjectInfo on success
  67. */
  68. virtual AZ::Outcome<ProjectInfo> GetProject(const QString& path) = 0;
  69. /**
  70. * Get info about all known projects
  71. * @return an outcome with ProjectInfos on success
  72. */
  73. virtual AZ::Outcome<QVector<ProjectInfo>> GetProjects() = 0;
  74. /**
  75. * Update a project
  76. * @param projectInfo the info to use to update the project
  77. * @return true on success, false on failure
  78. */
  79. virtual bool UpdateProject(const ProjectInfo& projectInfo) = 0;
  80. // Project Templates
  81. /**
  82. * Get info about all known project templates
  83. * @return an outcome with ProjectTemplateInfos on success
  84. */
  85. virtual AZ::Outcome<QVector<ProjectTemplateInfo>> GetProjectTemplates() = 0;
  86. };
  87. using PythonBindingsInterface = AZ::Interface<IPythonBindings>;
  88. } // namespace O3DE::ProjectManager