class Controller
Defined at line 894 of file fidling/gen/sdk/fidl/fuchsia.input.virtualkeyboard/fuchsia.input.virtualkeyboard/hlcpp/fuchsia/input/virtualkeyboard/cpp/fidl.h
Provides the ability to control a virtual keyboard.
# Abstract model
The virtual keyboard is "owned" by at most one Controller at a time.
The owner is the Controller whose associated `View` is focused. If no such
Controller exists, the virtual keyboard is unowned (and hidden).
Only the owning Controller may modify the virtual keyboard's configuration.
When the owning Controller loses focus, the implementer of this protocol
will automatically dismiss the virtual keyboard.
# Roles
This protocol will typically be:
* Implemented by platform components which control keyboard visibility.
* Consumed by application runtimes. For example, Flutter, Chromium.
# Related protocols
* This protocol does not provide access to the output of the virtual
keyboard. For that, see one of the following protocols:
* `fuchsia.ui.input3.Keyboard` (for keystrokes)
* `fuchsia.ui.input.InputMethodEditor` (for text editing)
* This protocol is tended for the consumer/user of a virtual keyboard.
The implementer/owner of the keyboard should use `Manager` below.
# Note for implementers
Calls to this protocol's methods would, ideally, only be allowed when the
associated `View` has focus. However, the implementer and consumer of this
protocol receive focus change notifications independently, with no guarantee
that the `Controller` implementer will learn of the focus change
before the `Controller` consumer.
Hence, disallowing calls when the `View` is not focused would run the risk
of spuriously rejecting valid calls, due to the race condition above.
Instead, implementations _should_ buffer requests as described in the
per-method comments.
Public Methods
void ~Controller ()
void SetTextType (::fuchsia::input::virtualkeyboard::TextType text_type)
Requests a change in text type for the virtual keyboard.
* If the callee determines that the `View` for this Controller is
focused, the callee applies the change immediately.
* If the callee determines that the `View` for this Controller is
_not_ focused, the callee applies the change when the `View` regains
focus.
* If the callee receives multiple calls before the `View` regains
focus, the callee will apply the value from the most recent call.
void RequestShow ()
Requests that the keyboard be made visible.
* If the callee determines that the `View` for this Controller is
focused, the callee applies the change immediately.
* If the callee determines that the `View` for this Controller is
_not_ focused, the callee applies the change when the `View`
regains focus. However, a call to `RequestHide()` will nullify
such a pending request.
* Calls to this method are idempotent.
void RequestHide ()
Requests that the keyboard be hidden.
* If the callee determines that the `View` for this Controller is
focused, the callee applies the change immediately.
* If the callee determines that the `View` for this Controller is
_not_ focused:
* If there is a pending `RequestShow()`, the callee cancels
that request.
* Otherwise, the call has no effect.
* Calls to this method are idempotent.
void WatchVisibility (WatchVisibilityCallback callback)
Waits for the visibility to change, then reports the new value.
* Returns `true` after the callee receives a RequestShow()
call from this Controller, when this Controller was not
already requesting the keyboard be shown.
* This _may_ occur before the keyboard is visible on screen.
* This _may_ occur before the `View` for this Controller is
focused.
* Returns `false` when the callee decides to hide the keyboard
that was requested by this Controller.
* This may happen due to a call to `RequestHide()`, or
implicitly when the `View` loses focus.
* The function _may_ return while the keyboard is still
visible on screen.
* The first call immediately returns...
* `true` if the callee has decided that the keyboard should
be visible due to a request from this Controller (this
does not guarantee that the keyboard is visible on screen)
* `false` otherwise