HeaderWidget.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 <QWidget>
  11. #include <AzCore/std/string/string.h>
  12. #include <AzCore/Memory/SystemAllocator.h>
  13. #endif
  14. namespace AZ
  15. {
  16. namespace SceneAPI
  17. {
  18. namespace Containers
  19. {
  20. class SceneManifest;
  21. }
  22. namespace DataTypes
  23. {
  24. class IManifestObject;
  25. }
  26. namespace UI
  27. {
  28. // QT space
  29. namespace Ui
  30. {
  31. class HeaderWidget;
  32. }
  33. class HeaderWidget : public QWidget
  34. {
  35. Q_OBJECT
  36. public:
  37. AZ_CLASS_ALLOCATOR_DECL
  38. enum NameStack
  39. {
  40. Label,
  41. EditField
  42. };
  43. explicit HeaderWidget(QWidget* parent);
  44. void SetManifestObject(const DataTypes::IManifestObject* target);
  45. const DataTypes::IManifestObject* GetManifestObject() const;
  46. bool ModifyTooltip(QString& toolTipString);
  47. protected:
  48. bool InitSceneManifest();
  49. virtual void DeleteObject();
  50. virtual void UpdateDeletable();
  51. virtual const char* GetSerializedName(const DataTypes::IManifestObject* target) const;
  52. virtual void UpdateUIForManifestObject(const DataTypes::IManifestObject* target);
  53. AZStd::string m_objectName;
  54. QScopedPointer<Ui::HeaderWidget> ui;
  55. Containers::SceneManifest* m_sceneManifest; // Reference only, does not point to a local instance.
  56. const DataTypes::IManifestObject* m_target; // Reference only, does not point to a local instance.
  57. };
  58. } // namespace UI
  59. } // namespace SceneAPI
  60. } // namespace AZ