2022-04-23 08:59:50 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-02-15 03:22:41 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
|
2020-11-18 12:53:10 +00:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2019-04-22 21:53:58 +00:00
|
|
|
namespace Service {
|
|
|
|
|
|
|
|
namespace FileSystem {
|
|
|
|
class FileSystemController;
|
|
|
|
} // namespace FileSystem
|
|
|
|
|
|
|
|
namespace NS {
|
2018-02-15 03:22:41 +00:00
|
|
|
|
2019-05-23 07:55:56 +00:00
|
|
|
class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IAccountProxyInterface(Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~IAccountProxyInterface() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IApplicationManagerInterface final : public ServiceFramework<IApplicationManagerInterface> {
|
|
|
|
public:
|
2020-11-18 12:53:10 +00:00
|
|
|
explicit IApplicationManagerInterface(Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~IApplicationManagerInterface() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
|
2023-07-15 00:16:39 +00:00
|
|
|
Result GetApplicationDesiredLanguage(u8* out_desired_language, u32 supported_languages);
|
|
|
|
Result ConvertApplicationLanguageToLanguageCode(u64* out_language_code,
|
|
|
|
u8 application_language);
|
2019-05-23 07:55:56 +00:00
|
|
|
|
|
|
|
private:
|
2023-02-19 19:42:12 +00:00
|
|
|
void GetApplicationControlData(HLERequestContext& ctx);
|
|
|
|
void GetApplicationDesiredLanguage(HLERequestContext& ctx);
|
|
|
|
void ConvertApplicationLanguageToLanguageCode(HLERequestContext& ctx);
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IApplicationVersionInterface final : public ServiceFramework<IApplicationVersionInterface> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IApplicationVersionInterface(Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~IApplicationVersionInterface() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
2020-06-29 02:01:34 +00:00
|
|
|
class IContentManagementInterface final : public ServiceFramework<IContentManagementInterface> {
|
2019-05-23 07:55:56 +00:00
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IContentManagementInterface(Core::System& system_);
|
2020-06-29 02:01:34 +00:00
|
|
|
~IContentManagementInterface() override;
|
2023-10-01 18:49:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void GetTotalSpaceSize(HLERequestContext& ctx);
|
|
|
|
void GetFreeSpaceSize(HLERequestContext& ctx);
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IDocumentInterface final : public ServiceFramework<IDocumentInterface> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IDocumentInterface(Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~IDocumentInterface() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IDownloadTaskInterface final : public ServiceFramework<IDownloadTaskInterface> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IDownloadTaskInterface(Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~IDownloadTaskInterface() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IECommerceInterface final : public ServiceFramework<IECommerceInterface> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IECommerceInterface(Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~IECommerceInterface() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IFactoryResetInterface final : public ServiceFramework<IFactoryResetInterface> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IFactoryResetInterface(Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~IFactoryResetInterface() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
};
|
|
|
|
|
2021-11-26 02:39:38 +00:00
|
|
|
class IReadOnlyApplicationControlDataInterface final
|
|
|
|
: public ServiceFramework<IReadOnlyApplicationControlDataInterface> {
|
|
|
|
public:
|
|
|
|
explicit IReadOnlyApplicationControlDataInterface(Core::System& system_);
|
|
|
|
~IReadOnlyApplicationControlDataInterface() override;
|
2022-10-11 22:15:30 +00:00
|
|
|
|
|
|
|
private:
|
2023-02-19 19:42:12 +00:00
|
|
|
void GetApplicationControlData(HLERequestContext& ctx);
|
2021-11-26 02:39:38 +00:00
|
|
|
};
|
|
|
|
|
2019-05-23 07:55:56 +00:00
|
|
|
class NS final : public ServiceFramework<NS> {
|
|
|
|
public:
|
2020-11-18 12:53:10 +00:00
|
|
|
explicit NS(const char* name, Core::System& system_);
|
2019-06-05 20:20:24 +00:00
|
|
|
~NS() override;
|
2019-05-23 07:55:56 +00:00
|
|
|
|
2019-05-23 08:28:27 +00:00
|
|
|
std::shared_ptr<IApplicationManagerInterface> GetApplicationManagerInterface() const;
|
2019-05-23 07:55:56 +00:00
|
|
|
|
|
|
|
private:
|
2020-11-18 12:53:10 +00:00
|
|
|
template <typename T, typename... Args>
|
2023-02-19 19:42:12 +00:00
|
|
|
void PushInterface(HLERequestContext& ctx) {
|
2019-05-23 07:55:56 +00:00
|
|
|
LOG_DEBUG(Service_NS, "called");
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
2021-05-21 05:05:04 +00:00
|
|
|
rb.Push(ResultSuccess);
|
2020-11-26 20:19:08 +00:00
|
|
|
rb.PushIpcInterface<T>(system);
|
2019-05-23 07:55:56 +00:00
|
|
|
}
|
|
|
|
|
2023-02-19 19:42:12 +00:00
|
|
|
void PushIApplicationManagerInterface(HLERequestContext& ctx) {
|
2020-11-18 12:53:10 +00:00
|
|
|
LOG_DEBUG(Service_NS, "called");
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
2021-05-21 05:05:04 +00:00
|
|
|
rb.Push(ResultSuccess);
|
2020-11-18 12:53:10 +00:00
|
|
|
rb.PushIpcInterface<IApplicationManagerInterface>(system);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename T, typename... Args>
|
|
|
|
std::shared_ptr<T> GetInterface(Args&&... args) const {
|
2023-02-19 19:42:12 +00:00
|
|
|
static_assert(std::is_base_of_v<SessionRequestHandler, T>,
|
2019-05-23 07:55:56 +00:00
|
|
|
"Not a base of ServiceFrameworkBase");
|
|
|
|
|
2020-11-18 12:53:10 +00:00
|
|
|
return std::make_shared<T>(std::forward<Args>(args)...);
|
2019-05-23 07:55:56 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-02-18 21:26:48 +00:00
|
|
|
void LoopProcess(Core::System& system);
|
2019-04-22 21:53:58 +00:00
|
|
|
|
|
|
|
} // namespace NS
|
|
|
|
} // namespace Service
|