| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.deprecatedtimezone; |
| |
| // NOTE: this FIDL protocol is deprecated and slated for removal. Please do |
| // not add new uses that depend on it. Use instead the following functionality: |
| // |
| // - For `GetTimezoneOffsetMinutes` and `GetTimezoneId`, get the timezone name |
| // from `fuchsia.intl.PropertyProvider`, and use the ICU library to compute |
| // the offset. |
| // - For `SetTimezone` and `Watch`, please use `fuchsia.settings.Intl`. |
| // |
| // For more information on the ICU timezone ID format, see: |
| // http://userguide.icu-project.org/datetime |
| @discoverable |
| protocol Timezone { |
| /// Returns local timezone offset (in minutes from UTC. Can be negative) for |
| /// the supplied number of milliseconds since the Unix epoch. Returns a |
| /// non-zero DST offset when appropriate. |
| GetTimezoneOffsetMinutes(struct { |
| milliseconds_since_epoch int64; |
| }) -> (struct { |
| local_offset_minutes int32; |
| dst_offset_minutes int32; |
| }); |
| |
| /// Sets the timezone for the machine based on an ICU ID. |
| SetTimezone(struct { |
| timezone_id string; |
| }) -> (struct { |
| status bool; |
| }); |
| |
| /// Gets the timezone ID string. |
| GetTimezoneId() -> (struct { |
| timezone_id string; |
| }); |
| |
| /// Watches for updates to the timezone ID. |
| Watch(resource struct { |
| watcher client_end:TimezoneWatcher; |
| }); |
| }; |
| |
| protocol TimezoneWatcher { |
| /// When the timezone changes, returns the new timezone ID. |
| OnTimezoneOffsetChange(struct { |
| timezone_id string; |
| }); |
| }; |