// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Input/Reply.h" #include "Framework/Commands/InputChord.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/SCompoundWidget.h" #include "AssetThumbnail.h" #include "Widgets/Views/STableViewBase.h" #include "Widgets/Views/STableRow.h" class FTabSwitchingListItemBase; template class SListView; ////////////////////////////////////////////////////////////////////////// // SGlobalTabSwitchingDialog class SGlobalTabSwitchingDialog : public SCompoundWidget { public: SLATE_BEGIN_ARGS(SGlobalTabSwitchingDialog){} SLATE_END_ARGS() public: void Construct(const FArguments& InArgs, FVector2D InSize, FInputChord InTriggerChord); ~SGlobalTabSwitchingDialog(); // SWidget interface virtual FReply OnPreviewKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override; virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override; virtual FReply OnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override; virtual bool SupportsKeyboardFocus() const override { return true; } // End of SWidget interface // Is an instance already open? static bool IsAlreadyOpen() { return bIsAlreadyOpen; } private: typedef TSharedPtr FTabListItemPtr; typedef SListView STabListWidget; private: TSharedRef OnGenerateTabSwitchListItemWidget(FTabListItemPtr InItem, const TSharedRef& OwnerTable); void CycleSelection(bool bForwards); void OnMainTabListSelectionChanged(FTabListItemPtr InItem, ESelectInfo::Type SelectInfo); void OnMainTabListItemClicked(FTabListItemPtr InItem); void DismissDialog(); FReply OnBrowseToSelectedAsset(); FTabListItemPtr GetMainTabListSelectedItem() const; private: // The chord that triggered the dialog (so we can handle the correct Tab/`/etc... key repeat, and dismiss on the correct control/command modifier release FInputChord TriggerChord; // The array of 'document' items TArray MainTabsListDataSource; // The widget representing the list of 'document' items TSharedPtr MainTabsListWidget; // The container widget for the indication of the asset that will be activated when the dialog closes TSharedPtr NewTabItemToActivateDisplayBox; // The container widget for the indication of the path to the asset that will be activated when the dialog closes TSharedPtr NewTabItemToActivatePathBox; static bool bIsAlreadyOpen; };