ManifestNameHandler.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. #if !defined(Q_MOC_RUN)
  10. #include <AzCore/Memory/SystemAllocator.h>
  11. #include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
  12. #include <SceneAPI/SceneUI/RowWidgets/ManifestNameWidget.h>
  13. #endif
  14. class QWidget;
  15. namespace AZ
  16. {
  17. namespace SceneAPI
  18. {
  19. namespace SceneUI
  20. {
  21. //Available Attributes:
  22. // - "FilterType" - Uuid for the type(s) to filter for. If set, the name will only be unique for
  23. // classes of this type or derived classes.
  24. class ManifestNameHandler
  25. : public QObject, public AzToolsFramework::PropertyHandler<AZStd::string, ManifestNameWidget>
  26. {
  27. Q_OBJECT
  28. public:
  29. AZ_CLASS_ALLOCATOR_DECL
  30. QWidget* CreateGUI(QWidget* parent) override;
  31. u32 GetHandlerName() const override;
  32. bool AutoDelete() const override;
  33. void ConsumeAttribute(ManifestNameWidget* widget, u32 attrib,
  34. AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override;
  35. void WriteGUIValuesIntoProperty(size_t index, ManifestNameWidget* GUI, property_t& instance,
  36. AzToolsFramework::InstanceDataNode* node) override;
  37. bool ReadValuesIntoGUI(size_t index, ManifestNameWidget* GUI, const property_t& instance,
  38. AzToolsFramework::InstanceDataNode* node) override;
  39. static void Register();
  40. static void Unregister();
  41. protected:
  42. virtual void ConsumeFilterTypeAttribute(ManifestNameWidget* widget,
  43. AzToolsFramework::PropertyAttributeReader* attrValue);
  44. private:
  45. static ManifestNameHandler* s_instance;
  46. };
  47. } // SceneUI
  48. } // SceneAPI
  49. } // AZ