#pragma once #include "UmgTypes.hpp" #include "UnrealWrapper.hpp" namespace PalUIExtension::Api { // ------------------------------------------------------------------ // UPanelSlot. // // Worth saying plainly: this class exposes ZERO UFUNCTIONs. Its entire // surface is two Instanced UPROPERTYs, Parent and Content. So this // wrapper cannot use ProcessEvent at all -- it exists only to give // CanvasPanelSlot a place to inherit property access from, and to give // you something typed to hold when AddChild() hands back a UPanelSlot* // whose concrete type you do not know yet. // // If you were expecting a base class full of shared calls to inherit, // that expectation does not survive contact with the engine here. The // real shared behaviour lives in UnrealWrapper, not in UPanelSlot. // ------------------------------------------------------------------ class PanelSlot : public UnrealWrapper { public: static auto ClassPath() -> const TCHAR* { return STR("/Script/UMG.PanelSlot"); } static auto DebugTag() -> const TCHAR* { return STR("PanelSlot"); } PanelSlot() = default; explicit PanelSlot(UObject* Obj) : PanelSlot(Obj, ClassOf(), DebugTag()) {} // Raw UObject* rather than wrappers: Parent is a UPanelWidget and // Content is a UWidget, and wrapping either here would mean // including headers that (transitively) include this one. auto GetParentObject() const -> UObject* { auto Ptr = PropertyPtr(STR("Parent")); return Ptr ? *Ptr : nullptr; } auto GetContentObject() const -> UObject* { auto Ptr = PropertyPtr(STR("Content")); return Ptr ? *Ptr : nullptr; } protected: PanelSlot(UObject* Obj, UClass* Expected, const TCHAR* Tag) : UnrealWrapper(Obj, Expected, Tag) {} }; }