Skip to main content

uika_ue_flags/
lib.rs

1// UE reflection flag constants.
2//
3// Mirrors EPropertyFlags, EFunctionFlags, and EClassFlags from UE 5.7 source:
4//   - Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectMacros.h
5//   - Engine/Source/Runtime/CoreUObject/Public/UObject/Script.h
6
7// ---------------------------------------------------------------------------
8// EPropertyFlags (CPF_*) — uint64
9// ---------------------------------------------------------------------------
10
11/// No flags.
12pub const CPF_NONE: u64 = 0x0000_0000_0000_0000;
13/// Property is user-settable in the editor.
14pub const CPF_EDIT: u64 = 0x0000_0000_0000_0001;
15/// This is a constant function parameter.
16pub const CPF_CONST_PARM: u64 = 0x0000_0000_0000_0002;
17/// This property can be read by blueprint code.
18pub const CPF_BLUEPRINT_VISIBLE: u64 = 0x0000_0000_0000_0004;
19/// Object can be exported with actor.
20pub const CPF_EXPORT_OBJECT: u64 = 0x0000_0000_0000_0008;
21/// This property cannot be modified by blueprint code.
22pub const CPF_BLUEPRINT_READ_ONLY: u64 = 0x0000_0000_0000_0010;
23/// Property is relevant to network replication.
24pub const CPF_NET: u64 = 0x0000_0000_0000_0020;
25/// Elements of an array can be modified, but its size cannot be changed.
26pub const CPF_EDIT_FIXED_SIZE: u64 = 0x0000_0000_0000_0040;
27/// Function/When call parameter.
28pub const CPF_PARM: u64 = 0x0000_0000_0000_0080;
29/// Value is copied out after function call.
30pub const CPF_OUT_PARM: u64 = 0x0000_0000_0000_0100;
31/// memset is fine for construction.
32pub const CPF_ZERO_CONSTRUCTOR: u64 = 0x0000_0000_0000_0200;
33/// Return value.
34pub const CPF_RETURN_PARM: u64 = 0x0000_0000_0000_0400;
35/// Disable editing of this property on an archetype/sub-blueprint.
36pub const CPF_DISABLE_EDIT_ON_TEMPLATE: u64 = 0x0000_0000_0000_0800;
37/// Object property can never be null.
38pub const CPF_NON_NULLABLE: u64 = 0x0000_0000_0000_1000;
39/// Property is transient: shouldn't be saved or loaded, except for Blueprint CDOs.
40pub const CPF_TRANSIENT: u64 = 0x0000_0000_0000_2000;
41/// Property should be loaded/saved as permanent profile.
42pub const CPF_CONFIG: u64 = 0x0000_0000_0000_4000;
43/// Parameter must be linked explicitly in blueprint.
44pub const CPF_REQUIRED_PARM: u64 = 0x0000_0000_0000_8000;
45/// Disable editing on an instance of this class.
46pub const CPF_DISABLE_EDIT_ON_INSTANCE: u64 = 0x0000_0000_0001_0000;
47/// Property is uneditable in the editor.
48pub const CPF_EDIT_CONST: u64 = 0x0000_0000_0002_0000;
49/// Load config from base class, not subclass.
50pub const CPF_GLOBAL_CONFIG: u64 = 0x0000_0000_0004_0000;
51/// Property is a component reference.
52pub const CPF_INSTANCED_REFERENCE: u64 = 0x0000_0000_0008_0000;
53/// Property saves objects in separate files, breaks hard links and reload them based on discovery.
54pub const CPF_EXPERIMENTAL_EXTERNAL_OBJECTS: u64 = 0x0000_0000_0010_0000;
55/// Property should always be reset to the default value during any type of duplication.
56pub const CPF_DUPLICATE_TRANSIENT: u64 = 0x0000_0000_0020_0000;
57// 0x0000_0000_0040_0000 — reserved
58// 0x0000_0000_0080_0000 — reserved
59/// Property should be serialized for save games.
60pub const CPF_SAVE_GAME: u64 = 0x0000_0000_0100_0000;
61/// Hide clear button.
62pub const CPF_NO_CLEAR: u64 = 0x0000_0000_0200_0000;
63/// Property is defined on an interface and does not include a useful Offset_Internal.
64pub const CPF_VIRTUAL: u64 = 0x0000_0000_0400_0000;
65/// Value is passed by reference; CPF_OUT_PARM and CPF_PARM should also be set.
66pub const CPF_REFERENCE_PARM: u64 = 0x0000_0000_0800_0000;
67/// MC Delegates only. Property should be exposed for assigning in blueprint code.
68pub const CPF_BLUEPRINT_ASSIGNABLE: u64 = 0x0000_0000_1000_0000;
69/// Property is deprecated. Read it from an archive, but don't save it.
70pub const CPF_DEPRECATED: u64 = 0x0000_0000_2000_0000;
71/// Property can be memcopied instead of CopyCompleteValue / CopySingleValue.
72pub const CPF_IS_PLAIN_OLD_DATA: u64 = 0x0000_0000_4000_0000;
73/// Not replicated. For non replicated properties in replicated structs.
74pub const CPF_REP_SKIP: u64 = 0x0000_0000_8000_0000;
75/// Notify actors when a property is replicated.
76pub const CPF_REP_NOTIFY: u64 = 0x0000_0001_0000_0000;
77/// Interpolatable property for use with cinematics.
78pub const CPF_INTERP: u64 = 0x0000_0002_0000_0000;
79/// Property isn't transacted.
80pub const CPF_NON_TRANSACTIONAL: u64 = 0x0000_0004_0000_0000;
81/// Property should only be loaded in the editor.
82pub const CPF_EDITOR_ONLY: u64 = 0x0000_0008_0000_0000;
83/// No destructor.
84pub const CPF_NO_DESTRUCTOR: u64 = 0x0000_0010_0000_0000;
85// 0x0000_0020_0000_0000 — reserved
86/// Only used for weak pointers, means the export type is autoweak.
87pub const CPF_AUTO_WEAK: u64 = 0x0000_0040_0000_0000;
88/// Property contains component references.
89pub const CPF_CONTAINS_INSTANCED_REFERENCE: u64 = 0x0000_0080_0000_0000;
90/// Asset instances will add properties with this flag to the asset registry automatically.
91pub const CPF_ASSET_REGISTRY_SEARCHABLE: u64 = 0x0000_0100_0000_0000;
92/// The property is visible by default in the editor details view.
93pub const CPF_SIMPLE_DISPLAY: u64 = 0x0000_0200_0000_0000;
94/// The property is advanced and not visible by default in the editor details view.
95pub const CPF_ADVANCED_DISPLAY: u64 = 0x0000_0400_0000_0000;
96/// Property is protected from the perspective of script.
97pub const CPF_PROTECTED: u64 = 0x0000_0800_0000_0000;
98/// MC Delegates only. Property should be exposed for calling in blueprint code.
99pub const CPF_BLUEPRINT_CALLABLE: u64 = 0x0000_1000_0000_0000;
100/// MC Delegates only. This delegate accepts (only in blueprint) only events with BlueprintAuthorityOnly.
101pub const CPF_BLUEPRINT_AUTHORITY_ONLY: u64 = 0x0000_2000_0000_0000;
102/// Property shouldn't be exported to text format (e.g. copy/paste).
103pub const CPF_TEXT_EXPORT_TRANSIENT: u64 = 0x0000_4000_0000_0000;
104/// Property should only be copied in PIE.
105pub const CPF_NON_PIE_DUPLICATE_TRANSIENT: u64 = 0x0000_8000_0000_0000;
106/// Property is exposed on spawn.
107pub const CPF_EXPOSE_ON_SPAWN: u64 = 0x0001_0000_0000_0000;
108/// A object referenced by the property is duplicated like a component.
109pub const CPF_PERSISTENT_INSTANCE: u64 = 0x0002_0000_0000_0000;
110/// Property was parsed as a wrapper class like TSubclassOf<T>, FScriptInterface etc.
111pub const CPF_UOBJECT_WRAPPER: u64 = 0x0004_0000_0000_0000;
112/// This property can generate a meaningful hash value.
113pub const CPF_HAS_GET_VALUE_TYPE_HASH: u64 = 0x0008_0000_0000_0000;
114/// Public native access specifier.
115pub const CPF_NATIVE_ACCESS_SPECIFIER_PUBLIC: u64 = 0x0010_0000_0000_0000;
116/// Protected native access specifier.
117pub const CPF_NATIVE_ACCESS_SPECIFIER_PROTECTED: u64 = 0x0020_0000_0000_0000;
118/// Private native access specifier.
119pub const CPF_NATIVE_ACCESS_SPECIFIER_PRIVATE: u64 = 0x0040_0000_0000_0000;
120/// Property shouldn't be serialized, can still be exported to text.
121pub const CPF_SKIP_SERIALIZATION: u64 = 0x0080_0000_0000_0000;
122/// Property is a TObjectPtr<T> instead of a USomething*.
123pub const CPF_TOBJECT_PTR: u64 = 0x0100_0000_0000_0000;
124/// [Experimental] Property will use overridable serialization logic.
125pub const CPF_EXPERIMENTAL_OVERRIDABLE_LOGIC: u64 = 0x0200_0000_0000_0000;
126/// [Experimental] Property should never inherit from the parent when using overridable serialization.
127pub const CPF_EXPERIMENTAL_ALWAYS_OVERRIDEN: u64 = 0x0400_0000_0000_0000;
128/// [Experimental] Property should never be overridden when using overridable serialization.
129pub const CPF_EXPERIMENTAL_NEVER_OVERRIDEN: u64 = 0x0800_0000_0000_0000;
130/// Enables the instancing graph self referencing logic.
131pub const CPF_ALLOW_SELF_REFERENCE: u64 = 0x1000_0000_0000_0000;
132
133// Combined CPF masks
134
135/// All native access specifier flags.
136pub const CPF_NATIVE_ACCESS_SPECIFIERS: u64 =
137    CPF_NATIVE_ACCESS_SPECIFIER_PUBLIC | CPF_NATIVE_ACCESS_SPECIFIER_PROTECTED | CPF_NATIVE_ACCESS_SPECIFIER_PRIVATE;
138
139/// All parameter flags.
140pub const CPF_PARM_FLAGS: u64 =
141    CPF_PARM | CPF_OUT_PARM | CPF_RETURN_PARM | CPF_REQUIRED_PARM | CPF_REFERENCE_PARM | CPF_CONST_PARM;
142
143// ---------------------------------------------------------------------------
144// EFunctionFlags (FUNC_*) — uint32
145// ---------------------------------------------------------------------------
146
147/// No flags.
148pub const FUNC_NONE: u32 = 0x0000_0000;
149/// Function is final (prebindable, non-overridable function).
150pub const FUNC_FINAL: u32 = 0x0000_0001;
151/// Indicates this function is DLL exported/imported.
152pub const FUNC_REQUIRED_API: u32 = 0x0000_0002;
153/// Function will only run if the object has network authority.
154pub const FUNC_BLUEPRINT_AUTHORITY_ONLY: u32 = 0x0000_0004;
155/// Function is cosmetic in nature and should not be invoked on dedicated servers.
156pub const FUNC_BLUEPRINT_COSMETIC: u32 = 0x0000_0008;
157// 0x0000_0010 — reserved
158// 0x0000_0020 — reserved
159/// Function is network-replicated.
160pub const FUNC_NET: u32 = 0x0000_0040;
161/// Function should be sent reliably on the network.
162pub const FUNC_NET_RELIABLE: u32 = 0x0000_0080;
163/// Function is sent to a net service.
164pub const FUNC_NET_REQUEST: u32 = 0x0000_0100;
165/// Executable from command line.
166pub const FUNC_EXEC: u32 = 0x0000_0200;
167/// Native function.
168pub const FUNC_NATIVE: u32 = 0x0000_0400;
169/// Event function.
170pub const FUNC_EVENT: u32 = 0x0000_0800;
171/// Function response from a net service.
172pub const FUNC_NET_RESPONSE: u32 = 0x0000_1000;
173/// Static function.
174pub const FUNC_STATIC: u32 = 0x0000_2000;
175/// Function is networked multicast Server -> All Clients.
176pub const FUNC_NET_MULTICAST: u32 = 0x0000_4000;
177/// Function is used as the merge 'ubergraph' for a blueprint.
178pub const FUNC_UBERGRAPH_FUNCTION: u32 = 0x0000_8000;
179/// Function is a multi-cast delegate signature (also requires FUNC_DELEGATE).
180pub const FUNC_MULTICAST_DELEGATE: u32 = 0x0001_0000;
181/// Function is accessible in all classes.
182pub const FUNC_PUBLIC: u32 = 0x0002_0000;
183/// Function is accessible only in the class it is defined in.
184pub const FUNC_PRIVATE: u32 = 0x0004_0000;
185/// Function is accessible only in the class it is defined in and subclasses.
186pub const FUNC_PROTECTED: u32 = 0x0008_0000;
187/// Function is delegate signature (single-cast or multi-cast).
188pub const FUNC_DELEGATE: u32 = 0x0010_0000;
189/// Function is executed on servers.
190pub const FUNC_NET_SERVER: u32 = 0x0020_0000;
191/// Function has out (pass by reference) parameters.
192pub const FUNC_HAS_OUT_PARMS: u32 = 0x0040_0000;
193/// Function has structs that contain defaults.
194pub const FUNC_HAS_DEFAULTS: u32 = 0x0080_0000;
195/// Function is executed on clients.
196pub const FUNC_NET_CLIENT: u32 = 0x0100_0000;
197/// Function is imported from a DLL.
198pub const FUNC_DLL_IMPORT: u32 = 0x0200_0000;
199/// Function can be called from blueprint code.
200pub const FUNC_BLUEPRINT_CALLABLE: u32 = 0x0400_0000;
201/// Function can be overridden/implemented from a blueprint.
202pub const FUNC_BLUEPRINT_EVENT: u32 = 0x0800_0000;
203/// Function can be called from blueprint code, and is also pure (no side effects).
204pub const FUNC_BLUEPRINT_PURE: u32 = 0x1000_0000;
205/// Function can only be called from an editor script.
206pub const FUNC_EDITOR_ONLY: u32 = 0x2000_0000;
207/// Function can be called from blueprint code, and only reads state (never writes state).
208pub const FUNC_CONST: u32 = 0x4000_0000;
209/// Function must supply a _Validate implementation.
210pub const FUNC_NET_VALIDATE: u32 = 0x8000_0000;
211/// All flags.
212pub const FUNC_ALL_FLAGS: u32 = 0xFFFF_FFFF;
213
214// ---------------------------------------------------------------------------
215// EClassFlags (CLASS_*) — uint32
216// ---------------------------------------------------------------------------
217
218/// No flags.
219pub const CLASS_NONE: u32 = 0x0000_0000;
220/// Class is abstract and can't be instantiated directly.
221pub const CLASS_ABSTRACT: u32 = 0x0000_0001;
222/// Save object configuration only to Default INIs, never to local INIs.
223pub const CLASS_DEFAULT_CONFIG: u32 = 0x0000_0002;
224/// Load object configuration at construction time.
225pub const CLASS_CONFIG: u32 = 0x0000_0004;
226/// This object type can't be saved; null it out at save time.
227pub const CLASS_TRANSIENT: u32 = 0x0000_0008;
228/// This object type may not be available in certain context.
229pub const CLASS_OPTIONAL: u32 = 0x0000_0010;
230/// Matched serializers.
231pub const CLASS_MATCHED_SERIALIZERS: u32 = 0x0000_0020;
232/// Config settings for this class will be saved to Project/User*.ini.
233pub const CLASS_PROJECT_USER_CONFIG: u32 = 0x0000_0040;
234/// Class is a native class.
235pub const CLASS_NATIVE: u32 = 0x0000_0080;
236// 0x0000_0100 — reserved
237/// Do not allow users to create in the editor.
238pub const CLASS_NOT_PLACEABLE: u32 = 0x0000_0200;
239/// Handle object configuration on a per-object basis, rather than per-class.
240pub const CLASS_PER_OBJECT_CONFIG: u32 = 0x0000_0400;
241/// Whether SetUpRuntimeReplicationData still needs to be called for this class.
242pub const CLASS_REPLICATION_DATA_IS_SET_UP: u32 = 0x0000_0800;
243/// Class can be constructed from editinline New button.
244pub const CLASS_EDIT_INLINE_NEW: u32 = 0x0000_1000;
245/// Display properties in the editor without using categories.
246pub const CLASS_COLLAPSE_CATEGORIES: u32 = 0x0000_2000;
247/// Class is an interface.
248pub const CLASS_INTERFACE: u32 = 0x0000_4000;
249/// Config for this class is overridden in platform inis.
250pub const CLASS_PER_PLATFORM_CONFIG: u32 = 0x0000_8000;
251/// All properties and functions in this class are const.
252pub const CLASS_CONST: u32 = 0x0001_0000;
253/// Class flag indicating objects of this class need deferred dependency loading.
254pub const CLASS_NEEDS_DEFERRED_DEPENDENCY_LOADING: u32 = 0x0002_0000;
255/// Indicates that the class was created from blueprint source material.
256pub const CLASS_COMPILED_FROM_BLUEPRINT: u32 = 0x0004_0000;
257/// Indicates that only the bare minimum bits of this class should be DLL exported/imported.
258pub const CLASS_MINIMAL_API: u32 = 0x0008_0000;
259/// Indicates this class must be DLL exported/imported (along with all of its members).
260pub const CLASS_REQUIRED_API: u32 = 0x0010_0000;
261/// Indicates that references to this class default to instanced.
262pub const CLASS_DEFAULT_TO_INSTANCED: u32 = 0x0020_0000;
263/// Indicates that the parent token stream has been merged with ours.
264pub const CLASS_TOKEN_STREAM_ASSEMBLED: u32 = 0x0040_0000;
265/// Class has component properties.
266pub const CLASS_HAS_INSTANCED_REFERENCE: u32 = 0x0080_0000;
267/// Don't show this class in the editor class browser or edit inline new menus.
268pub const CLASS_HIDDEN: u32 = 0x0100_0000;
269/// Don't save objects of this class when serializing.
270pub const CLASS_DEPRECATED: u32 = 0x0200_0000;
271/// Class not shown in editor drop down for class selection.
272pub const CLASS_HIDE_DROP_DOWN: u32 = 0x0400_0000;
273/// Class settings are saved to AppData (as opposed to CLASS_DEFAULT_CONFIG).
274pub const CLASS_GLOBAL_USER_CONFIG: u32 = 0x0800_0000;
275/// Class was declared directly in C++ and has no boilerplate generated by UnrealHeaderTool.
276pub const CLASS_INTRINSIC: u32 = 0x1000_0000;
277/// Class has already been constructed (maybe in a previous DLL version before hot-reload).
278pub const CLASS_CONSTRUCTED: u32 = 0x2000_0000;
279/// Indicates that object configuration will not check against ini base/defaults when serialized.
280pub const CLASS_CONFIG_DO_NOT_CHECK_DEFAULTS: u32 = 0x4000_0000;
281/// Class has been consigned to oblivion as part of a blueprint recompile; newer version exists.
282pub const CLASS_NEWER_VERSION_EXISTS: u32 = 0x8000_0000;
283
284/// Flags inherited from base class.
285pub const CLASS_INHERIT: u32 = CLASS_TRANSIENT
286    | CLASS_OPTIONAL
287    | CLASS_DEFAULT_CONFIG
288    | CLASS_CONFIG
289    | CLASS_PER_OBJECT_CONFIG
290    | CLASS_CONFIG_DO_NOT_CHECK_DEFAULTS
291    | CLASS_NOT_PLACEABLE
292    | CLASS_CONST
293    | CLASS_HAS_INSTANCED_REFERENCE
294    | CLASS_DEPRECATED
295    | CLASS_DEFAULT_TO_INSTANCED
296    | CLASS_GLOBAL_USER_CONFIG
297    | CLASS_PROJECT_USER_CONFIG
298    | CLASS_PER_PLATFORM_CONFIG
299    | CLASS_NEEDS_DEFERRED_DEPENDENCY_LOADING;