gi-gtk-4.0.9: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Exported types

newtype PrintDialog Source #

Memory-managed wrapper type.

Constructors

PrintDialog (ManagedPtr PrintDialog) 

Instances

Instances details
Eq PrintDialog Source # 
Instance details

Defined in GI.Gtk.Objects.PrintDialog

GObject PrintDialog Source # 
Instance details

Defined in GI.Gtk.Objects.PrintDialog

ManagedPtrNewtype PrintDialog Source # 
Instance details

Defined in GI.Gtk.Objects.PrintDialog

Methods

toManagedPtr :: PrintDialog -> ManagedPtr PrintDialog

TypedObject PrintDialog Source # 
Instance details

Defined in GI.Gtk.Objects.PrintDialog

Methods

glibType :: IO GType

HasParentTypes PrintDialog Source # 
Instance details

Defined in GI.Gtk.Objects.PrintDialog

IsGValue (Maybe PrintDialog) Source #

Convert PrintDialog to and from GValue. See toGValue and fromGValue.

Instance details

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 # 
Instance details

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

Instances details
(GObject o, IsDescendantOf PrintDialog o) => IsPrintDialog o Source # 
Instance details

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

getAcceptLabel

printDialogGetAcceptLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a) 
=> a

self: a GtkPrintDialog

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

printDialogGetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a) 
=> a

self: a GtkPrintDialog

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

self: a GtkPrintDialog

-> m PageSetup

Returns: the page setup

Returns the page setup.

Since: 4.14

getPrintSettings

printDialogGetPrintSettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a) 
=> a

self: a GtkPrintDialog

-> m PrintSettings

Returns: the settings

Returns the print settings for the print dialog.

Since: 4.14

getTitle

printDialogGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a) 
=> a

self: a GtkPrintDialog

-> m Text

Returns: the title

Returns the title that will be shown on the print dialog.

Since: 4.14

new

printDialogNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m PrintDialog

Returns: the new GtkPrintDialog

Creates a new GtkPrintDialog object.

Since: 4.14

print

printDialogPrint Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsCancellable c) 
=> a

self: a GtkPrintDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe PrintSetup

setup: the GtkPrintSetup to use

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

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

printDialogPrintFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsFile c, IsCancellable d) 
=> a

self: a GtkPrintDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe PrintSetup

setup: the GtkPrintSetup to use

-> c

file: the GFile to print

-> Maybe d

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

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

self: a GtkPrintDialog

-> b

result: a GAsyncResult

-> m ()

(Can throw GError)

Finishes the printDialogPrintFile call and returns the results.

Since: 4.14

printFinish

printDialogPrintFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a, IsAsyncResult b) 
=> a

self: a GtkPrintDialog

-> b

result: a GAsyncResult

-> m (Maybe OutputStream)

Returns: a OutputStream (Can throw GError)

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

self: a GtkPrintDialog

-> Text

acceptLabel: the new accept label

-> m () 

Sets the label that will be shown on the accept button of the print dialog shown for printDialogSetup.

Since: 4.14

setModal

printDialogSetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a) 
=> a

self: a GtkPrintDialog

-> Bool

modal: the new value

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

self: a GtkPrintDialog

-> b

pageSetup: the new page setup

-> m () 

Set the page setup for the print dialog.

Since: 4.14

setPrintSettings

printDialogSetPrintSettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a, IsPrintSettings b) 
=> a

self: a GtkPrintDialog

-> b

printSettings: the new print settings

-> m () 

Sets the print settings for the print dialog.

Since: 4.14

setTitle

printDialogSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a) 
=> a

self: a GtkPrintDialog

-> Text

title: the new title

-> m () 

Sets the title that will be shown on the print dialog.

Since: 4.14

setup

printDialogSetup Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrintDialog a, IsWindow b, IsCancellable c) 
=> a

self: a GtkPrintDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

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

self: a GtkPrintDialog

-> b

result: a GAsyncResult

-> m (Maybe PrintSetup)

Returns: The GtkPrintSetup object that resulted from the call, or NULL if the call was not successful (Can throw GError)

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 ]