LeviLamina
Loading...
Searching...
No Matches
UIControl.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/ChildInsertPosition.h"
7#include "mc/client/gui/NameResolutionScope.h"
8#include "mc/client/gui/VisibilityFlag.h"
9#include "mc/deps/core/math/Vec2.h"
10#include "mc/platform/brstd/function_ref.h"
11
12// auto generated forward declare list
13// clang-format off
17class UIComponent;
18class UIPropertyBag;
19// clang-format on
20
21class UIControl : public ::std::enable_shared_from_this<::UIControl> {
22public:
23 // UIControl inner types declare
24 // clang-format off
26 // clang-format on
27
28 // UIControl inner types define
30 public:
31 // member variables
32 // NOLINTBEGIN
33 ::ll::TypedStorage<8, 32, ::std::string> targetControlName;
34 ::ll::TypedStorage<4, 4, ::ui::NameResolutionScope> scope;
35 ::ll::TypedStorage<8, 64, ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>> setter;
36 // NOLINTEND
37
38 public:
39 // prevent constructor by default
40 ControlResolutionInfo();
41
42 public:
43 // member functions
44 // NOLINTBEGIN
45 MCAPI ControlResolutionInfo(
46 ::std::string const& aTargetControlName,
47 ::ui::NameResolutionScope aScope,
48 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> aSetter
49 );
50 // NOLINTEND
51
52 public:
53 // constructor thunks
54 // NOLINTBEGIN
55 MCAPI void* $ctor(
56 ::std::string const& aTargetControlName,
57 ::ui::NameResolutionScope aScope,
58 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> aSetter
59 );
60 // NOLINTEND
61 };
62
63 using CompIdType = uint64;
64
65 using NameResolverFunc = ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>;
66
67 using PostCreateFunc = ::std::function<void(::UIControl&)>;
68
69public:
70 // member variables
71 // NOLINTBEGIN
72 ::ll::TypedStorage<4, 8, ::glm::vec2> mCachedPosition;
73 bool mCachedPositionDirty : 1;
74 bool mHover : 1;
75 ::ui::VisibilityFlag mVisible : 2;
76 bool mIsVisibleInTree : 1;
77 bool mEnabled : 1;
78 bool mAllAncestorsEnabled : 1;
79 bool mSelected : 1;
80 bool mClipsChildren : 1;
81 bool mAllowClipping : 1;
82 bool mIsClipped : 1;
83 bool mEnableClippingScissorTest : 1;
84 bool mIsTemplate : 1;
85 bool mPropagateAlpha : 1;
86 bool mDelayCollectionUpdate : 1;
87 bool mTextToSpeechTriggered : 1;
88 ::ll::TypedStorage<2, 2, ushort> mControlCollectionFlag;
89 ::ll::TypedStorage<8, 32, ::std::string> mName;
90 ::ll::TypedStorage<4, 8, ::glm::vec2> mParentRelativePosition;
91 ::ll::TypedStorage<4, 8, ::glm::vec2> mSize;
92 ::ll::TypedStorage<4, 8, ::glm::vec2> mMinSize;
93 ::ll::TypedStorage<4, 8, ::glm::vec2> mMaxSize;
94 ::ll::TypedStorage<4, 4, float> mAlpha;
95 ::ll::TypedStorage<4, 4, int> mZOrder;
96 ::ll::TypedStorage<4, 4, int> mLayer;
97 ::ll::TypedStorage<4, 8, ::Vec2> mClipOffset;
98 ::ll::TypedStorage<4, 4, uint> mClipChangeEventId;
99 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIPropertyBag>> mPropertyBag;
100 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIPropertyBag>> mPropertyBagToPropagateToChildren;
101 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mParent;
102 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mChildren;
103 ::ll::TypedStorage<8, 8, uint64> mComponentsInUse;
104 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::UIComponent>>> mComponents;
105 ::ll::TypedStorage<8, 24, ::std::vector<::RenderableComponent*>> mRenderableComponentLookup;
106 ::ll::TypedStorage<8, 24, ::std::vector<::CustomFrameUpdateComponent*>> mCustomFrameUpdateComponentLookup;
107 ::ll::TypedStorage<8, 24, ::std::vector<::UIControl::ControlResolutionInfo>> mControlResolvers;
108 ::ll::TypedStorage<8, 24, ::std::vector<::std::function<void(::UIControl&)>>> mPostCreateVector;
109 ::ll::TypedStorage<8, 8, ::ControlScreenAction&> mControlScreenAction;
110 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mModalAncestor;
111 // NOLINTEND
112
113public:
114 // prevent constructor by default
115 UIControl& operator=(UIControl const&);
116 UIControl(UIControl const&);
117 UIControl();
118
119public:
120 // member functions
121 // NOLINTBEGIN
122 MCAPI void _propagateLockStateChange(bool broadcastEvent);
123
124 MCAPI void _registerControlNameResolver(
125 ::std::string const& controlName,
126 ::ui::NameResolutionScope scope,
127 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> setter
128 );
129
130 MCAPI void _registerPostCreateCallback(::std::function<void(::UIControl&)> setter);
131
132 MCAPI void _resolveControlNames(::UIControl& rootControl);
133
134 MCAPI void _resolvePostCreate();
135
136 MCAPI void _setCachedPosition() const;
137
138 MCAPI void _setPositionDirty();
139
140 MCAPI void
141 _setVisible(::ui::VisibilityFlag visibleFlags, bool setLayoutChangedFlag, bool doLayout, bool shrinkInvisible);
142
143 MCAPI void addChild(::std::shared_ptr<::UIControl> child, ::ui::ChildInsertPosition childInsertPosition);
144
145 MCAPI ::std::shared_ptr<::UIControl> clone(::UIControl* parent) const;
146
147 MCAPI void findAllCollectionIndices(::brstd::function_ref<void(::std::string const&, int)> callback);
148
149 MCAPI int findCollectionIndex(::std::string const& collectionName) const;
150
151 MCAPI ::std::shared_ptr<::UIControl> getAncestorWhere(::brstd::function_ref<bool(::UIControl const&)> predicate);
152
153 MCAPI ::std::string const getPathedName() const;
154
155 MCFOLD ::UIPropertyBag const& getPropertyBag() const;
156
157 MCFOLD ::UIPropertyBag& getPropertyBag();
158
159 MCAPI ::std::shared_ptr<::UIControl> moveChild(int index, bool notify);
160
161 MCAPI void notifyBindingsUpdated(
162 ::std::vector<::std::string> controlList,
163 ::std::string propertyName,
164 bool value,
165 bool siblingScope
166 );
167
168 MCAPI void popBackChild();
169
170 MCAPI void popFrontChild();
171
172 MCAPI void processPropertyBags(
173 ::std::unique_ptr<::UIPropertyBag> propertyBag,
174 ::std::unique_ptr<::UIPropertyBag> propertyBagForChildren
175 );
176
177 MCAPI void reloadFromControl(::UIControl const& control);
178
179 MCAPI bool removeChild(::std::shared_ptr<::UIControl> control);
180
181 MCAPI void reset(bool recursive, bool shouldClearCollectionFlag);
182
183 MCAPI void setEnabled(bool enabled, bool broadcastEvent);
184
185 MCAPI void setIsTemplate(bool isTemplate);
186
187 MCAPI ~UIControl();
188 // NOLINTEND
189
190public:
191 // destructor thunk
192 // NOLINTBEGIN
193 MCAPI void $dtor();
194 // NOLINTEND
195};
Definition ControlScreenAction.h:5
Definition CustomFrameUpdateComponent.h:5
Definition RenderableComponent.h:5
Definition UIComponent.h:5
Definition UIControl.h:5
Definition UIPropertyBag.h:5
Definition UIControl.h:13