LeviLamina
Loading...
Searching...
No Matches
UIResolvedDef.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/AnchorPoint.h"
7#include "mc/client/gui/AnimationType.h"
8#include "mc/client/gui/ClipDirection.h"
9#include "mc/client/gui/Draggable.h"
10#include "mc/client/gui/FontSize.h"
11#include "mc/client/gui/OrientationType.h"
12#include "mc/client/gui/PriorityRule.h"
13#include "mc/client/gui/TextAlignment.h"
14#include "mc/client/gui/UIDefType.h"
15#include "mc/client/gui/controls/BindingCondition.h"
16#include "mc/client/gui/controls/BindingType.h"
17#include "mc/client/gui/controls/SliderManagerBehavior.h"
18#include "mc/client/gui/controls/ToggleManagerBehavior.h"
19#include "mc/deps/core/utility/NonOwnerPointer.h"
20#include "mc/deps/json/Value.h"
21
22// auto generated forward declare list
23// clang-format off
25class UIPropertyBag;
26class UiExpression;
27class Vec2;
28namespace mce { class Color; }
29namespace ui { struct LayoutOffset; }
30namespace ui { struct SliceSize; }
31// clang-format on
32
33class UIResolvedDef {
34public:
35 // member variables
36 // NOLINTBEGIN
37 ::ll::TypedStorage<1, 1, bool> mIgnored;
38 ::ll::TypedStorage<8, 32, ::std::string const> mDefNamespace;
39 ::ll::TypedStorage<8, 32, ::std::string const> mDefName;
40 ::ll::TypedStorage<8, 8, ::Json::Value const&> mBaseVal;
41 ::ll::TypedStorage<8, 8, ::Json::Value const&> mOverrideVal;
42 ::ll::TypedStorage<8, 16, ::Json::Value> mVariables;
43 ::ll::TypedStorage<8, 8, ::std::vector<::Json::Value*>*> mVariablesStack;
44 ::ll::TypedStorage<8, 16, ::std::set<::std::string, ::std::less<void>>> mUnvalidatedProperties;
45 // NOLINTEND
46
47public:
48 // prevent constructor by default
49 UIResolvedDef& operator=(UIResolvedDef const&);
50 UIResolvedDef();
51
52public:
53 // member functions
54 // NOLINTBEGIN
55 MCAPI UIResolvedDef(::UIResolvedDef const&);
56
57 MCAPI UIResolvedDef(::std::vector<::Json::Value*>* variablesStack, ::Json::Value const& resolvedVal);
58
59 MCAPI UIResolvedDef(
60 ::std::vector<::Json::Value*>* variablesStack,
61 ::std::string_view defNamespace,
62 ::std::string_view defName,
63 ::Json::Value const& baseVal,
64 ::Json::Value const& overrideVal
65 );
66
67 MCAPI ::Json::Value const& _evaluate(::Json::Value const& value, bool forceExpressionEval) const;
68
69 MCAPI void _pushVariables();
70
71 MCAPI void _validateProperty(::std::string_view name) const;
72
73 MCAPI void foreachMemberNames(::std::function<void(::std::string_view)> predicate) const;
74
75 MCAPI ::ui::AnchorPoint getAsAnchorPoint(::std::string_view key, ::ui::AnchorPoint defaultValue) const;
76
77 MCAPI ::ui::AnimationType getAsAnimationType(::std::string_view key, ::ui::AnimationType defaultValue) const;
78
79 MCAPI ::BindingCondition getAsBindingCondition(::std::string_view key) const;
80
81 MCAPI ::BindingType getAsBindingType(::std::string_view key) const;
82
83 MCAPI bool getAsBool(::std::string_view key, bool defaultValue) const;
84
85 MCAPI uint getAsButtonId(::std::string_view key, uint defaultValue) const;
86
87 MCAPI ::ui::ClipDirection getAsClipDirection(::std::string_view key, ::ui::ClipDirection defaultValue) const;
88
89 MCAPI ::Vec2 getAsClipOffset(::std::string_view key) const;
90
91 MCAPI ::mce::Color getAsColor(::std::string_view key, ::mce::Color const& defaultValue) const;
92
93 MCAPI ::ui::Draggable getAsDraggable(::std::string_view key, ::ui::Draggable defaultValue) const;
94
95 MCAPI float getAsFloat(::std::string_view key, float defaultValue) const;
96
97 MCAPI ::ui::FontSize getAsFontSize(::std::string_view key, ::ui::FontSize defaultValue) const;
98
99 MCAPI ::glm::ivec2 getAsGridSize(::std::string_view key, ::glm::ivec2 const& defaultValue) const;
100
101 MCAPI int getAsInt(::std::string_view key, int defaultValue) const;
102
103 MCAPI ::ui::LayoutOffset getAsLayoutSize(::std::string_view key, ::ui::LayoutOffset const& defaultValue) const;
104
105 MCAPI ::ui::OrientationType getAsOrientation(::std::string_view key, ::ui::OrientationType defaultValue) const;
106
107 MCAPI ::ui::PriorityRule getAsPriorityRule(::std::string_view key, ::ui::PriorityRule defaultValue) const;
108
109 MCAPI ::std::unique_ptr<::UIPropertyBag>
110 getAsPropertyBag(::std::string_view key, ::std::unique_ptr<::UIPropertyBag> defaultValue) const;
111
112 MCAPI ::UiExpression getAsPropetyEvaluation(::std::string_view key) const;
113
114 MCAPI ::glm::vec2 getAsSize(::std::string_view key, ::glm::vec2 const& defaultValue) const;
115
116 MCAPI ::ui::SliceSize getAsSliceSize(::std::string_view key, ::ui::SliceSize const& defaultValue) const;
117
118 MCAPI ::SliderManagerBehavior getAsSliderManagerBehavior(::std::string_view key, ::SliderManagerBehavior) const;
119
120 MCAPI ::std::string getAsString(::std::string_view key, ::std::string_view defaultValue) const;
121
122 MCAPI ::std::vector<::std::string>
123 getAsStringVector(::std::string_view key, ::std::vector<::std::string> const& defaultValue) const;
124
125 MCAPI ::ui::TextAlignment getAsTextAlignment(::std::string_view key, ::ui::TextAlignment defaultValue) const;
126
127 MCAPI ::std::string getAsTextureString() const;
128
129 MCAPI ::ToggleManagerBehavior getAsToggleManagerBehavior(::std::string_view key, ::ToggleManagerBehavior) const;
130
131 MCFOLD ::glm::vec2 getAsUV(::std::string_view key, ::glm::vec2 const& defaultValue) const;
132
133 MCFOLD ::glm::vec2 getAsUVSize(::std::string_view key, ::glm::vec2 const& defaultValue) const;
134
135 MCAPI uint getAsUnsignedInt(::std::string_view key, uint defaultValue) const;
136
137 MCAPI ::UIDefType getDefType() const;
138
139 MCFOLD ::std::string const& getName() const;
140
141 MCFOLD ::std::string const& getNamespace() const;
142
143 MCAPI ::Json::Value const& getValue(::std::string_view key, bool forceExpressionEval) const;
144
145 MCAPI bool hasValue(::std::string_view key) const;
146
147 MCFOLD bool isIgnored() const;
148
149 MCAPI bool isNamed() const;
150
151 MCAPI ~UIResolvedDef();
152 // NOLINTEND
153
154public:
155 // static functions
156 // NOLINTBEGIN
157 MCAPI static ::std::string
158 _replaceVarsInRefString(::std::string_view refString, ::std::vector<::Json::Value*>* variablesStack);
159
160 MCAPI static ::UIResolvedDef create(
161 ::Bedrock::NotNullNonOwnerPtr<::IUIDefRepository const> defRepo,
162 ::std::vector<::Json::Value*>* variablesStack,
163 ::std::string_view currNamespace,
164 ::std::string_view name
165 );
166
167 MCAPI static ::UIResolvedDef createWithDef(
168 ::Bedrock::NotNullNonOwnerPtr<::IUIDefRepository const> defRepo,
169 ::std::vector<::Json::Value*>* variablesStack,
170 ::std::string_view currNamespace,
171 ::Json::Value const& def
172 );
173
174 MCAPI static ::Json::Value evaluate(
175 ::Json::Value const& value,
176 ::std::vector<::Json::Value*> const& variablesStack,
177 ::Json::Value const* optionalLocalStack
178 );
179
180 MCAPI static void parseName(
181 ::std::string_view input,
182 ::std::string& outName,
183 ::std::string& outNamespace,
184 ::std::string& outRef,
185 ::std::vector<::Json::Value*>* variablesStack
186 );
187 // NOLINTEND
188
189public:
190 // static variables
191 // NOLINTBEGIN
192 MCAPI static ::UIResolvedDef& mNull();
193 // NOLINTEND
194
195public:
196 // constructor thunks
197 // NOLINTBEGIN
198 MCAPI void* $ctor(::UIResolvedDef const&);
199
200 MCAPI void* $ctor(::std::vector<::Json::Value*>* variablesStack, ::Json::Value const& resolvedVal);
201
202 MCAPI void* $ctor(
203 ::std::vector<::Json::Value*>* variablesStack,
204 ::std::string_view defNamespace,
205 ::std::string_view defName,
206 ::Json::Value const& baseVal,
207 ::Json::Value const& overrideVal
208 );
209 // NOLINTEND
210
211public:
212 // destructor thunk
213 // NOLINTBEGIN
214 MCAPI void $dtor();
215 // NOLINTEND
216};
Definition IUIDefRepository.h:5
Definition UIPropertyBag.h:5
Definition UIResolvedDef.h:5
Definition UiExpression.h:5
Definition Vec2.h:5
Definition Color.h:13
Definition LayoutOffset.h:7
Definition SliceSize.h:7