PrintJobProtocol
public protocol PrintJobProtocol : ObjectProtocol
A GtkPrintJob
object represents a job that is sent to a printer.
You only need to deal directly with print jobs if you use the
non-portable [classGtk.PrintUnixDialog
] API.
Use [methodGtk.PrintJob.get_surface
] to obtain the cairo surface
onto which the pages must be drawn. Use [methodGtk.PrintJob.send
]
to send the finished job to the printer. If you don’t use cairo
GtkPrintJob
also supports printing of manually generated PostScript,
via [methodGtk.PrintJob.set_source_file
].
The PrintJobProtocol
protocol exposes the methods and properties of an underlying GtkPrintJob
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see PrintJob
.
Alternatively, use PrintJobRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkPrintJob
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
print_job_ptr
Default implementationTyped pointer to the underlying
GtkPrintJob
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPrintJob
instance.Declaration
Swift
var print_job_ptr: UnsafeMutablePointer<GtkPrintJob>! { get }
-
Required Initialiser for types conforming to
PrintJobProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PrintJobPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PrintJobPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a PrintJob property
Declaration
Swift
@inlinable func get(property: PrintJobPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a PrintJob property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PrintJobPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
PrintJobSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PrintJobSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
PrintJobSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PrintJobSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onStatusChanged(flags:
Extension methodhandler: ) Emitted when the status of a job changes.
The signal handler can use [method
Gtk.PrintJob.get_status
] to obtain the new status.Note
This represents the underlyingstatus-changed
signalDeclaration
Swift
@discardableResult @inlinable func onStatusChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
statusChanged
signal is emitted -
statusChangedSignal
Extension methodTyped
status-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var statusChangedSignal: PrintJobSignalName { get }
-
onNotifyPageSetup(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::page-setup
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPageSetup
signal is emitted -
notifyPageSetupSignal
Extension methodTyped
notify::page-setup
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPageSetupSignal: PrintJobSignalName { get }
-
onNotifyPrinter(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::printer
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPrinter(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPrinter
signal is emitted -
notifyPrinterSignal
Extension methodTyped
notify::printer
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPrinterSignal: PrintJobSignalName { get }
-
onNotifySettings(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::settings
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySettings(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySettings
signal is emitted -
notifySettingsSignal
Extension methodTyped
notify::settings
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifySettingsSignal: PrintJobSignalName { get }
-
onNotifyTitle(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::title
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTitle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTitle
signal is emitted -
notifyTitleSignal
Extension methodTyped
notify::title
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTitleSignal: PrintJobSignalName { get }
-
onNotifyTrackPrintStatus(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::track-print-status
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTrackPrintStatus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTrackPrintStatus
signal is emitted -
notifyTrackPrintStatusSignal
Extension methodTyped
notify::track-print-status
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTrackPrintStatusSignal: PrintJobSignalName { get }
-
getCollate()
Extension methodGets whether this job is printed collated.
Declaration
Swift
@inlinable func getCollate() -> Bool
-
getNUp()
Extension methodGets the n-up setting for this job.
Declaration
Swift
@inlinable func getNUp() -> Int
-
getNUpLayout()
Extension methodGets the n-up layout setting for this job.
Declaration
Swift
@inlinable func getNUpLayout() -> GtkNumberUpLayout
-
getNumCopies()
Extension methodGets the number of copies of this job.
Declaration
Swift
@inlinable func getNumCopies() -> Int
-
getPageRanges(nRanges:
Extension method) Gets the page ranges for this job.
Declaration
Swift
@inlinable func getPageRanges(nRanges: UnsafeMutablePointer<gint>!) -> UnsafeMutablePointer<GtkPageRange>!
-
getPageSet()
Extension methodGets the
GtkPageSet
setting for this job.Declaration
Swift
@inlinable func getPageSet() -> GtkPageSet
-
getPages()
Extension methodGets the
GtkPrintPages
setting for this job.Declaration
Swift
@inlinable func getPages() -> GtkPrintPages
-
getPrinter()
Extension methodGets the
GtkPrinter
of the print job.Declaration
Swift
@inlinable func getPrinter() -> PrinterRef!
-
getReverse()
Extension methodGets whether this job is printed reversed.
Declaration
Swift
@inlinable func getReverse() -> Bool
-
getRotate()
Extension methodGets whether the job is printed rotated.
Declaration
Swift
@inlinable func getRotate() -> Bool
-
getScale()
Extension methodGets the scale for this job.
Declaration
Swift
@inlinable func getScale() -> CDouble
-
getSettings()
Extension methodGets the
GtkPrintSettings
of the print job.Declaration
Swift
@inlinable func getSettings() -> PrintSettingsRef!
-
getStatus()
Extension methodGets the status of the print job.
Declaration
Swift
@inlinable func getStatus() -> GtkPrintStatus
-
getSurface()
Extension methodGets a cairo surface onto which the pages of the print job should be rendered.
Declaration
Swift
@inlinable func getSurface() throws -> Cairo.SurfaceRef!
-
getTitle()
Extension methodGets the job title.
Declaration
Swift
@inlinable func getTitle() -> String!
-
getTrackPrintStatus()
Extension methodReturns whether jobs will be tracked after printing.
For details, see [method
Gtk.PrintJob.set_track_print_status
].Declaration
Swift
@inlinable func getTrackPrintStatus() -> Bool
-
send(callback:
Extension methoduserData: dnotify: ) Sends the print job off to the printer.
Declaration
Swift
@inlinable func send(callback: GtkPrintJobCompleteFunc?, userData: gpointer! = nil, dnotify: GDestroyNotify?)
-
set(collate:
Extension method) Sets whether this job is printed collated.
Declaration
Swift
@inlinable func set(collate: Bool)
-
set(nUp:
Extension method) Sets the n-up setting for this job.
Declaration
Swift
@inlinable func set(nUp: Int)
-
setNUp(layout:
Extension method) Sets the n-up layout setting for this job.
Declaration
Swift
@inlinable func setNUp(layout: GtkNumberUpLayout)
-
set(numCopies:
Extension method) Sets the number of copies for this job.
Declaration
Swift
@inlinable func set(numCopies: Int)
-
setPage(ranges:
Extension methodnRanges: ) Sets the page ranges for this job.
Declaration
Swift
@inlinable func setPage(ranges: UnsafeMutablePointer<GtkPageRange>!, nRanges: Int)
-
set(pageSet:
Extension method) Sets the
GtkPageSet
setting for this job.Declaration
Swift
@inlinable func set(pageSet: GtkPageSet)
-
set(pages:
Extension method) Sets the
GtkPrintPages
setting for this job.Declaration
Swift
@inlinable func set(pages: GtkPrintPages)
-
set(reverse:
Extension method) Sets whether this job is printed reversed.
Declaration
Swift
@inlinable func set(reverse: Bool)
-
set(rotate:
Extension method) Sets whether this job is printed rotated.
Declaration
Swift
@inlinable func set(rotate: Bool)
-
set(scale:
Extension method) Sets the scale for this job.
1.0 means unscaled.
Declaration
Swift
@inlinable func set(scale: CDouble)
-
setSource(fd:
Extension method) Make the
GtkPrintJob
send an existing document to the printing system.The file can be in any format understood by the platforms printing system (typically PostScript, but on many platforms PDF may work too). See [method
Gtk.Printer.accepts_pdf
] and [methodGtk.Printer.accepts_ps
].This is similar to [method
Gtk.PrintJob.set_source_file
], but takes expects an open file descriptor for the file, instead of a filename.Declaration
Swift
@inlinable func setSource(fd: Int) throws -> Bool
-
setSourceFile(filename:
Extension method) Make the
GtkPrintJob
send an existing document to the printing system.The file can be in any format understood by the platforms printing system (typically PostScript, but on many platforms PDF may work too). See [method
Gtk.Printer.accepts_pdf
] and [methodGtk.Printer.accepts_ps
].Declaration
Swift
@inlinable func setSourceFile(filename: UnsafePointer<CChar>!) throws -> Bool
-
setTrackPrintStatus(trackStatus:
Extension method) If track_status is
true
, the print job will try to continue report on the status of the print job in the printer queues and printer.This can allow your application to show things like “out of paper” issues, and when the print job actually reaches the printer.
This function is often implemented using some form of polling, so it should not be enabled unless needed.
Declaration
Swift
@inlinable func setTrackPrintStatus(trackStatus: Bool)
-
collate
Extension methodGets whether this job is printed collated.
Declaration
Swift
@inlinable var collate: Bool { get nonmutating set }
-
nUp
Extension methodGets the n-up setting for this job.
Declaration
Swift
@inlinable var nUp: Int { get nonmutating set }
-
nUpLayout
Extension methodGets the n-up layout setting for this job.
Declaration
Swift
@inlinable var nUpLayout: GtkNumberUpLayout { get nonmutating set }
-
numCopies
Extension methodGets the number of copies of this job.
Declaration
Swift
@inlinable var numCopies: Int { get nonmutating set }
-
pageSet
Extension methodGets the
GtkPageSet
setting for this job.Declaration
Swift
@inlinable var pageSet: GtkPageSet { get nonmutating set }
-
pages
Extension methodGets the
GtkPrintPages
setting for this job.Declaration
Swift
@inlinable var pages: GtkPrintPages { get nonmutating set }
-
printer
Extension methodThe printer to send the job to.
Declaration
Swift
@inlinable var printer: PrinterRef! { get }
-
reverse
Extension methodGets whether this job is printed reversed.
Declaration
Swift
@inlinable var reverse: Bool { get nonmutating set }
-
rotate
Extension methodGets whether the job is printed rotated.
Declaration
Swift
@inlinable var rotate: Bool { get nonmutating set }
-
scale
Extension methodGets the scale for this job.
Declaration
Swift
@inlinable var scale: CDouble { get nonmutating set }
-
settings
Extension methodPrinter settings.
Declaration
Swift
@inlinable var settings: PrintSettingsRef! { get }
-
status
Extension methodGets the status of the print job.
Declaration
Swift
@inlinable var status: GtkPrintStatus { get }
-
surface
Extension methodGets a cairo surface onto which the pages of the print job should be rendered.
Declaration
Swift
@inlinable var surface: Cairo.SurfaceRef! { get }
-
title
Extension methodThe title of the print job.
Declaration
Swift
@inlinable var title: String! { get }
-
trackPrintStatus
Extension methodReturns whether jobs will be tracked after printing.
For details, see [method
Gtk.PrintJob.set_track_print_status
].Declaration
Swift
@inlinable var trackPrintStatus: Bool { get nonmutating set }