// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "PersonaAssetEditorToolkit.h" #include "CoreMinimal.h" #include "StatusBarSubsystem.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/Docking/SDockTab.h" #include "Widgets/SCompoundWidget.h" #include "WorkflowOrientedApp/WorkflowTabFactory.h" #include "Delegates/DelegateCombinations.h" #include "Templates/SharedPointer.h" #include "Toolkits/IToolkit.h" class FModeToolkit; class FPersonaAssetEditorToolkit; class IToolkit; class SBorder; struct FToolBoxSummoner : public FWorkflowTabFactory { public: FToolBoxSummoner(TSharedPtr InPersonaEditorToolkit); virtual TSharedRef SpawnTab(const FWorkflowTabSpawnInfo& Info) const override; virtual TSharedRef CreateTabBody(const FWorkflowTabSpawnInfo& Info) const override; virtual bool CanSpawnTab(const FSpawnTabArgs& SpawnArgs, TWeakPtr WeakTabManager) const override; protected: TWeakPtr PersonaAssetEditorToolkit; }; /** Widget to surface an Edit Mode its widget, similar to LevelEditor approach */ class PERSONA_API SPersonaToolbox : public SCompoundWidget { public: SLATE_BEGIN_ARGS( SPersonaToolbox ) {} SLATE_END_ARGS() ~SPersonaToolbox(); void Construct(const FArguments& InArgs, const TSharedRef& InOwningEditor); // Called to attach a toolkit to this toolbox widget (e.g. when the mode changes). void AttachToolkit(const TSharedRef& InToolkit); // Called to detach a toolkit from this toolbox widget (e.g. when the mode changes). void DetachToolkit(const TSharedRef& InToolkit); // Sets the owning tab so that we can update the tab icon based on what the toolkit provides. void SetOwningTab(const TSharedRef& InOwningTab); private: void UpdateInlineContent(const TSharedPtr& Toolkit, TSharedPtr InlineContent); void UpdatePalette(const TWeakPtr& InWeakToolkit) const; // Whether to show the inline content or not. EVisibility GetInlineContentHolderVisibility() const; // The owning tab where the toolkit's interface is hosted. We need this to update the icons // and title as the toolkit changes. TWeakPtr OwningTab; TWeakPtr PersonaEditor; // Inline content area for editor modes TSharedPtr InlineContentHolder; // The container holding the mode toolbar TSharedPtr ModeToolBarContainer; // The active tool header area TSharedPtr ModeToolHeader; // The global status bar to show the name of the active tool. FStatusBarMessageHandle StatusBarMessageHandle; };