eden/src/qt_common/qt_common.h

48 lines
1.1 KiB
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef QT_COMMON_H
#define QT_COMMON_H
#include <array>
#include <QWindow>
#include <core/frontend/emu_window.h>
namespace QtCommon {
static constexpr std::array<const char *, 3> METADATA_RESULTS = {
"The operation completed successfully.",
"The metadata cache couldn't be deleted. It might be in use or non-existent.",
"The metadata cache is already empty.",
};
enum MetadataResult {
Success,
Failure,
Empty,
};
/**
* @brief ResetMetadata Reset game list metadata.
* @return A result code.
*/
MetadataResult ResetMetadata();
/**
* \brief Get a string representation of a result from ResetMetadata.
* \param result The result code.
* \return A string representation of the passed result code.
*/
inline constexpr const char *GetResetMetadataResultString(MetadataResult result)
{
return METADATA_RESULTS.at(static_cast<std::size_t>(result));
}
Core::Frontend::WindowSystemType GetWindowSystemType();
Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window);
} // namespace QtCommon
#endif