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 |
GtkPrintUnixDialog
implements a print dialog for platforms
which don’t provide a native print dialog, like Unix.
It can be used very much like any other GTK dialog, at the cost of
the portability offered by the high-level printing API with
PrintOperation
.
In order to print something with GtkPrintUnixDialog
, you need to
use printUnixDialogGetSelectedPrinter
to obtain a
Printer
object and use it to construct a PrintJob
using printJobNew
.
GtkPrintUnixDialog
uses the following response values:
ResponseTypeOk
: for the “Print” buttonResponseTypeApply
: for the “Preview” buttonResponseTypeCancel
: for the “Cancel” button
GtkPrintUnixDialog as GtkBuildable
The GtkPrintUnixDialog
implementation of the GtkBuildable
interface
exposes its notebook
internal children with the name “notebook”.
An example of a GtkPrintUnixDialog
UI definition fragment:
xml code
<object class="GtkPrintUnixDialog" id="dialog1"> <child internal-child="notebook"> <object class="GtkNotebook" id="notebook"> <child> <object type="GtkNotebookPage"> <property name="tab_expand">False</property> <property name="tab_fill">False</property> <property name="tab"> <object class="GtkLabel" id="tablabel"> <property name="label">Tab label</property> </object> </property> <property name="child"> <object class="GtkLabel" id="tabcontent"> <property name="label">Content on notebook tab</property> </object> </property> </object> </child> </object> </child> </object>
CSS nodes
GtkPrintUnixDialog
has a single CSS node with name window. The style classes
dialog and print are added.
Synopsis
- newtype PrintUnixDialog = PrintUnixDialog (ManagedPtr PrintUnixDialog)
- class (GObject o, IsDescendantOf PrintUnixDialog o) => IsPrintUnixDialog o
- toPrintUnixDialog :: (MonadIO m, IsPrintUnixDialog o) => o -> m PrintUnixDialog
- printUnixDialogAddCustomTab :: (HasCallStack, MonadIO m, IsPrintUnixDialog a, IsWidget b, IsWidget c) => a -> b -> c -> m ()
- printUnixDialogGetCurrentPage :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m Int32
- printUnixDialogGetEmbedPageSetup :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m Bool
- printUnixDialogGetHasSelection :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m Bool
- printUnixDialogGetManualCapabilities :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m [PrintCapabilities]
- printUnixDialogGetPageSetup :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m PageSetup
- printUnixDialogGetPageSetupSet :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m Bool
- printUnixDialogGetSelectedPrinter :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m (Maybe Printer)
- printUnixDialogGetSettings :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m PrintSettings
- printUnixDialogGetSupportSelection :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> m Bool
- printUnixDialogNew :: (HasCallStack, MonadIO m, IsWindow a) => Maybe Text -> Maybe a -> m PrintUnixDialog
- printUnixDialogSetCurrentPage :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> Int32 -> m ()
- printUnixDialogSetEmbedPageSetup :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> Bool -> m ()
- printUnixDialogSetHasSelection :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> Bool -> m ()
- printUnixDialogSetManualCapabilities :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> [PrintCapabilities] -> m ()
- printUnixDialogSetPageSetup :: (HasCallStack, MonadIO m, IsPrintUnixDialog a, IsPageSetup b) => a -> b -> m ()
- printUnixDialogSetSettings :: (HasCallStack, MonadIO m, IsPrintUnixDialog a, IsPrintSettings b) => a -> Maybe b -> m ()
- printUnixDialogSetSupportSelection :: (HasCallStack, MonadIO m, IsPrintUnixDialog a) => a -> Bool -> m ()
- constructPrintUnixDialogCurrentPage :: (IsPrintUnixDialog o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getPrintUnixDialogCurrentPage :: (MonadIO m, IsPrintUnixDialog o) => o -> m Int32
- setPrintUnixDialogCurrentPage :: (MonadIO m, IsPrintUnixDialog o) => o -> Int32 -> m ()
- constructPrintUnixDialogEmbedPageSetup :: (IsPrintUnixDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintUnixDialogEmbedPageSetup :: (MonadIO m, IsPrintUnixDialog o) => o -> m Bool
- setPrintUnixDialogEmbedPageSetup :: (MonadIO m, IsPrintUnixDialog o) => o -> Bool -> m ()
- constructPrintUnixDialogHasSelection :: (IsPrintUnixDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintUnixDialogHasSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> m Bool
- setPrintUnixDialogHasSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> Bool -> m ()
- constructPrintUnixDialogManualCapabilities :: (IsPrintUnixDialog o, MonadIO m) => [PrintCapabilities] -> m (GValueConstruct o)
- getPrintUnixDialogManualCapabilities :: (MonadIO m, IsPrintUnixDialog o) => o -> m [PrintCapabilities]
- setPrintUnixDialogManualCapabilities :: (MonadIO m, IsPrintUnixDialog o) => o -> [PrintCapabilities] -> m ()
- constructPrintUnixDialogPageSetup :: (IsPrintUnixDialog o, MonadIO m, IsPageSetup a) => a -> m (GValueConstruct o)
- getPrintUnixDialogPageSetup :: (MonadIO m, IsPrintUnixDialog o) => o -> m PageSetup
- setPrintUnixDialogPageSetup :: (MonadIO m, IsPrintUnixDialog o, IsPageSetup a) => o -> a -> m ()
- clearPrintUnixDialogPrintSettings :: (MonadIO m, IsPrintUnixDialog o) => o -> m ()
- constructPrintUnixDialogPrintSettings :: (IsPrintUnixDialog o, MonadIO m, IsPrintSettings a) => a -> m (GValueConstruct o)
- getPrintUnixDialogPrintSettings :: (MonadIO m, IsPrintUnixDialog o) => o -> m (Maybe PrintSettings)
- setPrintUnixDialogPrintSettings :: (MonadIO m, IsPrintUnixDialog o, IsPrintSettings a) => o -> a -> m ()
- getPrintUnixDialogSelectedPrinter :: (MonadIO m, IsPrintUnixDialog o) => o -> m (Maybe Printer)
- constructPrintUnixDialogSupportSelection :: (IsPrintUnixDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintUnixDialogSupportSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> m Bool
- setPrintUnixDialogSupportSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> Bool -> m ()
Exported types
newtype PrintUnixDialog Source #
Memory-managed wrapper type.
PrintUnixDialog (ManagedPtr PrintUnixDialog) |
Instances
class (GObject o, IsDescendantOf PrintUnixDialog o) => IsPrintUnixDialog o Source #
Type class for types which can be safely cast to PrintUnixDialog
, for instance with toPrintUnixDialog
.
Instances
(GObject o, IsDescendantOf PrintUnixDialog o) => IsPrintUnixDialog o Source # | |
Defined in GI.Gtk.Objects.PrintUnixDialog |
toPrintUnixDialog :: (MonadIO m, IsPrintUnixDialog o) => o -> m PrintUnixDialog Source #
Cast to PrintUnixDialog
, 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
actionSetEnabled, activate, activateAction, activateDefault, addActionWidget, addButton, addController, addCssClass, addCustomTab, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, close, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, destroy, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, fullscreen, fullscreenOnMonitor, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasGroup, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isActive, isAncestor, isDrawable, isFloating, isFocus, isFullscreen, isMaximized, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, maximize, measure, minimize, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, present, presentWithTime, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, response, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unfullscreen, unmap, unmaximize, unminimize, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getApplication, getAtContext, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getContentArea, getCssClasses, getCssName, getCurrentPage, getCursor, getData, getDecorated, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getDirection, getDisplay, getEmbedPageSetup, getFirstAccessibleChild, getFirstChild, getFocus, getFocusChild, getFocusOnClick, getFocusVisible, getFocusable, getFontMap, getFontOptions, getFrameClock, getGroup, getHalign, getHandleMenubarAccel, getHasSelection, getHasTooltip, getHeaderBar, getHeight, getHexpand, getHexpandSet, getHideOnClose, getIconName, getLastChild, getLayoutManager, getManualCapabilities, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMnemonicsVisible, getModal, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPageSetup, getPageSetupSet, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRenderer, getRequestMode, getResizable, getResponseForWidget, getRoot, getScaleFactor, getSelectedPrinter, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSupportSelection, getSurface, getSurfaceTransform, getTemplateChild, getTitle, getTitlebar, getTooltipMarkup, getTooltipText, getTransientFor, getValign, getVexpand, getVexpandSet, getVisible, getWidgetForResponse, getWidth.
Setters
setAccessibleParent, setApplication, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCurrentPage, setCursor, setCursorFromName, setData, setDataFull, setDecorated, setDefaultResponse, setDefaultSize, setDefaultWidget, setDeletable, setDestroyWithParent, setDirection, setDisplay, setEmbedPageSetup, setFocus, setFocusChild, setFocusOnClick, setFocusVisible, setFocusable, setFontMap, setFontOptions, setHalign, setHandleMenubarAccel, setHasSelection, setHasTooltip, setHexpand, setHexpandSet, setHideOnClose, setIconName, setLayoutManager, setManualCapabilities, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMnemonicsVisible, setModal, setName, setOpacity, setOverflow, setPageSetup, setParent, setProperty, setReceivesDefault, setResizable, setResponseSensitive, setSensitive, setSettings, setSizeRequest, setStartupId, setStateFlags, setSupportSelection, setTitle, setTitlebar, setTooltipMarkup, setTooltipText, setTransientFor, setValign, setVexpand, setVexpandSet, setVisible.
addCustomTab
printUnixDialogAddCustomTab Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a, IsWidget b, IsWidget c) | |
=> a |
|
-> b |
|
-> c |
|
-> m () |
Adds a custom tab to the print dialog.
getCurrentPage
printUnixDialogGetCurrentPage Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m Int32 | Returns: the current page of |
Gets the current page of the GtkPrintUnixDialog
.
getEmbedPageSetup
printUnixDialogGetEmbedPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m Bool | Returns: whether to embed the page setup |
Gets whether to embed the page setup.
getHasSelection
printUnixDialogGetHasSelection Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m Bool | Returns: whether there is a selection |
Gets whether there is a selection.
getManualCapabilities
printUnixDialogGetManualCapabilities Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m [PrintCapabilities] | Returns: the printing capabilities |
Gets the capabilities that have been set on this GtkPrintUnixDialog
.
getPageSetup
printUnixDialogGetPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m PageSetup | Returns: the page setup of |
Gets the page setup that is used by the GtkPrintUnixDialog
.
getPageSetupSet
printUnixDialogGetPageSetupSet Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m Bool | Returns: whether a page setup was set by user. |
Gets whether a page setup was set by the user.
getSelectedPrinter
printUnixDialogGetSelectedPrinter Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m (Maybe Printer) | Returns: the currently selected printer |
Gets the currently selected printer.
getSettings
printUnixDialogGetSettings Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m PrintSettings | Returns: a new |
Gets a new GtkPrintSettings
object that represents the
current values in the print dialog.
Note that this creates a new object, and you need to unref it if don’t want to keep it.
getSupportSelection
printUnixDialogGetSupportSelection Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> m Bool | Returns: whether the application supports print of selection |
Gets whether the print dialog allows user to print a selection.
new
:: (HasCallStack, MonadIO m, IsWindow a) | |
=> Maybe Text |
|
-> Maybe a |
|
-> m PrintUnixDialog | Returns: a new |
Creates a new GtkPrintUnixDialog
.
setCurrentPage
printUnixDialogSetCurrentPage Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the current page number.
If currentPage
is not -1, this enables the current page choice
for the range of pages to print.
setEmbedPageSetup
printUnixDialogSetEmbedPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
Embed page size combo box and orientation combo box into page setup page.
setHasSelection
printUnixDialogSetHasSelection Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether a selection exists.
setManualCapabilities
printUnixDialogSetManualCapabilities Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> [PrintCapabilities] |
|
-> m () |
This lets you specify the printing capabilities your application supports.
For instance, if you can handle scaling the output then you pass
PrintCapabilitiesScale
. If you don’t pass that, then the dialog
will only let you select the scale if the printing system automatically
handles scaling.
setPageSetup
printUnixDialogSetPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a, IsPageSetup b) | |
=> a |
|
-> b |
|
-> m () |
Sets the page setup of the GtkPrintUnixDialog
.
setSettings
printUnixDialogSetSettings Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a, IsPrintSettings b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the GtkPrintSettings
for the GtkPrintUnixDialog
.
Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.
setSupportSelection
printUnixDialogSetSupportSelection Source #
:: (HasCallStack, MonadIO m, IsPrintUnixDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the print dialog allows user to print a selection.
Properties
currentPage
The current page in the document.
constructPrintUnixDialogCurrentPage :: (IsPrintUnixDialog o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “current-page
” property. This is rarely needed directly, but it is used by new
.
getPrintUnixDialogCurrentPage :: (MonadIO m, IsPrintUnixDialog o) => o -> m Int32 Source #
Get the value of the “current-page
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #currentPage
setPrintUnixDialogCurrentPage :: (MonadIO m, IsPrintUnixDialog o) => o -> Int32 -> m () Source #
Set the value of the “current-page
” property.
When overloading is enabled, this is equivalent to
set
printUnixDialog [ #currentPage:=
value ]
embedPageSetup
True
if the page setup controls are embedded.
constructPrintUnixDialogEmbedPageSetup :: (IsPrintUnixDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “embed-page-setup
” property. This is rarely needed directly, but it is used by new
.
getPrintUnixDialogEmbedPageSetup :: (MonadIO m, IsPrintUnixDialog o) => o -> m Bool Source #
Get the value of the “embed-page-setup
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #embedPageSetup
setPrintUnixDialogEmbedPageSetup :: (MonadIO m, IsPrintUnixDialog o) => o -> Bool -> m () Source #
Set the value of the “embed-page-setup
” property.
When overloading is enabled, this is equivalent to
set
printUnixDialog [ #embedPageSetup:=
value ]
hasSelection
Whether the application has a selection.
constructPrintUnixDialogHasSelection :: (IsPrintUnixDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “has-selection
” property. This is rarely needed directly, but it is used by new
.
getPrintUnixDialogHasSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> m Bool Source #
Get the value of the “has-selection
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #hasSelection
setPrintUnixDialogHasSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> Bool -> m () Source #
Set the value of the “has-selection
” property.
When overloading is enabled, this is equivalent to
set
printUnixDialog [ #hasSelection:=
value ]
manualCapabilities
Capabilities the application can handle.
constructPrintUnixDialogManualCapabilities :: (IsPrintUnixDialog o, MonadIO m) => [PrintCapabilities] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “manual-capabilities
” property. This is rarely needed directly, but it is used by new
.
getPrintUnixDialogManualCapabilities :: (MonadIO m, IsPrintUnixDialog o) => o -> m [PrintCapabilities] Source #
Get the value of the “manual-capabilities
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #manualCapabilities
setPrintUnixDialogManualCapabilities :: (MonadIO m, IsPrintUnixDialog o) => o -> [PrintCapabilities] -> m () Source #
Set the value of the “manual-capabilities
” property.
When overloading is enabled, this is equivalent to
set
printUnixDialog [ #manualCapabilities:=
value ]
pageSetup
The GtkPageSetup
object to use.
constructPrintUnixDialogPageSetup :: (IsPrintUnixDialog 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
.
getPrintUnixDialogPageSetup :: (MonadIO m, IsPrintUnixDialog o) => o -> m PageSetup Source #
Get the value of the “page-setup
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #pageSetup
setPrintUnixDialogPageSetup :: (MonadIO m, IsPrintUnixDialog o, IsPageSetup a) => o -> a -> m () Source #
Set the value of the “page-setup
” property.
When overloading is enabled, this is equivalent to
set
printUnixDialog [ #pageSetup:=
value ]
printSettings
The GtkPrintSettings
object used for this dialog.
clearPrintUnixDialogPrintSettings :: (MonadIO m, IsPrintUnixDialog o) => o -> m () Source #
Set the value of the “print-settings
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#printSettings
constructPrintUnixDialogPrintSettings :: (IsPrintUnixDialog 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
.
getPrintUnixDialogPrintSettings :: (MonadIO m, IsPrintUnixDialog o) => o -> m (Maybe PrintSettings) Source #
Get the value of the “print-settings
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #printSettings
setPrintUnixDialogPrintSettings :: (MonadIO m, IsPrintUnixDialog o, IsPrintSettings a) => o -> a -> m () Source #
Set the value of the “print-settings
” property.
When overloading is enabled, this is equivalent to
set
printUnixDialog [ #printSettings:=
value ]
selectedPrinter
The GtkPrinter
which is selected.
getPrintUnixDialogSelectedPrinter :: (MonadIO m, IsPrintUnixDialog o) => o -> m (Maybe Printer) Source #
Get the value of the “selected-printer
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #selectedPrinter
supportSelection
Whether the dialog supports selection.
constructPrintUnixDialogSupportSelection :: (IsPrintUnixDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “support-selection
” property. This is rarely needed directly, but it is used by new
.
getPrintUnixDialogSupportSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> m Bool Source #
Get the value of the “support-selection
” property.
When overloading is enabled, this is equivalent to
get
printUnixDialog #supportSelection
setPrintUnixDialogSupportSelection :: (MonadIO m, IsPrintUnixDialog o) => o -> Bool -> m () Source #
Set the value of the “support-selection
” property.
When overloading is enabled, this is equivalent to
set
printUnixDialog [ #supportSelection:=
value ]