Class UserMessage

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class UserMessage extends InitiallyUnowned

Message that can be sent between the UI process and web process extensions.

A WebKitUserMessage is a message that can be used for the communication between the UI process and web process extensions. A WebKitUserMessage always has a name, and it can also include parameters and UNIX file descriptors. Messages can be sent from a WebKitWebContext to all web process extensions, from a web process extension to its corresponding WebKitWebContext, and from a WebKitWebView to its corresponding WebKitWebPage (and vice versa). One to one messages can be replied to directly with webkit_user_message_send_reply().

Since:
2.28
  • Constructor Details

    • UserMessage

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

      public UserMessage(String name, @Nullable Variant parameters)
      Create a new WebKitUserMessage with name.
      Parameters:
      name - the message name
      parameters - the message parameters as a GVariant, or null
      Since:
      2.28
    • UserMessage

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

    • getType

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

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

      protected UserMessage 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 InitiallyUnowned
      Returns:
      the instance as if it were its parent type
    • withFdList

      public static UserMessage withFdList(String name, @Nullable Variant parameters, @Nullable UnixFDList fdList)
      Create a new WebKitUserMessage including also a list of UNIX file descriptors to be sent.
      Parameters:
      name - the message name
      parameters - the message parameters as a GVariant
      fdList - the message file descriptors
      Returns:
      the newly created WebKitUserMessage object.
      Since:
      2.28
    • errorQuark

      public static Quark errorQuark()
      Gets the quark for the domain of user message errors.
      Returns:
      user message error domain.
    • getFdList

      public @Nullable UnixFDList getFdList()
      Get the this UserMessage list of file descritpor.
      Returns:
      the message list of file descriptors
      Since:
      2.28
    • getName

      public String getName()
      Get the this UserMessage name.
      Returns:
      the message name
      Since:
      2.28
    • getParameters

      public @Nullable Variant getParameters()
      Get the this UserMessage parameters.
      Returns:
      the message parameters
      Since:
      2.28
    • sendReply

      public void sendReply(UserMessage reply)

      Send a reply to an user message.

      If reply is floating, it's consumed. You can only send a reply to a WebKitUserMessage that has been received.

      Parameters:
      reply - a WebKitUserMessage to send as reply
      Since:
      2.28
    • builder

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