2023-12-14 06:50:07 +00:00
|
|
|
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
|
2022-12-04 11:03:45 +00:00
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
|
2020-07-21 14:03:01 +00:00
|
|
|
#pragma once
|
2023-12-14 06:50:07 +00:00
|
|
|
|
2020-07-21 14:03:01 +00:00
|
|
|
#include "common/progress_callback.h"
|
2023-12-14 06:50:07 +00:00
|
|
|
#include "common/timer.h"
|
2020-07-21 14:03:01 +00:00
|
|
|
|
2020-08-06 09:32:53 +00:00
|
|
|
class HostInterfaceProgressCallback final : public BaseProgressCallback
|
2020-07-21 14:03:01 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-07-31 07:09:18 +00:00
|
|
|
HostInterfaceProgressCallback();
|
2020-07-21 14:03:01 +00:00
|
|
|
|
2023-12-14 06:50:07 +00:00
|
|
|
ALWAYS_INLINE void SetOpenDelay(float delay) { m_open_delay = delay; }
|
|
|
|
|
2020-07-21 14:03:01 +00:00
|
|
|
void PushState() override;
|
|
|
|
void PopState() override;
|
|
|
|
|
|
|
|
void SetCancellable(bool cancellable) override;
|
2020-08-06 09:32:53 +00:00
|
|
|
void SetTitle(const char* title) override;
|
2020-07-21 14:03:01 +00:00
|
|
|
void SetStatusText(const char* text) override;
|
|
|
|
void SetProgressRange(u32 range) override;
|
|
|
|
void SetProgressValue(u32 value) override;
|
|
|
|
|
|
|
|
void DisplayError(const char* message) override;
|
|
|
|
void DisplayWarning(const char* message) override;
|
|
|
|
void DisplayInformation(const char* message) override;
|
|
|
|
void DisplayDebugMessage(const char* message) override;
|
|
|
|
|
|
|
|
void ModalError(const char* message) override;
|
|
|
|
bool ModalConfirmation(const char* message) override;
|
2020-08-06 09:32:53 +00:00
|
|
|
void ModalInformation(const char* message) override;
|
2023-12-14 06:50:07 +00:00
|
|
|
|
2020-07-21 14:03:01 +00:00
|
|
|
private:
|
|
|
|
void Redraw(bool force);
|
|
|
|
|
2023-12-14 06:50:07 +00:00
|
|
|
Common::Timer m_open_time;
|
|
|
|
float m_open_delay = 1.0f;
|
2020-07-21 14:03:01 +00:00
|
|
|
int m_last_progress_percent = -1;
|
|
|
|
};
|