blob: 983dea2c8d0817f9f8340bdb96687575f8d2d7eb [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
protocol DeviceListenerRegistry {
// TODO(fxbug.dev/41384): 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() ")
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.
@transitional
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.
protocol MediaButtonsListener {
// TODO(fxbug.dev/41384): Remove when no longer used.
@deprecated("Use OnEvent() ")
OnMediaButtonsEvent(struct {
event fuchsia.ui.input.MediaButtonsEvent;
});
@transitional
OnEvent(struct {
event fuchsia.ui.input.MediaButtonsEvent;
}) -> ();
};