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 |
Allows to embed a custom widget in print dialog.
A WebKitPrintCustomWidget allows to embed a custom widget in the print
dialog by connecting to the PrintOperation::createCustomWidget
signal, creating a new WebKitPrintCustomWidget with
printCustomWidgetNew
and returning it from there. You can later
use printOperationRunDialog
to display the dialog.
Since: 2.16
Synopsis
- newtype PrintCustomWidget = PrintCustomWidget (ManagedPtr PrintCustomWidget)
- class (GObject o, IsDescendantOf PrintCustomWidget o) => IsPrintCustomWidget o
- toPrintCustomWidget :: (MonadIO m, IsPrintCustomWidget o) => o -> m PrintCustomWidget
- printCustomWidgetGetTitle :: (HasCallStack, MonadIO m, IsPrintCustomWidget a) => a -> m Text
- printCustomWidgetGetWidget :: (HasCallStack, MonadIO m, IsPrintCustomWidget a) => a -> m (Maybe Widget)
- printCustomWidgetNew :: (HasCallStack, MonadIO m, IsWidget a) => a -> Text -> m PrintCustomWidget
- constructPrintCustomWidgetTitle :: (IsPrintCustomWidget o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintCustomWidgetTitle :: (MonadIO m, IsPrintCustomWidget o) => o -> m Text
- constructPrintCustomWidgetWidget :: (IsPrintCustomWidget o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getPrintCustomWidgetWidget :: (MonadIO m, IsPrintCustomWidget o) => o -> m (Maybe Widget)
- type PrintCustomWidgetApplyCallback = IO ()
- afterPrintCustomWidgetApply :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetApplyCallback) -> m SignalHandlerId
- onPrintCustomWidgetApply :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetApplyCallback) -> m SignalHandlerId
- type PrintCustomWidgetUpdateCallback = PageSetup -> PrintSettings -> IO ()
- afterPrintCustomWidgetUpdate :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetUpdateCallback) -> m SignalHandlerId
- onPrintCustomWidgetUpdate :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetUpdateCallback) -> m SignalHandlerId
Exported types
newtype PrintCustomWidget Source #
Memory-managed wrapper type.
PrintCustomWidget (ManagedPtr PrintCustomWidget) |
Instances
class (GObject o, IsDescendantOf PrintCustomWidget o) => IsPrintCustomWidget o Source #
Type class for types which can be safely cast to PrintCustomWidget
, for instance with toPrintCustomWidget
.
Instances
(GObject o, IsDescendantOf PrintCustomWidget o) => IsPrintCustomWidget o Source # | |
Defined in GI.WebKit2.Objects.PrintCustomWidget |
toPrintCustomWidget :: (MonadIO m, IsPrintCustomWidget o) => o -> m PrintCustomWidget Source #
Cast to PrintCustomWidget
, 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, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata, getTitle, getWidget.
Setters
getTitle
printCustomWidgetGetTitle Source #
:: (HasCallStack, MonadIO m, IsPrintCustomWidget a) | |
=> a |
|
-> m Text | Returns: Title of the |
Return the value of PrintCustomWidget:title property.
Return the value of PrintCustomWidget:title property for the given
printCustomWidget
object.
Since: 2.16
getWidget
printCustomWidgetGetWidget Source #
:: (HasCallStack, MonadIO m, IsPrintCustomWidget a) | |
=> a |
|
-> m (Maybe Widget) | Returns: a |
Return the value of PrintCustomWidget:widget property.
Return the value of PrintCustomWidget:widget property for the given
printCustomWidget
object. The returned value will always be valid if called
from PrintCustomWidget::apply or PrintCustomWidget::update
callbacks, but it will be Nothing
if called after the
PrintCustomWidget::apply signal is emitted.
Since: 2.16
new
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a |
|
-> Text |
|
-> m PrintCustomWidget | Returns: a new |
Create a new PrintCustomWidget
with given widget
and title
.
The widget
ownership is taken and it is destroyed together with the dialog even if this
object could still be alive at that point. You typically want to pass a container
widget with multiple widgets in it.
Since: 2.16
Properties
title
The title of the custom widget.
Since: 2.16
constructPrintCustomWidgetTitle :: (IsPrintCustomWidget 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
.
getPrintCustomWidgetTitle :: (MonadIO m, IsPrintCustomWidget o) => o -> m Text Source #
Get the value of the “title
” property.
When overloading is enabled, this is equivalent to
get
printCustomWidget #title
widget
The custom Widget
that will be embedded in the dialog.
Since: 2.16
constructPrintCustomWidgetWidget :: (IsPrintCustomWidget o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “widget
” property. This is rarely needed directly, but it is used by new
.
getPrintCustomWidgetWidget :: (MonadIO m, IsPrintCustomWidget o) => o -> m (Maybe Widget) Source #
Get the value of the “widget
” property.
When overloading is enabled, this is equivalent to
get
printCustomWidget #widget
Signals
apply
type PrintCustomWidgetApplyCallback = IO () Source #
Emitted right before the printing will start. You should read the information from the widget and update the content based on it if necessary. The widget is not guaranteed to be valid at a later time.
Since: 2.16
afterPrintCustomWidgetApply :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetApplyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the apply signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
printCustomWidget #apply 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.
onPrintCustomWidgetApply :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetApplyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the apply signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
printCustomWidget #apply callback
update
type PrintCustomWidgetUpdateCallback Source #
= PageSetup |
|
-> PrintSettings |
|
-> IO () |
Emitted after change of selected printer in the dialog. The actual page setup and print settings are available and the custom widget can actualize itself according to their values.
Since: 2.16
afterPrintCustomWidgetUpdate :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetUpdateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the update signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
printCustomWidget #update 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.
onPrintCustomWidgetUpdate :: (IsPrintCustomWidget a, MonadIO m) => a -> ((?self :: a) => PrintCustomWidgetUpdateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the update signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
printCustomWidget #update callback