/* * Copyright (C) 2005-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include "settings/lib/ISettingCallback.h" #include "settings/lib/ISettingsHandler.h" #include #include #include class CSetting; struct StringSettingOption; class CPosixTimezone : public ISettingCallback, public ISettingsHandler { public: CPosixTimezone(); void OnSettingChanged(const std::shared_ptr& setting) override; void OnSettingsLoaded() override; std::string GetOSConfiguredTimezone(); std::vector GetCounties(); std::vector GetTimezonesByCountry(const std::string& country); std::string GetCountryByTimezone(const std::string& timezone); void SetTimezone(const std::string& timezone); int m_IsDST = 0; static void SettingOptionsTimezoneCountriesFiller(const std::shared_ptr& setting, std::vector& list, std::string& current, void* data); static void SettingOptionsTimezonesFiller(const std::shared_ptr& setting, std::vector& list, std::string& current, void* data); private: std::vector m_counties; std::map m_countryByCode; std::map m_countryByName; std::map > m_timezonesByCountryCode; std::map m_countriesByTimezoneName; }; extern CPosixTimezone g_timezone;