3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/settings/AsyncProgressInfo.h"
7#include "mc/client/settings/Component.h"
8#include "mc/client/settings/ComponentState.h"
9#include "mc/client/settings/ConfirmationRequest.h"
10#include "mc/client/settings/SettingsActionType.h"
19class ActionComponent :
public ::Settings::Component<::Settings::ActionComponent> {
22 using DataProvider = ::Settings::IActionDataProvider;
24 using ActionLabelOverrideProvider =
25 ::std::function<::std::optional<::std::string>(::Settings::ActionComponent
const&)>;
27 using ActionCallback = ::std::function<void(::std::function<
void(
bool)>)>;
32 ::ll::TypedStorage<8, 32, ::std::string> mActionLabel;
33 ::ll::TypedStorage<4, 8, ::std::optional<::Settings::SettingsActionType>> mActionType;
34 ::ll::TypedStorage<8, 136, ::std::optional<::Settings::ConfirmationRequest>> mConfirmationRequest;
35 ::ll::TypedStorage<8, 176, ::std::optional<::Settings::AsyncProgressInfo>> mAsyncProgressInfo;
36 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Settings::IActionDataProvider>> mDataProvider;
37 ::ll::TypedStorage<8, 64, ::std::function<void(::std::function<
void(
bool)>)>> mActionCallback;
38 ::ll::TypedStorage<8, 64, ::std::function<::std::optional<::std::string>(::Settings::ActionComponent
const&)>>
39 mActionLabelOverrideProvider;
49 virtual ~ActionComponent() =
default;
51 virtual ::Settings::ComponentState getDefaultState() const ;
57 MCAPI ActionComponent(
58 ::std::string_view
id,
59 ::std::string_view name,
60 ::std::optional<::std::
string> description,
61 ::std::string_view actionLabel,
62 ::std::function<
void(::std::function<
void(
bool)>)> actionCallback,
63 ::std::optional<::Settings::ConfirmationRequest> confirmationRequest,
64 ::std::optional<::Settings::AsyncProgressInfo> asyncProgressInfo,
65 ::std::unique_ptr<::Settings::IActionDataProvider> dataProvider
68 MCAPI ::std::
string getActionLabel() const;
70 MCAPI
bool invokeClickCallback(::std::function<
void(
bool)> statusCallback);
77 ::std::string_view
id,
78 ::std::string_view name,
79 ::std::optional<::std::
string> description,
80 ::std::string_view actionLabel,
81 ::std::function<
void(::std::function<
void(
bool)>)> actionCallback,
82 ::std::optional<::Settings::ConfirmationRequest> confirmationRequest,
83 ::std::optional<::Settings::AsyncProgressInfo> asyncProgressInfo,
84 ::std::unique_ptr<::Settings::IActionDataProvider> dataProvider
91 MCAPI ::Settings::ComponentState $getDefaultState() const;
Definition ActionComponent.h:7
Definition IActionDataProvider.h:7