blob: 68526d4ca91681ba923ac6bbb60806a2318d37df [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 {
/// 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.
Watch() -> (struct {
settings IntlSettings;
});
/// Sets [IntlSettings] settings. Any field not explicitly set in the table performs a
/// no-op, and will not make any changes.
Set(struct {
settings IntlSettings;
}) -> (struct {}) 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.
type HourCycle = strict enum {
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.
type IntlSettings = table {
/// An ordered list of preferred locales.
1: locales vector<fuchsia.intl.LocaleId>:10;
/// The preferred temperature unit.
2: temperature_unit fuchsia.intl.TemperatureUnit;
/// The currently set time zone.
3: time_zone_id fuchsia.intl.TimeZoneId;
/// The preferred hour cycle.
4: hour_cycle HourCycle;
};