#pragma once
#ifndef ROBOT_MESSAGE_UTILS_H
#define ROBOT_MESSAGE_UTILS_H

#include <QMessageBox>
#include <QInputDialog>
#include <QWidget>
#include <cstdarg>
#include <string>

// 弹窗类型枚举
enum E_MESSAGE_TYPE {
    MESSAGE_INFO = 0,        // 普通信息弹窗
    MESSAGE_WARN = 1,        // 警告弹窗
    MESSAGE_ERROR = 2,       // 错误弹窗
    MESSAGE_CONFIRM = 3,     // 确认弹窗
    MESSAGE_INPUT = 4,       // 输入弹窗
    MESSAGE_TYPE_MAX = 5     // 弹窗类型总数
};

// 全局控制变量(来自Const.h)
inline bool m_bMessageEnable[MESSAGE_TYPE_MAX] = {
    true,  // MESSAGE_INFO
    true,  // MESSAGE_WARN
    true,  // MESSAGE_ERROR
    true,  // MESSAGE_CONFIRM
    true,  // MESSAGE_INPUT
};

// 格式化字符串函数(来自Const.cpp)
std::string formatString(const char* format, ...);

// 格式化信息弹窗
void showInfoMessage(const std::string& title, const char* format, ...);
void showInfoMessage(const char* title, const char* format, ...);

// 格式化警告弹窗
void showWarnMessage(const std::string& title, const char* format, ...);
void showWarnMessage(const char* title, const char* format, ...);

// 格式化错误弹窗
void showErrorMessage(const std::string& title, const char* format, ...);
void showErrorMessage(const char* title, const char* format, ...);

// 格式化确认弹窗
bool showConfirmMessage(const std::string& title, const char* format, ...);
bool showConfirmMessage(const char* title, const char* format, ...);

#endif