Skip to content
LeviMC
English
AutoLightDark
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, 76, ::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 MCNAPI explicit ScrollViewComponent(::UIControl& owner);
84
85 MCNAPI ::glm::vec2 _getContentSize() const;
86
87 MCNAPI void _makeScrollBarVisible();
88
89 MCNAPI void _setContentOffset(
90 ::LayoutComponent& layout,
91 ::glm::vec2 offset,
92 ::glm::vec2 const& scrollContentSize,
93 ::glm::vec2 const& scrollViewPortSize
94 );
95
96 MCNAPI ::ui::AnimationStatus _updateDynamicsAndScrollPosition(::mce::TimeStep const& timeStep);
97
98 MCNAPI void _updateScroll(::glm::vec2 const& delta, bool updateScrollBoxLayout);
99
100 MCNAPI void _updateScrollBoxSize();
101
102 MCNAPI void _updateScrollFromScrollBox(::ScreenEvent const& screenEvent);
103
105
106 MCNAPI ::ui::AnimationStatus animationScrollingTick(::mce::TimeStep const& timeStep);
107
109 ::VisualTree& visualTree,
110 ::UIAnimationController& animationController,
112 ::glm::vec2 const& position,
113 ::glm::vec2 const& deltaPosition,
114 bool alreadyHandled
115 );
116
117 MCNAPI bool isPointInViewPort(::glm::vec2 const& pointerPosition) const;
118 // NOLINTEND
119
120public:
121 // constructor thunks
122 // NOLINTBEGIN
123 MCNAPI void* $ctor(::UIControl& owner);
124 // NOLINTEND
125
126public:
127 // virtual function thunks
128 // NOLINTBEGIN
129 MCNAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
130
131 MCNAPI void $reset();
132
133 MCNAPI void $reload(::UIComponent const& rhs);
134
135 MCNAPI ::ComponentReceiveActionType $receive(
136 ::VisualTree& visualTree,
138 ::UIAnimationController& animationController,
139 ::ScreenEvent const& screenEvent
140 );
141
143
144 MCNAPI bool $onLayoutChange();
145 // NOLINTEND
146};
Definition LayoutComponent.h:5
Definition ScreenInputContext.h:5
Definition ScrollViewComponent.h:5
MCAPI bool $onLayoutChange()
MCAPI void * $ctor(::UIControl &owner)
MCAPI::ui::AnimationStatus animationScrollingTick(::mce::TimeStep const &timeStep)
MCAPI::ComponentReceiveActionType $receive(::VisualTree &visualTree, ::ScreenInputContext &context, ::UIAnimationController &animationController, ::ScreenEvent const &screenEvent)
MCAPI void _updateScrollBoxSize()
MCAPI void $onNotifyChildRemoved()
MCAPI bool isPointInViewPort(::glm::vec2 const &pointerPosition) const
MCAPI void $reload(::UIComponent const &rhs)
MCAPI ::std::unique_ptr<::UIComponent > $clone(::UIControl &cloneOwner) const
MCAPI void _updateScrollFromScrollBox(::ScreenEvent const &screenEvent)
MCAPI::ui::AnimationStatus _updateDynamicsAndScrollPosition(::mce::TimeStep const &timeStep)
MCAPI void _makeScrollBarVisible()
MCAPI void _updateTouchScrollbarVisibility(::mce::TimeStep const &timeStep)
MCAPI bool handleScrollDirection(::VisualTree &visualTree, ::UIAnimationController &animationController, ::ScreenInputContext &context, ::glm::vec2 const &position, ::glm::vec2 const &deltaPosition, bool alreadyHandled)
MCAPI void $reset()
MCAPI ScrollViewComponent(::UIControl &owner)
MCAPI::glm::vec2 _getContentSize() const
MCAPI void _setContentOffset(::LayoutComponent &layout, ::glm::vec2 offset, ::glm::vec2 const &scrollContentSize, ::glm::vec2 const &scrollViewPortSize)
MCAPI void _updateScroll(::glm::vec2 const &delta, bool updateScrollBoxLayout)
Definition UIAnimationController.h:5
Definition UIComponent.h:5
Definition UIControl.h:5
Definition VisualTree.h:5
Definition ScreenEvent.h:5
Definition context.h:5
Definition TimeStep.h:7