/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #if !defined(Q_MOC_RUN) #include #include #include #include #endif namespace AZ { namespace LyIntegration { //! Custom thumbnail that detects when an asset changes and updates the thumbnail class SharedThumbnail final : public AzToolsFramework::Thumbnailer::Thumbnail , public AzToolsFramework::Thumbnailer::ThumbnailerRendererNotificationBus::Handler , private AzFramework::AssetCatalogEventBus::Handler { Q_OBJECT public: SharedThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key); ~SharedThumbnail() override; //! AzToolsFramework::ThumbnailerRendererNotificationBus::Handler overrides... void ThumbnailRendered(const QPixmap& thumbnailImage) override; void ThumbnailFailedToRender() override; protected: void LoadThread() override; private: // AzFramework::AssetCatalogEventBus::Handler interface overrides... void OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) override; AZStd::binary_semaphore m_renderWait; Data::AssetId m_assetId; AZ::Uuid m_typeId; }; //! Cache configuration for large thumbnails class SharedThumbnailCache final : public AzToolsFramework::Thumbnailer::ThumbnailCache { public: SharedThumbnailCache(); ~SharedThumbnailCache() override; int GetPriority() const override; const char* GetProviderName() const override; static constexpr const char* ProviderName = "Common Feature Shared Thumbnail= Provider"; protected: bool IsSupportedThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key) const override; }; } // namespace LyIntegration } // namespace AZ