Files
UnrealEngineUWP/Engine/Source/Editor/SourceControlWindows/Public/ISourceControlWindowsModule.h
benoit chauvin 5f4e27ed26 New Delegate to override the submit functionality for the Source Control Changelist window and the Source Control Window.
This new delegate give users the capability to intercept and handle the submit instead of the regular flows.
Depending on the reply from the delegate the current flow will be:
- interrupted if the submit is handled by the delegate
- interrupted and set to fail state if the delegate returns an error
- continued if the delegate cannot handle the current source provider

#rb Stuart.Hill, brooke.hubert, Patrick.Enfedaque

[CL 28533359 by benoit chauvin in ue5-main branch]
2023-10-06 04:38:12 -04:00

55 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Containers/Union.h"
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"
/**
* SourceControlWindows module interface
*/
enum class FSubmitOverrideReply
{
Handled,
ProviderNotSupported,
Error,
Num
};
struct SSubmitOverrideParameters
{
TUnion<FString, TArray<FString>> ToSubmit;
FString Description;
};
DECLARE_DELEGATE_RetVal_OneParam(FSubmitOverrideReply, FSubmitOverrideDelegate, SSubmitOverrideParameters /*InParameters*/);
class ISourceControlWindowsModule : public IModuleInterface
{
public:
/**
* Get reference to the SourceControlWindows module instance
*/
static inline ISourceControlWindowsModule& Get()
{
return FModuleManager::LoadModuleChecked<ISourceControlWindowsModule>("SourceControlWindows");
}
static inline ISourceControlWindowsModule* TryGet()
{
return FModuleManager::GetModulePtr<ISourceControlWindowsModule>("SourceControlWindows");
}
virtual void ShowChangelistsTab() = 0;
virtual bool CanShowChangelistsTab() const = 0;
virtual void SelectFiles(const TArray<FString>& Filenames) = 0;
DECLARE_EVENT_OneParam(ISourceControlWindowsModule, FChangelistFileDoubleClickedEvent, const FString&);
virtual FChangelistFileDoubleClickedEvent& OnChangelistFileDoubleClicked() = 0;
FSubmitOverrideDelegate SubmitOverrideDelegate;
};