blob: c7a1b93aabbca9c800490d2c47c451c23ffadc9f [file] [log] [blame]
// Copyright 2018 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.setui;
enum ReturnCode {
OK = 0;
FAILED = 1;
UNSUPPORTED = 2;
};
struct SettingsObject {
SettingType setting_type;
SettingData data;
};
struct UpdateResponse {
ReturnCode return_code;
};
struct MutationResponse {
ReturnCode return_code;
};
// The main interface for UIs to change system settings. Currently, the
// settings are scoped to the device, but will eventually be scoped to the user
// as is applicable.
[Discoverable]
interface SetUiService {
// Begins listening to changes to a given settings object. This may cause the
// SetUiService to connect to any applicable device services until all listeners
// for a given type are closed.
// The service will call the listener with the current state immediately on
// initialization.
Listen(SettingType settingType, SettingListener listener);
// Sets the value of a given settings object. Returns once operation
// has completed.
Update(SettingsObject value) -> (UpdateResponse response);
Mutate(SettingType settingType, Mutation mutation) -> (MutationResponse response);
InteractiveMutate(SettingType settingType, Mutation mutation, MutationHandles mutation_handles) -> (MutationResponse response);
};
interface SettingListener {
Notify(SettingsObject object);
};