// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include "core/hle/service/cmif_types.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/psc/time/common.h" #include "core/hle/service/psc/time/manager.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" namespace Core { class System; } namespace Tz { struct Rule; } namespace Service::PSC::Time { class TimeZoneService final : public ServiceFramework { using InRule = InLargeData; using OutRule = OutLargeData; public: explicit TimeZoneService(Core::System& system, StandardSteadyClockCore& clock_core, TimeZone& time_zone, bool can_write_timezone_device_location); ~TimeZoneService() override = default; Result GetDeviceLocationName(Out out_location_name); Result SetDeviceLocationName(LocationName& location_name); Result GetTotalLocationNameCount(Out out_count); Result LoadLocationNameList(Out out_count, OutArray out_names, u32 index); Result LoadTimeZoneRule(OutRule out_rule, LocationName& location_name); Result GetTimeZoneRuleVersion(Out out_rule_version); Result GetDeviceLocationNameAndUpdatedTime(Out location_name, Out out_time_point); Result SetDeviceLocationNameWithTimeZoneRule(LocationName& location_name, InBuffer binary); Result ParseTimeZoneBinary(OutRule out_rule, InBuffer binary); Result GetDeviceLocationNameOperationEventReadableHandle( OutCopyHandle out_event); Result ToCalendarTime(Out out_calendar_time, Out out_additional_info, s64 time, InRule rule); Result ToCalendarTimeWithMyRule(Out out_calendar_time, Out out_additional_info, s64 time); Result ToPosixTime(Out out_count, OutArray out_times, Out out_times_count, CalendarTime& calendar_time, InRule rule); Result ToPosixTimeWithMyRule(Out out_count, OutArray out_times, Out out_times_count, CalendarTime& calendar_time); private: Core::System& m_system; StandardSteadyClockCore& m_clock_core; TimeZone& m_time_zone; bool m_can_write_timezone_device_location; }; } // namespace Service::PSC::Time