AssetIdNodePropertyDisplay.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 <AzFramework/Asset/AssetCatalogBus.h>
  10. #include <AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx>
  11. #include <GraphCanvas/Components/NodePropertyDisplay/NodePropertyDisplay.h>
  12. #include <GraphCanvas/Components/NodePropertyDisplay/AssetIdDataInterface.h>
  13. class QGraphicsProxyWidget;
  14. namespace GraphCanvas
  15. {
  16. class GraphCanvasLabel;
  17. class AssetIdNodePropertyDisplay
  18. : public NodePropertyDisplay
  19. {
  20. public:
  21. AZ_CLASS_ALLOCATOR(AssetIdNodePropertyDisplay, AZ::SystemAllocator);
  22. AssetIdNodePropertyDisplay(AssetIdDataInterface* dataInterface);
  23. virtual ~AssetIdNodePropertyDisplay();
  24. // NodePropertyDisplay
  25. void RefreshStyle() override;
  26. void UpdateDisplay() override;
  27. QGraphicsLayoutItem* GetDisabledGraphicsLayoutItem() override;
  28. QGraphicsLayoutItem* GetDisplayGraphicsLayoutItem() override;
  29. QGraphicsLayoutItem* GetEditableGraphicsLayoutItem() override;
  30. ////
  31. // DataSlotNotifications
  32. void OnDragDropStateStateChanged(const DragDropState& dragState) override;
  33. ////
  34. private:
  35. void EditStart();
  36. void EditFinished();
  37. void SubmitValue();
  38. void SetupProxyWidget();
  39. void CleanupProxyWidget();
  40. AssetIdDataInterface* m_dataInterface;
  41. AzToolsFramework::PropertyAssetCtrl* m_propertyAssetCtrl;
  42. GraphCanvasLabel* m_disabledLabel;
  43. QGraphicsProxyWidget* m_proxyWidget;
  44. GraphCanvasLabel* m_displayLabel;
  45. };
  46. }