3#include "mc/_HeaderOutputPredefine.h"
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"
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;
55 ScrollViewComponent();
60 virtual ~ScrollViewComponent() =
default;
62 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner)
const ;
64 virtual void reset() ;
66 virtual void reload(::UIComponent
const& rhs) ;
68 virtual ::ComponentReceiveActionType receive(
69 ::VisualTree& visualTree,
70 ::ScreenInputContext& context,
71 ::UIAnimationController& animationController,
72 ::ScreenEvent
const& screenEvent
75 virtual void onNotifyChildRemoved() ;
77 virtual bool onLayoutChange() ;
83 MCAPI
explicit ScrollViewComponent(::UIControl& owner);
85 MCAPI ::glm::vec2 _getContentSize()
const;
87 MCAPI
bool _handlePointerMove(
88 ::VisualTree& screenEvent,
89 ::ScreenInputContext& returnValue,
90 ::UIAnimationController&,
92 ::ComponentReceiveActionType&
95 MCAPI
bool _handleScrollDirection(
96 ::VisualTree& screenEvent,
97 ::ScreenInputContext& returnValue,
98 ::UIAnimationController&,
100 ::ComponentReceiveActionType&
103 MCAPI
bool _handleScrollRequest(
104 ::VisualTree& screenEvent,
105 ::ScreenInputContext& returnValue,
106 ::UIAnimationController&,
107 ::ScreenEvent
const&,
108 ::ComponentReceiveActionType&
111 MCAPI
bool _handleTrackScrollButton(
112 ::VisualTree& screenEvent,
113 ::ScreenInputContext& returnValue,
114 ::UIAnimationController&,
115 ::ScreenEvent
const&,
116 ::ComponentReceiveActionType&
119 MCAPI
void _makeScrollBarVisible();
121 MCAPI
void _setContentOffset(
122 ::LayoutComponent& layout,
124 ::glm::vec2
const& scrollContentSize,
125 ::glm::vec2
const& scrollViewPortSize
128 MCAPI ::ui::AnimationStatus _updateDynamicsAndScrollPosition(::mce::TimeStep
const& timeStep);
130 MCAPI
void _updateScroll(::glm::vec2
const& delta,
bool updateScrollBoxLayout);
132 MCAPI
void _updateScrollBoxSize();
134 MCAPI
void _updateScrollFromScrollBox(::ScreenEvent
const& screenEvent);
136 MCAPI
void _updateTouchScrollbarVisibility(::mce::TimeStep
const& timeStep);
138 MCAPI ::ui::AnimationStatus animationScrollingTick(::mce::TimeStep
const& timeStep);
140 MCFOLD ::std::weak_ptr<::UIControl> getScrollContent()
const;
142 MCAPI
bool handleScrollDirection(
143 ::VisualTree& visualTree,
144 ::UIAnimationController& animationController,
145 ::ScreenInputContext& context,
146 ::glm::vec2
const& position,
147 ::glm::vec2
const& deltaPosition,
151 MCAPI
bool isPointInViewPort(::glm::vec2
const& pointerPosition)
const;
153 MCFOLD
void setGestureControlMode(
bool state);
159 MCAPI
void* $ctor(::UIControl& owner);
165 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner)
const;
169 MCAPI
void $reload(::UIComponent
const& rhs);
171 MCAPI ::ComponentReceiveActionType $receive(
172 ::VisualTree& visualTree,
173 ::ScreenInputContext& context,
174 ::UIAnimationController& animationController,
175 ::ScreenEvent
const& screenEvent
178 MCFOLD
void $onNotifyChildRemoved();
180 MCAPI
bool $onLayoutChange();
Definition LayoutComponent.h:5
Definition ScreenInputContext.h:5
Definition UIAnimationController.h:5
Definition UIComponent.h:5
Definition VisualTree.h:5
Definition ScreenEvent.h:5