Class XRPermissionRequest

All Implemented Interfaces:
Proxy, PermissionRequest

@Generated("org.javagi.JavaGI") public final class XRPermissionRequest extends GObject implements PermissionRequest

A permission request for accessing virtual reality (VR) and augmented reality (AR) devices, including sensors and head-mounted displays.

WebKitXRPermissionRequest represents a request for permission to decide whether WebKit can initialize an XR session through the WebXR API.

When a WebKitXRPermissionRequest is not handled by the user, it is denied by default.

Since:
2.52
  • Constructor Details

    • XRPermissionRequest

      public XRPermissionRequest(MemorySegment address)
      Create a XRPermissionRequest instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • XRPermissionRequest

      public XRPermissionRequest()
      Create a new XRPermissionRequest.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the XRPermissionRequest class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected XRPermissionRequest asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • getConsentOptionalFeatures

      public Set<XRSessionFeatures> getConsentOptionalFeatures()

      Gets the optional features that need user consent.

      These features can be granted by calling webkit_xr_permission_request_set_granted_optional_features() before allowing the request with webkit_permission_request_allow().

      Returns:
      a WebKitXRSessionFeatures flag combination
      Since:
      2.52
    • getConsentRequiredFeatures

      public Set<XRSessionFeatures> getConsentRequiredFeatures()

      Gets the required features that need user consent.

      These features are automatically granted if the request is allowed with webkit_permission_request_allow().

      Returns:
      a WebKitXRSessionFeatures flag combination
      Since:
      2.52
    • getGrantedFeatures

      public Set<XRSessionFeatures> getGrantedFeatures()
      Gets the features requested by the origin for the XR device, which are either granted by default or have been explicitly granted by the user.
      Returns:
      a WebKitXRSessionFeatures flag combination
      Since:
      2.52
    • getOptionalFeaturesRequested

      public Set<XRSessionFeatures> getOptionalFeaturesRequested()

      Gets the full set of optional features requested by the web application.

      This includes both already granted features and those requiring consent.

      Returns:
      a WebKitXRSessionFeatures flag combination
      Since:
      2.52
    • getRequiredFeaturesRequested

      public Set<XRSessionFeatures> getRequiredFeaturesRequested()

      Gets the full set of required features requested by the web application.

      This includes both already granted features and those requiring consent.

      Returns:
      a WebKitXRSessionFeatures flag combination
      Since:
      2.52
    • getSecurityOrigin

      public SecurityOrigin getSecurityOrigin()
      Gets the security origin that initiated the permission request.
      Returns:
      the WebKitSecurityOrigin that initiated the request
      Since:
      2.52
    • getSessionMode

      public XRSessionMode getSessionMode()
      Gets the session mode for which permission is being requested.
      Returns:
      a WebKitXRSessionMode
      Since:
      2.52
    • setGrantedOptionalFeatures

      public void setGrantedOptionalFeatures(Set<XRSessionFeatures> granted)

      Sets which optional features should be granted if the permission request is allowed.

      This function should be called with a subset of the features from webkit_xr_permission_request_get_consent_optional_features() before calling webkit_permission_request_allow(). If the request is denied, no features are granted, regardless of what is set here.

      Parameters:
      granted - granted features
      Since:
      2.52
    • setGrantedOptionalFeatures

      public void setGrantedOptionalFeatures(XRSessionFeatures... granted)

      Sets which optional features should be granted if the permission request is allowed.

      This function should be called with a subset of the features from webkit_xr_permission_request_get_consent_optional_features() before calling webkit_permission_request_allow(). If the request is denied, no features are granted, regardless of what is set here.

      Parameters:
      granted - granted features
      Since:
      2.52
    • builder

      public static XRPermissionRequest.Builder<? extends XRPermissionRequest.Builder> builder()
      A XRPermissionRequest.Builder object constructs a XRPermissionRequest with the specified properties. Use the various set...() methods to set properties, and finish construction with XRPermissionRequest.Builder.build().
      Returns:
      the builder object