Application.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <AzFramework/Application/Application.h>
  11. #include <AzToolsFramework/API/PythonLoader.h>
  12. #include <QCoreApplication>
  13. #include <PythonBindings.h>
  14. #include <Settings.h>
  15. #include <ProjectManagerWindow.h>
  16. #endif
  17. namespace AZ
  18. {
  19. class Entity;
  20. }
  21. namespace O3DE::ProjectManager
  22. {
  23. class Application
  24. : public AzFramework::Application
  25. , public AzToolsFramework::EmbeddedPython::PythonLoader
  26. {
  27. public:
  28. AZ_CLASS_ALLOCATOR(Application, AZ::SystemAllocator)
  29. using AzFramework::Application::Application;
  30. virtual ~Application();
  31. bool Init(bool interactive = true, AZStd::unique_ptr<PythonBindings> pythonBindings = nullptr);
  32. bool Run();
  33. void TearDown();
  34. private:
  35. bool InitLog(const char* logName);
  36. bool RegisterEngine(bool interactive);
  37. AZStd::unique_ptr<PythonBindings> m_pythonBindings;
  38. AZStd::unique_ptr<Settings> m_settings;
  39. QSharedPointer<QCoreApplication> m_app;
  40. QSharedPointer<ProjectManagerWindow> m_mainWindow;
  41. AZ::Entity* m_entity = nullptr;
  42. };
  43. }