Files
UnrealEngineUWP/Engine/Source/Runtime/LiveLinkInterface/Public/LiveLinkSourceFactory.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

60 lines
2.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "UObject/Object.h"
#include "LiveLinkSourceFactory.generated.h"
class ILiveLinkSource;
class ILiveLinkClient;
class SWidget;
/**
* Base class of factory that creates Source. A source can be created in the editor via the Live Link panel or at runtime via a connection string.
*/
UCLASS(Abstract)
class LIVELINKINTERFACE_API ULiveLinkSourceFactory : public UObject
{
GENERATED_BODY()
public:
/** The name of the menu item (of any EMenuType) */
virtual FText GetSourceDisplayName() const PURE_VIRTUAL( ULiveLinkSourceFactory::GetSourceDisplayName, return FText(); );
/** The tooltip of the menu item (of any EMenyType) */
virtual FText GetSourceTooltip() const PURE_VIRTUAL(ULiveLinkSourceFactory::GetSourceTooltip, return FText(); );
UE_DEPRECATED(4.23, "CreateSourceCreationPanel is deprecated. LiveLinkSourceFactory can now be used at runtime. This factory won't work until it's been updated.")
virtual TSharedPtr<SWidget> CreateSourceCreationPanel();
UE_DEPRECATED(4.23, "OnSourceCreationPanelClosed is deprecated. LiveLinkSourceFactory can now be used at runtime. The factory won't work until it's been updated.")
virtual TSharedPtr<ILiveLinkSource> OnSourceCreationPanelClosed(bool bMakeSource);
enum class EMenuType
{
SubPanel, // In the UI, a sub menu will used
MenuEntry, // In the UI, a button will be used
Disabled, // In the UI, the button will be used but it will be disabled
};
/**
* How the factory should be visible in the LiveLink UI.
* If SubPanel, BuildCreationPanel should be implemented.
*/
virtual EMenuType GetMenuType() const { return EMenuType::Disabled; }
DECLARE_DELEGATE_TwoParams(FOnLiveLinkSourceCreated, TSharedPtr<ILiveLinkSource> /*Created source*/, FString /*ConnectionString*/);
/**
* Create a widget responsible for the creation of a Live Link source.
* @param OnLiveLinkSourceCreated Callback to call when the source has been created by the custom UI.
* @return The subpanel UI created by the factory.
*/
virtual TSharedPtr<SWidget> BuildCreationPanel(FOnLiveLinkSourceCreated OnLiveLinkSourceCreated) const;
/** Create a new source from a ConnectionString */
virtual TSharedPtr<ILiveLinkSource> CreateSource(const FString& ConnectionString) const PURE_VIRTUAL(ULiveLinkSourceFactory::CreateSource, return TSharedPtr<ILiveLinkSource>(); );
};