// 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" #define UE_API PERSONA_API 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 SPersonaToolbox : public SCompoundWidget { public: SLATE_BEGIN_ARGS( SPersonaToolbox ) {} SLATE_END_ARGS() UE_API ~SPersonaToolbox(); UE_API void Construct(const FArguments& InArgs, const TSharedRef& InOwningEditor); // Called to attach a toolkit to this toolbox widget (e.g. when the mode changes). UE_API void AttachToolkit(const TSharedRef& InToolkit); // Called to detach a toolkit from this toolbox widget (e.g. when the mode changes). UE_API void DetachToolkit(const TSharedRef& InToolkit); // Sets the owning tab so that we can update the tab icon based on what the toolkit provides. UE_API void SetOwningTab(const TSharedRef& InOwningTab); private: UE_API void UpdateInlineContent(const TSharedPtr& Toolkit, TSharedPtr InlineContent); UE_API void UpdatePalette(const TWeakPtr& InWeakToolkit) const; // Whether to show the inline content or not. UE_API 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; }; #undef UE_API