class ViewRef

Defined at line 585 of file fidling/gen/sdk/fidl/fuchsia.ui.views/fuchsia.ui.views/hlcpp/fuchsia/ui/views/cpp/fidl.h

A ViewRef is a handle to a kernel object which identifies a unique View

across the system. Two ViewRefs to the same View have the same KOID.

Clients use a ViewRef to identify a View, to validate a View, and to

receive a View invalidation signal.

As part of View creation, the client creates a linked

ViewRef/ViewRefControl pair and hands the pair to Scenic (ViewRefControl is

described below). The client must remove the ViewRef's signal

capabilities; otherwise the View is not created.

The client may freely clone its ViewRef and share it, even before sending

it to Scenic.

Example 1. Accessibility accepts a ViewRef from a client to group the

semantic nodes, and semantic operations, associated with a client's View.

It must validate a client's ViewRef with Scenic.

Example 2. We use ViewRefs to create a FocusChain, which identifies Views

considered as "in-focus" down the View hierarchy. When a View is destroyed,

Scenic signals to all FocusChain holders that the ViewRef is now invalid.

Public Members

eventpair reference

Public Methods

::std::unique_ptr<ViewRef> New ()
void Encode (::fidl::Encoder * _encoder, size_t _offset, std::optional< ::fidl::HandleInformation> maybe_handle_info)
void Decode (::fidl::Decoder * _decoder, ViewRef * value, size_t _offset)
zx_status_t Clone (ViewRef * result)