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 |
GI.Gtk.Objects.PrintDialog
Description
A GtkPrintDialog
object collects the arguments that
are needed to present a print dialog to the user, such
as a title for the dialog and whether it should be modal.
The dialog is shown with the printDialogSetup
function.
The actual printing can be done with printDialogPrint
or
printDialogPrintFile
. These APIs follows the GIO async pattern,
and the results can be obtained by calling the corresponding finish methods.
Since: 4.14
Synopsis
- newtype PrintDialog = PrintDialog (ManagedPtr PrintDialog)
- class (GObject o, IsDescendantOf PrintDialog o) => IsPrintDialog o
- toPrintDialog :: (MonadIO m, IsPrintDialog o) => o -> m PrintDialog
- printDialogGetAcceptLabel :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> m Text
- printDialogGetModal :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> m Bool
- printDialogGetPageSetup :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> m PageSetup
- printDialogGetPrintSettings :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> m PrintSettings
- printDialogGetTitle :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> m Text
- printDialogNew :: (HasCallStack, MonadIO m) => m PrintDialog
- printDialogPrint :: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe PrintSetup -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- printDialogPrintFile :: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsFile c, IsCancellable d) => a -> Maybe b -> Maybe PrintSetup -> c -> Maybe d -> Maybe AsyncReadyCallback -> m ()
- printDialogPrintFileFinish :: (HasCallStack, MonadIO m, IsPrintDialog a, IsAsyncResult b) => a -> b -> m ()
- printDialogPrintFinish :: (HasCallStack, MonadIO m, IsPrintDialog a, IsAsyncResult b) => a -> b -> m (Maybe OutputStream)
- printDialogSetAcceptLabel :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> Text -> m ()
- printDialogSetModal :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> Bool -> m ()
- printDialogSetPageSetup :: (HasCallStack, MonadIO m, IsPrintDialog a, IsPageSetup b) => a -> b -> m ()
- printDialogSetPrintSettings :: (HasCallStack, MonadIO m, IsPrintDialog a, IsPrintSettings b) => a -> b -> m ()
- printDialogSetTitle :: (HasCallStack, MonadIO m, IsPrintDialog a) => a -> Text -> m ()
- printDialogSetup :: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- printDialogSetupFinish :: (HasCallStack, MonadIO m, IsPrintDialog a, IsAsyncResult b) => a -> b -> m (Maybe PrintSetup)
- constructPrintDialogAcceptLabel :: (IsPrintDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintDialogAcceptLabel :: (MonadIO m, IsPrintDialog o) => o -> m Text
- setPrintDialogAcceptLabel :: (MonadIO m, IsPrintDialog o) => o -> Text -> m ()
- constructPrintDialogModal :: (IsPrintDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintDialogModal :: (MonadIO m, IsPrintDialog o) => o -> m Bool
- setPrintDialogModal :: (MonadIO m, IsPrintDialog o) => o -> Bool -> m ()
- constructPrintDialogPageSetup :: (IsPrintDialog o, MonadIO m, IsPageSetup a) => a -> m (GValueConstruct o)
- getPrintDialogPageSetup :: (MonadIO m, IsPrintDialog o) => o -> m PageSetup
- setPrintDialogPageSetup :: (MonadIO m, IsPrintDialog o, IsPageSetup a) => o -> a -> m ()
- constructPrintDialogPrintSettings :: (IsPrintDialog o, MonadIO m, IsPrintSettings a) => a -> m (GValueConstruct o)
- getPrintDialogPrintSettings :: (MonadIO m, IsPrintDialog o) => o -> m PrintSettings
- setPrintDialogPrintSettings :: (MonadIO m, IsPrintDialog o, IsPrintSettings a) => o -> a -> m ()
- constructPrintDialogTitle :: (IsPrintDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintDialogTitle :: (MonadIO m, IsPrintDialog o) => o -> m Text
- setPrintDialogTitle :: (MonadIO m, IsPrintDialog o) => o -> Text -> m ()
Exported types
newtype PrintDialog Source #
Memory-managed wrapper type.
Constructors
PrintDialog (ManagedPtr PrintDialog) |
Instances
Eq PrintDialog Source # | |
Defined in GI.Gtk.Objects.PrintDialog | |
GObject PrintDialog Source # | |
Defined in GI.Gtk.Objects.PrintDialog | |
ManagedPtrNewtype PrintDialog Source # | |
Defined in GI.Gtk.Objects.PrintDialog Methods toManagedPtr :: PrintDialog -> ManagedPtr PrintDialog | |
TypedObject PrintDialog Source # | |
Defined in GI.Gtk.Objects.PrintDialog | |
HasParentTypes PrintDialog Source # | |
Defined in GI.Gtk.Objects.PrintDialog | |
IsGValue (Maybe PrintDialog) Source # | Convert |
Defined in GI.Gtk.Objects.PrintDialog Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe PrintDialog -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe PrintDialog) | |
type ParentTypes PrintDialog Source # | |
Defined in GI.Gtk.Objects.PrintDialog type ParentTypes PrintDialog = '[Object] |
class (GObject o, IsDescendantOf PrintDialog o) => IsPrintDialog o Source #
Type class for types which can be safely cast to PrintDialog
, for instance with toPrintDialog
.
Instances
(GObject o, IsDescendantOf PrintDialog o) => IsPrintDialog o Source # | |
Defined in GI.Gtk.Objects.PrintDialog |
toPrintDialog :: (MonadIO m, IsPrintDialog o) => o -> m PrintDialog Source #
Cast to PrintDialog
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, print, printFile, printFileFinish, printFinish, ref, refSink, runDispose, setup, setupFinish, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAcceptLabel, getData, getModal, getPageSetup, getPrintSettings, getProperty, getQdata, getTitle.
Setters
setAcceptLabel, setData, setDataFull, setModal, setPageSetup, setPrintSettings, setProperty, setTitle.
getAcceptLabel
printDialogGetAcceptLabel Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> m Text | Returns: the accept label |
Returns the label that will be shown on the accept button of the print dialog.
Since: 4.14
getModal
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> m Bool | Returns: whether the print dialog is modal |
Returns whether the print dialog blocks interaction with the parent window while it is presented.
Since: 4.14
getPageSetup
printDialogGetPageSetup Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> m PageSetup | Returns: the page setup |
Returns the page setup.
Since: 4.14
getPrintSettings
printDialogGetPrintSettings Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> m PrintSettings | Returns: the settings |
Returns the print settings for the print dialog.
Since: 4.14
getTitle
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> m Text | Returns: the title |
Returns the title that will be shown on the print dialog.
Since: 4.14
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m PrintDialog | Returns: the new |
Creates a new GtkPrintDialog
object.
Since: 4.14
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsCancellable c) | |
=> a |
|
-> Maybe b |
|
-> Maybe PrintSetup |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
This function prints content from a stream.
If you pass NULL
as setup
, then this method will present a print dialog.
Otherwise, it will attempt to print directly, without user interaction.
The callback
will be called when the printing is done. It should call
printDialogPrintFinish
to obtain the results.
Since: 4.14
printFile
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsFile c, IsCancellable d) | |
=> a |
|
-> Maybe b |
|
-> Maybe PrintSetup |
|
-> c |
|
-> Maybe d |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
This function prints a file.
If you pass NULL
as setup
, then this method will present a print dialog.
Otherwise, it will attempt to print directly, without user interaction.
The callback
will be called when the printing is done. It should call
printDialogPrintFileFinish
to obtain the results.
Since: 4.14
printFileFinish
printDialogPrintFileFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes the printDialogPrintFile
call and
returns the results.
Since: 4.14
printFinish
printDialogPrintFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe OutputStream) | Returns: a |
Finishes the printDialogPrint
call and
returns the results.
If the call was successful, the content to be printed should be
written to the returned output stream. Otherwise, NULL
is returned.
The overall results of the print operation will be returned in the
outputStreamClose
call, so if you are interested in the
results, you need to explicitly close the output stream (it will be
closed automatically if you just unref it). Be aware that the close
call may not be instant as it operation will for the printer to finish
printing.
Since: 4.14
setAcceptLabel
printDialogSetAcceptLabel Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the label that will be shown on the
accept button of the print dialog shown for
printDialogSetup
.
Since: 4.14
setModal
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the print dialog blocks interaction with the parent window while it is presented.
Since: 4.14
setPageSetup
printDialogSetPageSetup Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsPageSetup b) | |
=> a |
|
-> b |
|
-> m () |
Set the page setup for the print dialog.
Since: 4.14
setPrintSettings
printDialogSetPrintSettings Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsPrintSettings b) | |
=> a |
|
-> b |
|
-> m () |
Sets the print settings for the print dialog.
Since: 4.14
setTitle
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the title that will be shown on the print dialog.
Since: 4.14
setup
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsCancellable c) | |
=> a |
|
-> Maybe b |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
This function presents a print dialog to let the user select a printer, and set up print settings and page setup.
The callback
will be called when the dialog is dismissed.
It should call printDialogSetupFinish
to obtain the results in the form of a [structgtk
.PrintSetup],
that can then be passed to printDialogPrint
or printDialogPrintFile
.
One possible use for this method is to have the user select a printer,
then show a page setup UI in the application (e.g. to arrange images
on a page), then call printDialogPrint
on self
to do the printing without further user interaction.
Since: 4.14
setupFinish
printDialogSetupFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsPrintDialog a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe PrintSetup) | Returns: The |
Finishes the printDialogSetup
call.
If the call was successful, it returns a [structgtk
.PrintSetup]
which contains the print settings and page setup information that
will be used to print.
Since: 4.14
Properties
acceptLabel
A label that may be shown on the accept button of a print dialog
that is presented by printDialogSetup
.
Since: 4.14
constructPrintDialogAcceptLabel :: (IsPrintDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “accept-label
” property. This is rarely needed directly, but it is used by new
.
getPrintDialogAcceptLabel :: (MonadIO m, IsPrintDialog o) => o -> m Text Source #
Get the value of the “accept-label
” property.
When overloading is enabled, this is equivalent to
get
printDialog #acceptLabel
setPrintDialogAcceptLabel :: (MonadIO m, IsPrintDialog o) => o -> Text -> m () Source #
Set the value of the “accept-label
” property.
When overloading is enabled, this is equivalent to
set
printDialog [ #acceptLabel:=
value ]
modal
Whether the print dialog is modal.
Since: 4.14
constructPrintDialogModal :: (IsPrintDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “modal
” property. This is rarely needed directly, but it is used by new
.
getPrintDialogModal :: (MonadIO m, IsPrintDialog o) => o -> m Bool Source #
Get the value of the “modal
” property.
When overloading is enabled, this is equivalent to
get
printDialog #modal
setPrintDialogModal :: (MonadIO m, IsPrintDialog o) => o -> Bool -> m () Source #
Set the value of the “modal
” property.
When overloading is enabled, this is equivalent to
set
printDialog [ #modal:=
value ]
pageSetup
The page setup to use.
Since: 4.14
constructPrintDialogPageSetup :: (IsPrintDialog 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
.
getPrintDialogPageSetup :: (MonadIO m, IsPrintDialog o) => o -> m PageSetup Source #
Get the value of the “page-setup
” property.
When overloading is enabled, this is equivalent to
get
printDialog #pageSetup
setPrintDialogPageSetup :: (MonadIO m, IsPrintDialog o, IsPageSetup a) => o -> a -> m () Source #
Set the value of the “page-setup
” property.
When overloading is enabled, this is equivalent to
set
printDialog [ #pageSetup:=
value ]
printSettings
The print settings to use.
Since: 4.14
constructPrintDialogPrintSettings :: (IsPrintDialog o, MonadIO m, IsPrintSettings a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “print-settings
” property. This is rarely needed directly, but it is used by new
.
getPrintDialogPrintSettings :: (MonadIO m, IsPrintDialog o) => o -> m PrintSettings Source #
Get the value of the “print-settings
” property.
When overloading is enabled, this is equivalent to
get
printDialog #printSettings
setPrintDialogPrintSettings :: (MonadIO m, IsPrintDialog o, IsPrintSettings a) => o -> a -> m () Source #
Set the value of the “print-settings
” property.
When overloading is enabled, this is equivalent to
set
printDialog [ #printSettings:=
value ]
title
A title that may be shown on the print dialog that is
presented by printDialogSetup
.
Since: 4.14
constructPrintDialogTitle :: (IsPrintDialog 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
.
getPrintDialogTitle :: (MonadIO m, IsPrintDialog o) => o -> m Text Source #
Get the value of the “title
” property.
When overloading is enabled, this is equivalent to
get
printDialog #title
setPrintDialogTitle :: (MonadIO m, IsPrintDialog o) => o -> Text -> m () Source #
Set the value of the “title
” property.
When overloading is enabled, this is equivalent to
set
printDialog [ #title:=
value ]