3
0

AWSCoreEditorSystemComponent.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <AzToolsFramework/API/ToolsApplicationAPI.h>
  11. #include <AzToolsFramework/ActionManager/ActionManagerRegistrationNotificationBus.h>
  12. #include <Editor/UI/AWSCoreEditorMenu.h>
  13. namespace AWSCore
  14. {
  15. class AWSCoreEditorSystemComponent
  16. : public AZ::Component
  17. , private AzToolsFramework::ActionManagerRegistrationNotificationBus::Handler
  18. , private AWSCoreEditorRequestBus::Handler
  19. {
  20. public:
  21. static constexpr const char EDITOR_HELP_MENU_TEXT[] = "&Help";
  22. AZ_COMPONENT(AWSCoreEditorSystemComponent, "{6098B19B-90F2-41DC-8D01-70277980249D}");
  23. AWSCoreEditorSystemComponent() = default;
  24. static void Reflect(AZ::ReflectContext* context);
  25. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  26. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  27. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  28. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  29. private:
  30. // AZ::Component interface implementation
  31. void Init() override;
  32. void Activate() override;
  33. void Deactivate() override;
  34. // AWSCoreEditorRequestBus interface implementation
  35. void CreateSubMenu(const AZStd::string& parentMenuIdentifier, const char* const menuDetails[], int sort) override;
  36. void AddExternalLinkAction(const AZStd::string& menuIdentifier, const char* const actionDetails[], int sort) override;
  37. // ActionManagerRegistrationNotificationBus implementation
  38. void OnMenuBarRegistrationHook() override;
  39. void OnMenuBindingHook() override;
  40. AZStd::unique_ptr<AWSCoreEditorMenu> m_awsCoreEditorMenu;
  41. AzToolsFramework::ActionManagerInterface* m_actionManagerInterface = nullptr;
  42. AzToolsFramework::MenuManagerInterface* m_menuManagerInterface = nullptr;
  43. AzToolsFramework::MenuManagerInternalInterface* m_menuManagerInternalInterface = nullptr;
  44. };
  45. } // namespace AWSCore