// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Widgets/Docking/SDockTab.h" #include "ViewportTabContent.h" class FEditorViewportLayout; /** * Represents the content in a viewport tab in an editor. * Each SDockTab holding viewports in an editor contains and owns one of these. */ class UNREALED_API FEditorViewportTabContent: public FViewportTabContent , public TSharedFromThis { public: /** Returns whether the tab is currently shown */ bool IsVisible() const; /** @return True if this viewport belongs to the tab given */ bool BelongsToTab(TSharedRef InParentTab) const; /** @return The string used to identify the layout of this viewport tab */ const FString& GetLayoutString() const { return LayoutString; } const TSharedPtr GetActiveViewportLayout() const { return ActiveViewportLayout; } TSharedPtr ConstructViewportLayoutByTypeName(const FName& TypeName, bool bSwitchingLayouts); void Initialize(TFunction(void)> Func, TSharedPtr InParentTab, const FString& InLayoutString); /** * Sets the current layout by changing the contained layout object * * @param ConfigurationName The name of the layout (for the names in namespace EditorViewportConfigurationNames) */ void SetViewportConfiguration(TFunction(void)>& Func, const FName& ConfigurationName); void SetViewportConfiguration(const FName& ConfigurationName) override; TSharedPtr GetFirstViewport(); void UpdateViewportTabWidget(TFunction(void)>& Func); /** Save any configuration required to persist state for this viewport layout */ void SaveConfig() const; private: TFunction(void)> ViewportCreationFunc; };