blob: 38e2b4ff0665832728cce883b86c8ae213147aaf [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.ui.policy
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## DeviceListenerRegistry {#DeviceListenerRegistry}
*Defined in [fuchsia.ui.policy/device_listener.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.policy/device_listener.fidl;l=10)*
<p>Service for exposing state and events of devices, such as media buttons.</p>
### RegisterListener {#DeviceListenerRegistry.RegisterListener}
<p>Registers a listener to receive media button related events, such as
changes from volume buttons and mute switches.
On registration, the <code>listener</code> receives the last media button event that
occurred, if one exists, and all media button events going forward.</p>
#### Request {#DeviceListenerRegistry.RegisterListener_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>listener</code></td>
<td>
<code><a class='link' href='#MediaButtonsListener'>MediaButtonsListener</a></code>
</td>
</tr>
</table>
#### Response {#DeviceListenerRegistry.RegisterListener_Response}
&lt;EMPTY&gt;
### RegisterMediaButtonsListener {#DeviceListenerRegistry.RegisterMediaButtonsListener}
<p>Registers a listener to receive media button related events, such as
changes from volume buttons and mute switches.</p>
<p><b>DEPRECATED </b>- Use RegisterListener() </p>
#### Request {#DeviceListenerRegistry.RegisterMediaButtonsListener_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>listener</code></td>
<td>
<code><a class='link' href='#MediaButtonsListener'>MediaButtonsListener</a></code>
</td>
</tr>
</table>
## DisplayBacklight {#DisplayBacklight}
*Defined in [fuchsia.ui.policy/display_backlight.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.policy/display_backlight.fidl;l=21)*
<p>Manipulates global policy for display backlight. Serves as the main &quot;front
end&quot; interface for usage by UX components; other protocols (such as
fuchsia.ui.scenic.Session and fuchsia.hardware.display.Controller) act as
implementation.</p>
<p>Global Scope. All displays, in all display controllers, are affected uniformly.</p>
<p>Effect Timing. This protocol does not guarantee a deadline by which the
minimum value is applied to a display; it is best effort.</p>
<p>Multiple clients. This protocol does not guarantee unique access to
manipulate display backlight functionality.</p>
<p>Reference. Related to fuchsia.hardware.display.Controller.</p>
### SetMinimumRgb {#DisplayBacklight.SetMinimumRgb}
<p>Submits a new minimum color channel value for display backlight.</p>
<p>The valid range for a minimum value is [0, 255] (inclusive). For a new
minimum value M, each color channel's range will be limited to [M, 255].</p>
<p>Flow control: The caller is allowed at most one in-flight
|SetMinimumRgb| at at time. Subsequent calls must wait until the
acknowledgment returns. Non-compliance results in channel closure.</p>
#### Request {#DisplayBacklight.SetMinimumRgb_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>minimum_rgb</code></td>
<td>
<code>uint8</code>
</td>
</tr>
</table>
#### Response {#DisplayBacklight.SetMinimumRgb_Response}
&lt;EMPTY&gt;
## MediaButtonsListener {#MediaButtonsListener}
*Defined in [fuchsia.ui.policy/device_listener.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.policy/device_listener.fidl;l=32)*
<p>A listener for media buttons events. <code>DeviceListenerRegistry.RegisterMediaButtonsListener</code>
will consume this listener interface and call <code>OnMediaButtonsEvent</code> when the
registered media buttons event occurs.</p>
### OnEvent {#MediaButtonsListener.OnEvent}
#### Request {#MediaButtonsListener.OnEvent_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>event</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.input/'>fuchsia.ui.input</a>/<a class='link' href='../fuchsia.ui.input/#MediaButtonsEvent'>MediaButtonsEvent</a></code>
</td>
</tr>
</table>
#### Response {#MediaButtonsListener.OnEvent_Response}
&lt;EMPTY&gt;
### OnMediaButtonsEvent {#MediaButtonsListener.OnMediaButtonsEvent}
<p><b>DEPRECATED </b>- Use OnEvent() </p>
#### Request {#MediaButtonsListener.OnMediaButtonsEvent_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>event</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.input/'>fuchsia.ui.input</a>/<a class='link' href='../fuchsia.ui.input/#MediaButtonsEvent'>MediaButtonsEvent</a></code>
</td>
</tr>
</table>
## PointerCaptureListenerHACK {#PointerCaptureListenerHACK}
*Defined in [fuchsia.ui.policy/presentation.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.policy/presentation.fidl;l=9)*
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Deprecated: 10</span></div>
### OnPointerEvent {#PointerCaptureListenerHACK.OnPointerEvent}
#### Request {#PointerCaptureListenerHACK.OnPointerEvent_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>event</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.input/'>fuchsia.ui.input</a>/<a class='link' href='../fuchsia.ui.input/#PointerEvent'>PointerEvent</a></code>
</td>
</tr>
</table>
## Presentation {#Presentation}
*Defined in [fuchsia.ui.policy/presentation.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.policy/presentation.fidl;l=17)*
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Deprecated: 10</span></div>
### CapturePointerEventsHACK {#Presentation.CapturePointerEventsHACK}
#### Request {#Presentation.CapturePointerEventsHACK_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>listener</code></td>
<td>
<code><a class='link' href='#PointerCaptureListenerHACK'>PointerCaptureListenerHACK</a></code>
</td>
</tr>
</table>
## Presenter {#Presenter}
*Defined in [fuchsia.ui.policy/presenter.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.policy/presenter.fidl;l=13)*
<p>The Presenter service provides a way for applications to ask that a view be
added to a view tree, leaving any window management concerns up to the
discretion of the presenter implementation.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Deprecated: 10</span></div>
### PresentOrReplaceView {#Presenter.PresentOrReplaceView}
<p>Request that the View's contents be displayed on the screen as a <code>Presentation</code>.
Destroys any existing presentations and replaces them with the new one.
This is true whether the existing view was created by a call to
PresentView, PresentOrReplaceView or PresentOrReplaceView2.</p>
#### Request {#Presenter.PresentOrReplaceView_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>view_holder_token</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#ViewHolderToken'>ViewHolderToken</a></code>
</td>
</tr>
<tr>
<td><code>presentation_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Presentation'>Presentation</a>&gt;?</code>
</td>
</tr>
</table>
### PresentOrReplaceView2 {#Presenter.PresentOrReplaceView2}
#### Request {#Presenter.PresentOrReplaceView2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>view_holder_token</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#ViewHolderToken'>ViewHolderToken</a></code>
</td>
</tr>
<tr>
<td><code>view_ref</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#ViewRef'>ViewRef</a></code>
</td>
</tr>
<tr>
<td><code>presentation_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Presentation'>Presentation</a>&gt;?</code>
</td>
</tr>
</table>
### PresentView {#Presenter.PresentView}
<p>Request that the View's contents be displayed on the screen as a <code>Presentation</code>.
Each call to <code>PresentView</code> creates a new <code>Presentation</code>. Having more than one simultaneous
<code>Presentation</code> (i.e. calling <code>PresentView</code> more than once) is not allowed and will result</p>
#### Request {#Presenter.PresentView_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>view_holder_token</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#ViewHolderToken'>ViewHolderToken</a></code>
</td>
</tr>
<tr>
<td><code>presentation_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Presentation'>Presentation</a>&gt;?</code>
</td>
</tr>
</table>
## **ENUMS**
### DisplayUsage [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DisplayUsage data-text="DisplayUsage"}
Type: <code>uint32</code>
*Defined in [fuchsia.ui.policy/display_usage.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.policy/display_usage.fidl;l=7)*
<p>Describes the intended usage of the display.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="DisplayUsage.kUnknown">
<td><h3 id="DisplayUsage.kUnknown" class="add-link hide-from-toc">kUnknown</h3></td>
<td><code>0</code></td>
<td></td>
</tr>
<tr id="DisplayUsage.kHandheld">
<td><h3 id="DisplayUsage.kHandheld" class="add-link hide-from-toc">kHandheld</h3></td>
<td><code>1</code></td>
<td><p>Display is held in one or both hands.</p>
</td>
</tr>
<tr id="DisplayUsage.kClose">
<td><h3 id="DisplayUsage.kClose" class="add-link hide-from-toc">kClose</h3></td>
<td><code>2</code></td>
<td><p>Display is used well within arm's reach.</p>
</td>
</tr>
<tr id="DisplayUsage.kNear">
<td><h3 id="DisplayUsage.kNear" class="add-link hide-from-toc">kNear</h3></td>
<td><code>3</code></td>
<td><p>Display is used at arm's reach.</p>
</td>
</tr>
<tr id="DisplayUsage.kMidrange">
<td><h3 id="DisplayUsage.kMidrange" class="add-link hide-from-toc">kMidrange</h3></td>
<td><code>4</code></td>
<td><p>Display is used beyond arm's reach.</p>
</td>
</tr>
<tr id="DisplayUsage.kFar">
<td><h3 id="DisplayUsage.kFar" class="add-link hide-from-toc">kFar</h3></td>
<td><code>5</code></td>
<td><p>Display is used well beyond arm's reach.</p>
</td>
</tr>
</table>