| // 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.text; |
| |
| using fuchsia.ui.input; |
| |
| /// A service provided to keyboard apps that allows them to access a TextField |
| /// interface for the currently focused text field. Requests to this TextField |
| /// interface are proxied through the TextManager to batch edits together, |
| /// and to ensure requests aren't sent to unfocused TextFields. |
| [Discoverable] |
| protocol TextInputContext { |
| /// Tells anyone listening to ImeVisibilityService (usually a shell) to hide |
| /// the onscreen keyboard. |
| HideKeyboard(); |
| |
| /// This event fires any time a new text field is focused. It also is sent to |
| /// newly connected keyboards when they connect, if there is a focused text |
| /// field. If focus is lost, the TextField handle will be closed. |
| -> OnFocus(TextField text_field); |
| |
| /// This event fires any time a physical keyboard event is sent to the |
| /// TextManager. The keyboard may translate it into an edit on the focused |
| /// text field if it so desires. It's expected that this interface will change |
| /// as the routing for keyboard events and keymaps evolves. |
| -> OnInputEvent(fuchsia.ui.input.InputEvent event); |
| }; |