// Copyright Epic Games, Inc. All Rights Reserved #pragma once #include "Containers/Ticker.h" #include "Framework/Docking/TabManager.h" // TraceInsightsFrontend #include "InsightsFrontend/InsightsFrontendSettings.h" #include "InsightsFrontend/ITraceInsightsFrontendModule.h" namespace UE::Trace { class FStoreConnection; } namespace UE::Insights { class FInsightsAutomationController; class STraceStoreWindow; class SConnectionWindow; class FTraceInsightsFrontendModule : public ITraceInsightsFrontendModule { public: virtual ~FTraceInsightsFrontendModule() { } ////////////////////////////////////////////////// // IModuleInterface virtual void StartupModule() override; virtual void ShutdownModule() override; virtual bool SupportsDynamicReloading() override { return false; } ////////////////////////////////////////////////// // ITraceInsightsFrontendModule virtual bool ConnectToStore(const TCHAR* InStoreHost, uint32 InStorePort = 0) override; virtual void CreateFrontendWindow(const FCreateFrontendWindowParams& Params) override; virtual TSharedPtr GetTraceStoreWindow() const override { return TraceStoreWindow.Pin(); } virtual TSharedPtr GetConnectionWindow() const override { return ConnectionWindow.Pin(); } virtual void RunAutomationTests(const FString& InCmd) override; ////////////////////////////////////////////////// FInsightsFrontendSettings& GetSettings(); private: void RegisterTabSpawners(); void UnregisterTabSpawners(); /** Called to spawn the Trace Store major tab. */ TSharedRef SpawnTraceStoreTab(const FSpawnTabArgs& Args); /** Callback called when the Trace Store major tab is closed. */ void OnTraceStoreTabClosed(TSharedRef TabBeingClosed); /** Called to spawn the Connection major tab. */ TSharedRef SpawnConnectionTab(const FSpawnTabArgs& Args); /** Callback called when the Connection major tab is closed. */ void OnConnectionTabClosed(TSharedRef TabBeingClosed); private: /** An instance of the main settings. */ TSharedPtr Settings; FCreateFrontendWindowParams CreateWindowParams; TSharedPtr PersistentLayout; static FString LayoutIni; TSharedPtr TraceStoreConnection; /** A weak pointer to the Trace Store window. */ TWeakPtr TraceStoreWindow; /** A weak pointer to the Connection window. */ TWeakPtr ConnectionWindow; bool bIsMainTabSet = false; TSharedPtr InsightsAutomationController; /** The delegate to be invoked when this ticks. */ FTickerDelegate OnTick; /** Handle to the registered OnTick. */ FTSTicker::FDelegateHandle OnTickHandle; }; } // UE::Insights