SharedPreviewer.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 <AzCore/Asset/AssetCommon.h>
  11. #include <AzCore/Memory/SystemAllocator.h>
  12. #include <AzToolsFramework/AssetBrowser/Previewer/Previewer.h>
  13. AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
  14. #include <QScopedPointer>
  15. #include <QWidget>
  16. AZ_POP_DISABLE_WARNING
  17. #endif
  18. namespace Ui
  19. {
  20. class SharedPreviewerClass;
  21. }
  22. namespace AzToolsFramework
  23. {
  24. namespace AssetBrowser
  25. {
  26. class ProductAssetBrowserEntry;
  27. class SourceAssetBrowserEntry;
  28. class AssetBrowserEntry;
  29. } // namespace AssetBrowser
  30. } // namespace AzToolsFramework
  31. class QResizeEvent;
  32. namespace AZ
  33. {
  34. namespace LyIntegration
  35. {
  36. class SharedPreviewer final : public AzToolsFramework::AssetBrowser::Previewer
  37. {
  38. Q_OBJECT
  39. public:
  40. AZ_CLASS_ALLOCATOR(SharedPreviewer, AZ::SystemAllocator);
  41. explicit SharedPreviewer(QWidget* parent = nullptr);
  42. ~SharedPreviewer();
  43. // AzToolsFramework::AssetBrowser::Previewer overrides...
  44. void Clear() const override;
  45. void Display(const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) override;
  46. const QString& GetName() const override;
  47. protected:
  48. void resizeEvent(QResizeEvent* event) override;
  49. private:
  50. void UpdateFileInfo() const;
  51. QScopedPointer<Ui::SharedPreviewerClass> m_ui;
  52. QString m_fileInfo;
  53. QString m_name = "SharedPreviewer";
  54. };
  55. } // namespace LyIntegration
  56. } // namespace AZ