Class Printer

All Implemented Interfaces:
PointerInterface

public class Printer extends Object
A `GtkPrinter` object represents a printer.

You only need to deal directly with printers if you use the
non-portable [class@Gtk.PrintUnixDialog] API.

A `GtkPrinter` allows to get status information about the printer,
such as its description, its location, the number of queued jobs,
etc. Most importantly, a `GtkPrinter` object can be used to create
a [class@Gtk.PrintJob] object, which lets you print to the printer.

https://docs.gtk.org/gtk4/class.Printer.html

  • Field Details

  • Constructor Details

    • Printer

      public Printer(PointerContainer pointer)
    • Printer

      public Printer(@Nonnull Str name, @Nonnull ch.bailu.gtk.gtk.PrintBackend backend, boolean virtual_)
      Creates a new `GtkPrinter`.
      Parameters:
      name - the name of the printer
      backend - a `GtkPrintBackend`
      virtual_ - whether the printer is virtual
    • Printer

      public Printer(String name, @Nonnull ch.bailu.gtk.gtk.PrintBackend backend, boolean virtual_)
      Creates a new `GtkPrinter`.
      Parameters:
      name - the name of the printer
      backend - a `GtkPrintBackend`
      virtual_ - whether the printer is virtual
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • acceptsPdf

      public boolean acceptsPdf()
      Returns whether the printer accepts input in
      PDF format.
      Returns:
      %TRUE if @printer accepts PDF
    • acceptsPs

      public boolean acceptsPs()
      Returns whether the printer accepts input in
      PostScript format.
      Returns:
      %TRUE if @printer accepts PostScript
    • compare

      public int compare(@Nonnull Printer b)
      Compares two printers.
      Parameters:
      b - another `GtkPrinter`
      Returns:
      0 if the printer match, a negative value if @a < @b, or a positive value if @a > @b
    • getBackend

      public ch.bailu.gtk.gtk.PrintBackend getBackend()
      Returns the backend of the printer.
      Returns:
      the backend of @printer
    • getCapabilities

      public int getCapabilities()
      Returns the printer’s capabilities.

      This is useful when you’re using `GtkPrintUnixDialog`’s
      manual-capabilities setting and need to know which settings
      the printer can handle and which you must handle yourself.

      This will return 0 unless the printer’s details are
      available, see [method@Gtk.Printer.has_details] and
      [method@Gtk.Printer.request_details].
      Returns:
      the printer’s capabilities
    • getDefaultPageSize

      public PageSetup getDefaultPageSize()
      Returns default page size of @printer.
      Returns:
      a newly allocated `GtkPageSetup` with default page size of the printer.
    • getDescription

      public Str getDescription()
      Gets the description of the printer.
      Returns:
      the description of @printer
    • getIconName

      public Str getIconName()
      Gets the name of the icon to use for the printer.
      Returns:
      the icon name for @printer
    • getJobCount

      public int getJobCount()
      Gets the number of jobs currently queued on the printer.
      Returns:
      the number of jobs on @printer
    • getLocation

      public Str getLocation()
      Returns a description of the location of the printer.
      Returns:
      the location of @printer
    • getName

      public Str getName()
      Returns the name of the printer.
      Returns:
      the name of @printer
    • getStateMessage

      public Str getStateMessage()
      Returns the state message describing the current state
      of the printer.
      Returns:
      the state message of @printer
    • hasDetails

      public boolean hasDetails()
      Returns whether the printer details are available.
      Returns:
      %TRUE if @printer details are available
    • isAcceptingJobs

      public boolean isAcceptingJobs()
      Returns whether the printer is accepting jobs
      Returns:
      %TRUE if @printer is accepting jobs
    • isActive

      public boolean isActive()
      Returns whether the printer is currently active (i.e.
      accepts new jobs).
      Returns:
      %TRUE if @printer is active
    • isDefault

      public boolean isDefault()
      Returns whether the printer is the default printer.
      Returns:
      %TRUE if @printer is the default
    • isPaused

      public boolean isPaused()
      Returns whether the printer is currently paused.

      A paused printer still accepts jobs, but it is not
      printing them.
      Returns:
      %TRUE if @printer is paused
    • isVirtual

      public boolean isVirtual()
      Returns whether the printer is virtual (i.e. does not
      represent actual printer hardware, but something like
      a CUPS class).
      Returns:
      %TRUE if @printer is virtual
    • listPapers

      public List listPapers()
      Lists all the paper sizes @printer supports.

      This will return and empty list unless the printer’s details
      are available, see [method@Gtk.Printer.has_details] and
      [method@Gtk.Printer.request_details].
      Returns:
      a newly allocated list of newly allocated `GtkPageSetup`s.
    • requestDetails

      public void requestDetails()
      Requests the printer details.

      When the details are available, the
      [signal@Gtk.Printer::details-acquired] signal
      will be emitted on @printer.
    • onDetailsAcquired

      public SignalHandler onDetailsAcquired(Printer.OnDetailsAcquired signal)
      Connect to signal "details-acquired".
      See Printer.OnDetailsAcquired.onDetailsAcquired(boolean) for signal description.
      Field SIGNAL_ON_DETAILS_ACQUIRED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()