LeviLamina
Loading...
Searching...
No Matches
GridComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/OrientationType.h"
7#include "mc/client/gui/controls/UIComponent.h"
8#include "mc/deps/core/utility/pub_sub/Publisher.h"
9
10// auto generated forward declare list
11// clang-format off
12class UIControl;
14namespace Bedrock::PubSub { class Subscription; }
15namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
16// clang-format on
17
18class GridComponent : public ::UIComponent {
19public:
20 // member variables
21 // NOLINTBEGIN
22 ::ll::TypedStorage<4, 8, ::glm::ivec2> mDimensions;
23 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::UIControl>> mGridItemTemplate;
24 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControlFactory>> mControlFactory;
25 ::ll::TypedStorage<8, 32, ::std::string> mGridDimensionBinding;
26 ::ll::TypedStorage<8, 32, ::std::string> mCollectionName;
27 ::ll::TypedStorage<1, 1, ::ui::OrientationType> mGridRescalingType;
28 ::ll::TypedStorage<1, 1, ::ui::OrientationType> mGridFillDirection;
29 ::ll::TypedStorage<4, 4, int> mMaximumGridItems;
30 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mCachedControls;
31 ::ll::TypedStorage<1, 1, bool> mLowMemoryMode;
32 ::ll::TypedStorage<4, 4, int> mPartialCreationStartIndex;
33 ::ll::TypedStorage<4, 4, int> mPartialCreationEndIndex;
34 ::ll::TypedStorage<
35 8,
36 128,
37 ::Bedrock::PubSub::Publisher<void(uint64), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
38 mPublisher;
39 // NOLINTEND
40
41public:
42 // prevent constructor by default
43 GridComponent();
44
45public:
46 // virtual functions
47 // NOLINTBEGIN
48 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner) const /*override*/;
49
50 virtual void reset() /*override*/;
51
52 virtual void onNotifyChildAdded() /*override*/;
53
54 virtual void onNotifyChildRemoved() /*override*/;
55 // NOLINTEND
56
57public:
58 // member functions
59 // NOLINTBEGIN
60 MCAPI GridComponent(::UIControl& owner, ::std::weak_ptr<::UIControlFactory> factoryPtr);
61
62 MCAPI void _assignStaticGridItemIndexes();
63
64 MCAPI void _cacheGridItemControlAt(::UIControl& owner, uint64 const& index);
65
66 MCAPI void _createGridItemAt(int index);
67
68 MCAPI void _reconstructGridItem(::UIControl& gridItem, int gridItemIndex);
69
70 MCAPI ::std::pair<int, int> getClippedCollectionRange() const;
71
72 MCFOLD ::std::string const& getCollectionName() const;
73
74 MCAPI int getExpectedSize() const;
75
76 MCFOLD ::glm::ivec2 const& getGridDimensions() const;
77
78 MCAPI ::ui::OrientationType const& getGridFillDirection() const;
79
80 MCFOLD ::std::shared_ptr<::UIControl> getGridItemTemplate() const;
81
82 MCFOLD ::ui::OrientationType const& getGridRescalingType() const;
83
84 MCFOLD int getMaximumGridItems() const;
85
86 MCAPI bool getNeedsRescaling() const;
87
88 MCFOLD bool isDynamic() const;
89
90 MCAPI bool partiallyCreateGridItems(int startIndex, int endIndex);
91
92 MCAPI void reassignGridPositions();
93
94 MCAPI void refreshGridItems();
95
96 MCFOLD ::Bedrock::PubSub::Subscription registerGridCompletionListener(::std::function<void(uint64)> callback);
97
98 MCFOLD void setCollectionName(::std::string const& collectionName);
99
100 MCFOLD void setGridDimensionBinding(::std::string const& binding);
101
102 MCAPI void setGridDimensions(::glm::ivec2 const& dimensions);
103
104 MCAPI void setGridFillDirection(::ui::OrientationType const& val);
105
106 MCAPI void setGridItemTemplate(::std::shared_ptr<::UIControl> gridItemTemplate);
107
108 MCAPI void setGridRescalingType(::ui::OrientationType const& val);
109
110 MCFOLD void setLowMemoryMode(bool lowMemoryMode);
111
112 MCAPI void setMaximumGridItems(int val);
113 // NOLINTEND
114
115public:
116 // constructor thunks
117 // NOLINTBEGIN
118 MCAPI void* $ctor(::UIControl& owner, ::std::weak_ptr<::UIControlFactory> factoryPtr);
119 // NOLINTEND
120
121public:
122 // virtual function thunks
123 // NOLINTBEGIN
124 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
125
126 MCFOLD void $reset();
127
128 MCFOLD void $onNotifyChildAdded();
129
130 MCFOLD void $onNotifyChildRemoved();
131 // NOLINTEND
132
133public:
134 // vftables
135 // NOLINTBEGIN
136 MCNAPI static void** $vftable();
137 // NOLINTEND
138};
Definition Subscription.h:10
Definition GridComponent.h:5
static MCAPI void ** $vftable()
Definition UIComponent.h:5
Definition UIControlFactory.h:5
Definition UIControl.h:5