3#include "mc/_HeaderOutputPredefine.h"
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"
18namespace Bedrock::PubSub::ThreadModel {
struct MultiThreaded; }
35 enum class RouterPushMode :
int {
44 ::ll::TypedStorage<8, 160, ::std::optional<::OreUI::RouterLocation>> mOldLocation;
45 ::ll::TypedStorage<8, 160, ::std::optional<::OreUI::RouterLocation>> mCurrentLocation;
50 DeferredChangeNotification();
55 MCAPI DeferredChangeNotification(
56 ::std::optional<::OreUI::RouterLocation>
const& oldLocation,
57 ::std::optional<::OreUI::RouterLocation>
const& currentLocation
60 MCAPI ~DeferredChangeNotification();
67 ::std::optional<::OreUI::RouterLocation>
const& oldLocation,
68 ::std::optional<::OreUI::RouterLocation>
const& currentLocation
79 using OnRouteChangedCallback = void(
80 ::std::optional<::OreUI::RouterLocation>
const&,
81 ::std::optional<::OreUI::RouterLocation>
const&,
88 ::ll::TypedStorage<8, 128, ::OreUI::RouterHistory> mHistory;
89 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IRouteMatcher const>> mRouteMatcher;
90 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ISceneStack>> mSceneStack;
94 ::Bedrock::PubSub::Publisher<
96 ::std::optional<::OreUI::RouterLocation>
const&,
97 ::std::optional<::OreUI::RouterLocation>
const&,
100 ::Bedrock::PubSub::ThreadModel::MultiThreaded,
102 mOnRouteChangedPublisher;
103 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler>> mPrerequisiteHandler;
104 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::RouterEventing>> mEventing;
105 ::ll::TypedStorage<1, 1, bool> mIsNotifyingListeners;
106 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::Router::DeferredChangeNotification>> mDeferredChangeNotifications;
117 ::std::unique_ptr<::OreUI::IRouteMatcher const> routeMatcher,
118 ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler> prerequisiteHandler,
119 ::std::unique_ptr<::OreUI::RouterEventing> routerEventing,
120 ::Bedrock::NotNullNonOwnerPtr<::ISceneStack>
const& sceneStack
123 MCAPI
void _handleSceneStackPop(
124 ::std::shared_ptr<::AbstractScene>
const& newTopScreen,
126 ::std::optional<::OreUI::RouteAction>
const& routeAction
129 MCAPI
void _handleSceneStackPush(
130 ::std::shared_ptr<::AbstractScene>
const& newScreen,
131 ::std::optional<::OreUI::RouteAction>
const& routeAction
134 MCAPI
void _onChange(
135 ::std::optional<::OreUI::RouterLocation>
const& oldLocation,
136 ::std::optional<::OreUI::RouterLocation>
const& currentLocation
139 MCAPI
bool _pushRoute(::std::string
const& route, ::OreUI::Router::RouterPushMode mode);
141 MCAPI
void _replaceCurrentRouteInHistory(::std::string
const& newRoute, ::OreUI::RouteHistoryAction action);
143 MCAPI
bool _shouldGoBackAndReplaceInsteadOfPush(::std::string
const& newRoute)
const;
145 MCAPI
bool _shouldPopCurrentScreenOnReplacingWithIncompatibleRoute()
const;
147 MCFOLD ::Bedrock::PubSub::Subscription addObserver(
148 ::std::function<
void(
149 ::std::optional<::OreUI::RouterLocation>
const&,
150 ::std::optional<::OreUI::RouterLocation>
const&,
151 ::OreUI::RouterAction
155 MCAPI ::std::optional<::OreUI::RouterLocation> getCurrentLocation()
const;
159 MCAPI
bool isCurrentRoute(::std::string_view route)
const;
161 MCAPI
bool replaceRoute(::std::string
const& route);
163 MCAPI
void replaceRouteMatcher(::std::unique_ptr<::OreUI::IRouteMatcher> newRouteMatcher);
171 MCAPI static ::std::add_lvalue_reference_t<char const[]> BEDROCK_PREFIX();
178 ::std::unique_ptr<::OreUI::IRouteMatcher const> routeMatcher,
179 ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler> prerequisiteHandler,
180 ::std::unique_ptr<::OreUI::RouterEventing> routerEventing,
181 ::Bedrock::NotNullNonOwnerPtr<::ISceneStack>
const& sceneStack
Definition AbstractScene.h:5
Definition Subscription.h:10
Definition ISceneStack.h:5
Definition IRouteMatcher.h:7
Definition IRoutePrerequisiteHandler.h:7
Definition RouterEventing.h:7
Definition MultiThreaded.h:12
Definition RouteAction.h:7