Interface PrintOperation.OnPreview

Enclosing class:
PrintOperation
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 PrintOperation.OnPreview
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    onPreview(PrintOperationPreview preview, PrintContext context, Window parent)
    Gets emitted when a preview is requested from the native dialog.
  • Method Details

    • onPreview

      boolean onPreview(@Nonnull PrintOperationPreview preview, @Nonnull PrintContext context, @Nullable Window parent)
      Gets emitted when a preview is requested from the native dialog.

      The default handler for this signal uses an external viewer
      application to preview.

      To implement a custom print preview, an application must return
      %TRUE from its handler for this signal. In order to use the
      provided @context for the preview implementation, it must be
      given a suitable cairo context with
      [method@Gtk.PrintContext.set_cairo_context].

      The custom preview implementation can use
      [method@Gtk.PrintOperationPreview.is_selected] and
      [method@Gtk.PrintOperationPreview.render_page] to find pages which
      are selected for print and render them. The preview must be
      finished by calling [method@Gtk.PrintOperationPreview.end_preview]
      (typically in response to the user clicking a close button).
      Parameters:
      preview - the `GtkPrintOperationPreview` for the current operation
      context - the `GtkPrintContext` that will be used
      parent - the `GtkWindow` to use as window parent
      Returns:
      %TRUE if the listener wants to take over control of the preview