Path: blob/master/src/updater/updater_progress_callback.h
6236 views
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <[email protected]>1// SPDX-License-Identifier: CC-BY-NC-ND-4.023#pragma once4#include "common/progress_callback.h"56class UpdaterProgressCallback : public ProgressCallback7{8public:9UpdaterProgressCallback() = default;10virtual ~UpdaterProgressCallback() override = default;1112virtual void DisplayError(const std::string_view message) = 0;13virtual void DisplayWarning(const std::string_view message) = 0;14virtual void DisplayInformation(const std::string_view message) = 0;15virtual void DisplayDebugMessage(const std::string_view message) = 0;1617virtual void ModalError(const std::string_view message) = 0;18virtual bool ModalConfirmation(const std::string_view message) = 0;19virtual void ModalInformation(const std::string_view message) = 0;2021#define MAKE_PROGRESS_CALLBACK_FORWARDER(from, to) \22template<typename... T> \23void from(fmt::format_string<T...> fmt, T&&... args) \24{ \25TinyString str; \26fmt::vformat_to(std::back_inserter(str), fmt, fmt::make_format_args(args...)); \27to(str.view()); \28}2930MAKE_PROGRESS_CALLBACK_FORWARDER(FormatError, DisplayError);31MAKE_PROGRESS_CALLBACK_FORWARDER(FormatWarning, DisplayWarning);32MAKE_PROGRESS_CALLBACK_FORWARDER(FormatInformation, DisplayInformation);33MAKE_PROGRESS_CALLBACK_FORWARDER(FormatDebugMessage, DisplayDebugMessage);34MAKE_PROGRESS_CALLBACK_FORWARDER(FormatModalError, ModalError);35MAKE_PROGRESS_CALLBACK_FORWARDER(FormatModalConfirmation, ModalConfirmation);36MAKE_PROGRESS_CALLBACK_FORWARDER(FormatModalInformation, ModalInformation);3738#undef MAKE_PROGRESS_CALLBACK_FORWARDER39};404142