blob: 328901f9a5a960ea1740476370068b114949d465 [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.ui.policy;
using fuchsia.ui.input;
/// Service for exposing state and events of devices, such as media buttons.
@discoverable
closed protocol DeviceListenerRegistry {
// TODO(https://fxbug.dev/42117461): Remove when no longer used.
/// Registers a listener to receive media button related events, such as
/// changes from volume buttons and mute switches.
@deprecated("Use RegisterListener() ")
strict RegisterMediaButtonsListener(resource struct {
listener client_end:MediaButtonsListener;
});
/// Registers a listener to receive media button related events, such as
/// changes from volume buttons and mute switches.
/// On registration, the `listener` receives the last media button event that
/// occurred, if one exists, and all media button events going forward.
strict RegisterListener(resource struct {
listener client_end:MediaButtonsListener;
}) -> ();
};
/// A listener for media buttons events. `DeviceListenerRegistry.RegisterMediaButtonsListener`
/// will consume this listener interface and call `OnMediaButtonsEvent` when the
/// registered media buttons event occurs.
closed protocol MediaButtonsListener {
// TODO(https://fxbug.dev/42117461): Remove when no longer used.
@deprecated("Use OnEvent() ")
strict OnMediaButtonsEvent(struct {
event fuchsia.ui.input.MediaButtonsEvent;
});
strict OnEvent(struct {
event fuchsia.ui.input.MediaButtonsEvent;
}) -> ();
};