UiEditorInternalBus.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/EBus/EBus.h>
  10. #include <AzToolsFramework/API/ToolsApplicationAPI.h>
  11. ////////////////////////////////////////////////////////////////////////////////////////////////////
  12. //! Interface class that the UI Editor needs to implement
  13. class UiEditorInernalRequests
  14. : public AZ::EBusTraits
  15. {
  16. public: // member functions
  17. //! Get the selected entityIds in the UiEditor
  18. virtual AzToolsFramework::EntityIdList GetSelectedEntityIds() = 0;
  19. //! Get the selected components in the UiEditor
  20. virtual AZ::Entity::ComponentArrayType GetSelectedComponents() = 0;
  21. //! Get the entityId of the active Canvas in the UiEditor
  22. virtual AZ::EntityId GetActiveCanvasEntityId() = 0;
  23. };
  24. typedef AZ::EBus<UiEditorInernalRequests> UiEditorInternalRequestBus;
  25. ////////////////////////////////////////////////////////////////////////////////////////////////////
  26. //! Interface class that the UI Editor needs to implement
  27. class UiEditorInternalNotifications
  28. : public AZ::EBusTraits
  29. {
  30. public:
  31. //! Called when a property on the selected entities has changed
  32. virtual void OnSelectedEntitiesPropertyChanged() = 0;
  33. //! Called before making an undoable change to entities
  34. virtual void OnBeginUndoableEntitiesChange() = 0;
  35. //! Called after making an undoable change to entities
  36. virtual void OnEndUndoableEntitiesChange(const AZStd::string& commandText) = 0;
  37. };
  38. typedef AZ::EBus<UiEditorInternalNotifications> UiEditorInternalNotificationBus;