2026-03-10 05:37:45 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
2025-09-15 17:21:18 +02:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
2026-06-04 05:49:07 +02:00
|
|
|
#pragma once
|
2025-09-15 17:21:18 +02:00
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include "common/common_types.h"
|
2025-10-15 04:54:41 +02:00
|
|
|
#include "frontend_common/data_manager.h"
|
2025-10-18 22:19:06 +02:00
|
|
|
#include "frontend_common/firmware_manager.h"
|
|
|
|
|
#include "qt_common/qt_string_lookup.h"
|
2025-09-15 17:21:18 +02:00
|
|
|
|
|
|
|
|
namespace QtCommon::Content {
|
|
|
|
|
|
|
|
|
|
//
|
2026-03-10 05:37:45 +01:00
|
|
|
bool CheckGameFirmware(u64 program_id);
|
2025-09-15 17:21:18 +02:00
|
|
|
|
|
|
|
|
enum class FirmwareInstallResult {
|
|
|
|
|
Success,
|
|
|
|
|
NoNCAs,
|
|
|
|
|
FailedDelete,
|
|
|
|
|
FailedCopy,
|
|
|
|
|
FailedCorrupted,
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-10 06:51:08 +01:00
|
|
|
inline const QString GetFirmwareInstallResultString(FirmwareInstallResult result) {
|
2025-11-09 18:07:38 +01:00
|
|
|
return LOOKUP_ENUM(result, FwInstallSuccess);
|
2025-10-18 22:19:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get a string representation of a result from InstallKeys.
|
|
|
|
|
* \param result The result code.
|
|
|
|
|
* \return A string representation of the passed result code.
|
|
|
|
|
*/
|
2026-03-10 06:51:08 +01:00
|
|
|
inline const QString GetKeyInstallResultString(FirmwareManager::KeyInstallResult result) {
|
2025-11-09 18:07:38 +01:00
|
|
|
return LOOKUP_ENUM(result, KeyInstallSuccess);
|
2025-09-15 17:21:18 +02:00
|
|
|
}
|
|
|
|
|
|
2026-03-10 06:51:08 +01:00
|
|
|
void InstallFirmware(const QString& location, bool recursive);
|
|
|
|
|
QString UnzipFirmwareToTmp(const QString& location);
|
2025-09-15 17:21:18 +02:00
|
|
|
|
2026-05-20 04:49:16 +02:00
|
|
|
bool CheckKeys();
|
|
|
|
|
void InstallFirmware();
|
|
|
|
|
void InstallFirmwareZip();
|
|
|
|
|
|
2025-09-15 17:21:18 +02:00
|
|
|
// Keys //
|
|
|
|
|
void InstallKeys();
|
|
|
|
|
|
|
|
|
|
// Content //
|
2026-03-10 06:51:08 +01:00
|
|
|
void VerifyGameContents(const std::string& game_path);
|
2025-09-15 17:21:18 +02:00
|
|
|
void VerifyInstalledContents();
|
2025-10-07 01:32:09 +02:00
|
|
|
|
2026-03-10 06:51:08 +01:00
|
|
|
void ClearDataDir(FrontendCommon::DataManager::DataDir dir, const std::string& user_id = "");
|
|
|
|
|
void ExportDataDir(FrontendCommon::DataManager::DataDir dir, const std::string& user_id = "",
|
|
|
|
|
const QString& name = QStringLiteral("export"),
|
|
|
|
|
std::function<void()> callback = {});
|
|
|
|
|
void ImportDataDir(FrontendCommon::DataManager::DataDir dir, const std::string& user_id = "",
|
2025-10-15 04:54:41 +02:00
|
|
|
std::function<void()> callback = {});
|
|
|
|
|
|
2026-05-20 04:49:16 +02:00
|
|
|
// Loader //
|
|
|
|
|
void configureFilesystemProvider(const std::string& filepath);
|
|
|
|
|
|
2025-10-07 01:32:09 +02:00
|
|
|
// Profiles //
|
|
|
|
|
void FixProfiles();
|
2026-03-10 06:51:08 +01:00
|
|
|
} // namespace QtCommon::Content
|