Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor/Private/SLevelEditorModeContent.h
Lauren Barnes b4b7f96557 UEdMode initial implementation and handling by FEdModeManager
#jira UETOOL-1722
#rb none
#rnx
#fyi Ryan.Schmidt

[CL 8614167 by Lauren Barnes in Dev-Editor branch]
2019-09-10 12:01:07 -04:00

81 lines
2.3 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Layout/Visibility.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
#include "ILevelEditor.h"
#include "Misc/NotifyHook.h"
class FEdMode;
class SBorder;
class FName;
typedef FName FEditorModeID;
/**
* Tools for the level editor
*/
class SLevelEditorModeContent : public SCompoundWidget, public FNotifyHook
{
public:
SLATE_BEGIN_ARGS( SLevelEditorModeContent ){}
SLATE_END_ARGS()
~SLevelEditorModeContent();
void Construct(
const FArguments& InArgs,
const TSharedRef< class ILevelEditor >& OwningLevelEditor,
const TSharedRef< SDockTab >& InOwningDocTab,
FEdMode* EditorMode );
/** Called by SLevelEditor to notify the toolbox about a new toolkit being hosted */
void OnToolkitHostingStarted( const TSharedRef< class IToolkit >& Toolkit );
/** Called by SLevelEditor to notify the toolbox about an existing toolkit no longer being hosted */
void OnToolkitHostingFinished( const TSharedRef< class IToolkit >& Toolkit );
private:
/**
* Handles being notified when any editor mode changes to see if this tab needs to close.
* @param Mode The mode that changed.
* @param IsEnabled true if the mode is enabled, otherwise false.
*/
void HandleEditorModeChanged(const FEditorModeID& EditorModeID, bool IsEnabled);
/** Gets the visibility for the SBorder showing toolbox editor mode inline content */
EVisibility GetInlineContentHolderVisibility() const;
/** Updates the widget for showing toolbox editor mode inline content */
void UpdateInlineContent(TSharedPtr<SWidget> InlineContent) const;
/** Creates and sets the mode toolbar */
void UpdateModeToolBar();
/** Handles updating the mode toolbar when the user settings change */
void HandleUserSettingsChange( FName PropertyName );
/**
* Called when the tab is closed.
* @param TabBeingClosed The tab being closed
*/
void HandleParentClosed( TSharedRef<SDockTab> TabBeingClosed );
private:
/** Level editor that we're associated with */
TWeakPtr<class ILevelEditor> LevelEditor;
/** Doc tab we're hosted in */
TWeakPtr<class SDockTab> DocTab;
FEdMode* EditorMode;
/** Inline content area for editor modes */
TSharedPtr<SBorder> InlineContentHolder;
};