Interface WebView.PrintCallback

All Superinterfaces:
FunctionPointer
Enclosing class:
WebView
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface WebView.PrintCallback extends FunctionPointer

Functional interface declaration of the PrintCallback callback.

See Also:
  • Method Details

    • run

      boolean run(@Nullable PrintOperation printOperation)

      Emitted when printing is requested on webView, usually by a JavaScript call, before the print dialog is shown. This signal can be used to set the initial print settings and page setup of printOperation to be used as default values in the print dialog. You can call webkit_print_operation_set_print_settings() and webkit_print_operation_set_page_setup() and then return false to propagate the event so that the print dialog is shown.

      You can connect to this signal and return true to cancel the print operation or implement your own print dialog.

    • upcall

      default int upcall(MemorySegment sourceWebView, MemorySegment printOperation)
      The upcall method is called from native code. The parameters are marshaled and run(PrintOperation) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer