Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- getCollate
- getNUp
- getNUpLayout
- getNumCopies
- getPageRanges
- getPageSet
- getPages
- getPrinter
- getReverse
- getRotate
- getScale
- getSettings
- getStatus
- getSurface
- getTitle
- getTrackPrintStatus
- new
- send
- setCollate
- setNUp
- setNUpLayout
- setNumCopies
- setPageRanges
- setPageSet
- setPages
- setReverse
- setRotate
- setScale
- setSourceFd
- setSourceFile
- setTrackPrintStatus
- Properties
- Signals
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 PrintUnixDialog
API.
Use printJobGetSurface
to obtain the cairo surface
onto which the pages must be drawn. Use printJobSend
to send the finished job to the printer. If you don’t use cairo
GtkPrintJob
also supports printing of manually generated PostScript,
via printJobSetSourceFile
.
Synopsis
- newtype PrintJob = PrintJob (ManagedPtr PrintJob)
- class (GObject o, IsDescendantOf PrintJob o) => IsPrintJob o
- toPrintJob :: (MonadIO m, IsPrintJob o) => o -> m PrintJob
- printJobGetCollate :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Bool
- printJobGetNUp :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Word32
- printJobGetNUpLayout :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m NumberUpLayout
- printJobGetNumCopies :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Int32
- printJobGetPageRanges :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m [PageRange]
- printJobGetPageSet :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m PageSet
- printJobGetPages :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m PrintPages
- printJobGetPrinter :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Printer
- printJobGetReverse :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Bool
- printJobGetRotate :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Bool
- printJobGetScale :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Double
- printJobGetSettings :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m PrintSettings
- printJobGetStatus :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m PrintStatus
- printJobGetSurface :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Surface
- printJobGetTitle :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Text
- printJobGetTrackPrintStatus :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> m Bool
- printJobNew :: (HasCallStack, MonadIO m, IsPrinter a, IsPrintSettings b, IsPageSetup c) => Text -> a -> b -> c -> m PrintJob
- printJobSend :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> PrintJobCompleteFunc -> m ()
- printJobSetCollate :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Bool -> m ()
- printJobSetNUp :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Word32 -> m ()
- printJobSetNUpLayout :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> NumberUpLayout -> m ()
- printJobSetNumCopies :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Int32 -> m ()
- printJobSetPageRanges :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> [PageRange] -> m ()
- printJobSetPageSet :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> PageSet -> m ()
- printJobSetPages :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> PrintPages -> m ()
- printJobSetReverse :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Bool -> m ()
- printJobSetRotate :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Bool -> m ()
- printJobSetScale :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Double -> m ()
- printJobSetSourceFd :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Int32 -> m ()
- printJobSetSourceFile :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> [Char] -> m ()
- printJobSetTrackPrintStatus :: (HasCallStack, MonadIO m, IsPrintJob a) => a -> Bool -> m ()
- constructPrintJobPageSetup :: (IsPrintJob o, MonadIO m, IsPageSetup a) => a -> m (GValueConstruct o)
- getPrintJobPageSetup :: (MonadIO m, IsPrintJob o) => o -> m (Maybe PageSetup)
- constructPrintJobPrinter :: (IsPrintJob o, MonadIO m, IsPrinter a) => a -> m (GValueConstruct o)
- getPrintJobPrinter :: (MonadIO m, IsPrintJob o) => o -> m Printer
- constructPrintJobSettings :: (IsPrintJob o, MonadIO m, IsPrintSettings a) => a -> m (GValueConstruct o)
- getPrintJobSettings :: (MonadIO m, IsPrintJob o) => o -> m PrintSettings
- constructPrintJobTitle :: (IsPrintJob o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintJobTitle :: (MonadIO m, IsPrintJob o) => o -> m Text
- constructPrintJobTrackPrintStatus :: (IsPrintJob o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintJobTrackPrintStatus :: (MonadIO m, IsPrintJob o) => o -> m Bool
- setPrintJobTrackPrintStatus :: (MonadIO m, IsPrintJob o) => o -> Bool -> m ()
- type PrintJobStatusChangedCallback = IO ()
- afterPrintJobStatusChanged :: (IsPrintJob a, MonadIO m) => a -> ((?self :: a) => PrintJobStatusChangedCallback) -> m SignalHandlerId
- onPrintJobStatusChanged :: (IsPrintJob a, MonadIO m) => a -> ((?self :: a) => PrintJobStatusChangedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq PrintJob Source # | |
GObject PrintJob Source # | |
Defined in GI.Gtk.Objects.PrintJob | |
ManagedPtrNewtype PrintJob Source # | |
Defined in GI.Gtk.Objects.PrintJob toManagedPtr :: PrintJob -> ManagedPtr PrintJob | |
TypedObject PrintJob Source # | |
Defined in GI.Gtk.Objects.PrintJob | |
HasParentTypes PrintJob Source # | |
Defined in GI.Gtk.Objects.PrintJob | |
IsGValue (Maybe PrintJob) Source # | Convert |
Defined in GI.Gtk.Objects.PrintJob gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe PrintJob -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe PrintJob) | |
type ParentTypes PrintJob Source # | |
Defined in GI.Gtk.Objects.PrintJob type ParentTypes PrintJob = '[Object] |
class (GObject o, IsDescendantOf PrintJob o) => IsPrintJob o Source #
Type class for types which can be safely cast to PrintJob
, for instance with toPrintJob
.
Instances
(GObject o, IsDescendantOf PrintJob o) => IsPrintJob o Source # | |
Defined in GI.Gtk.Objects.PrintJob |
toPrintJob :: (MonadIO m, IsPrintJob o) => o -> m PrintJob Source #
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, send, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCollate, getData, getNUp, getNUpLayout, getNumCopies, getPageRanges, getPageSet, getPages, getPrinter, getProperty, getQdata, getReverse, getRotate, getScale, getSettings, getStatus, getSurface, getTitle, getTrackPrintStatus.
Setters
setCollate, setData, setDataFull, setNUp, setNUpLayout, setNumCopies, setPageRanges, setPageSet, setPages, setProperty, setReverse, setRotate, setScale, setSourceFd, setSourceFile, setTrackPrintStatus.
getCollate
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Bool | Returns: whether the job is printed collated |
Gets whether this job is printed collated.
getNUp
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Word32 | Returns: the n-up setting |
Gets the n-up setting for this job.
getNUpLayout
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m NumberUpLayout | Returns: the n-up layout |
Gets the n-up layout setting for this job.
getNumCopies
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Int32 | Returns: the number of copies |
Gets the number of copies of this job.
getPageRanges
printJobGetPageRanges Source #
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m [PageRange] | Returns: a pointer to an
array of |
Gets the page ranges for this job.
getPageSet
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m PageSet | Returns: the |
Gets the GtkPageSet
setting for this job.
getPages
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m PrintPages | Returns: the |
Gets the GtkPrintPages
setting for this job.
getPrinter
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Printer | Returns: the printer of |
Gets the GtkPrinter
of the print job.
getReverse
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Bool | Returns: whether the job is printed reversed. |
Gets whether this job is printed reversed.
getRotate
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Bool | Returns: whether the job is printed rotated |
Gets whether the job is printed rotated.
getScale
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Double | Returns: the scale |
Gets the scale for this job.
getSettings
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m PrintSettings | Returns: the settings of |
Gets the GtkPrintSettings
of the print job.
getStatus
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m PrintStatus | Returns: the status of |
Gets the status of the print job.
getSurface
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Surface | Returns: the cairo surface of |
Gets a cairo surface onto which the pages of the print job should be rendered.
getTitle
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Text | Returns: the title of |
Gets the job title.
getTrackPrintStatus
printJobGetTrackPrintStatus Source #
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether jobs will be tracked after printing.
For details, see printJobSetTrackPrintStatus
.
new
:: (HasCallStack, MonadIO m, IsPrinter a, IsPrintSettings b, IsPageSetup c) | |
=> Text |
|
-> a |
|
-> b |
|
-> c |
|
-> m PrintJob | Returns: a new |
Creates a new GtkPrintJob
.
send
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> PrintJobCompleteFunc |
|
-> m () |
Sends the print job off to the printer.
setCollate
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether this job is printed collated.
setNUp
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the n-up setting for this job.
setNUpLayout
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> NumberUpLayout |
|
-> m () |
Sets the n-up layout setting for this job.
setNumCopies
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the number of copies for this job.
setPageRanges
printJobSetPageRanges Source #
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> [PageRange] |
|
-> m () |
Sets the page ranges for this job.
setPageSet
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> PageSet |
|
-> m () |
Sets the GtkPageSet
setting for this job.
setPages
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> PrintPages |
|
-> m () |
Sets the GtkPrintPages
setting for this job.
setReverse
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether this job is printed reversed.
setRotate
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether this job is printed rotated.
setScale
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the scale for this job.
- 0 means unscaled.
setSourceFd
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Int32 |
|
-> m () | (Can throw |
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 printerAcceptsPdf
and
printerAcceptsPs
.
This is similar to printJobSetSourceFile
,
but takes expects an open file descriptor for the file,
instead of a filename.
setSourceFile
printJobSetSourceFile Source #
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> [Char] |
|
-> m () | (Can throw |
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 printerAcceptsPdf
and
printerAcceptsPs
.
setTrackPrintStatus
printJobSetTrackPrintStatus Source #
:: (HasCallStack, MonadIO m, IsPrintJob a) | |
=> a |
|
-> Bool |
|
-> m () |
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.
Properties
pageSetup
Page setup.
constructPrintJobPageSetup :: (IsPrintJob o, MonadIO m, IsPageSetup a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “page-setup
” property. This is rarely needed directly, but it is used by new
.
getPrintJobPageSetup :: (MonadIO m, IsPrintJob o) => o -> m (Maybe PageSetup) Source #
Get the value of the “page-setup
” property.
When overloading is enabled, this is equivalent to
get
printJob #pageSetup
printer
The printer to send the job to.
constructPrintJobPrinter :: (IsPrintJob o, MonadIO m, IsPrinter a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “printer
” property. This is rarely needed directly, but it is used by new
.
getPrintJobPrinter :: (MonadIO m, IsPrintJob o) => o -> m Printer Source #
Get the value of the “printer
” property.
When overloading is enabled, this is equivalent to
get
printJob #printer
settings
Printer settings.
constructPrintJobSettings :: (IsPrintJob o, MonadIO m, IsPrintSettings a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “settings
” property. This is rarely needed directly, but it is used by new
.
getPrintJobSettings :: (MonadIO m, IsPrintJob o) => o -> m PrintSettings Source #
Get the value of the “settings
” property.
When overloading is enabled, this is equivalent to
get
printJob #settings
title
The title of the print job.
constructPrintJobTitle :: (IsPrintJob o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “title
” property. This is rarely needed directly, but it is used by new
.
getPrintJobTitle :: (MonadIO m, IsPrintJob o) => o -> m Text Source #
Get the value of the “title
” property.
When overloading is enabled, this is equivalent to
get
printJob #title
trackPrintStatus
True
if the print job will continue to emit status-changed
signals after the print data has been setn to the printer.
constructPrintJobTrackPrintStatus :: (IsPrintJob o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “track-print-status
” property. This is rarely needed directly, but it is used by new
.
getPrintJobTrackPrintStatus :: (MonadIO m, IsPrintJob o) => o -> m Bool Source #
Get the value of the “track-print-status
” property.
When overloading is enabled, this is equivalent to
get
printJob #trackPrintStatus
setPrintJobTrackPrintStatus :: (MonadIO m, IsPrintJob o) => o -> Bool -> m () Source #
Set the value of the “track-print-status
” property.
When overloading is enabled, this is equivalent to
set
printJob [ #trackPrintStatus:=
value ]
Signals
statusChanged
type PrintJobStatusChangedCallback = IO () Source #
Emitted when the status of a job changes.
The signal handler can use printJobGetStatus
to obtain the new status.
afterPrintJobStatusChanged :: (IsPrintJob a, MonadIO m) => a -> ((?self :: a) => PrintJobStatusChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the statusChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
printJob #statusChanged callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onPrintJobStatusChanged :: (IsPrintJob a, MonadIO m) => a -> ((?self :: a) => PrintJobStatusChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the statusChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
printJob #statusChanged callback