2018-02-15 03:22:41 +00: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"
|
2019-05-23 07:55:56 +00:00
|
|
|
#include "core/hle/service/set/set.h"
|
2018-02-15 03:22:41 +00:00
|
|
|
|
2018-04-20 01:41:44 +00:00
|
|
|
namespace Service::NS {
|
2018-02-15 03:22:41 +00:00
|
|
|
|
2019-05-23 07:55:56 +00:00
|
|
|
class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> {
|
|
|
|
public:
|
|
|
|
explicit IAccountProxyInterface();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IApplicationManagerInterface final : public ServiceFramework<IApplicationManagerInterface> {
|
|
|
|
public:
|
|
|
|
explicit IApplicationManagerInterface();
|
|
|
|
|
|
|
|
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:
|
|
|
|
explicit IApplicationVersionInterface();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IContentManagerInterface final : public ServiceFramework<IContentManagerInterface> {
|
|
|
|
public:
|
|
|
|
explicit IContentManagerInterface();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IDocumentInterface final : public ServiceFramework<IDocumentInterface> {
|
|
|
|
public:
|
|
|
|
explicit IDocumentInterface();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IDownloadTaskInterface final : public ServiceFramework<IDownloadTaskInterface> {
|
|
|
|
public:
|
|
|
|
explicit IDownloadTaskInterface();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IECommerceInterface final : public ServiceFramework<IECommerceInterface> {
|
|
|
|
public:
|
|
|
|
explicit IECommerceInterface();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IFactoryResetInterface final : public ServiceFramework<IFactoryResetInterface> {
|
|
|
|
public:
|
|
|
|
explicit IFactoryResetInterface();
|
|
|
|
};
|
|
|
|
|
|
|
|
class NS final : public ServiceFramework<NS> {
|
|
|
|
public:
|
|
|
|
explicit NS(const char* name);
|
|
|
|
|
|
|
|
std::shared_ptr<IApplicationManagerInterface> GetApplicationManagerInterface();
|
|
|
|
|
|
|
|
private:
|
|
|
|
template <typename T>
|
|
|
|
void PushInterface(Kernel::HLERequestContext& ctx) {
|
|
|
|
LOG_DEBUG(Service_NS, "called");
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.PushIpcInterface<T>();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
std::shared_ptr<T> GetInterface() {
|
|
|
|
static_assert(std::is_base_of_v<Kernel::SessionRequestHandler, T>,
|
|
|
|
"Not a base of ServiceFrameworkBase");
|
|
|
|
|
|
|
|
return std::make_shared<T>();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-02-15 03:22:41 +00:00
|
|
|
/// Registers all NS services with the specified service manager.
|
|
|
|
void InstallInterfaces(SM::ServiceManager& service_manager);
|
|
|
|
|
2018-04-20 01:41:44 +00:00
|
|
|
} // namespace Service::NS
|