2
0

QComponentEntityEditorMainWindow.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. #if !defined(Q_MOC_RUN)
  10. #include <QMainWindow>
  11. #include <QStackedWidget>
  12. #include <AzToolsFramework/API/ToolsApplicationAPI.h>
  13. #include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
  14. #include <AzToolsFramework/AssetBrowser/AssetBrowserEntityInspectorWidget.h>
  15. #include <CryCommon/ISystem.h>
  16. #endif
  17. class QObjectPropertyModel;
  18. class PropertyInfo;
  19. namespace AZ
  20. {
  21. class Entity;
  22. }
  23. namespace AzToolsFramework
  24. {
  25. class ReflectedPropertyEditor;
  26. class EntityPropertyEditor;
  27. }
  28. // This is the shell class to interface between Qt and the Sandbox. All Sandbox implementation is retained in an inherited class.
  29. class QComponentEntityEditorInspectorWindow
  30. : public QMainWindow
  31. , public ISystemEventListener
  32. , public AzToolsFramework::ToolsApplicationNotificationBus::Handler
  33. , public AzToolsFramework::AssetBrowser::AssetBrowserPreviewRequestBus::Handler
  34. {
  35. Q_OBJECT
  36. public:
  37. explicit QComponentEntityEditorInspectorWindow(QWidget* parent = 0);
  38. ~QComponentEntityEditorInspectorWindow();
  39. void Init();
  40. // Used to receive events from widgets where SIGNALS aren't available or implemented yet.
  41. // Required override.
  42. void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam) override;
  43. // ToolsApplicationNotificationBus overrides...
  44. void AfterEntitySelectionChanged(
  45. [[maybe_unused]]const AzToolsFramework::EntityIdList& newlySelectedEntities,
  46. [[maybe_unused]]const AzToolsFramework::EntityIdList& newlyDeselectedEntities) override;
  47. // AssetBrowserPreviewRequestBus overrides...
  48. void PreviewAsset([[maybe_unused]]const AzToolsFramework::AssetBrowser::AssetBrowserEntry* selectedEntry) override;
  49. // you are required to implement this to satisfy the unregister/registerclass requirements on "AzToolsFramework::RegisterViewPane"
  50. // make sure you pick a unique GUID
  51. static const GUID& GetClassID()
  52. {
  53. // {D7FEC1E3-8898-4D1F-8A9C-F8A161AF6746}
  54. static const GUID guid =
  55. {
  56. 0xD7FEC1E3, 0x8898, 0x4D1F, { 0x8a, 0x9c, 0xf8, 0xa1, 0x61, 0xaf, 0x67, 0x46 }
  57. };
  58. return guid;
  59. }
  60. void closeEvent(QCloseEvent* ev) override;
  61. AzToolsFramework::EntityPropertyEditor* GetPropertyEditor() { return m_propertyEditor; }
  62. AzToolsFramework::AssetBrowser::AssetBrowserEntityInspectorWidget* GetAssetBrowserInspector() { return m_assetBrowserInspector; }
  63. private:
  64. AzToolsFramework::EntityPropertyEditor* m_propertyEditor;
  65. AzToolsFramework::AssetBrowser::AssetBrowserEntityInspectorWidget* m_assetBrowserInspector;
  66. QStackedWidget* m_inspectorWidgetStack;
  67. };