2022-04-01 14:21:11 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "MVVMPropertyPath.h"
|
|
|
|
|
#include "Types/MVVMBindingMode.h"
|
|
|
|
|
|
|
|
|
|
#include "MVVMBlueprintViewBinding.generated.h"
|
|
|
|
|
|
2022-04-06 08:17:40 -04:00
|
|
|
class UMVVMBlueprintView;
|
|
|
|
|
|
2022-04-01 14:21:11 -04:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
USTRUCT(BlueprintType)
|
2022-06-27 16:24:02 -04:00
|
|
|
struct MODELVIEWVIEWMODELBLUEPRINT_API FMVVMBlueprintViewConversionPath
|
2022-04-01 14:21:11 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
2022-04-06 08:17:40 -04:00
|
|
|
/** The Conversion function when converting the value from the destination to the source. */
|
2022-04-01 14:21:11 -04:00
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM", AdvancedDisplay)
|
2022-05-05 14:31:09 -04:00
|
|
|
FMemberReference DestinationToSourceFunction;
|
2022-06-27 16:24:02 -04:00
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FName DestinationToSourceWrapper;
|
2022-04-01 14:21:11 -04:00
|
|
|
|
2022-04-06 08:17:40 -04:00
|
|
|
/** The Conversion function when converting the value from the source to the destination. */
|
2022-04-01 14:21:11 -04:00
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM", AdvancedDisplay)
|
2022-05-05 14:31:09 -04:00
|
|
|
FMemberReference SourceToDestinationFunction;
|
2022-06-27 16:24:02 -04:00
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FName SourceToDestinationWrapper;
|
2022-04-01 14:21:11 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
USTRUCT(BlueprintType)
|
2022-06-27 16:24:02 -04:00
|
|
|
struct MODELVIEWVIEWMODELBLUEPRINT_API FMVVMBlueprintViewBinding
|
2022-04-01 14:21:11 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM")
|
2022-05-20 18:54:05 -04:00
|
|
|
FMVVMBlueprintPropertyPath ViewModelPath;
|
2022-04-01 14:21:11 -04:00
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM")
|
2022-05-20 18:54:05 -04:00
|
|
|
FMVVMBlueprintPropertyPath WidgetPath;
|
2022-04-01 14:21:11 -04:00
|
|
|
|
|
|
|
|
/** */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM")
|
|
|
|
|
EMVVMBindingMode BindingType = EMVVMBindingMode::OneWayToDestination;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM")
|
|
|
|
|
EMVVMViewBindingUpdateMode UpdateMode = EMVVMViewBindingUpdateMode::Immediate;
|
|
|
|
|
|
|
|
|
|
/** */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM")
|
|
|
|
|
FMVVMBlueprintViewConversionPath Conversion;
|
|
|
|
|
|
|
|
|
|
/** */
|
|
|
|
|
UPROPERTY(VisibleAnywhere, Category = "MVVM", Transient)
|
|
|
|
|
TArray<FText> Errors;
|
|
|
|
|
|
|
|
|
|
/** Whether the binding is enabled or disabled by default. The instance may enable the binding at runtime. */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM")
|
|
|
|
|
bool bEnabled = true;
|
|
|
|
|
|
|
|
|
|
/** The binding is visible in the editor, but is not compiled and cannot be used at runtime. */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "MVVM")
|
|
|
|
|
bool bCompile = true;
|
2022-04-06 08:17:40 -04:00
|
|
|
|
2022-06-27 16:24:02 -04:00
|
|
|
/**
|
|
|
|
|
* Get an internal name. For use in the UI, use GetDisplayNameString()
|
|
|
|
|
*/
|
|
|
|
|
FName GetFName(const UMVVMBlueprintView* View) const;
|
|
|
|
|
|
2022-04-06 08:17:40 -04:00
|
|
|
/**
|
|
|
|
|
* Get a string that identifies this binding.
|
|
|
|
|
* This is of the form: ViewModel.Property -> Widget.Property
|
|
|
|
|
*/
|
2022-06-27 16:24:02 -04:00
|
|
|
FString GetDisplayNameString(const UMVVMBlueprintView* View) const;
|
2022-04-01 14:21:11 -04:00
|
|
|
};
|