LeviLamina
Loading...
Searching...
No Matches
RouteMatcher.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/oreui/interface/IRouteMatcher.h"
7#include "mc/client/gui/oreui/interface/RouteMode.h"
8#include "mc/client/gui/oreui/interface/RoutePrerequisite.h"
9#include "mc/client/gui/oreui/interface/RouteType.h"
10#include "mc/client/gui/oreui/routing/RouteHistoryAction.h"
11
12namespace OreUI {
13
14class RouteMatcher : public ::OreUI::IRouteMatcher {
15public:
16 // RouteMatcher inner types declare
17 // clang-format off
18 struct RouteEntry;
19 struct DefaultRouteEntry;
20 struct RedirectEntry;
21 // clang-format on
22
23 // RouteMatcher inner types define
24 struct RouteEntry {
25 public:
26 // member variables
27 // NOLINTBEGIN
28 ::ll::TypedStorage<8, 32, ::std::string const> baseScreenId;
29 ::ll::TypedStorage<8, 32, ::std::string const> pattern;
30 ::ll::TypedStorage<4, 4, ::OreUI::RouteType> type;
31 ::ll::TypedStorage<4, 4, ::OreUI::RouteMode> mode;
32 ::ll::TypedStorage<4, 4, ::OreUI::RoutePrerequisite> prerequisite;
33 ::ll::TypedStorage<8, 64, ::std::function<bool()>> isActiveCallback;
34 ::ll::TypedStorage<8, 64, ::std::function<void(::std::string const&, ::OreUI::RouteHistoryAction)>>
35 matchCallback;
36 // NOLINTEND
37
38 public:
39 // prevent constructor by default
40 RouteEntry();
41
42 public:
43 // member functions
44 // NOLINTBEGIN
45 MCAPI RouteEntry(
46 ::std::string const& baseScreenId,
47 ::std::string const& pattern,
48 ::OreUI::RouteType type,
49 ::OreUI::RouteMode mode,
50 ::OreUI::RoutePrerequisite prerequisite,
51 ::std::function<bool()> isActiveCallback,
52 ::std::function<void(::std::string const&, ::OreUI::RouteHistoryAction)> matchCallback
53 );
54 // NOLINTEND
55
56 public:
57 // constructor thunks
58 // NOLINTBEGIN
59 MCAPI void* $ctor(
60 ::std::string const& baseScreenId,
61 ::std::string const& pattern,
62 ::OreUI::RouteType type,
63 ::OreUI::RouteMode mode,
64 ::OreUI::RoutePrerequisite prerequisite,
65 ::std::function<bool()> isActiveCallback,
66 ::std::function<void(::std::string const&, ::OreUI::RouteHistoryAction)> matchCallback
67 );
68 // NOLINTEND
69 };
70
71 struct DefaultRouteEntry {
72 public:
73 // member variables
74 // NOLINTBEGIN
75 ::ll::TypedStorage<8, 32, ::std::string const> baseScreenId;
76 ::ll::TypedStorage<8, 32, ::std::string const> route;
77 // NOLINTEND
78
79 public:
80 // prevent constructor by default
81 DefaultRouteEntry();
82
83 public:
84 // member functions
85 // NOLINTBEGIN
86 MCAPI DefaultRouteEntry(::std::string const& baseScreenId, ::std::string const& route);
87 // NOLINTEND
88
89 public:
90 // constructor thunks
91 // NOLINTBEGIN
92 MCFOLD void* $ctor(::std::string const& baseScreenId, ::std::string const& route);
93 // NOLINTEND
94 };
95
96 struct RedirectEntry {
97 public:
98 // member variables
99 // NOLINTBEGIN
100 ::ll::TypedStorage<8, 32, ::std::string const> pattern;
101 ::ll::TypedStorage<8, 64, ::std::function<bool()>> isActiveCallback;
102 ::ll::TypedStorage<8, 64, ::std::function<::std::string(::std::string const&)>> composer;
103 // NOLINTEND
104
105 public:
106 // prevent constructor by default
107 RedirectEntry();
108
109 public:
110 // member functions
111 // NOLINTBEGIN
112 MCAPI RedirectEntry(
113 ::std::string const& pattern,
114 ::std::function<bool()> isActiveCallback,
115 ::std::function<::std::string(::std::string const&)> composer
116 );
117 // NOLINTEND
118
119 public:
120 // constructor thunks
121 // NOLINTBEGIN
122 MCAPI void* $ctor(
123 ::std::string const& pattern,
124 ::std::function<bool()> isActiveCallback,
125 ::std::function<::std::string(::std::string const&)> composer
126 );
127 // NOLINTEND
128 };
129
130 using IsActiveCallback = ::std::function<bool()>;
131
132 using OnMatchCallback = ::std::function<void(::std::string const&, ::OreUI::RouteHistoryAction)>;
133
134 using RouteRedirectComposer = ::std::function<::std::string(::std::string const&)>;
135
136public:
137 // member variables
138 // NOLINTBEGIN
139 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::RouteMatcher::RouteEntry>> mRoutes;
140 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::RouteMatcher::DefaultRouteEntry>> mDefaultRoutes;
141 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::RouteMatcher::RedirectEntry>> mRedirects;
142 // NOLINTEND
143
144public:
145 // virtual functions
146 // NOLINTBEGIN
147 virtual void navigateTo(::std::string const& route, ::OreUI::RouteHistoryAction action) const /*override*/;
148
149 virtual ::std::string redirectIfNeeded(::std::string const& route) const /*override*/;
150
151 virtual bool isSupported(::std::string const& route) const /*override*/;
152
153 virtual bool areCompatible(::std::string const& routeA, ::std::string const& routeB) const /*override*/;
154
155 virtual ::std::optional<::std::string> getDefaultRouteForFile(::std::string const& file) const /*override*/;
156
157 virtual ::OreUI::RouteType getRouteType(::std::string const& route) const /*override*/;
158
159 virtual ::OreUI::RouteMode getRouteMode(::std::string const& route) const /*override*/;
160
161 virtual ::OreUI::RoutePrerequisite getRoutePrerequisite(::std::string const& route) const /*override*/;
162 // NOLINTEND
163
164public:
165 // member functions
166 // NOLINTBEGIN
167 MCAPI ::std::optional<::OreUI::RouteMatcher::RedirectEntry> _matchRedirect(::std::string const& route) const;
168
169 MCAPI ::std::optional<::OreUI::RouteMatcher::RouteEntry> _matchRoute(::std::string const& route) const;
170
171 MCAPI void addRedirect(
172 ::std::string const& path,
173 ::std::function<bool()> isActiveCallback,
174 ::std::function<::std::string(::std::string const&)> composer
175 );
176
177 MCAPI void addRoute(
178 ::std::string const& baseScreenId,
179 ::std::string const& pattern,
180 ::OreUI::RouteType type,
181 ::OreUI::RouteMode mode,
182 ::OreUI::RoutePrerequisite prerequisite,
183 ::std::function<bool()> isActiveCallback,
184 ::std::function<void(::std::string const&, ::OreUI::RouteHistoryAction)> matchCallback
185 );
186 // NOLINTEND
187
188public:
189 // virtual function thunks
190 // NOLINTBEGIN
191 MCAPI void $navigateTo(::std::string const& route, ::OreUI::RouteHistoryAction action) const;
192
193 MCAPI ::std::string $redirectIfNeeded(::std::string const& route) const;
194
195 MCAPI bool $isSupported(::std::string const& route) const;
196
197 MCAPI bool $areCompatible(::std::string const& routeA, ::std::string const& routeB) const;
198
199 MCAPI ::std::optional<::std::string> $getDefaultRouteForFile(::std::string const& file) const;
200
201 MCAPI ::OreUI::RouteType $getRouteType(::std::string const& route) const;
202
203 MCAPI ::OreUI::RouteMode $getRouteMode(::std::string const& route) const;
204
205 MCAPI ::OreUI::RoutePrerequisite $getRoutePrerequisite(::std::string const& route) const;
206 // NOLINTEND
207};
208
209} // namespace OreUI
Definition RouteMatcher.h:7
Definition RouteMatcher.h:19
Definition RouteMatcher.h:21
Definition RouteMatcher.h:17