LeviLamina
Loading...
Searching...
No Matches
ScrollViewComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/controls/ComponentReceiveActionType.h"
7#include "mc/client/gui/controls/ScrollbarDynamics.h"
8#include "mc/client/gui/controls/UIComponent.h"
9#include "mc/client/gui/screens/AnimationStatus.h"
10#include "mc/deps/input/enums/ButtonState.h"
11
12// auto generated forward declare list
13// clang-format off
14class LayoutComponent;
17class UIControl;
18class VisualTree;
19struct ScreenEvent;
20namespace mce { struct TimeStep; }
21// clang-format on
22
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mScrollViewPort;
28 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mScrollContent;
29 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mScrollTrack;
30 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mScrollBox;
31 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mBoxAndTrackPanel;
32 ::ll::TypedStorage<4, 4, uint> mTrackScrollButtonId;
33 ::ll::TypedStorage<4, 4, uint> mTouchScrollButtonId;
34 ::ll::TypedStorage<4, 4, uint> mScrollingActiveEventId;
35 ::ll::TypedStorage<4, 4, uint> mScrollBarReleasedEventId;
36 ::ll::TypedStorage<4, 4, uint> mScrollBarBottomEventId;
37 ::ll::TypedStorage<1, 1, ::ButtonState> mLastTouchButtonState;
38 ::ll::TypedStorage<1, 1, ::ButtonState> mLastScrollBoxPressedState;
39 ::ll::TypedStorage<4, 4, float> mDistanceForScrollEventsToPassOn;
40 ::ll::TypedStorage<4, 4, float> mScrollSpeed;
41 ::ll::TypedStorage<1, 1, bool> mGestureControlMode;
42 ::ll::TypedStorage<1, 1, bool> mAlwaysHandleScrolling;
43 ::ll::TypedStorage<1, 1, bool> mTouchMode;
44 ::ll::TypedStorage<1, 1, bool> mAllowScrollEvenWhenContentFits;
45 ::ll::TypedStorage<1, 1, bool> mScrollbarAlwaysVisible;
46 ::ll::TypedStorage<4, 68, ::ScrollbarDynamics> mScrollbarDynamics;
47 ::ll::TypedStorage<1, 1, bool> mTouchScrollBarVisible;
48 ::ll::TypedStorage<4, 4, float> mTouchScrollBarIntensity;
49 ::ll::TypedStorage<1, 1, bool> mJumpToBottomOnUpdate;
50 ::ll::TypedStorage<4, 4, float> mContentSize;
51 // NOLINTEND
52
53public:
54 // prevent constructor by default
55 ScrollViewComponent();
56
57public:
58 // virtual functions
59 // NOLINTBEGIN
60 virtual ~ScrollViewComponent() /*override*/ = default;
61
62 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner) const /*override*/;
63
64 virtual void reset() /*override*/;
65
66 virtual void reload(::UIComponent const& rhs) /*override*/;
67
68 virtual ::ComponentReceiveActionType receive(
69 ::VisualTree& visualTree,
70 ::ScreenInputContext& context,
71 ::UIAnimationController& animationController,
72 ::ScreenEvent const& screenEvent
73 ) /*override*/;
74
75 virtual void onNotifyChildRemoved() /*override*/;
76
77 virtual bool onLayoutChange() /*override*/;
78 // NOLINTEND
79
80public:
81 // member functions
82 // NOLINTBEGIN
83 MCAPI explicit ScrollViewComponent(::UIControl& owner);
84
85 MCAPI ::glm::vec2 _getContentSize() const;
86
87 MCAPI bool _handlePointerMove(
88 ::VisualTree& screenEvent,
89 ::ScreenInputContext& returnValue,
90 ::UIAnimationController&,
91 ::ScreenEvent const&,
92 ::ComponentReceiveActionType&
93 );
94
95 MCAPI bool _handleScrollDirection(
96 ::VisualTree& screenEvent,
97 ::ScreenInputContext& returnValue,
98 ::UIAnimationController&,
99 ::ScreenEvent const&,
100 ::ComponentReceiveActionType&
101 );
102
103 MCAPI bool _handleScrollRequest(
104 ::VisualTree& screenEvent,
105 ::ScreenInputContext& returnValue,
106 ::UIAnimationController&,
107 ::ScreenEvent const&,
108 ::ComponentReceiveActionType&
109 );
110
111 MCAPI bool _handleTrackScrollButton(
112 ::VisualTree& screenEvent,
113 ::ScreenInputContext& returnValue,
114 ::UIAnimationController&,
115 ::ScreenEvent const&,
116 ::ComponentReceiveActionType&
117 );
118
119 MCAPI void _makeScrollBarVisible();
120
121 MCAPI void _setContentOffset(
122 ::LayoutComponent& layout,
123 ::glm::vec2 offset,
124 ::glm::vec2 const& scrollContentSize,
125 ::glm::vec2 const& scrollViewPortSize
126 );
127
128 MCAPI ::ui::AnimationStatus _updateDynamicsAndScrollPosition(::mce::TimeStep const& timeStep);
129
130 MCAPI void _updateScroll(::glm::vec2 const& delta, bool updateScrollBoxLayout);
131
132 MCAPI void _updateScrollBoxSize();
133
134 MCAPI void _updateScrollFromScrollBox(::ScreenEvent const& screenEvent);
135
136 MCAPI void _updateTouchScrollbarVisibility(::mce::TimeStep const& timeStep);
137
138 MCAPI ::ui::AnimationStatus animationScrollingTick(::mce::TimeStep const& timeStep);
139
140 MCFOLD ::std::weak_ptr<::UIControl> getScrollContent() const;
141
142 MCAPI bool handleScrollDirection(
143 ::VisualTree& visualTree,
144 ::UIAnimationController& animationController,
145 ::ScreenInputContext& context,
146 ::glm::vec2 const& position,
147 ::glm::vec2 const& deltaPosition,
148 bool alreadyHandled
149 );
150
151 MCAPI bool isPointInViewPort(::glm::vec2 const& pointerPosition) const;
152
153 MCFOLD void setGestureControlMode(bool state);
154 // NOLINTEND
155
156public:
157 // constructor thunks
158 // NOLINTBEGIN
159 MCAPI void* $ctor(::UIControl& owner);
160 // NOLINTEND
161
162public:
163 // virtual function thunks
164 // NOLINTBEGIN
165 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
166
167 MCAPI void $reset();
168
169 MCAPI void $reload(::UIComponent const& rhs);
170
171 MCAPI ::ComponentReceiveActionType $receive(
172 ::VisualTree& visualTree,
173 ::ScreenInputContext& context,
174 ::UIAnimationController& animationController,
175 ::ScreenEvent const& screenEvent
176 );
177
178 MCFOLD void $onNotifyChildRemoved();
179
180 MCAPI bool $onLayoutChange();
181 // NOLINTEND
182
183public:
184 // vftables
185 // NOLINTBEGIN
186 MCNAPI static void** $vftable();
187 // NOLINTEND
188};
Definition LayoutComponent.h:5
Definition ScreenInputContext.h:5
Definition ScrollViewComponent.h:5
static MCAPI void ** $vftable()
Definition UIAnimationController.h:5
Definition UIComponent.h:5
Definition UIControl.h:5
Definition VisualTree.h:5
Definition ScreenEvent.h:5
Definition TimeStep.h:7