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
15class RectangleArea;
20struct ScreenEvent;
22struct UIComponent;
23struct UIPropertyBag;
24struct VisualTree;
25// clang-format on
26
27class UIControl : public ::std::enable_shared_from_this<::UIControl> {
28public:
29 // UIControl inner types declare
30 // clang-format off
32 // clang-format on
33
34 // UIControl inner types define
36 public:
37 // member variables
38 // NOLINTBEGIN
39 ::ll::TypedStorage<8, 32, ::std::string> targetControlName;
40 ::ll::TypedStorage<4, 4, ::ui::NameResolutionScope> scope;
41 ::ll::TypedStorage<8, 64, ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>> setter;
42 // NOLINTEND
43 };
44
45 using CompIdType = uint64;
46
47 using NameResolverFunc = ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>;
48
49 using PostCreateFunc = ::std::function<void(::UIControl&)>;
50
51public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<4, 8, ::glm::vec2> mCachedPosition;
55 bool mCachedPositionDirty : 1;
56 bool mHover : 1;
57 ::ui::VisibilityFlag mVisible : 2;
58 bool mIsVisibleInTree : 1;
59 bool mEnabled : 1;
60 bool mAllAncestorsEnabled : 1;
61 bool mSelected : 1;
62 bool mClipsChildren : 1;
63 bool mAllowClipping : 1;
64 bool mIsClipped : 1;
65 bool mEnableClippingScissorTest : 1;
66 bool mIsTemplate : 1;
67 bool mPropagateAlpha : 1;
68 bool mDelayCollectionUpdate : 1;
69 bool mTextToSpeechTriggered : 1;
70 ::ll::TypedStorage<2, 2, ushort> mControlCollectionFlag;
71 ::ll::TypedStorage<8, 32, ::std::string> mName;
72 ::ll::TypedStorage<4, 8, ::glm::vec2> mParentRelativePosition;
73 ::ll::TypedStorage<4, 8, ::glm::vec2> mSize;
74 ::ll::TypedStorage<4, 8, ::glm::vec2> mMinSize;
75 ::ll::TypedStorage<4, 8, ::glm::vec2> mMaxSize;
76 ::ll::TypedStorage<4, 4, float> mAlpha;
77 ::ll::TypedStorage<4, 4, int> mZOrder;
78 ::ll::TypedStorage<4, 4, int> mLayer;
79 ::ll::TypedStorage<4, 8, ::Vec2> mClipOffset;
80 ::ll::TypedStorage<4, 4, uint> mClipChangeEventId;
81 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIPropertyBag>> mPropertyBag;
82 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mParent;
83 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mChildren;
84 ::ll::TypedStorage<8, 8, uint64> mComponentsInUse;
85 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::UIComponent>>> mComponents;
86 ::ll::TypedStorage<8, 24, ::std::vector<::RenderableComponent*>> mRenderableComponentLookup;
87 ::ll::TypedStorage<8, 24, ::std::vector<::CustomFrameUpdateComponent*>> mCustomFrameUpdateComponentLookup;
88 ::ll::TypedStorage<8, 24, ::std::vector<::UIControl::ControlResolutionInfo>> mControlResolvers;
89 ::ll::TypedStorage<8, 24, ::std::vector<::std::function<void(::UIControl&)>>> mPostCreateVector;
90 ::ll::TypedStorage<8, 8, ::ControlScreenAction&> mControlScreenAction;
91 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mModalAncestor;
92 // NOLINTEND
93
94public:
95 // prevent constructor by default
96 UIControl& operator=(UIControl const&);
97 UIControl(UIControl const&);
98 UIControl();
99
100public:
101 // member functions
102 // NOLINTBEGIN
103 MCAPI explicit UIControl(::ControlScreenAction& controlScreenAction);
104
105 MCAPI void _eraseComponentFromLookup(::UIComponent& component);
106
107 MCAPI uint _getComponentIndexFromBitId(uint64 bitId) const;
108
109 MCAPI void _propagateLockStateChange(bool broadcastEvent);
110
111 MCAPI void _registerControlNameResolver(
112 ::std::string const& controlName,
113 ::ui::NameResolutionScope scope,
114 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> setter
115 );
116
117 MCAPI void _registerPostCreateCallback(::std::function<void(::UIControl&)> setter);
118
119 MCAPI void _resolveControlNames(::UIControl& rootControl);
120
121 MCAPI void _resolvePostCreate();
122
123 MCAPI void _setPositionDirty();
124
125 MCAPI void
126 _setVisible(::ui::VisibilityFlag visibleFlags, bool setLayoutChangedFlag, bool doLayout, bool shrinkInvisible);
127
128 MCAPI void addChild(::std::shared_ptr<::UIControl> child, ::ui::ChildInsertPosition childInsertPosition);
129
130 MCAPI void appendPropertyBag(::UIPropertyBag const& propertyBag);
131
132 MCAPI ::ComponentReceiveActionType broadcastEvent(
133 ::VisualTree& visualTree,
134 ::ScreenInputContext& context,
135 ::UIAnimationController& animationController,
136 ::UIComponent* sender,
137 ::ScreenEvent const& screenEvent
138 );
139
140 MCAPI bool canBeFocused() const;
141
142 MCAPI ::std::shared_ptr<::UIControl> clone(::UIControl* parent) const;
143
144 MCAPI bool containsPoint(::glm::vec2 const& point) const;
145
146 MCAPI void findAllCollectionIndices(::brstd::function_ref<void(::std::string const&, int)> callback);
147
148 MCAPI int findCollectionIndex(::std::string const& collectionName) const;
149
150 MCAPI ::RectangleArea getAABB() const;
151
152 MCAPI ::std::shared_ptr<::UIControl> getAncestorWhere(::brstd::function_ref<bool(::UIControl const&)> predicate);
153
154 MCAPI ::std::string const getPathedName() const;
155
156 MCAPI ::glm::vec2 const& getPosition() const;
157
158 MCAPI ::UIPropertyBag const& getPropertyBag() const;
159
160 MCFOLD ::UIPropertyBag& getPropertyBag();
161
162 MCAPI ::std::shared_ptr<::UIControl> moveChild(int index, bool notify);
163
164 MCAPI void notifyBindingsUpdated(
165 ::std::vector<::std::string> controlList,
166 ::std::string propertyName,
167 bool value,
168 bool siblingScope
169 );
170
171 MCAPI void popBackChild();
172
173 MCAPI void popFrontChild();
174
175 MCAPI void reloadFromControl(::UIControl const& control);
176
177 MCAPI bool removeChild(::std::shared_ptr<::UIControl> control);
178
179 MCAPI bool removeParentByName(::std::string const& name);
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 void setModalAncestor(::std::weak_ptr<::UIControl> control);
188
189 MCAPI void setVisible(bool visible, bool setLayoutChangedFlag, bool doLayout);
190
191 MCAPI ~UIControl();
192 // NOLINTEND
193
194public:
195 // constructor thunks
196 // NOLINTBEGIN
197 MCAPI void* $ctor(::ControlScreenAction& controlScreenAction);
198 // NOLINTEND
199
200public:
201 // destructor thunk
202 // NOLINTBEGIN
203 MCAPI void $dtor();
204 // NOLINTEND
205};
Definition RectangleArea.h:5
Definition UIAnimationController.h:5
Definition UIControl.h:5
Definition ControlScreenAction.h:5
Definition CustomFrameUpdateComponent.h:5
Definition RenderableComponent.h:5
Definition ScreenEvent.h:5
Definition ScreenInputContext.h:5
Definition UIComponent.h:5
Definition UIControl.h:13
Definition UIPropertyBag.h:5
Definition VisualTree.h:5