Class GeolocationManager

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class GeolocationManager extends GObject

Geolocation manager.

WebKitGeolocationManager provides API to get the geographical position of the user. Once a WebKitGeolocationPermissionRequest is allowed, when WebKit needs to know the user location WebKitGeolocationManager::start signal is emitted. If the signal is handled and returns true, the application is responsible for providing the position every time it's updated by calling webkit_geolocation_manager_update_position(). The signal WebKitGeolocationManager::stop will be emitted when location updates are no longer needed.

Since:
2.26
  • Constructor Details

    • GeolocationManager

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

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

    • getType

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

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

      protected GeolocationManager 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
    • failed

      public void failed(String errorMessage)
      Notify this GeolocationManager that determining the position failed.
      Parameters:
      errorMessage - the error message
      Since:
      2.26
    • getEnableHighAccuracy

      public boolean getEnableHighAccuracy()
      Get whether high accuracy is enabled.
      Returns:
      Whether the setting is enabled.
      Since:
      2.26
    • updatePosition

      public void updatePosition(GeolocationPosition position)
      Notify this GeolocationManager that position has been updated to position.
      Parameters:
      position - a WebKitGeolocationPosition
      Since:
      2.26
    • onStart

      The signal is emitted to notify that manager needs to start receiving position updates. After this signal is emitted the user should provide the updates using webkit_geolocation_manager_update_position() every time the position changes, or use webkit_geolocation_manager_failed() in case it isn't possible to determine the current position.

      If the signal is not handled, WebKit will try to determine the position using GeoClue if available.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      2.26
      See Also:
    • emitStart

      public boolean emitStart()
      Emits the "start" signal. See onStart(GeolocationManager.StartCallback).
    • onStop

      The signal is emitted to notify that manager doesn't need to receive position updates anymore.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      2.26
      See Also:
    • emitStop

      public void emitStop()
      Emits the "stop" signal. See onStop(GeolocationManager.StopCallback).
    • builder

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