HeaderHandler.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/Math/Crc.h>
  11. #include <AzCore/Memory/SystemAllocator.h>
  12. #include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
  13. #include <SceneAPI/SceneUI/RowWidgets/HeaderWidget.h>
  14. #include <SceneAPI/SceneData/Groups/MeshGroup.h>
  15. #endif
  16. class QWidget;
  17. /*
  18. =============================================================
  19. = Handler Documentation =
  20. =============================================================
  21. Handler Name: "Header"
  22. */
  23. namespace AZ
  24. {
  25. namespace SceneAPI
  26. {
  27. namespace UI
  28. {
  29. class HeaderHandler
  30. : public QObject, public AzToolsFramework::PropertyHandler<DataTypes::IManifestObject, HeaderWidget>
  31. {
  32. Q_OBJECT
  33. public:
  34. AZ_CLASS_ALLOCATOR_DECL
  35. QWidget* CreateGUI(QWidget* parent) override;
  36. u32 GetHandlerName() const override;
  37. bool AutoDelete() const override;
  38. bool IsDefaultHandler() const override;
  39. void ConsumeAttribute(HeaderWidget* widget, u32 attrib,
  40. AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override;
  41. void WriteGUIValuesIntoProperty(size_t index, HeaderWidget* GUI, property_t& instance,
  42. AzToolsFramework::InstanceDataNode* node) override;
  43. bool ReadValuesIntoGUI(size_t index, HeaderWidget* GUI, const property_t& instance,
  44. AzToolsFramework::InstanceDataNode* node) override;
  45. bool ModifyTooltip(QWidget* widget, QString& toolTipString) override;
  46. static void Register();
  47. static void Unregister();
  48. private:
  49. static HeaderHandler* s_instance;
  50. };
  51. } // UI
  52. } // SceneAPI
  53. } // AZ