LeviLamina
Loading...
Searching...
No Matches
Router.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/oreui/routing/RouteHistoryAction.h"
7#include "mc/client/gui/oreui/routing/RouterAction.h"
8#include "mc/client/gui/oreui/routing/RouterHistory.h"
9#include "mc/client/gui/oreui/routing/RouterLocation.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11#include "mc/deps/core/utility/pub_sub/Publisher.h"
12
13// auto generated forward declare list
14// clang-format off
15class AbstractScene;
16class ISceneStack;
17namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
18namespace OreUI { class IRouteMatcher; }
19namespace OreUI { class IRoutePrerequisiteHandler; }
20namespace OreUI { class RouterEventing; }
21namespace OreUI { struct RouteAction; }
22// clang-format on
23
24namespace OreUI {
25
26class Router {
27public:
28 // Router inner types declare
29 // clang-format off
31 // clang-format on
32
33 // Router inner types define
34 enum class RouterPushMode : int {
35 Normal = 0,
36 Flux = 1,
37 };
38
40 public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<8, 160, ::std::optional<::OreUI::RouterLocation>> mOldLocation;
44 ::ll::TypedStorage<8, 160, ::std::optional<::OreUI::RouterLocation>> mCurrentLocation;
45 // NOLINTEND
46 };
47
48 using OnRouteChangedCallback = void(
49 ::std::optional<::OreUI::RouterLocation> const&,
50 ::std::optional<::OreUI::RouterLocation> const&,
51 ::OreUI::RouterAction
52 );
53
54public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<8, 128, ::OreUI::RouterHistory> mHistory;
58 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IRouteMatcher const>> mRouteMatcher;
59 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ISceneStack>> mSceneStack;
60 ::ll::TypedStorage<
61 8,
62 128,
63 ::Bedrock::PubSub::Publisher<
64 void(
65 ::std::optional<::OreUI::RouterLocation> const&,
66 ::std::optional<::OreUI::RouterLocation> const&,
67 ::OreUI::RouterAction
68 ),
69 ::Bedrock::PubSub::ThreadModel::MultiThreaded,
70 0>>
71 mOnRouteChangedPublisher;
72 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler>> mPrerequisiteHandler;
73 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::RouterEventing>> mEventing;
74 ::ll::TypedStorage<1, 1, bool> mIsNotifyingListeners;
75 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::Router::DeferredChangeNotification>> mDeferredChangeNotifications;
76 // NOLINTEND
77
78public:
79 // prevent constructor by default
80 Router();
81
82public:
83 // member functions
84 // NOLINTBEGIN
85 MCAPI Router(
86 ::std::unique_ptr<::OreUI::IRouteMatcher const> routeMatcher,
87 ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler> prerequisiteHandler,
88 ::std::unique_ptr<::OreUI::RouterEventing> routerEventing,
89 ::Bedrock::NotNullNonOwnerPtr<::ISceneStack> const& sceneStack
90 );
91
92 MCAPI void _handleSceneStackPop(
93 ::std::shared_ptr<::AbstractScene> const& newTopScreen,
94 bool,
95 ::std::optional<::OreUI::RouteAction> const& routeAction
96 );
97
98 MCAPI void _handleSceneStackPush(
99 ::std::shared_ptr<::AbstractScene> const& newScreen,
100 ::std::optional<::OreUI::RouteAction> const& routeAction
101 );
102
103 MCAPI void _onChange(
104 ::std::optional<::OreUI::RouterLocation> const& oldLocation,
105 ::std::optional<::OreUI::RouterLocation> const& currentLocation
106 );
107
108 MCAPI bool _pushRoute(::std::string const& route, ::OreUI::Router::RouterPushMode mode);
109
110 MCAPI void _replaceCurrentRouteInHistory(::std::string const& newRoute, ::OreUI::RouteHistoryAction action);
111
112 MCAPI ::std::optional<::OreUI::RouterLocation> getCurrentLocation() const;
113
114 MCAPI void goBack();
115
116 MCAPI bool isCurrentRoute(::std::string_view route) const;
117
118 MCAPI bool replaceRoute(::std::string const& route);
119
120 MCAPI void replaceRouteMatcher(::std::unique_ptr<::OreUI::IRouteMatcher> newRouteMatcher);
121
122 MCAPI ~Router();
123 // NOLINTEND
124
125public:
126 // static variables
127 // NOLINTBEGIN
128 MCAPI static ::std::add_lvalue_reference_t<char const[]> BEDROCK_PREFIX();
129 // NOLINTEND
130
131public:
132 // constructor thunks
133 // NOLINTBEGIN
134 MCAPI void* $ctor(
135 ::std::unique_ptr<::OreUI::IRouteMatcher const> routeMatcher,
136 ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler> prerequisiteHandler,
137 ::std::unique_ptr<::OreUI::RouterEventing> routerEventing,
138 ::Bedrock::NotNullNonOwnerPtr<::ISceneStack> const& sceneStack
139 );
140 // NOLINTEND
141
142public:
143 // destructor thunk
144 // NOLINTBEGIN
145 MCAPI void $dtor();
146 // NOLINTEND
147};
148
149} // namespace OreUI
Definition AbstractScene.h:5
Definition ISceneStack.h:5
Definition IRouteMatcher.h:7
Definition IRoutePrerequisiteHandler.h:7
Definition RouterEventing.h:7
Definition Router.h:7
Definition RouteAction.h:7