88 void ShowMessageBox(
const std::string& title,
const std::string& message,
100 void ShowInputDialog(
const std::string& title,
const std::string& prompt,
const std::string& defaultValue =
"",
101 std::function<
void(
const std::string&)> callback =
nullptr);
118 void UpdateProgress(
int dialogId,
float progress,
const std::string& message =
"");
133 void ShowListDialog(
const std::string& title,
const std::vector<std::string>& items,
134 std::function<
void(
int)> callback =
nullptr);
144 std::function<
void(
bool)> callback =
nullptr);
168 Awaiter(
DialogManager* mgr, std::string dialogTitle, std::string dialogMessage)
169 : manager(mgr), title(std::move(dialogTitle)), message(std::move(dialogMessage)) {}
171 [[nodiscard]]
bool await_ready()
const noexcept {
174 void await_suspend(std::coroutine_handle<> handle) {
175 manager->
ShowConfirmation(title, message, [
this, handle](
bool confirmed)
mutable {
180 [[nodiscard]]
bool await_resume()
const noexcept {
184 return Awaiter{
this, std::move(title), std::move(message)};
192 [[nodiscard]]
auto AwaitInput(std::string title, std::string prompt, std::string defaultValue =
"") {
198 std::string defaultValue;
202 Awaiter(
DialogManager* mgr, std::string dialogTitle, std::string dialogPrompt, std::string dialogDefault)
203 : manager(mgr), title(std::move(dialogTitle)), prompt(std::move(dialogPrompt)),
204 defaultValue(std::move(dialogDefault)) {}
206 [[nodiscard]]
bool await_ready()
const noexcept {
209 void await_suspend(std::coroutine_handle<> handle) {
210 manager->
ShowInputDialog(title, prompt, defaultValue, [
this, handle](
const std::string& value)
mutable {
215 [[nodiscard]] std::string await_resume() {
216 return std::move(result);
219 return Awaiter{
this, std::move(title), std::move(prompt), std::move(defaultValue)};
234 std::unique_ptr<Impl> m_impl;
236 void RenderMessageBox();
237 void RenderInputDialog();
238 void RenderProgressDialogs();
239 void RenderListDialog();