3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/oreui/ScreenPerformanceTelemetry.h"
7#include "mc/client/gui/oreui/interface/IView.h"
8#include "mc/client/gui/oreui/interface/RouteMode.h"
9#include "mc/client/gui/oreui/interface/ViewState.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11#include "mc/external/gameface/cohtml/ControlType.h"
12#include "mc/external/gameface/cohtml/Cursors.h"
13#include "mc/external/gameface/cohtml/IViewListener.h"
14#include "mc/platform/brstd/flat_map.h"
27namespace OreUI {
class IScene; }
33namespace OreUI::Detail {
class Binder; }
37namespace cohtml {
class View; }
43class View :
public ::OreUI::IView,
public ::cohtml::IViewListener {
47 ::ll::TypedStorage<8, 8, ::cohtml::View*> mGamefaceView;
48 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::ViewRenderer>> mRenderer;
49 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::ViewInputHandler>> mInputHandler;
50 ::ll::TypedStorage<8, 32, ::std::string> mUrl;
51 ::ll::TypedStorage<8, 24, ::std::vector<::std::reference_wrapper<::OreUI::IScene>>> mScenes;
52 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::BedrockInputSource>> mBedrockInputSource;
53 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IClientInstance>> mClientInstance;
54 ::ll::TypedStorage<8, 8, ::KeyboardManager&> mKeyboardManager;
55 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::FacetBinder>> mFacetBinder;
56 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IFacetRegistry>> mFacetRegistry;
57 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::Detail::Binder>> mBinder;
58 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::Detail::ViewContext>> mViewContext;
59 ::ll::TypedStorage<8, 8, ::OreUI::ITelemetry&> mTelemetry;
60 ::ll::TypedStorage<8, 400, ::std::optional<::OreUI::ScreenPerformanceTelemetry>> mScreenPerformanceTelemetry;
61 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mUpdatedFacets;
62 ::ll::TypedStorage<1, 1, ::OreUI::ViewState> mState;
63 ::ll::TypedStorage<4, 4, ::OreUI::RouteMode> mRouteMode;
64 ::ll::TypedStorage<8, 8, double> mLastUpdateTime;
65 ::ll::TypedStorage<8, 8, double> mTimeStamp;
66 ::ll::TypedStorage<8, 8, ::Option*> mScreenAnimationsOption;
68 TypedStorage<8, 48, ::brstd::flat_map<int, uint64, ::std::less<int>, ::std::vector<int>, ::std::vector<uint64>>>
74 View& operator=(View
const&);
81 virtual ~View() =
default;
83 virtual void pushCurrentScene(::OreUI::IScene& scene, ::OreUI::RouteMode routeMode) ;
85 virtual bool hasScenes() const ;
87 virtual
void removeScene(::OreUI::IScene const& scene) ;
89 virtual
void update(
double time) ;
91 virtual
void render(::ScreenContext& screenContext) ;
93 virtual
void resize(uint width, uint height) ;
95 virtual
void reload() ;
97 virtual
void leave() ;
99 virtual
void onSuspend() ;
101 virtual
void onResume() ;
103 virtual
void onRouteChanged(
104 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
105 ::std::optional<::OreUI::RouterLocation> const& currentLocation
108 virtual ::std::string_view getUrl() const ;
110 virtual ::OreUI::RouteMode getRouteMode() const ;
112 virtual uint getWidth() const ;
114 virtual uint getHeight() const ;
116 virtual ::OreUI::ViewState getState() const ;
118 virtual
void setTextBoxState(::TextBoxStateChange const& stateChange) ;
120 virtual
void onKeyboardDismissed() ;
122 virtual
void setCaretLocation(
int caretLocation) ;
124 virtual
void triggerEvent(::std::
string const& eventName, ::std::
string const& eventData) ;
126 virtual ::std::unique_ptr<::IGamefaceTextInputProxy> getTextInputProxy() ;
128 virtual
void OnLoadFailed(
char const* url,
char const* error) ;
130 virtual
void OnReadyForBindings() ;
132 virtual
void OnBindingsReleased() ;
134 virtual ::cohtml::ScreenInfo OnScreenInfoRequested() ;
136 virtual
void OnTextInputTypeChanged(::cohtml::TextInputControlType::ControlType type) ;
138 virtual
void OnCaretRectChanged(
int x,
int y, uint width, uint height) ;
141 OnCursorChanged(::cohtml::CursorTypes::Cursors cursor,
char const*,
float const*,
float const*) ;
143 virtual ::cohtml::IClientSideSocket* OnCreateWebSocket(
144 ::cohtml::ISocketListener* listener,
146 char const** protocols,
150 virtual
void OnAudioStreamCreated(
int id,
int bitDepth,
int channels,
float samplingRate) ;
152 virtual
void OnAudioStreamClosed(
int id) ;
154 virtual
void OnAudioStreamPlay(
int id) ;
156 virtual
void OnAudioStreamPause(
int id) ;
158 virtual
void OnAudioDataReceived(
int id,
int samples,
float** pcm,
int channels) ;
160 virtual
void OnAudioStreamEnded(
int id) ;
162 virtual
void OnAudioStreamVolumeChanged(
int id,
float volume) ;
164 virtual
void OnClipboardTextSet(
char const* text, uint lengthBytes) ;
166 virtual
void OnClipboardTextGet(::cohtml::IViewListener::
IClipboardData* setDataObject) ;
168 virtual ::OreUI::IViewTestHelper* getViewTestHelper() ;
174 MCAPI
void $pushCurrentScene(::OreUI::IScene& scene, ::OreUI::RouteMode routeMode);
176 MCAPI
bool $hasScenes() const;
178 MCAPI
void $removeScene(::OreUI::IScene const& scene);
180 MCAPI
void $update(
double time);
182 MCAPI
void $render(::ScreenContext& screenContext);
184 MCAPI
void $resize(uint width, uint height);
186 MCAPI
void $reload();
190 MCAPI
void $onSuspend();
192 MCAPI
void $onResume();
194 MCAPI
void $onRouteChanged(
195 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
196 ::std::optional<::OreUI::RouterLocation> const& currentLocation
199 MCAPI ::std::string_view $getUrl() const;
201 MCAPI ::OreUI::RouteMode $getRouteMode() const;
203 MCAPI uint $getWidth() const;
205 MCAPI uint $getHeight() const;
207 MCAPI ::OreUI::ViewState $getState() const;
209 MCAPI
void $setTextBoxState(::TextBoxStateChange const& stateChange);
211 MCAPI
void $onKeyboardDismissed();
213 MCAPI
void $setCaretLocation(
int caretLocation);
215 MCAPI
void $triggerEvent(::std::
string const& eventName, ::std::
string const& eventData);
217 MCAPI ::std::unique_ptr<::IGamefaceTextInputProxy> $getTextInputProxy();
219 MCAPI
void $OnLoadFailed(
char const* url,
char const* error);
221 MCAPI
void $OnReadyForBindings();
223 MCAPI
void $OnBindingsReleased();
225 MCAPI ::cohtml::ScreenInfo $OnScreenInfoRequested();
227 MCAPI
void $OnTextInputTypeChanged(::cohtml::TextInputControlType::ControlType type);
229 MCAPI
void $OnCaretRectChanged(
int x,
int y, uint width, uint height);
231 MCAPI
void $OnCursorChanged(::cohtml::CursorTypes::Cursors cursor,
char const*,
float const*,
float const*);
233 MCFOLD ::cohtml::IClientSideSocket* $OnCreateWebSocket(
234 ::cohtml::ISocketListener* listener,
236 char const** protocols,
240 MCAPI
void $OnAudioStreamCreated(
int id,
int bitDepth,
int channels,
float samplingRate);
242 MCAPI
void $OnAudioStreamClosed(
int id);
244 MCAPI
void $OnAudioStreamPlay(
int id);
246 MCAPI
void $OnAudioStreamPause(
int id);
248 MCAPI
void $OnAudioDataReceived(
int id,
int samples,
float** pcm,
int channels);
250 MCAPI
void $OnAudioStreamEnded(
int id);
252 MCAPI
void $OnAudioStreamVolumeChanged(
int id,
float volume);
254 MCAPI
void $OnClipboardTextSet(
char const* text, uint lengthBytes);
256 MCAPI
void $OnClipboardTextGet(::cohtml::IViewListener::
IClipboardData* setDataObject);
258 MCFOLD ::OreUI::IViewTestHelper* $getViewTestHelper();
Definition IClientInstance.h:5
Definition IGamefaceTextInputProxy.h:5
Definition KeyboardManager.h:5
Definition ViewContext.h:7
Definition FacetBinder.h:7
Definition IFacetRegistry.h:7
Definition ITelemetry.h:7
Definition IViewTestHelper.h:7
Definition RouterLocation.h:7
Definition ViewRenderer.h:7
Definition ScreenContext.h:5
Definition IClientSideSocket.h:7
Definition ISocketListener.h:7
Definition TextBoxStateChange.h:5
Definition IViewListener.h:15
Definition ScreenInfo.h:7