LeviLamina
Loading...
Searching...
No Matches
ToastManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/ViewRequest.h"
7#include "mc/client/social/IToastManager.h"
8#include "mc/client/social/ToastChannel.h"
9#include "mc/client/social/ToastMessage.h"
10#include "mc/client/social/ToastMessageType.h"
11#include "mc/client/social/ToastState.h"
12#include "mc/deps/core/minecraft/threading/EnableQueueForMainThread.h"
13#include "mc/deps/core/utility/NonOwnerPointer.h"
14#include "mc/resources/ResourcePackListener.h"
15
16// auto generated forward declare list
17// clang-format off
18class IClientInstance;
20class IToastListener;
21class Option;
23class RectangleArea;
26namespace Json { class Value; }
27// clang-format on
28
29class ToastManager : public ::IToastManager,
32 public ::std::enable_shared_from_this<::ToastManager> {
33public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClient;
37 ::ll::TypedStorage<4, 4, ::ToastState> mState;
38 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager>> mResourcePackManager;
39 ::ll::TypedStorage<8, 376, ::std::optional<::ToastMessage>> mCurrentMessage;
40 ::ll::TypedStorage<8, 24, ::std::vector<::ToastMessage>> mQueuedToastMessages;
41 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::ToastChannel, ::IToastListener*>>> mListeners;
42 ::ll::TypedStorage<8, 24, ::std::vector<::gsl::not_null<::IToastEventListener*>>> mEventListeners;
43 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RecipeToastDataViewer>> mIconsViewer;
44 ::ll::TypedStorage<8, 64, ::std::function<::RectangleArea()>> mAreaBinding;
45 ::ll::TypedStorage<8, 64, ::std::function<bool()>> mActiveBinding;
46 ::ll::TypedStorage<1, 1, bool> mToastClicked;
47 ::ll::TypedStorage<1, 1, bool> mToastsEnabled;
48 ::ll::TypedStorage<1, 1, bool> mRefreshPendingInvites;
49 ::ll::TypedStorage<1, 1, bool> mDestroyToast;
50 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mToastStartTime;
51 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mToastEndTime;
52 ::ll::TypedStorage<4, 4, float> mDeltaTime;
53 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastUpdateTimePoint;
54 ::ll::TypedStorage<8, 8, ::Option*> mEnableDebugToastsOption;
55 // NOLINTEND
56
57public:
58 // prevent constructor by default
59 ToastManager& operator=(ToastManager const&);
60 ToastManager(ToastManager const&);
61 ToastManager();
62
63public:
64 // virtual functions
65 // NOLINTBEGIN
66 virtual ~ToastManager() /*override*/;
67
68 virtual void pushToast(::ToastMessage&& message) /*override*/;
69
70 virtual bool isEditorModeEnabled() const /*override*/;
71
72 virtual void onActiveResourcePacksChanged(::ResourcePackManager&) /*override*/;
73 // NOLINTEND
74
75public:
76 // member functions
77 // NOLINTBEGIN
78 MCAPI ToastManager(
79 ::IClientInstance& client,
80 ::Option* enableDebugToastsOption,
81 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
82 );
83
84 MCAPI void _destroyToast();
85
86 MCAPI ::std::string _extractGameInviteDescription(::Json::Value const& propertyBag);
87
88 MCAPI ::std::string _extractGameInviteHandle(::Json::Value const& propertyBag);
89
90 MCAPI void _handleInvite(bool parseJSON);
91
92 MCAPI void _invitationTelemetry(::Json::Value const& data, ::ToastMessageType type);
93
94 MCAPI bool _isToastAllowed(::ToastMessageType messageType) const;
95
96 MCAPI void _playDefaultToastSound() const;
97
98 MCAPI void _playMobileInviteTTS() const;
99
100 MCAPI void _playRecipeUnlockingToastInSound() const;
101
102 MCAPI void _playRecipeUnlockingToastOutSound() const;
103
104 MCAPI void _reportClick();
105
106 MCAPI void _sendRemoveToast();
107
108 MCAPI void _sendShowToast(bool animateIn);
109
110 MCAPI void _sendTTS(bool useIndication, ::std::string const& message) const;
111
112 MCAPI void _setInitialToastValues();
113
114 MCAPI void _showNewToast();
115
116 MCAPI float getCurrentToastDisplaySeconds() const;
117
118 MCAPI ::ui::ViewRequest handleToastButton();
119
120 MCAPI void pushNotificationReceived(::PushNotificationMessage const& msg);
121
122 MCAPI void setCurrentToastsDuration(float timeInSec);
123
124 MCAPI void update();
125 // NOLINTEND
126
127public:
128 // constructor thunks
129 // NOLINTBEGIN
130 MCAPI void* $ctor(
131 ::IClientInstance& client,
132 ::Option* enableDebugToastsOption,
133 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
134 );
135 // NOLINTEND
136
137public:
138 // destructor thunk
139 // NOLINTBEGIN
140 MCAPI void $dtor();
141 // NOLINTEND
142
143public:
144 // virtual function thunks
145 // NOLINTBEGIN
146 MCAPI void $pushToast(::ToastMessage&& message);
147
148 MCAPI bool $isEditorModeEnabled() const;
149
150 MCAPI void $onActiveResourcePacksChanged(::ResourcePackManager&);
151 // NOLINTEND
152
153public:
154 // vftables
155 // NOLINTBEGIN
156 MCNAPI static void** $vftableForIToastManager();
157
158 MCNAPI static void** $vftableForResourcePackListener();
159
161 // NOLINTEND
162};
Definition EnableQueueForMainThread.h:17
Definition IClientInstance.h:5
Definition IToastEventListener.h:5
Definition IToastListener.h:5
Definition IToastManager.h:5
Definition Value.h:16
Definition Option.h:22
Definition PushNotificationMessage.h:5
Definition RectangleArea.h:5
Definition ResourcePackListener.h:10
Definition ResourcePackManager.h:29
Definition ToastManager.h:5
static MCAPI void ** $vftableForIToastManager()
static MCAPI void ** $vftableForEnableQueueForMainThread()
static MCAPI void ** $vftableForResourcePackListener()
Definition RecipeToastDataViewer.h:5