Files
UnrealEngineUWP/Engine/Plugins/Runtime/ModelViewViewModel/Source/ModelViewViewModelBlueprint/Private/ViewModel/MVVMViewModelBlueprintCompiler.h
henrik karlsson 2f78497e67 [Engine/Plugins]
* Updated private files with IWYU for all plugins which had 3 or less changes made in ue5 main since last integration to fn

#preflight 63bf8d8b577437afe607dc72
#rb none

[CL 23659643 by henrik karlsson in ue5-main branch]
2023-01-12 01:48:34 -05:00

73 lines
2.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "KismetCompiler.h"
#include "KismetCompilerModule.h"
class UEdGraph;
class UMVVMViewModelBlueprint;
class UMVVMViewModelBlueprintGeneratedClass;
//////////////////////////////////////////////////////////////////////////
// FViewModelBlueprintCompiler
namespace UE::MVVM
{
class FViewModelBlueprintCompiler : public IBlueprintCompiler
{
public:
bool CanCompile(const UBlueprint* Blueprint) override;
void Compile(UBlueprint* Blueprint, const FKismetCompilerOptions& CompileOptions, FCompilerResultsLog& Results) override;
bool GetBlueprintTypesForClass(UClass* ParentClass, UClass*& OutBlueprintClass, UClass*& OutBlueprintGeneratedClass) const override;
};
} //namespace
//////////////////////////////////////////////////////////////////////////
// FViewModelBlueprintCompilerContext
namespace UE::MVVM
{
class FViewModelBlueprintCompilerContext : public FKismetCompilerContext
{
typedef FKismetCompilerContext Super;
public:
using FKismetCompilerContext::FKismetCompilerContext;
private:
UMVVMViewModelBlueprint* GetViewModelBlueprint() const;
FProperty* FindPropertyByNameOnNewClass(FName PropertyName) const;
//~ Begin FKismetCompilerContext Interface
virtual void SaveSubObjectsFromCleanAndSanitizeClass(FSubobjectCollection& SubObjectsToSave, UBlueprintGeneratedClass* ClassToClean) override;
virtual void CleanAndSanitizeClass(UBlueprintGeneratedClass* ClassToClean, UObject*& InOutOldCDO) override;
virtual void CreateFunctionList() override;
virtual void CreateClassVariablesFromBlueprint() override;
virtual void SpawnNewClass(const FString& NewClassName) override;
virtual void OnNewClassSet(UBlueprintGeneratedClass* ClassToUse) override;
virtual void PostcompileFunction(FKismetFunctionContext& Context) override;
virtual void FinishCompilingClass(UClass* Class) override;
//~ End FKismetCompilerContext Interface
private:
struct FGeneratedFunction
{
FName PropertyName;
UEdGraph* SetterFunction = nullptr;
UEdGraph* NetRepFunction = nullptr;
FProperty* Property = nullptr;
FProperty* SkelProperty = nullptr;
};
UMVVMViewModelBlueprintGeneratedClass* NewViewModelBlueprintClass;
TArray<FGeneratedFunction> GeneratedFunctions;
};
} //namespace