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, 376, ::std::optional<::ToastMessage>> mCurrentMessage;
38 ::ll::TypedStorage<8, 24, ::std::vector<::ToastMessage>> mQueuedToastMessages;
39 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::ToastChannel, ::IToastListener*>>> mListeners;
40 ::ll::TypedStorage<8, 24, ::std::vector<::gsl::not_null<::IToastEventListener*>>> mEventListeners;
41 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RecipeToastDataViewer>> mIconsViewer;
42 ::ll::TypedStorage<1, 1, bool> mToastClicked;
43 ::ll::TypedStorage<1, 1, bool> mToastsEnabled;
44 ::ll::TypedStorage<1, 1, bool> mRefreshPendingInvites;
45 ::ll::TypedStorage<1, 1, bool> mDestroyToast;
46 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mToastStartTime;
47 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mToastEndTime;
48 ::ll::TypedStorage<4, 4, float> mDeltaTime;
49 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastUpdateTimePoint;
50 ::ll::TypedStorage<8, 8, ::Option*> mEnableDebugToastsOption;
51 ::ll::TypedStorage<8, 32, ::std::string> mLongestRecipeText;
52 // NOLINTEND
53
54public:
55 // prevent constructor by default
56 ToastManager& operator=(ToastManager const&);
57 ToastManager(ToastManager const&);
58 ToastManager();
59
60public:
61 // virtual functions
62 // NOLINTBEGIN
63 virtual ~ToastManager() /*override*/ = default;
64
65 virtual void pushToast(::ToastMessage&& message) /*override*/;
66
67 virtual bool isEditorModeEnabled() const /*override*/;
68
69 virtual void onActiveResourcePacksChanged(::ResourcePackManager&) /*override*/;
70 // NOLINTEND
71
72public:
73 // member functions
74 // NOLINTBEGIN
75 MCAPI ToastManager(
76 ::IClientInstance& client,
77 ::Option* enableDebugToastsOption,
78 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
79 );
80
81 MCAPI void _destroyToast();
82
83 MCAPI ::std::string _getNewRecipesText() const;
84
85 MCAPI void _handleInvite(bool parseJSON);
86
87 MCAPI bool _isToastAllowed(::ToastMessageType messageType) const;
88
89 MCAPI void _reportClick();
90
91 MCAPI void _sendShowToast(bool const animateIn);
92
93 MCAPI void _sendTTS(bool useIndication, ::std::string const& message) const;
94
95 MCAPI void _setInitialToastValues();
96
97 MCAPI void _showNewToast();
98
99 MCAPI void _updateLongestRecipeText();
100
101 MCAPI ::std::string getMoreRecipesTitle() const;
102
103 MCAPI ::std::string getRecipeTranslationText();
104
105 MCAPI ::ui::ViewRequest handleToastButton();
106
107 MCAPI void pushNotificationReceived(::PushNotificationMessage const& msg);
108
109 MCAPI void unregisterListener(::IToastListener* listener);
110
111 MCAPI void update();
112 // NOLINTEND
113
114public:
115 // constructor thunks
116 // NOLINTBEGIN
117 MCAPI void* $ctor(
118 ::IClientInstance& client,
119 ::Option* enableDebugToastsOption,
120 ::Bedrock::NotNullNonOwnerPtr<::ResourcePackManager> resourcePackManager
121 );
122 // NOLINTEND
123
124public:
125 // virtual function thunks
126 // NOLINTBEGIN
127 MCAPI void $pushToast(::ToastMessage&& message);
128
129 MCAPI bool $isEditorModeEnabled() const;
130
131 MCAPI void $onActiveResourcePacksChanged(::ResourcePackManager&);
132 // NOLINTEND
133};
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:38
Definition ToastManager.h:5