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.

  • ptr

    Untyped pointer to the underlying GtkPrintJob instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • print_job_ptr Default implementation

    Typed 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)

PrintJob Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

PrintJob signals

  • Connect a Swift signal handler to the given, typed PrintJobSignalName signal

    Declaration

    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 by userData

    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 a C signal handler to the given, typed PrintJobSignalName signal

    Declaration

    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 by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Emitted when the status of a job changes.

    The signal handler can use [methodGtk.PrintJob.get_status] to obtain the new status.

    Note

    This represents the underlying status-changed signal

    Declaration

    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 method

    Typed status-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var statusChangedSignal: PrintJobSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::page-setup signal

    Declaration

    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 method

    Typed notify::page-setup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPageSetupSignal: PrintJobSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::printer signal

    Declaration

    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 method

    Typed notify::printer signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPrinterSignal: PrintJobSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::settings signal

    Declaration

    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 method

    Typed notify::settings signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySettingsSignal: PrintJobSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::title signal

    Declaration

    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 method

    Typed notify::title signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyTitleSignal: PrintJobSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::track-print-status signal

    Declaration

    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 method

    Typed notify::track-print-status signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyTrackPrintStatusSignal: PrintJobSignalName { get }

PrintJob Class: PrintJobProtocol extension (methods and fields)

  • getCollate() Extension method

    Gets whether this job is printed collated.

    Declaration

    Swift

    @inlinable
    func getCollate() -> Bool
  • getNUp() Extension method

    Gets the n-up setting for this job.

    Declaration

    Swift

    @inlinable
    func getNUp() -> Int
  • getNUpLayout() Extension method

    Gets the n-up layout setting for this job.

    Declaration

    Swift

    @inlinable
    func getNUpLayout() -> GtkNumberUpLayout
  • getNumCopies() Extension method

    Gets 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 method

    Gets the GtkPageSet setting for this job.

    Declaration

    Swift

    @inlinable
    func getPageSet() -> GtkPageSet
  • getPages() Extension method

    Gets the GtkPrintPages setting for this job.

    Declaration

    Swift

    @inlinable
    func getPages() -> GtkPrintPages
  • getPrinter() Extension method

    Gets the GtkPrinter of the print job.

    Declaration

    Swift

    @inlinable
    func getPrinter() -> PrinterRef!
  • getReverse() Extension method

    Gets whether this job is printed reversed.

    Declaration

    Swift

    @inlinable
    func getReverse() -> Bool
  • getRotate() Extension method

    Gets whether the job is printed rotated.

    Declaration

    Swift

    @inlinable
    func getRotate() -> Bool
  • getScale() Extension method

    Gets the scale for this job.

    Declaration

    Swift

    @inlinable
    func getScale() -> CDouble
  • getSettings() Extension method

    Gets the GtkPrintSettings of the print job.

    Declaration

    Swift

    @inlinable
    func getSettings() -> PrintSettingsRef!
  • getStatus() Extension method

    Gets the status of the print job.

    Declaration

    Swift

    @inlinable
    func getStatus() -> GtkPrintStatus
  • getSurface() Extension method

    Gets a cairo surface onto which the pages of the print job should be rendered.

    Declaration

    Swift

    @inlinable
    func getSurface() throws -> Cairo.SurfaceRef!
  • getTitle() Extension method

    Gets the job title.

    Declaration

    Swift

    @inlinable
    func getTitle() -> String!
  • getTrackPrintStatus() Extension method

    Returns whether jobs will be tracked after printing.

    For details, see [methodGtk.PrintJob.set_track_print_status].

    Declaration

    Swift

    @inlinable
    func getTrackPrintStatus() -> Bool
  • 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:nRanges:) Extension method

    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 [methodGtk.Printer.accepts_pdf] and [methodGtk.Printer.accepts_ps].

    This is similar to [methodGtk.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 [methodGtk.Printer.accepts_pdf] and [methodGtk.Printer.accepts_ps].

    Declaration

    Swift

    @inlinable
    func setSourceFile(filename: UnsafePointer<CChar>!) throws -> Bool
  • 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 method

    Gets whether this job is printed collated.

    Declaration

    Swift

    @inlinable
    var collate: Bool { get nonmutating set }
  • nUp Extension method

    Gets the n-up setting for this job.

    Declaration

    Swift

    @inlinable
    var nUp: Int { get nonmutating set }
  • nUpLayout Extension method

    Gets the n-up layout setting for this job.

    Declaration

    Swift

    @inlinable
    var nUpLayout: GtkNumberUpLayout { get nonmutating set }
  • numCopies Extension method

    Gets the number of copies of this job.

    Declaration

    Swift

    @inlinable
    var numCopies: Int { get nonmutating set }
  • pageSet Extension method

    Gets the GtkPageSet setting for this job.

    Declaration

    Swift

    @inlinable
    var pageSet: GtkPageSet { get nonmutating set }
  • pages Extension method

    Gets the GtkPrintPages setting for this job.

    Declaration

    Swift

    @inlinable
    var pages: GtkPrintPages { get nonmutating set }
  • printer Extension method

    The printer to send the job to.

    Declaration

    Swift

    @inlinable
    var printer: PrinterRef! { get }
  • reverse Extension method

    Gets whether this job is printed reversed.

    Declaration

    Swift

    @inlinable
    var reverse: Bool { get nonmutating set }
  • rotate Extension method

    Gets whether the job is printed rotated.

    Declaration

    Swift

    @inlinable
    var rotate: Bool { get nonmutating set }
  • scale Extension method

    Gets the scale for this job.

    Declaration

    Swift

    @inlinable
    var scale: CDouble { get nonmutating set }
  • settings Extension method

    Printer settings.

    Declaration

    Swift

    @inlinable
    var settings: PrintSettingsRef! { get }
  • status Extension method

    Gets the status of the print job.

    Declaration

    Swift

    @inlinable
    var status: GtkPrintStatus { get }
  • surface Extension method

    Gets a cairo surface onto which the pages of the print job should be rendered.

    Declaration

    Swift

    @inlinable
    var surface: Cairo.SurfaceRef! { get }
  • title Extension method

    The title of the print job.

    Declaration

    Swift

    @inlinable
    var title: String! { get }
  • trackPrintStatus Extension method

    Returns whether jobs will be tracked after printing.

    For details, see [methodGtk.PrintJob.set_track_print_status].

    Declaration

    Swift

    @inlinable
    var trackPrintStatus: Bool { get nonmutating set }