/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #pragma once #include #include #include #include namespace AZ { class Entity; } namespace AzQtComponents { class DragAndDropContextBase; } namespace AzToolsFramework { namespace AssetBrowser { class AssetBrowserEntry; class PreviewerFactory; class ProductAssetBrowserEntry; class SourceAssetBrowserEntry; } } class AzAssetBrowserRequestHandler : protected AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler , protected AzQtComponents::DragAndDropEventsBus::Handler { public: AzAssetBrowserRequestHandler(); ~AzAssetBrowserRequestHandler() override; ////////////////////////////////////////////////////////////////////////// // AssetBrowserInteractionNotificationBus ////////////////////////////////////////////////////////////////////////// void AddContextMenuActions(QWidget* caller, QMenu* menu, const AZStd::vector& entries) override; void AddSourceFileOpeners(const char* fullSourceFileName, const AZ::Uuid& sourceUUID, AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) override; void OpenAssetInAssociatedEditor(const AZ::Data::AssetId& assetId, bool& alreadyHandled) override; static bool OpenWithOS(const AZStd::string& fullEntryPath); protected: ////////////////////////////////////////////////////////////////////////// // AzQtComponents::DragAndDropEventsBus::Handler ////////////////////////////////////////////////////////////////////////// void DragEnter(QDragEnterEvent* event, AzQtComponents::DragAndDropContextBase& context) override; void DragMove(QDragMoveEvent* event, AzQtComponents::DragAndDropContextBase& context) override; void DragLeave(QDragLeaveEvent* event) override; void Drop(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) override; bool CanAcceptDragAndDropEvent( QDropEvent* event, AzQtComponents::DragAndDropContextBase& context, AZStd::optional*> outSources = AZStd::nullopt, AZStd::optional*> outProducts = AZStd::nullopt) const; };