Package ch.bailu.gtk.gtk
Class Printer
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.Printer
- All Implemented Interfaces:
PointerInterface
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.
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.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
FieldsFields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the printer accepts input in
PDF format.boolean
Returns whether the printer accepts input in
PostScript format.int
Compares two printers.ch.bailu.gtk.gtk.PrintBackend
Returns the backend of the printer.int
Returns the printer’s capabilities.static ClassHandler
Returns default page size of @printer.Gets the description of the printer.Gets the name of the icon to use for the printer.static int
int
Gets the number of jobs currently queued on the printer.Returns a description of the location of the printer.getName()
Returns the name of the printer.static long
static TypeSystem.TypeSize
Returns the state message describing the current state
of the printer.static long
static TypeSystem.TypeSize
boolean
Returns whether the printer details are available.boolean
Returns whether the printer is accepting jobsboolean
isActive()
Returns whether the printer is currently active (i.e.boolean
Returns whether the printer is the default printer.boolean
isPaused()
Returns whether the printer is currently paused.boolean
Returns whether the printer is virtual (i.e. does not
represent actual printer hardware, but something like
a CUPS class).Lists all the paper sizes @printer supports.Connect to signal "details-acquired".void
Requests the printer details.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_DETAILS_ACQUIRED
- See Also:
-
-
Constructor Details
-
Printer
-
Printer
Creates a new `GtkPrinter`.- Parameters:
name
- the name of the printerbackend
- a `GtkPrintBackend`virtual_
- whether the printer is virtual
-
Printer
Creates a new `GtkPrinter`.- Parameters:
name
- the name of the printerbackend
- a `GtkPrintBackend`virtual_
- whether the printer is virtual
-
-
Method Details
-
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
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
Returns default page size of @printer.- Returns:
- a newly allocated `GtkPageSetup` with default page size of the printer.
-
getDescription
Gets the description of the printer.- Returns:
- the description of @printer
-
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
Returns a description of the location of the printer.- Returns:
- the location of @printer
-
getName
Returns the name of the printer.- Returns:
- the name of @printer
-
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
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
Connect to signal "details-acquired".
SeePrinter.OnDetailsAcquired.onDetailsAcquired(boolean)
for signal description.
FieldSIGNAL_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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-