UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TypedElementSelectionInterface.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
10#include "HAL/Platform.h"
13#include "Templates/UniquePtr.h"
14#include "UObject/Interface.h"
17
18#include "TypedElementSelectionInterface.generated.h"
19
20class UObject;
21struct FFrame;
22
23UENUM()
33
34UENUM()
44
45USTRUCT(BlueprintType)
47{
49
50public:
51 FTypedElementIsSelectedOptions& SetAllowIndirect(const bool InAllowIndirect) { bAllowIndirect = InAllowIndirect; return *this; }
52 bool AllowIndirect() const { return bAllowIndirect; }
53
54 // Set the selection set name that will be passed into the selection column in TEDS (if it is enabled)
56 FName GetNameForTEDSIntegration() const { return TEDSIntegrationSelectionSetName; }
57
58private:
59 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|Selection|IsSelectedOptions", meta=(AllowPrivateAccess=true))
60 bool bAllowIndirect = false;
61
62 FName TEDSIntegrationSelectionSetName = FName();
63};
64
65USTRUCT(BlueprintType)
67{
69
70public:
71 FTypedElementSelectionOptions& SetAllowHidden(const bool InAllowHidden) { bAllowHidden = InAllowHidden; return *this; }
72 bool AllowHidden() const { return bAllowHidden; }
73
74 FTypedElementSelectionOptions& SetAllowGroups(const bool InAllowGroups) { bAllowGroups = InAllowGroups; return *this; }
75 bool AllowGroups() const { return bAllowGroups; }
76
78 bool AllowLegacyNotifications() const { return bAllowLegacyNotifications; }
79
80 FTypedElementSelectionOptions& SetWarnIfLocked(const bool InWarnIfLocked) { bWarnIfLocked = InWarnIfLocked; return *this; }
81 bool WarnIfLocked() const { return bWarnIfLocked; }
82
84 bool AllowSubRootSelection() const { return bAllowSubRootSelection; }
85
87 ETypedElementChildInclusionMethod GetChildElementInclusionMethod() const { return ChildElementInclusionMethod; }
88
89 // Set the selection set name that will be passed into the selection column in TEDS (if it is enabled)
91 FName GetNameForTEDSIntegration() const { return TEDSIntegrationSelectionSetName; }
92private:
93 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|Selection|SelectionOptions", meta=(AllowPrivateAccess=true))
94 bool bAllowHidden = false;
95
96 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|Selection|SelectionOptions", meta=(AllowPrivateAccess=true))
97 bool bAllowGroups = true;
98
99 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|Selection|SelectionOptions", meta=(AllowPrivateAccess=true))
100 bool bAllowLegacyNotifications = true;
101
102 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|Selection|SelectionOptions", meta=(AllowPrivateAccess=true))
103 bool bWarnIfLocked = false;
104
105 UPROPERTY(BlueprintReadWrite, Category = "TypedElementInterfaces|Selection|SelectionOptions", meta = (AllowPrivateAccess = true))
106 bool bAllowSubRootSelection = false;
107
108 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|Selection|SelectionOptions", meta=(AllowPrivateAccess=true))
110
111 FName TEDSIntegrationSelectionSetName = FName();
112};
113
115{
116public:
118
120 {
122 checkf(Cloned, TEXT("ITypedElementTransactedElement derived types must implement a valid Clone function!"));
123 return Cloned;
124 }
125
127 {
128 return GetElementImpl();
129 }
130
132 {
133 return TypeId;
134 }
135
137 {
138 SetElementType(InElementHandle.GetId().GetTypeId());
139 SetElementImpl(InElementHandle);
140 }
141
143 {
144 TypeId = InTypeId;
145 }
146
148 {
149 checkf(!InArchive.IsPersistent(), TEXT("ITypedElementTransactedElement can only be serialized by transient archives!"));
150 SerializeImpl(InArchive);
151 }
152
153protected:
157 virtual void SerializeImpl(FArchive& InArchive) = 0;
158
159private:
160 FTypedHandleTypeId TypeId = 0;
161};
162
163UINTERFACE(MinimalAPI, BlueprintType, meta = (CannotImplementInterfaceInBlueprint))
168
170{
172
173public:
178
183
188
194
200
205
210
214 virtual bool ShouldPreventTransactions(const FTypedElementHandle& InElementHandle) { return false; }
215
228
241
242
250 UFUNCTION(BlueprintCallable, Category = "TypedElementInterfaces|Selection")
252
256 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|Selection")
258
262 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|Selection")
264
269 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|Selection")
271
276 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|Selection")
278
282 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|Selection")
284
288 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|Selection")
290
297};
298
299template <>
300struct TTypedElement<ITypedElementSelectionInterface> : public TTypedElementBase<ITypedElementSelectionInterface>
301{
307 bool AllowSelectionModifiers(FTypedElementListConstRef InSelectionSet) const { return InterfacePtr->AllowSelectionModifiers(*this, InSelectionSet); }
309 bool ShouldPreventTransactions() const { return InterfacePtr->ShouldPreventTransactions(*this); }
310 TUniquePtr<ITypedElementTransactedElement> CreateTransactedElement() const { return InterfacePtr->CreateTransactedElement(*this); }
311};
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UINTERFACE(...)
Definition ObjectMacros.h:780
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
uint8 FTypedHandleTypeId
Definition TypedElementLimits.h:29
ETypedElementSelectionMethod
Definition TypedElementSelectionInterface.h:25
ETypedElementChildInclusionMethod
Definition TypedElementSelectionInterface.h:36
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition NameTypes.h:617
Definition TypedElementSelectionInterface.h:170
TUniquePtr< ITypedElementTransactedElement > CreateTransactedElement(const FTypedHandleTypeId InTypeId)
Definition TypedElementSelectionInterface.h:232
virtual TYPEDELEMENTRUNTIME_API bool SelectElement(const FTypedElementHandle &InElementHandle, const FTypedElementListPtr &InSelectionSet, const FTypedElementSelectionOptions &InSelectionOptions)
Definition TypedElementSelectionInterface.cpp:18
virtual TYPEDELEMENTRUNTIME_API bool DeselectElement(const FTypedElementHandle &InElementHandle, const FTypedElementListPtr &InSelectionSet, const FTypedElementSelectionOptions &InSelectionOptions)
Definition TypedElementSelectionInterface.cpp:23
virtual bool AllowSelectionModifiers(const FTypedElementHandle &InElementHandle, const FTypedElementListConstPtr &InSelectionSet)
Definition TypedElementSelectionInterface.h:204
virtual bool CanDeselectElement(const FTypedElementHandle &InElementHandle, const FTypedElementSelectionOptions &InSelectionOptions)
Definition TypedElementSelectionInterface.h:187
virtual TYPEDELEMENTRUNTIME_API bool IsElementSelected(const FTypedElementHandle &InElementHandle, const FTypedElementListConstPtr &SelectionSetPtr, const FTypedElementIsSelectedOptions &InSelectionOptions)
Definition TypedElementSelectionInterface.cpp:13
virtual FTypedElementHandle GetSelectionElement(const FTypedElementHandle &InElementHandle, const FTypedElementListConstPtr &InCurrentSelection, const ETypedElementSelectionMethod InSelectionMethod)
Definition TypedElementSelectionInterface.h:209
virtual bool CanSelectElement(const FTypedElementHandle &InElementHandle, const FTypedElementSelectionOptions &InSelectionOptions)
Definition TypedElementSelectionInterface.h:182
TUniquePtr< ITypedElementTransactedElement > CreateTransactedElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementSelectionInterface.h:219
virtual bool ShouldPreventTransactions(const FTypedElementHandle &InElementHandle)
Definition TypedElementSelectionInterface.h:214
virtual TUniquePtr< ITypedElementTransactedElement > CreateTransactedElementImpl()
Definition TypedElementSelectionInterface.h:296
Definition TypedElementSelectionInterface.h:115
virtual FTypedElementHandle GetElementImpl() const =0
void SetElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementSelectionInterface.h:136
FTypedElementHandle GetElement() const
Definition TypedElementSelectionInterface.h:126
TUniquePtr< ITypedElementTransactedElement > Clone() const
Definition TypedElementSelectionInterface.h:119
void SetElementType(const FTypedHandleTypeId InTypeId)
Definition TypedElementSelectionInterface.h:142
virtual void SerializeImpl(FArchive &InArchive)=0
void Serialize(FArchive &InArchive)
Definition TypedElementSelectionInterface.h:147
virtual void SetElementImpl(const FTypedElementHandle &InElementHandle)=0
virtual ~ITypedElementTransactedElement()=default
virtual TUniquePtr< ITypedElementTransactedElement > CloneImpl() const =0
FTypedHandleTypeId GetElementType() const
Definition TypedElementSelectionInterface.h:131
Definition SharedPointer.h:153
Definition UniquePtr.h:107
Definition Interface.h:19
Definition Object.h:95
Definition TypedElementSelectionInterface.h:165
@ false
Definition radaudio_common.h:23
Definition Stack.h:114
Definition TypedElementHandle.h:625
Definition TypedElementListProxy.h:18
Definition TypedElementHandle.h:18
Definition TypedElementSelectionInterface.h:47
FTypedElementIsSelectedOptions & SetNameForTEDSIntegration(const FName &InTEDSIntegrationSelectionSetName)
Definition TypedElementSelectionInterface.h:55
bool AllowIndirect() const
Definition TypedElementSelectionInterface.h:52
FName GetNameForTEDSIntegration() const
Definition TypedElementSelectionInterface.h:56
FTypedElementIsSelectedOptions & SetAllowIndirect(const bool InAllowIndirect)
Definition TypedElementSelectionInterface.h:51
Definition TypedElementSelectionInterface.h:67
FTypedElementSelectionOptions & SetWarnIfLocked(const bool InWarnIfLocked)
Definition TypedElementSelectionInterface.h:80
bool AllowLegacyNotifications() const
Definition TypedElementSelectionInterface.h:78
bool WarnIfLocked() const
Definition TypedElementSelectionInterface.h:81
FTypedElementSelectionOptions & SetAllowSubRootSelection(const bool InAllowSubRootSelectioin)
Definition TypedElementSelectionInterface.h:83
bool AllowSubRootSelection() const
Definition TypedElementSelectionInterface.h:84
FTypedElementSelectionOptions & SetAllowHidden(const bool InAllowHidden)
Definition TypedElementSelectionInterface.h:71
ETypedElementChildInclusionMethod GetChildElementInclusionMethod() const
Definition TypedElementSelectionInterface.h:87
FTypedElementSelectionOptions & SetAllowGroups(const bool InAllowGroups)
Definition TypedElementSelectionInterface.h:74
bool AllowHidden() const
Definition TypedElementSelectionInterface.h:72
FTypedElementSelectionOptions & SetNameForTEDSIntegration(const FName &InTEDSIntegrationSelectionSetName)
Definition TypedElementSelectionInterface.h:90
bool AllowGroups() const
Definition TypedElementSelectionInterface.h:75
FTypedElementSelectionOptions & SetAllowLegacyNotifications(const bool InAllowLegacyNotifications)
Definition TypedElementSelectionInterface.h:77
FTypedElementSelectionOptions & SetChildElementInclusionMethod(const ETypedElementChildInclusionMethod InChildElementInclusionMethod)
Definition TypedElementSelectionInterface.h:86
FName GetNameForTEDSIntegration() const
Definition TypedElementSelectionInterface.h:91
Definition TypedElementHandle.h:271
BaseInterfaceType * InterfacePtr
Definition TypedElementHandle.h:386
TUniquePtr< ITypedElementTransactedElement > CreateTransactedElement() const
Definition TypedElementSelectionInterface.h:310
FTypedElementHandle GetSelectionElement(FTypedElementListConstRef InCurrentSelection, const ETypedElementSelectionMethod InSelectionMethod) const
Definition TypedElementSelectionInterface.h:308
bool ShouldPreventTransactions() const
Definition TypedElementSelectionInterface.h:309
bool SelectElement(FTypedElementListRef InSelectionSet, const FTypedElementSelectionOptions &InSelectionOptions) const
Definition TypedElementSelectionInterface.h:305
bool IsElementSelected(FTypedElementListConstRef InSelectionSet, const FTypedElementIsSelectedOptions &InSelectionOptions) const
Definition TypedElementSelectionInterface.h:302
bool CanSelectElement(const FTypedElementSelectionOptions &InSelectionOptions) const
Definition TypedElementSelectionInterface.h:303
bool DeselectElement(FTypedElementListRef InSelectionSet, const FTypedElementSelectionOptions &InSelectionOptions) const
Definition TypedElementSelectionInterface.h:306
bool AllowSelectionModifiers(FTypedElementListConstRef InSelectionSet) const
Definition TypedElementSelectionInterface.h:307
bool CanDeselectElement(const FTypedElementSelectionOptions &InSelectionOptions) const
Definition TypedElementSelectionInterface.h:304
Definition TypedElementHandle.h:396