Skip to content
LeviMC
English
AutoLightDark
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;
25// clang-format on
26
27class ToastManager : public ::IToastManager,
30 public ::std::enable_shared_from_this<::ToastManager> {
31public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClient;
35 ::ll::TypedStorage<4, 4, ::ToastState> mState;
36 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager>> mResourcePackManager;
37 ::ll::TypedStorage<8, 384, ::std::optional<::ToastMessage>> mCurrentMessage;
38 ::ll::TypedStorage<8, 24, ::std::vector<::ToastMessage>> mQueuedToastMessages;
39 ::ll::TypedStorage<8, 384, ::std::optional<::ToastMessage>> mPersistentToastMessage;
40 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::ToastChannel, ::IToastListener*>>> mListeners;
41 ::ll::TypedStorage<8, 24, ::std::vector<::gsl::not_null<::IToastEventListener*>>> mEventListeners;
42 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RecipeToastDataViewer>> mIconsViewer;
43 ::ll::TypedStorage<1, 1, bool> mToastClicked;
44 ::ll::TypedStorage<1, 1, bool> mToastsEnabled;
45 ::ll::TypedStorage<1, 1, bool> mRefreshPendingInvites;
46 ::ll::TypedStorage<1, 1, bool> mDestroyToast;
47 ::ll::TypedStorage<1, 1, bool> mMatchmakingJoiningToastExpired;
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 ::ll::TypedStorage<8, 32, ::std::string> mLongestRecipeText;
54 // NOLINTEND
55
56public:
57 // prevent constructor by default
58 ToastManager& operator=(ToastManager const&);
59 ToastManager(ToastManager const&);
60 ToastManager();
61
62public:
63 // virtual functions
64 // NOLINTBEGIN
65 virtual ~ToastManager() /*override*/ = default;
66
67 virtual void pushToast(::ToastMessage&& message) /*override*/;
68
69 virtual void pushPersistentToast(::ToastMessage&& message) /*override*/;
70
71 virtual void removePersistentToast() /*override*/;
72
73 virtual bool isEditorModeEnabled() const /*override*/;
74
75 virtual void onActiveResourcePacksChanged(::ResourcePackManager&) /*override*/;
76 // NOLINTEND
77
78public:
79 // member functions
80 // NOLINTBEGIN
81 MCNAPI ToastManager(
82 ::IClientInstance& client,
83 ::Option* enableDebugToastsOption,
84 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
85 );
86
87 MCNAPI void _destroyToast();
88
89 MCNAPI ::std::string _getNewRecipesText() const;
90
91 MCNAPI void _handleInvite(bool parseJSON);
92
93 MCNAPI bool _isToastAllowed(::ToastMessageType messageType) const;
94
96
97 MCNAPI void _reportClick();
98
99 MCNAPI void _sendShowToast(bool const animateIn);
100
101 MCNAPI void _sendTTS(bool useIndication, ::std::string const& message) const;
102
104
105 MCNAPI void _showNewToast();
106
108
110
111 MCNAPI ::std::string getMoreRecipesTitle() const;
112
113 MCNAPI ::std::string getRecipeTranslationText();
114
115 MCNAPI ::ui::ViewRequest handleToastButton();
116
118
119 MCNAPI void unregisterListener(::IToastListener* listener);
120
121 MCNAPI void update();
122 // NOLINTEND
123
124public:
125 // constructor thunks
126 // NOLINTBEGIN
127 MCNAPI void* $ctor(
128 ::IClientInstance& client,
129 ::Option* enableDebugToastsOption,
130 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
131 );
132 // NOLINTEND
133
134public:
135 // virtual function thunks
136 // NOLINTBEGIN
137 MCNAPI void $pushToast(::ToastMessage&& message);
138
139 MCNAPI void $pushPersistentToast(::ToastMessage&& message);
140
142
143 MCNAPI bool $isEditorModeEnabled() const;
144
146 // NOLINTEND
147};
Definition EnableQueueForMainThread.h:10
Definition IClientInstance.h:5
Definition IToastEventListener.h:5
Definition IToastListener.h:5
Definition IToastManager.h:5
Definition Option.h:22
Definition PushNotificationMessage.h:5
Definition RecipeToastDataViewer.h:5
Definition ResourcePackListener.h:10
Definition ResourcePackManager.h:29
Definition ToastManager.h:5
MCAPI void _handleInvite(bool parseJSON)
MCAPI::std::string getRecipeTranslationText()
MCAPI::std::string getMoreRecipesTitle() const
MCAPI void _sendTTS(bool useIndication, ::std::string const &message) const
MCAPI void update()
MCAPI void unregisterListener(::IToastListener *listener)
MCAPI void _removePendingPersistentToast()
MCAPI void * $ctor(::IClientInstance &client, ::Option *enableDebugToastsOption, ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager > resourcePackManager)
MCAPI void _updatePersistentToast()
MCAPI void $pushPersistentToast(::ToastMessage &&message)
MCAPI void _showNewToast()
MCAPI void $onActiveResourcePacksChanged(::ResourcePackManager &)
MCAPI::ui::ViewRequest handleToastButton()
MCAPI void _sendShowToast(bool const animateIn)
MCAPI::std::string _getNewRecipesText() const
MCAPI void _setInitialToastValues()
MCAPI void _destroyToast()
MCAPI void _updateLongestRecipeText()
MCAPI void $pushToast(::ToastMessage &&message)
MCAPI bool $isEditorModeEnabled() const
MCAPI bool _isToastAllowed(::ToastMessageType messageType) const
MCAPI void _reportClick()
MCAPI void $removePersistentToast()
MCAPI void pushNotificationReceived(::PushNotificationMessage const &msg)
Definition ToastMessage.h:5
STL namespace.