QtForPythonSystemComponent.h 1.8 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. #include <AzCore/Component/Component.h>
  10. #include <QtForPython/QtForPythonBus.h>
  11. #include <EditorPythonBindings/EditorPythonBindingsBus.h>
  12. namespace QtForPython
  13. {
  14. class QtForPythonEventHandler;
  15. class QtForPythonSystemComponent
  16. : public AZ::Component
  17. , protected QtForPythonRequestBus::Handler
  18. , protected EditorPythonBindings::EditorPythonBindingsNotificationBus::Handler
  19. {
  20. public:
  21. AZ_COMPONENT(QtForPythonSystemComponent, "{0C939FBF-8BC9-4CB0-93B8-04140155AA8C}");
  22. static void Reflect(AZ::ReflectContext* context);
  23. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  24. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  25. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  26. protected:
  27. ////////////////////////////////////////////////////////////////////////
  28. // QtForPythonRequestBus interface implementation
  29. bool IsActive() const override;
  30. QtBootstrapParameters GetQtBootstrapParameters() const override;
  31. ////////////////////////////////////////////////////////////////////////
  32. // AZ::Component interface implementation
  33. void Activate() override;
  34. void Deactivate() override;
  35. ////////////////////////////////////////////////////////////////////////
  36. // EditorPythonBindings::EditorPythonBindingsNotificationBus interface implementation
  37. void OnImportModule(PyObject* module) override;
  38. private:
  39. QtForPythonEventHandler* m_eventHandler = nullptr;
  40. };
  41. }