acc.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "core/hle/service/glue/manager.h"
  6. #include "core/hle/service/service.h"
  7. namespace Service::Account {
  8. class ProfileManager;
  9. class Module final {
  10. public:
  11. class Interface : public ServiceFramework<Interface> {
  12. public:
  13. explicit Interface(std::shared_ptr<Module> module,
  14. std::shared_ptr<ProfileManager> profile_manager, Core::System& system,
  15. const char* name);
  16. ~Interface() override;
  17. void GetUserCount(Kernel::HLERequestContext& ctx);
  18. void GetUserExistence(Kernel::HLERequestContext& ctx);
  19. void ListAllUsers(Kernel::HLERequestContext& ctx);
  20. void ListOpenUsers(Kernel::HLERequestContext& ctx);
  21. void GetLastOpenedUser(Kernel::HLERequestContext& ctx);
  22. void GetProfile(Kernel::HLERequestContext& ctx);
  23. void InitializeApplicationInfo(Kernel::HLERequestContext& ctx);
  24. void InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx);
  25. void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx);
  26. void IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx);
  27. void TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx);
  28. void IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx);
  29. private:
  30. ResultCode InitializeApplicationInfoBase(u64 process_id);
  31. enum class ApplicationType : u32_le {
  32. GameCard = 0,
  33. Digital = 1,
  34. Unknown = 3,
  35. };
  36. struct ApplicationInfo {
  37. Service::Glue::ApplicationLaunchProperty launch_property;
  38. ApplicationType application_type;
  39. constexpr explicit operator bool() const {
  40. return launch_property.title_id != 0x0;
  41. }
  42. };
  43. ApplicationInfo application_info{};
  44. protected:
  45. std::shared_ptr<Module> module;
  46. std::shared_ptr<ProfileManager> profile_manager;
  47. Core::System& system;
  48. };
  49. };
  50. /// Registers all ACC services with the specified service manager.
  51. void InstallInterfaces(Core::System& system);
  52. } // namespace Service::Account