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