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/client/gui/controls/ComponentReceiveActionType.h"
10#include "mc/deps/core/math/Vec2.h"
11#include "mc/platform/brstd/function_ref.h"
12
13// auto generated forward declare list
14// clang-format off
17class RectangleArea;
21class UIComponent;
23class UIPropertyBag;
24class VisualTree;
25struct ScreenEvent;
26// clang-format on
27
28class UIControl : public ::std::enable_shared_from_this<::UIControl> {
29public:
30 // UIControl inner types declare
31 // clang-format off
33 // clang-format on
34
35 // UIControl inner types define
37 public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<8, 32, ::std::string> targetControlName;
41 ::ll::TypedStorage<4, 4, ::ui::NameResolutionScope> scope;
42 ::ll::TypedStorage<8, 64, ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>> setter;
43 // NOLINTEND
44
45 public:
46 // prevent constructor by default
47 ControlResolutionInfo& operator=(ControlResolutionInfo const&);
48 ControlResolutionInfo();
49
50 public:
51 // member functions
52 // NOLINTBEGIN
53 MCAPI ControlResolutionInfo(::UIControl::ControlResolutionInfo const&);
54
55 MCAPI ControlResolutionInfo(
56 ::std::string const& aTargetControlName,
57 ::ui::NameResolutionScope aScope,
58 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> aSetter
59 );
60 // NOLINTEND
61
62 public:
63 // constructor thunks
64 // NOLINTBEGIN
65 MCFOLD void* $ctor(::UIControl::ControlResolutionInfo const&);
66
67 MCAPI void* $ctor(
68 ::std::string const& aTargetControlName,
69 ::ui::NameResolutionScope aScope,
70 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> aSetter
71 );
72 // NOLINTEND
73 };
74
75 using CompIdType = uint64;
76
77 using NameResolverFunc = ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>;
78
79 using PostCreateFunc = ::std::function<void(::UIControl&)>;
80
81public:
82 // member variables
83 // NOLINTBEGIN
84 ::ll::TypedStorage<4, 8, ::glm::vec2> mCachedPosition;
85 bool mCachedPositionDirty : 1;
86 bool mHover : 1;
87 ::ui::VisibilityFlag mVisible : 2;
88 bool mIsVisibleInTree : 1;
89 bool mEnabled : 1;
90 bool mAllAncestorsEnabled : 1;
91 bool mSelected : 1;
92 bool mClipsChildren : 1;
93 bool mAllowClipping : 1;
94 bool mIsClipped : 1;
95 bool mEnableClippingScissorTest : 1;
96 bool mIsTemplate : 1;
97 bool mPropagateAlpha : 1;
98 bool mDelayCollectionUpdate : 1;
99 bool mTextToSpeechTriggered : 1;
100 ::ll::TypedStorage<2, 2, ushort> mControlCollectionFlag;
101 ::ll::TypedStorage<8, 32, ::std::string> mName;
102 ::ll::TypedStorage<4, 8, ::glm::vec2> mParentRelativePosition;
103 ::ll::TypedStorage<4, 8, ::glm::vec2> mSize;
104 ::ll::TypedStorage<4, 8, ::glm::vec2> mMinSize;
105 ::ll::TypedStorage<4, 8, ::glm::vec2> mMaxSize;
106 ::ll::TypedStorage<4, 4, float> mAlpha;
107 ::ll::TypedStorage<4, 4, int> mZOrder;
108 ::ll::TypedStorage<4, 4, int> mLayer;
109 ::ll::TypedStorage<4, 8, ::Vec2> mClipOffset;
110 ::ll::TypedStorage<4, 4, uint> mClipChangeEventId;
111 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIPropertyBag>> mPropertyBag;
112 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIPropertyBag>> mPropertyBagToPropagateToChildren;
113 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mParent;
114 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mChildren;
115 ::ll::TypedStorage<8, 8, uint64> mComponentsInUse;
116 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::UIComponent>>> mComponents;
117 ::ll::TypedStorage<8, 24, ::std::vector<::RenderableComponent*>> mRenderableComponentLookup;
118 ::ll::TypedStorage<8, 24, ::std::vector<::CustomFrameUpdateComponent*>> mCustomFrameUpdateComponentLookup;
119 ::ll::TypedStorage<8, 24, ::std::vector<::UIControl::ControlResolutionInfo>> mControlResolvers;
120 ::ll::TypedStorage<8, 24, ::std::vector<::std::function<void(::UIControl&)>>> mPostCreateVector;
121 ::ll::TypedStorage<8, 8, ::ControlScreenAction&> mControlScreenAction;
122 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mModalAncestor;
123 // NOLINTEND
124
125public:
126 // prevent constructor by default
127 UIControl& operator=(UIControl const&);
128 UIControl(UIControl const&);
129 UIControl();
130
131public:
132 // member functions
133 // NOLINTBEGIN
134 MCAPI explicit UIControl(::ControlScreenAction& controlScreenAction);
135
136 MCAPI uint _getComponentIndexFromBitId(uint64 bitId) const;
137
138 MCAPI void _propagateLockStateChange(bool broadcastEvent);
139
140 MCAPI void _registerControlNameResolver(
141 ::std::string const& controlName,
142 ::ui::NameResolutionScope scope,
143 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> setter
144 );
145
146 MCAPI void _registerPostCreateCallback(::std::function<void(::UIControl&)> setter);
147
148 MCAPI void _resolveControlNames(::UIControl& rootControl);
149
150 MCAPI void _resolvePostCreate();
151
152 MCAPI void _setCachedPosition() const;
153
154 MCAPI void _setPositionDirty();
155
156 MCAPI void
157 _setVisible(::ui::VisibilityFlag visibleFlags, bool setLayoutChangedFlag, bool doLayout, bool shrinkInvisible);
158
159 MCAPI void addChild(::std::shared_ptr<::UIControl> child, ::ui::ChildInsertPosition childInsertPosition);
160
161 MCAPI void addControlCollectionFlag(ushort flag);
162
163 MCAPI void appendPropertyBag(::UIPropertyBag const& propertyBag);
164
165 MCAPI bool areAllAncestorsEnabled() const;
166
167 MCAPI ::ComponentReceiveActionType broadcastEvent(::UIComponent* sender, ::ScreenEvent const& screenEvent);
168
169 MCAPI ::ComponentReceiveActionType broadcastEvent(
170 ::VisualTree& visualTree,
171 ::ScreenInputContext& context,
172 ::UIAnimationController& animationController,
173 ::UIComponent* sender,
174 ::ScreenEvent const& screenEvent
175 );
176
177 MCAPI bool canBeFocused() const;
178
179 MCAPI bool changeClipState(bool clipped);
180
181 MCAPI void clearControlCollectionFlag();
182
183 MCAPI ::std::shared_ptr<::UIControl> clone(::UIControl* parent) const;
184
185 MCAPI bool containsPoint(::glm::vec2 const& point) const;
186
187 MCAPI void findAllCollectionIndices(::brstd::function_ref<void(::std::string const&, int)> callback);
188
189 MCAPI int findCollectionIndex(::std::string const& collectionName) const;
190
191 MCAPI void foreachRenderableComponents(::brstd::function_ref<void(::RenderableComponent&)> predicate) const;
192
193 MCAPI ::RectangleArea getAABB() const;
194
195 MCAPI bool getAllowClipping() const;
196
197 MCFOLD float getAlpha() const;
198
199 MCAPI ::std::shared_ptr<::UIControl> getAncestorWhere(::brstd::function_ref<bool(::UIControl const&)> predicate);
200
201 MCFOLD ::std::vector<::std::shared_ptr<::UIControl const>> const& getChildren() const;
202
203 MCFOLD ::std::vector<::std::shared_ptr<::UIControl>> const& getChildren();
204
205 MCFOLD uint getClipChangeEventId() const;
206
207 MCAPI ::Vec2 getClipOffset() const;
208
209 MCAPI bool getClipState() const;
210
211 MCAPI bool getClipsChildren() const;
212
213 MCAPI bool getDelayCollectionUpdate() const;
214
215 MCAPI bool getEnableScissorTestForClipping() const;
216
217 MCAPI bool getEnabled() const;
218
219 MCAPI bool getHover() const;
220
221 MCFOLD int getLayer() const;
222
223 MCFOLD ::glm::vec2 const& getMaxSize() const;
224
225 MCFOLD ::glm::vec2 const& getMinSize() const;
226
227 MCAPI ::std::shared_ptr<::UIControl> getModalAncestor();
228
229 MCAPI ::std::weak_ptr<::UIControl> getModalAncestorWeak();
230
231 MCFOLD ::std::string const& getName() const;
232
233 MCAPI ::std::shared_ptr<::UIControl const> getParent() const;
234
235 MCAPI ::std::shared_ptr<::UIControl> getParent();
236
237 MCFOLD ::glm::vec2 const& getParentRelativePosition() const;
238
239 MCAPI ::std::string const getPathedName() const;
240
241 MCAPI ::glm::vec2 const& getPosition() const;
242
243 MCFOLD ::UIPropertyBag const& getPropertyBag() const;
244
245 MCFOLD ::UIPropertyBag& getPropertyBag();
246
247 MCAPI ::UIPropertyBag const& getPropertyBagForChildren() const;
248
249 MCFOLD ::ControlScreenAction& getScreenAction(bool usingForCreation);
250
251 MCAPI bool getSelected() const;
252
253 MCFOLD ::glm::vec2 const& getSize() const;
254
255 MCAPI bool getVisible() const;
256
257 MCFOLD int getZOrder() const;
258
259 MCAPI bool hasClipChangeEvent() const;
260
261 MCAPI bool hasControlCollectionFlag(ushort flag) const;
262
263 MCFOLD bool hasPropertyBag() const;
264
265 MCAPI bool hasRenderableComponent() const;
266
267 MCAPI bool isTemplate() const;
268
269 MCAPI bool isVisibleInTree() const;
270
271 MCAPI void markToRemoveDeadDependencies();
272
273 MCAPI ::std::shared_ptr<::UIControl> moveChild(int index, bool notify);
274
275 MCAPI void notifyBindingsUpdated(
276 ::std::vector<::std::string> controlList,
277 ::std::string propertyName,
278 bool value,
279 bool siblingScope
280 );
281
282 MCAPI void notifyChildAdded();
283
284 MCAPI bool notifyLayoutChange();
285
286 MCAPI void onAdded();
287
288 MCAPI void popBackChild();
289
290 MCAPI void popFrontChild();
291
292 MCAPI void processPropertyBags(
293 ::std::unique_ptr<::UIPropertyBag> propertyBag,
294 ::std::unique_ptr<::UIPropertyBag> propertyBagForChildren
295 );
296
297 MCAPI bool propagateAlpha() const;
298
299 MCAPI void propogateAlphaValue(float alpha) const;
300
301 MCAPI void reloadFromControl(::UIControl const& control);
302
303 MCAPI bool removeChild(::std::shared_ptr<::UIControl> control);
304
305 MCAPI void removeControlCollectionFlag(ushort flag);
306
307 MCAPI bool removeParentByName(::std::string const& name);
308
309 MCAPI void reset(bool recursive, bool shouldClearCollectionFlag);
310
311 MCAPI void setAlpha(float alpha);
312
313 MCAPI void setDelayCollectionUpdate(bool delay);
314
315 MCAPI void setEnabled(bool enabled, bool broadcastEvent);
316
317 MCAPI void setHover(bool hover);
318
319 MCAPI void setIsTemplate(bool isTemplate);
320
321 MCFOLD void setMaxSize(::glm::vec2 const& size);
322
323 MCAPI void setMinSize(::glm::vec2 const& size);
324
325 MCAPI void setModalAncestor(::std::weak_ptr<::UIControl> control);
326
327 MCAPI void setName(::std::string_view name);
328
329 MCAPI void setParentRelativePosition(::glm::vec2 const& position);
330
331 MCAPI void setPropagateAlpha(bool propagateAlpha);
332
333 MCAPI void setPropertyBag(::std::unique_ptr<::UIPropertyBag> propertyBag);
334
335 MCAPI void setPropertyBagForChildren(::std::unique_ptr<::UIPropertyBag> propertyBag);
336
337 MCAPI void setSelected(bool selected);
338
339 MCAPI void setSize(::glm::vec2 const& size);
340
341 MCAPI void setTextToSpeechTriggered(bool value);
342
343 MCAPI void setVisible(bool visible, bool setLayoutChangedFlag, bool doLayout);
344
345 MCAPI void setVisibleInStackPanel(bool visible, bool setLayoutChangedFlag, bool doLayout);
346
347 MCAPI void setVisibleInTree(bool visible);
348
349 MCAPI void setZOrder(int zOrder);
350
351 MCAPI void updateFrameUpdateComponents(::UIFrameUpdateContext& context);
352
353 MCFOLD ::std::weak_ptr<::UIControl> weakRef();
354
355 MCAPI ~UIControl();
356 // NOLINTEND
357
358public:
359 // constructor thunks
360 // NOLINTBEGIN
361 MCAPI void* $ctor(::ControlScreenAction& controlScreenAction);
362 // NOLINTEND
363
364public:
365 // destructor thunk
366 // NOLINTBEGIN
367 MCAPI void $dtor();
368 // NOLINTEND
369};
Definition ControlScreenAction.h:5
Definition CustomFrameUpdateComponent.h:5
Definition RectangleArea.h:5
Definition RenderableComponent.h:5
Definition ScreenInputContext.h:5
Definition UIAnimationController.h:5
Definition UIComponent.h:5
Definition UIControl.h:5
Definition UIFrameUpdateContext.h:5
Definition UIPropertyBag.h:5
Definition VisualTree.h:5
Definition ScreenEvent.h:5
Definition UIControl.h:13