Skip to content
LeviMC
English
AutoLightDark
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
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 MCNAPI 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 MCNAPI void _propagateLockStateChange(bool broadcastEvent);
123
125 ::std::string const& controlName,
126 ::ui::NameResolutionScope scope,
127 ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)> setter
128 );
129
130 MCNAPI void _resolveControlNames(::UIControl& rootControl);
131
132 MCNAPI void _resolvePostCreate();
133
134 MCAPI void _setCachedPosition() const;
135
136 MCAPI void _setPositionDirty();
137
138 MCNAPI void
139 _setVisible(::ui::VisibilityFlag visibleFlags, bool setLayoutChangedFlag, bool doLayout, bool shrinkInvisible);
140
141 MCNAPI void addChild(::std::shared_ptr<::UIControl> child, ::ui::ChildInsertPosition childInsertPosition);
142
143 MCNAPI ::std::shared_ptr<::UIControl> clone(::UIControl* parent) const;
144
145 MCAPI void findAllCollectionIndices(::brstd::function_ref<void(::std::string const&, int)> callback);
146
147 MCAPI int findCollectionIndex(::std::string const& collectionName) const;
148
149 MCNAPI ::std::shared_ptr<::UIControl> getAncestorWhere(::brstd::function_ref<bool(::UIControl const&)> predicate);
150
151 MCNAPI ::std::string const getPathedName() const;
152
153 MCNAPI ::UIPropertyBag const& getPropertyBag() const;
154
155 MCFOLD ::UIPropertyBag& getPropertyBag();
156
157 MCNAPI ::std::shared_ptr<::UIControl> moveChild(int index, bool notify);
158
160 ::std::vector<::std::string> controlList,
161 ::std::string propertyName,
162 bool value,
163 bool siblingScope
164 );
165
166 MCNAPI void popBackChild();
167
168 MCNAPI void popFrontChild();
169
171 ::std::unique_ptr<::UIPropertyBag> propertyBag,
172 ::std::unique_ptr<::UIPropertyBag> propertyBagForChildren
173 );
174
175 MCNAPI void reloadFromControl(::UIControl const& control);
176
177 MCNAPI bool removeChild(::std::shared_ptr<::UIControl> control);
178
179 MCNAPI void reset(bool recursive, bool shouldClearCollectionFlag);
180
181 MCNAPI void setEnabled(bool enabled, bool broadcastEvent);
182
183 MCNAPI void setIsTemplate(bool isTemplate);
184
185 MCNAPI ~UIControl();
186 // NOLINTEND
187
188public:
189 // destructor thunk
190 // NOLINTBEGIN
191 MCNAPI void $dtor();
192 // NOLINTEND
193};
Definition ControlScreenAction.h:5
Definition CustomFrameUpdateComponent.h:5
Definition RenderableComponent.h:5
Definition UIComponent.h:5
Definition UIControl.h:5
MCAPI ::std::shared_ptr<::UIControl > getAncestorWhere(::brstd::function_ref< bool(::UIControl const &)> predicate)
MCAPI void $dtor()
MCAPI void popFrontChild()
MCAPI::UIPropertyBag const & getPropertyBag() const
MCAPI void reloadFromControl(::UIControl const &control)
MCAPI void processPropertyBags(::std::unique_ptr<::UIPropertyBag > propertyBag, ::std::unique_ptr<::UIPropertyBag > propertyBagForChildren)
MCAPI bool removeChild(::std::shared_ptr<::UIControl > control)
MCAPI void _registerControlNameResolver(::std::string const &controlName, ::ui::NameResolutionScope scope, ::std::function< void(::UIControl &, ::std::shared_ptr<::UIControl >)> setter)
MCAPI void notifyBindingsUpdated(::std::vector<::std::string > controlList, ::std::string propertyName, bool value, bool siblingScope)
MCAPI void _resolvePostCreate()
MCAPI ::std::shared_ptr<::UIControl > moveChild(int index, bool notify)
MCAPI void reset(bool recursive, bool shouldClearCollectionFlag)
MCAPI ::std::shared_ptr<::UIControl > clone(::UIControl *parent) const
MCAPI void _propagateLockStateChange(bool broadcastEvent)
MCAPI void setIsTemplate(bool isTemplate)
MCAPI ~UIControl()
MCAPI void setEnabled(bool enabled, bool broadcastEvent)
MCAPI void addChild(::std::shared_ptr<::UIControl > child, ::ui::ChildInsertPosition childInsertPosition)
MCAPI void _setVisible(::ui::VisibilityFlag visibleFlags, bool setLayoutChangedFlag, bool doLayout, bool shrinkInvisible)
MCAPI::std::string const getPathedName() const
MCAPI void _resolveControlNames(::UIControl &rootControl)
MCAPI void popBackChild()
Definition UIPropertyBag.h:5
Definition function_ref.h:60
Definition UIControl.h:13
MCAPI ControlResolutionInfo(::std::string const &aTargetControlName, ::ui::NameResolutionScope aScope, ::std::function< void(::UIControl &, ::std::shared_ptr<::UIControl >)> aSetter)
MCAPI void * $ctor(::std::string const &aTargetControlName, ::ui::NameResolutionScope aScope, ::std::function< void(::UIControl &, ::std::shared_ptr<::UIControl >)> aSetter)