diff options
author | Liam <byteslice@airmail.cc> | 2024-02-22 02:59:33 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-22 05:00:01 +0100 |
commit | a37bd0b9a706f63cf1eb4503549171c232bf4238 (patch) | |
tree | 3a6581dcac41fc4a504effad56e18fe7810bb5f6 /src/core/hle/service/pctl/parental_control_service.h | |
parent | pctl: move types and results (diff) | |
download | yuzu-a37bd0b9a706f63cf1eb4503549171c232bf4238.tar yuzu-a37bd0b9a706f63cf1eb4503549171c232bf4238.tar.gz yuzu-a37bd0b9a706f63cf1eb4503549171c232bf4238.tar.bz2 yuzu-a37bd0b9a706f63cf1eb4503549171c232bf4238.tar.lz yuzu-a37bd0b9a706f63cf1eb4503549171c232bf4238.tar.xz yuzu-a37bd0b9a706f63cf1eb4503549171c232bf4238.tar.zst yuzu-a37bd0b9a706f63cf1eb4503549171c232bf4238.zip |
Diffstat (limited to 'src/core/hle/service/pctl/parental_control_service.h')
-rw-r--r-- | src/core/hle/service/pctl/parental_control_service.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/core/hle/service/pctl/parental_control_service.h b/src/core/hle/service/pctl/parental_control_service.h new file mode 100644 index 000000000..dcc357f65 --- /dev/null +++ b/src/core/hle/service/pctl/parental_control_service.h @@ -0,0 +1,74 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/pctl/pctl_types.h" +#include "core/hle/service/service.h" + +namespace Service::PCTL { + +class IParentalControlService final : public ServiceFramework<IParentalControlService> { +public: + explicit IParentalControlService(Core::System& system_, Capability capability_); + ~IParentalControlService() override; + +private: + bool CheckFreeCommunicationPermissionImpl() const; + bool ConfirmStereoVisionPermissionImpl() const; + void SetStereoVisionRestrictionImpl(bool is_restricted); + + void Initialize(HLERequestContext& ctx); + void CheckFreeCommunicationPermission(HLERequestContext& ctx); + void ConfirmSnsPostPermission(HLERequestContext& ctx); + void IsRestrictionTemporaryUnlocked(HLERequestContext& ctx); + void ConfirmStereoVisionPermission(HLERequestContext& ctx); + void EndFreeCommunication(HLERequestContext& ctx); + void IsFreeCommunicationAvailable(HLERequestContext& ctx); + void IsRestrictionEnabled(HLERequestContext& ctx); + void GetSafetyLevel(HLERequestContext& ctx); + void GetCurrentSettings(HLERequestContext& ctx); + void GetFreeCommunicationApplicationListCount(HLERequestContext& ctx); + void ConfirmStereoVisionRestrictionConfigurable(HLERequestContext& ctx); + void IsStereoVisionPermitted(HLERequestContext& ctx); + void IsPairingActive(HLERequestContext& ctx); + void GetSynchronizationEvent(HLERequestContext& ctx); + void GetPlayTimerSettings(HLERequestContext& ctx); + void GetPlayTimerEventToRequestSuspension(HLERequestContext& ctx); + void IsPlayTimerAlarmDisabled(HLERequestContext& ctx); + void GetUnlinkedEvent(HLERequestContext& ctx); + void SetStereoVisionRestriction(HLERequestContext& ctx); + void GetStereoVisionRestriction(HLERequestContext& ctx); + void ResetConfirmedStereoVisionPermission(HLERequestContext& ctx); + + struct States { + u64 current_tid{}; + ApplicationInfo application_info{}; + u64 tid_from_event{}; + bool launch_time_valid{}; + bool is_suspended{}; + bool temporary_unlocked{}; + bool free_communication{}; + bool stereo_vision{}; + }; + + struct ParentalControlSettings { + bool is_stero_vision_restricted{}; + bool is_free_communication_default_on{}; + bool disabled{}; + }; + + States states{}; + ParentalControlSettings settings{}; + RestrictionSettings restriction_settings{}; + std::array<char, 8> pin_code{}; + Capability capability{}; + + Kernel::KEvent* synchronization_event; + Kernel::KEvent* unlinked_event; + Kernel::KEvent* request_suspension_event; + KernelHelpers::ServiceContext service_context; +}; + +} // namespace Service::PCTL |