2018-02-15 04:22:41 +01:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
|
2020-11-18 13:53:10 +01:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2019-04-22 23:53:58 +02:00
|
|
|
namespace Service {
|
|
|
|
|
|
|
|
namespace FileSystem {
|
|
|
|
class FileSystemController;
|
|
|
|
} // namespace FileSystem
|
|
|
|
|
|
|
|
namespace NS {
|
2018-02-15 04:22:41 +01:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit IAccountProxyInterface(Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~IAccountProxyInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class IApplicationManagerInterface final : public ServiceFramework<IApplicationManagerInterface> {
|
|
|
|
public:
|
2020-11-18 13:53:10 +01:00
|
|
|
explicit IApplicationManagerInterface(Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~IApplicationManagerInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
|
|
|
|
ResultVal<u8> GetApplicationDesiredLanguage(u32 supported_languages);
|
|
|
|
ResultVal<u64> ConvertApplicationLanguageToLanguageCode(u8 application_language);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void GetApplicationControlData(Kernel::HLERequestContext& ctx);
|
|
|
|
void GetApplicationDesiredLanguage(Kernel::HLERequestContext& ctx);
|
|
|
|
void ConvertApplicationLanguageToLanguageCode(Kernel::HLERequestContext& ctx);
|
|
|
|
};
|
|
|
|
|
|
|
|
class IApplicationVersionInterface final : public ServiceFramework<IApplicationVersionInterface> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit IApplicationVersionInterface(Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~IApplicationVersionInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
|
2020-06-29 04:01:34 +02:00
|
|
|
class IContentManagementInterface final : public ServiceFramework<IContentManagementInterface> {
|
2019-05-23 09:55:56 +02:00
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit IContentManagementInterface(Core::System& system_);
|
2020-06-29 04:01:34 +02:00
|
|
|
~IContentManagementInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class IDocumentInterface final : public ServiceFramework<IDocumentInterface> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit IDocumentInterface(Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~IDocumentInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class IDownloadTaskInterface final : public ServiceFramework<IDownloadTaskInterface> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit IDownloadTaskInterface(Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~IDownloadTaskInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class IECommerceInterface final : public ServiceFramework<IECommerceInterface> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit IECommerceInterface(Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~IECommerceInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class IFactoryResetInterface final : public ServiceFramework<IFactoryResetInterface> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit IFactoryResetInterface(Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~IFactoryResetInterface() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class NS final : public ServiceFramework<NS> {
|
|
|
|
public:
|
2020-11-18 13:53:10 +01:00
|
|
|
explicit NS(const char* name, Core::System& system_);
|
2019-06-05 22:20:24 +02:00
|
|
|
~NS() override;
|
2019-05-23 09:55:56 +02:00
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
std::shared_ptr<IApplicationManagerInterface> GetApplicationManagerInterface() const;
|
2019-05-23 09:55:56 +02:00
|
|
|
|
|
|
|
private:
|
2020-11-18 13:53:10 +01:00
|
|
|
template <typename T, typename... Args>
|
2019-05-23 09:55:56 +02:00
|
|
|
void PushInterface(Kernel::HLERequestContext& ctx) {
|
|
|
|
LOG_DEBUG(Service_NS, "called");
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
2020-11-26 21:19:08 +01:00
|
|
|
rb.PushIpcInterface<T>(system);
|
2019-05-23 09:55:56 +02:00
|
|
|
}
|
|
|
|
|
2020-11-18 13:53:10 +01:00
|
|
|
void PushIApplicationManagerInterface(Kernel::HLERequestContext& ctx) {
|
|
|
|
LOG_DEBUG(Service_NS, "called");
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.PushIpcInterface<IApplicationManagerInterface>(system);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename T, typename... Args>
|
|
|
|
std::shared_ptr<T> GetInterface(Args&&... args) const {
|
2019-05-23 09:55:56 +02:00
|
|
|
static_assert(std::is_base_of_v<Kernel::SessionRequestHandler, T>,
|
|
|
|
"Not a base of ServiceFrameworkBase");
|
|
|
|
|
2020-11-18 13:53:10 +01:00
|
|
|
return std::make_shared<T>(std::forward<Args>(args)...);
|
2019-05-23 09:55:56 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-02-15 04:22:41 +01:00
|
|
|
/// Registers all NS services with the specified service manager.
|
2019-09-22 08:40:58 +02:00
|
|
|
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
|
2019-04-22 23:53:58 +02:00
|
|
|
|
|
|
|
} // namespace NS
|
|
|
|
} // namespace Service
|