blob: ce20d2e2fa1fd24dd2de5a2e0c07b1351d716616 [file] [log] [blame]
// 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.settings;
using fuchsia.intl;
/// Settings related to internationalization such as locale, time zone, and
/// temperature units.
///
/// Supported SettingsEpitaph enums:
/// REQUEST_NOT_SUPPORTED, INTERNAL_SERVICE_ERROR, PERSISTENT_STORAGE_ERROR,
/// FILE_READ_ERROR
[Discoverable]
protocol Intl {
/// DEPRECATED: new watches should use Watch2.
[Transitional = "Deprecated in favor of Watch2"]
Watch() -> (IntlSettings settings) error Error;
/// Gets the current [IntlSettings]. Returns immediately on first call;
/// subsequent calls return when the value changes.
///
/// If this call fails, it is considered a fatal error and the channel
/// will be closed.
[Transitional = "Replacement for Watch"]
Watch2() -> (IntlSettings settings);
/// Sets [IntlSettings] settings. Any field not explicitly set in the table performs a
/// no-op, and will not make any changes.
Set(IntlSettings settings) -> () error Error;
};
/// Whether if the time format should be using 12 hour or 24 hour clock. H indicates the
/// maximum number that the hour indicator will ever show.
enum HourCycle {
UNKNOWN = 0;
/// 12-hour clock, 0:10am after midnight.
H11 = 1;
/// 12-hour clock, 12:10am after midnight.
H12 = 2;
/// 24-hour clock, 0:10 after midnight.
H23 = 3;
/// 24-hour clock, 24:10 after midnight.
H24 = 4;
};
/// Collection of internationalization-related settings.
table IntlSettings {
/// An ordered list of preferred locales.
1: vector<fuchsia.intl.LocaleId>:10 locales;
/// The preferred temperature unit.
2: fuchsia.intl.TemperatureUnit temperature_unit;
/// The currently set time zone.
3: fuchsia.intl.TimeZoneId time_zone_id;
/// The preferred hour cycle.
4: HourCycle hour_cycle;
};