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;
25struct ToastIconData;
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<1, 1, bool> mToastClicked;
45 ::ll::TypedStorage<1, 1, bool> mToastsEnabled;
46 ::ll::TypedStorage<1, 1, bool> mRefreshPendingInvites;
47 ::ll::TypedStorage<1, 1, bool> mDestroyToast;
48 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mToastStartTime;
49 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mToastEndTime;
50 ::ll::TypedStorage<4, 4, float> mDeltaTime;
51 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastUpdateTimePoint;
52 ::ll::TypedStorage<8, 8, ::Option*> mEnableDebugToastsOption;
53 // NOLINTEND
54
55public:
56 // prevent constructor by default
57 ToastManager& operator=(ToastManager const&);
58 ToastManager(ToastManager const&);
59 ToastManager();
60
61public:
62 // virtual functions
63 // NOLINTBEGIN
64 virtual ~ToastManager() /*override*/;
65
66 virtual void pushToast(::ToastMessage&& message) /*override*/;
67
68 virtual bool isEditorModeEnabled() const /*override*/;
69
70 virtual void onActiveResourcePacksChanged(::ResourcePackManager&) /*override*/;
71 // NOLINTEND
72
73public:
74 // member functions
75 // NOLINTBEGIN
76 MCAPI ToastManager(
77 ::IClientInstance& client,
78 ::Option* enableDebugToastsOption,
79 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
80 );
81
82 MCAPI void _destroyToast();
83
84 MCAPI ::std::string _extractGameInviteDescription(::Json::Value const& propertyBag);
85
86 MCAPI ::std::string _extractGameInviteHandle(::Json::Value const& propertyBag);
87
88 MCAPI ::std::string const _getKeyNameForCurrentInput() const;
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 _playButtonTTS() const;
97
98 MCAPI void _playDefaultToastSound() const;
99
100 MCAPI void _playRecipeUnlockingToastInSound() const;
101
102 MCAPI void _playRecipeUnlockingToastOutSound() const;
103
104 MCAPI void _reportClick();
105
106 MCAPI void _sendShowToast(bool animateIn);
107
108 MCAPI void _sendTTS(bool useIndication, ::std::string const& message) const;
109
110 MCAPI void _setInitialToastValues();
111
112 MCAPI void _showNewToast();
113
114 MCAPI float getCurrentToastDisplaySeconds() const;
115
116 MCAPI float getCurrentToastRemainingDuration() const;
117
118 MCAPI float getCurrentToastTotalDuration() const;
119
120 MCAPI ::ToastIconData getIconData();
121
122 MCFOLD ::RecipeToastDataViewer const* getIconViewer() const;
123
124 MCAPI ::std::string getRecipeTranslationText();
125
126 MCAPI bool getRefreshPendingInvites() const;
127
128 MCAPI ::ToastMessageType getToastMessageType() const;
129
130 MCAPI ::ui::ViewRequest handleToastButton();
131
132 MCAPI bool hasActiveToast() const;
133
134 MCAPI bool isToastAllowed(::ToastMessageType messageType) const;
135
136 MCAPI void pushNotificationReceived(::PushNotificationMessage const& msg);
137
138 MCAPI void registerEventListener(::gsl::not_null<::IToastEventListener*> eventListener);
139
140 MCAPI void registerListener(::IToastListener* listener, ::ToastChannel channel);
141
142 MCAPI void setRefreshPendingInvites(bool flag);
143
144 MCAPI void setToastsEnabled(bool toastsEnabled);
145
146 MCAPI void toastAnimatedInEvent();
147
148 MCAPI void toastAnimatedOutEvent();
149
150 MCAPI void unregisterEventListener(::gsl::not_null<::IToastEventListener*> eventListener);
151
152 MCAPI void unregisterListener(::IToastListener*);
153
154 MCAPI void update();
155 // NOLINTEND
156
157public:
158 // constructor thunks
159 // NOLINTBEGIN
160 MCAPI void* $ctor(
161 ::IClientInstance& client,
162 ::Option* enableDebugToastsOption,
163 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
164 );
165 // NOLINTEND
166
167public:
168 // destructor thunk
169 // NOLINTBEGIN
170 MCAPI void $dtor();
171 // NOLINTEND
172
173public:
174 // virtual function thunks
175 // NOLINTBEGIN
176 MCAPI void $pushToast(::ToastMessage&& message);
177
178 MCAPI bool $isEditorModeEnabled() const;
179
180 MCAPI void $onActiveResourcePacksChanged(::ResourcePackManager&);
181 // NOLINTEND
182
183public:
184 // vftables
185 // NOLINTBEGIN
186 MCNAPI static void** $vftableForIToastManager();
187
188 MCNAPI static void** $vftableForResourcePackListener();
189
191 // NOLINTEND
192};
Definition EnableQueueForMainThread.h:11
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 RecipeToastDataViewer.h:5
Definition ResourcePackListener.h:10
Definition ResourcePackManager.h:35
Definition ToastManager.h:5
static MCAPI void ** $vftableForIToastManager()
static MCAPI void ** $vftableForEnableQueueForMainThread()
static MCAPI void ** $vftableForResourcePackListener()
Definition ToastIconData.h:5