{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

GtkPrintOperation is the high-level, portable printing API.
It looks a bit different than other GTK+ dialogs such as the
'GI.Gtk.Interfaces.FileChooser.FileChooser', since some platforms don’t expose enough
infrastructure to implement a good print dialog. On such
platforms, GtkPrintOperation uses the native print dialog.
On platforms which do not provide a native print dialog, GTK+
uses its own, see @/GtkPrintUnixDialog/@.

The typical way to use the high-level printing API is to create
a GtkPrintOperation object with 'GI.Gtk.Objects.PrintOperation.printOperationNew' when
the user selects to print. Then you set some properties on it,
e.g. the page size, any 'GI.Gtk.Objects.PrintSettings.PrintSettings' from previous print
operations, the number of pages, the current page, etc.

Then you start the print operation by calling 'GI.Gtk.Objects.PrintOperation.printOperationRun'.
It will then show a dialog, let the user select a printer and
options. When the user finished the dialog various signals will
be emitted on the 'GI.Gtk.Objects.PrintOperation.PrintOperation', the main one being
'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/draw-page/@, which you are supposed to catch
and render the page on the provided 'GI.Gtk.Objects.PrintContext.PrintContext' using Cairo.

= The high-level printing API


=== /C code/
>
>static GtkPrintSettings *settings = NULL;
>
>static void
>do_print (void)
>{
>  GtkPrintOperation *print;
>  GtkPrintOperationResult res;
>
>  print = gtk_print_operation_new ();
>
>  if (settings != NULL)
>    gtk_print_operation_set_print_settings (print, settings);
>
>  g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), NULL);
>  g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
>
>  res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
>                                 GTK_WINDOW (main_window), NULL);
>
>  if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
>    {
>      if (settings != NULL)
>        g_object_unref (settings);
>      settings = g_object_ref (gtk_print_operation_get_print_settings (print));
>    }
>
>  g_object_unref (print);
>}


By default GtkPrintOperation uses an external application to do
print preview. To implement a custom print preview, an application
must connect to the preview signal. The functions
'GI.Gtk.Interfaces.PrintOperationPreview.printOperationPreviewRenderPage',
'GI.Gtk.Interfaces.PrintOperationPreview.printOperationPreviewEndPreview' and
'GI.Gtk.Interfaces.PrintOperationPreview.printOperationPreviewIsSelected'
are useful when implementing a print preview.
-}

module GI.Gtk.Objects.PrintOperation
    ( 

-- * Exported types
    PrintOperation(..)                      ,
    IsPrintOperation                        ,
    toPrintOperation                        ,
    noPrintOperation                        ,


 -- * Methods
-- ** cancel #method:cancel#
    PrintOperationCancelMethodInfo          ,
    printOperationCancel                    ,


-- ** drawPageFinish #method:drawPageFinish#
    PrintOperationDrawPageFinishMethodInfo  ,
    printOperationDrawPageFinish            ,


-- ** getDefaultPageSetup #method:getDefaultPageSetup#
    PrintOperationGetDefaultPageSetupMethodInfo,
    printOperationGetDefaultPageSetup       ,


-- ** getEmbedPageSetup #method:getEmbedPageSetup#
    PrintOperationGetEmbedPageSetupMethodInfo,
    printOperationGetEmbedPageSetup         ,


-- ** getError #method:getError#
    PrintOperationGetErrorMethodInfo        ,
    printOperationGetError                  ,


-- ** getHasSelection #method:getHasSelection#
    PrintOperationGetHasSelectionMethodInfo ,
    printOperationGetHasSelection           ,


-- ** getNPagesToPrint #method:getNPagesToPrint#
    PrintOperationGetNPagesToPrintMethodInfo,
    printOperationGetNPagesToPrint          ,


-- ** getPrintSettings #method:getPrintSettings#
    PrintOperationGetPrintSettingsMethodInfo,
    printOperationGetPrintSettings          ,


-- ** getStatus #method:getStatus#
    PrintOperationGetStatusMethodInfo       ,
    printOperationGetStatus                 ,


-- ** getStatusString #method:getStatusString#
    PrintOperationGetStatusStringMethodInfo ,
    printOperationGetStatusString           ,


-- ** getSupportSelection #method:getSupportSelection#
    PrintOperationGetSupportSelectionMethodInfo,
    printOperationGetSupportSelection       ,


-- ** isFinished #method:isFinished#
    PrintOperationIsFinishedMethodInfo      ,
    printOperationIsFinished                ,


-- ** new #method:new#
    printOperationNew                       ,


-- ** run #method:run#
    PrintOperationRunMethodInfo             ,
    printOperationRun                       ,


-- ** setAllowAsync #method:setAllowAsync#
    PrintOperationSetAllowAsyncMethodInfo   ,
    printOperationSetAllowAsync             ,


-- ** setCurrentPage #method:setCurrentPage#
    PrintOperationSetCurrentPageMethodInfo  ,
    printOperationSetCurrentPage            ,


-- ** setCustomTabLabel #method:setCustomTabLabel#
    PrintOperationSetCustomTabLabelMethodInfo,
    printOperationSetCustomTabLabel         ,


-- ** setDefaultPageSetup #method:setDefaultPageSetup#
    PrintOperationSetDefaultPageSetupMethodInfo,
    printOperationSetDefaultPageSetup       ,


-- ** setDeferDrawing #method:setDeferDrawing#
    PrintOperationSetDeferDrawingMethodInfo ,
    printOperationSetDeferDrawing           ,


-- ** setEmbedPageSetup #method:setEmbedPageSetup#
    PrintOperationSetEmbedPageSetupMethodInfo,
    printOperationSetEmbedPageSetup         ,


-- ** setExportFilename #method:setExportFilename#
    PrintOperationSetExportFilenameMethodInfo,
    printOperationSetExportFilename         ,


-- ** setHasSelection #method:setHasSelection#
    PrintOperationSetHasSelectionMethodInfo ,
    printOperationSetHasSelection           ,


-- ** setJobName #method:setJobName#
    PrintOperationSetJobNameMethodInfo      ,
    printOperationSetJobName                ,


-- ** setNPages #method:setNPages#
    PrintOperationSetNPagesMethodInfo       ,
    printOperationSetNPages                 ,


-- ** setPrintSettings #method:setPrintSettings#
    PrintOperationSetPrintSettingsMethodInfo,
    printOperationSetPrintSettings          ,


-- ** setShowProgress #method:setShowProgress#
    PrintOperationSetShowProgressMethodInfo ,
    printOperationSetShowProgress           ,


-- ** setSupportSelection #method:setSupportSelection#
    PrintOperationSetSupportSelectionMethodInfo,
    printOperationSetSupportSelection       ,


-- ** setTrackPrintStatus #method:setTrackPrintStatus#
    PrintOperationSetTrackPrintStatusMethodInfo,
    printOperationSetTrackPrintStatus       ,


-- ** setUnit #method:setUnit#
    PrintOperationSetUnitMethodInfo         ,
    printOperationSetUnit                   ,


-- ** setUseFullPage #method:setUseFullPage#
    PrintOperationSetUseFullPageMethodInfo  ,
    printOperationSetUseFullPage            ,




 -- * Properties
-- ** allowAsync #attr:allowAsync#
    PrintOperationAllowAsyncPropertyInfo    ,
    constructPrintOperationAllowAsync       ,
    getPrintOperationAllowAsync             ,
    printOperationAllowAsync                ,
    setPrintOperationAllowAsync             ,


-- ** currentPage #attr:currentPage#
    PrintOperationCurrentPagePropertyInfo   ,
    constructPrintOperationCurrentPage      ,
    getPrintOperationCurrentPage            ,
    printOperationCurrentPage               ,
    setPrintOperationCurrentPage            ,


-- ** customTabLabel #attr:customTabLabel#
    PrintOperationCustomTabLabelPropertyInfo,
    clearPrintOperationCustomTabLabel       ,
    constructPrintOperationCustomTabLabel   ,
    getPrintOperationCustomTabLabel         ,
    printOperationCustomTabLabel            ,
    setPrintOperationCustomTabLabel         ,


-- ** defaultPageSetup #attr:defaultPageSetup#
    PrintOperationDefaultPageSetupPropertyInfo,
    clearPrintOperationDefaultPageSetup     ,
    constructPrintOperationDefaultPageSetup ,
    getPrintOperationDefaultPageSetup       ,
    printOperationDefaultPageSetup          ,
    setPrintOperationDefaultPageSetup       ,


-- ** embedPageSetup #attr:embedPageSetup#
    PrintOperationEmbedPageSetupPropertyInfo,
    constructPrintOperationEmbedPageSetup   ,
    getPrintOperationEmbedPageSetup         ,
    printOperationEmbedPageSetup            ,
    setPrintOperationEmbedPageSetup         ,


-- ** exportFilename #attr:exportFilename#
    PrintOperationExportFilenamePropertyInfo,
    clearPrintOperationExportFilename       ,
    constructPrintOperationExportFilename   ,
    getPrintOperationExportFilename         ,
    printOperationExportFilename            ,
    setPrintOperationExportFilename         ,


-- ** hasSelection #attr:hasSelection#
    PrintOperationHasSelectionPropertyInfo  ,
    constructPrintOperationHasSelection     ,
    getPrintOperationHasSelection           ,
    printOperationHasSelection              ,
    setPrintOperationHasSelection           ,


-- ** jobName #attr:jobName#
    PrintOperationJobNamePropertyInfo       ,
    constructPrintOperationJobName          ,
    getPrintOperationJobName                ,
    printOperationJobName                   ,
    setPrintOperationJobName                ,


-- ** nPages #attr:nPages#
    PrintOperationNPagesPropertyInfo        ,
    constructPrintOperationNPages           ,
    getPrintOperationNPages                 ,
    printOperationNPages                    ,
    setPrintOperationNPages                 ,


-- ** nPagesToPrint #attr:nPagesToPrint#
    PrintOperationNPagesToPrintPropertyInfo ,
    getPrintOperationNPagesToPrint          ,
    printOperationNPagesToPrint             ,


-- ** printSettings #attr:printSettings#
    PrintOperationPrintSettingsPropertyInfo ,
    clearPrintOperationPrintSettings        ,
    constructPrintOperationPrintSettings    ,
    getPrintOperationPrintSettings          ,
    printOperationPrintSettings             ,
    setPrintOperationPrintSettings          ,


-- ** showProgress #attr:showProgress#
    PrintOperationShowProgressPropertyInfo  ,
    constructPrintOperationShowProgress     ,
    getPrintOperationShowProgress           ,
    printOperationShowProgress              ,
    setPrintOperationShowProgress           ,


-- ** status #attr:status#
    PrintOperationStatusPropertyInfo        ,
    getPrintOperationStatus                 ,
    printOperationStatus                    ,


-- ** statusString #attr:statusString#
    PrintOperationStatusStringPropertyInfo  ,
    getPrintOperationStatusString           ,
    printOperationStatusString              ,


-- ** supportSelection #attr:supportSelection#
    PrintOperationSupportSelectionPropertyInfo,
    constructPrintOperationSupportSelection ,
    getPrintOperationSupportSelection       ,
    printOperationSupportSelection          ,
    setPrintOperationSupportSelection       ,


-- ** trackPrintStatus #attr:trackPrintStatus#
    PrintOperationTrackPrintStatusPropertyInfo,
    constructPrintOperationTrackPrintStatus ,
    getPrintOperationTrackPrintStatus       ,
    printOperationTrackPrintStatus          ,
    setPrintOperationTrackPrintStatus       ,


-- ** unit #attr:unit#
    PrintOperationUnitPropertyInfo          ,
    constructPrintOperationUnit             ,
    getPrintOperationUnit                   ,
    printOperationUnit                      ,
    setPrintOperationUnit                   ,


-- ** useFullPage #attr:useFullPage#
    PrintOperationUseFullPagePropertyInfo   ,
    constructPrintOperationUseFullPage      ,
    getPrintOperationUseFullPage            ,
    printOperationUseFullPage               ,
    setPrintOperationUseFullPage            ,




 -- * Signals
-- ** beginPrint #signal:beginPrint#
    C_PrintOperationBeginPrintCallback      ,
    PrintOperationBeginPrintCallback        ,
    PrintOperationBeginPrintSignalInfo      ,
    afterPrintOperationBeginPrint           ,
    genClosure_PrintOperationBeginPrint     ,
    mk_PrintOperationBeginPrintCallback     ,
    noPrintOperationBeginPrintCallback      ,
    onPrintOperationBeginPrint              ,
    wrap_PrintOperationBeginPrintCallback   ,


-- ** createCustomWidget #signal:createCustomWidget#
    C_PrintOperationCreateCustomWidgetCallback,
    PrintOperationCreateCustomWidgetCallback,
    PrintOperationCreateCustomWidgetSignalInfo,
    afterPrintOperationCreateCustomWidget   ,
    genClosure_PrintOperationCreateCustomWidget,
    mk_PrintOperationCreateCustomWidgetCallback,
    noPrintOperationCreateCustomWidgetCallback,
    onPrintOperationCreateCustomWidget      ,
    wrap_PrintOperationCreateCustomWidgetCallback,


-- ** customWidgetApply #signal:customWidgetApply#
    C_PrintOperationCustomWidgetApplyCallback,
    PrintOperationCustomWidgetApplyCallback ,
    PrintOperationCustomWidgetApplySignalInfo,
    afterPrintOperationCustomWidgetApply    ,
    genClosure_PrintOperationCustomWidgetApply,
    mk_PrintOperationCustomWidgetApplyCallback,
    noPrintOperationCustomWidgetApplyCallback,
    onPrintOperationCustomWidgetApply       ,
    wrap_PrintOperationCustomWidgetApplyCallback,


-- ** done #signal:done#
    C_PrintOperationDoneCallback            ,
    PrintOperationDoneCallback              ,
    PrintOperationDoneSignalInfo            ,
    afterPrintOperationDone                 ,
    genClosure_PrintOperationDone           ,
    mk_PrintOperationDoneCallback           ,
    noPrintOperationDoneCallback            ,
    onPrintOperationDone                    ,
    wrap_PrintOperationDoneCallback         ,


-- ** drawPage #signal:drawPage#
    C_PrintOperationDrawPageCallback        ,
    PrintOperationDrawPageCallback          ,
    PrintOperationDrawPageSignalInfo        ,
    afterPrintOperationDrawPage             ,
    genClosure_PrintOperationDrawPage       ,
    mk_PrintOperationDrawPageCallback       ,
    noPrintOperationDrawPageCallback        ,
    onPrintOperationDrawPage                ,
    wrap_PrintOperationDrawPageCallback     ,


-- ** endPrint #signal:endPrint#
    C_PrintOperationEndPrintCallback        ,
    PrintOperationEndPrintCallback          ,
    PrintOperationEndPrintSignalInfo        ,
    afterPrintOperationEndPrint             ,
    genClosure_PrintOperationEndPrint       ,
    mk_PrintOperationEndPrintCallback       ,
    noPrintOperationEndPrintCallback        ,
    onPrintOperationEndPrint                ,
    wrap_PrintOperationEndPrintCallback     ,


-- ** paginate #signal:paginate#
    C_PrintOperationPaginateCallback        ,
    PrintOperationPaginateCallback          ,
    PrintOperationPaginateSignalInfo        ,
    afterPrintOperationPaginate             ,
    genClosure_PrintOperationPaginate       ,
    mk_PrintOperationPaginateCallback       ,
    noPrintOperationPaginateCallback        ,
    onPrintOperationPaginate                ,
    wrap_PrintOperationPaginateCallback     ,


-- ** preview #signal:preview#
    C_PrintOperationPreviewCallback         ,
    PrintOperationPreviewCallback           ,
    PrintOperationPreviewSignalInfo         ,
    afterPrintOperationPreview              ,
    genClosure_PrintOperationPreview        ,
    mk_PrintOperationPreviewCallback        ,
    noPrintOperationPreviewCallback         ,
    onPrintOperationPreview                 ,
    wrap_PrintOperationPreviewCallback      ,


-- ** requestPageSetup #signal:requestPageSetup#
    C_PrintOperationRequestPageSetupCallback,
    PrintOperationRequestPageSetupCallback  ,
    PrintOperationRequestPageSetupSignalInfo,
    afterPrintOperationRequestPageSetup     ,
    genClosure_PrintOperationRequestPageSetup,
    mk_PrintOperationRequestPageSetupCallback,
    noPrintOperationRequestPageSetupCallback,
    onPrintOperationRequestPageSetup        ,
    wrap_PrintOperationRequestPageSetupCallback,


-- ** statusChanged #signal:statusChanged#
    C_PrintOperationStatusChangedCallback   ,
    PrintOperationStatusChangedCallback     ,
    PrintOperationStatusChangedSignalInfo   ,
    afterPrintOperationStatusChanged        ,
    genClosure_PrintOperationStatusChanged  ,
    mk_PrintOperationStatusChangedCallback  ,
    noPrintOperationStatusChangedCallback   ,
    onPrintOperationStatusChanged           ,
    wrap_PrintOperationStatusChangedCallback,


-- ** updateCustomWidget #signal:updateCustomWidget#
    C_PrintOperationUpdateCustomWidgetCallback,
    PrintOperationUpdateCustomWidgetCallback,
    PrintOperationUpdateCustomWidgetSignalInfo,
    afterPrintOperationUpdateCustomWidget   ,
    genClosure_PrintOperationUpdateCustomWidget,
    mk_PrintOperationUpdateCustomWidgetCallback,
    noPrintOperationUpdateCustomWidgetCallback,
    onPrintOperationUpdateCustomWidget      ,
    wrap_PrintOperationUpdateCustomWidgetCallback,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.PrintOperationPreview as Gtk.PrintOperationPreview
import {-# SOURCE #-} qualified GI.Gtk.Objects.PageSetup as Gtk.PageSetup
import {-# SOURCE #-} qualified GI.Gtk.Objects.PrintContext as Gtk.PrintContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.PrintSettings as Gtk.PrintSettings
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
import {-# SOURCE #-} qualified GI.Gtk.Objects.Window as Gtk.Window

newtype PrintOperation = PrintOperation (ManagedPtr PrintOperation)
foreign import ccall "gtk_print_operation_get_type"
    c_gtk_print_operation_get_type :: IO GType

instance GObject PrintOperation where
    gobjectType _ = c_gtk_print_operation_get_type
    

class GObject o => IsPrintOperation o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError PrintOperation a) =>
    IsPrintOperation a
#endif
instance IsPrintOperation PrintOperation
instance GObject.Object.IsObject PrintOperation
instance Gtk.PrintOperationPreview.IsPrintOperationPreview PrintOperation

toPrintOperation :: IsPrintOperation o => o -> IO PrintOperation
toPrintOperation = unsafeCastTo PrintOperation

noPrintOperation :: Maybe PrintOperation
noPrintOperation = Nothing

type family ResolvePrintOperationMethod (t :: Symbol) (o :: *) :: * where
    ResolvePrintOperationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolvePrintOperationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolvePrintOperationMethod "cancel" o = PrintOperationCancelMethodInfo
    ResolvePrintOperationMethod "drawPageFinish" o = PrintOperationDrawPageFinishMethodInfo
    ResolvePrintOperationMethod "endPreview" o = Gtk.PrintOperationPreview.PrintOperationPreviewEndPreviewMethodInfo
    ResolvePrintOperationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolvePrintOperationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolvePrintOperationMethod "isFinished" o = PrintOperationIsFinishedMethodInfo
    ResolvePrintOperationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolvePrintOperationMethod "isSelected" o = Gtk.PrintOperationPreview.PrintOperationPreviewIsSelectedMethodInfo
    ResolvePrintOperationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolvePrintOperationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolvePrintOperationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolvePrintOperationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolvePrintOperationMethod "renderPage" o = Gtk.PrintOperationPreview.PrintOperationPreviewRenderPageMethodInfo
    ResolvePrintOperationMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolvePrintOperationMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolvePrintOperationMethod "run" o = PrintOperationRunMethodInfo
    ResolvePrintOperationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolvePrintOperationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolvePrintOperationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolvePrintOperationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolvePrintOperationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolvePrintOperationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolvePrintOperationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolvePrintOperationMethod "getDefaultPageSetup" o = PrintOperationGetDefaultPageSetupMethodInfo
    ResolvePrintOperationMethod "getEmbedPageSetup" o = PrintOperationGetEmbedPageSetupMethodInfo
    ResolvePrintOperationMethod "getError" o = PrintOperationGetErrorMethodInfo
    ResolvePrintOperationMethod "getHasSelection" o = PrintOperationGetHasSelectionMethodInfo
    ResolvePrintOperationMethod "getNPagesToPrint" o = PrintOperationGetNPagesToPrintMethodInfo
    ResolvePrintOperationMethod "getPrintSettings" o = PrintOperationGetPrintSettingsMethodInfo
    ResolvePrintOperationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolvePrintOperationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolvePrintOperationMethod "getStatus" o = PrintOperationGetStatusMethodInfo
    ResolvePrintOperationMethod "getStatusString" o = PrintOperationGetStatusStringMethodInfo
    ResolvePrintOperationMethod "getSupportSelection" o = PrintOperationGetSupportSelectionMethodInfo
    ResolvePrintOperationMethod "setAllowAsync" o = PrintOperationSetAllowAsyncMethodInfo
    ResolvePrintOperationMethod "setCurrentPage" o = PrintOperationSetCurrentPageMethodInfo
    ResolvePrintOperationMethod "setCustomTabLabel" o = PrintOperationSetCustomTabLabelMethodInfo
    ResolvePrintOperationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolvePrintOperationMethod "setDefaultPageSetup" o = PrintOperationSetDefaultPageSetupMethodInfo
    ResolvePrintOperationMethod "setDeferDrawing" o = PrintOperationSetDeferDrawingMethodInfo
    ResolvePrintOperationMethod "setEmbedPageSetup" o = PrintOperationSetEmbedPageSetupMethodInfo
    ResolvePrintOperationMethod "setExportFilename" o = PrintOperationSetExportFilenameMethodInfo
    ResolvePrintOperationMethod "setHasSelection" o = PrintOperationSetHasSelectionMethodInfo
    ResolvePrintOperationMethod "setJobName" o = PrintOperationSetJobNameMethodInfo
    ResolvePrintOperationMethod "setNPages" o = PrintOperationSetNPagesMethodInfo
    ResolvePrintOperationMethod "setPrintSettings" o = PrintOperationSetPrintSettingsMethodInfo
    ResolvePrintOperationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolvePrintOperationMethod "setShowProgress" o = PrintOperationSetShowProgressMethodInfo
    ResolvePrintOperationMethod "setSupportSelection" o = PrintOperationSetSupportSelectionMethodInfo
    ResolvePrintOperationMethod "setTrackPrintStatus" o = PrintOperationSetTrackPrintStatusMethodInfo
    ResolvePrintOperationMethod "setUnit" o = PrintOperationSetUnitMethodInfo
    ResolvePrintOperationMethod "setUseFullPage" o = PrintOperationSetUseFullPageMethodInfo
    ResolvePrintOperationMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolvePrintOperationMethod t PrintOperation, O.MethodInfo info PrintOperation p) => O.IsLabelProxy t (PrintOperation -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolvePrintOperationMethod t PrintOperation, O.MethodInfo info PrintOperation p) => O.IsLabel t (PrintOperation -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- signal PrintOperation::begin-print
type PrintOperationBeginPrintCallback =
    Gtk.PrintContext.PrintContext ->
    IO ()

noPrintOperationBeginPrintCallback :: Maybe PrintOperationBeginPrintCallback
noPrintOperationBeginPrintCallback = Nothing

type C_PrintOperationBeginPrintCallback =
    Ptr () ->                               -- object
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationBeginPrintCallback :: C_PrintOperationBeginPrintCallback -> IO (FunPtr C_PrintOperationBeginPrintCallback)

genClosure_PrintOperationBeginPrint :: PrintOperationBeginPrintCallback -> IO Closure
genClosure_PrintOperationBeginPrint cb = do
    let cb' = wrap_PrintOperationBeginPrintCallback cb
    mk_PrintOperationBeginPrintCallback cb' >>= newCClosure


wrap_PrintOperationBeginPrintCallback ::
    PrintOperationBeginPrintCallback ->
    Ptr () ->
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr () ->
    IO ()
wrap_PrintOperationBeginPrintCallback _cb _ context _ = do
    context' <- (newObject Gtk.PrintContext.PrintContext) context
    _cb  context'


onPrintOperationBeginPrint :: (GObject a, MonadIO m) => a -> PrintOperationBeginPrintCallback -> m SignalHandlerId
onPrintOperationBeginPrint obj cb = liftIO $ connectPrintOperationBeginPrint obj cb SignalConnectBefore
afterPrintOperationBeginPrint :: (GObject a, MonadIO m) => a -> PrintOperationBeginPrintCallback -> m SignalHandlerId
afterPrintOperationBeginPrint obj cb = connectPrintOperationBeginPrint obj cb SignalConnectAfter

connectPrintOperationBeginPrint :: (GObject a, MonadIO m) =>
                                   a -> PrintOperationBeginPrintCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationBeginPrint obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationBeginPrintCallback cb
    cb'' <- mk_PrintOperationBeginPrintCallback cb'
    connectSignalFunPtr obj "begin-print" cb'' after

-- signal PrintOperation::create-custom-widget
type PrintOperationCreateCustomWidgetCallback =
    IO GObject.Object.Object

noPrintOperationCreateCustomWidgetCallback :: Maybe PrintOperationCreateCustomWidgetCallback
noPrintOperationCreateCustomWidgetCallback = Nothing

type C_PrintOperationCreateCustomWidgetCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO (Ptr GObject.Object.Object)

foreign import ccall "wrapper"
    mk_PrintOperationCreateCustomWidgetCallback :: C_PrintOperationCreateCustomWidgetCallback -> IO (FunPtr C_PrintOperationCreateCustomWidgetCallback)

genClosure_PrintOperationCreateCustomWidget :: PrintOperationCreateCustomWidgetCallback -> IO Closure
genClosure_PrintOperationCreateCustomWidget cb = do
    let cb' = wrap_PrintOperationCreateCustomWidgetCallback cb
    mk_PrintOperationCreateCustomWidgetCallback cb' >>= newCClosure


wrap_PrintOperationCreateCustomWidgetCallback ::
    PrintOperationCreateCustomWidgetCallback ->
    Ptr () ->
    Ptr () ->
    IO (Ptr GObject.Object.Object)
wrap_PrintOperationCreateCustomWidgetCallback _cb _ _ = do
    result <- _cb 
    result' <- B.ManagedPtr.disownObject result
    return result'


onPrintOperationCreateCustomWidget :: (GObject a, MonadIO m) => a -> PrintOperationCreateCustomWidgetCallback -> m SignalHandlerId
onPrintOperationCreateCustomWidget obj cb = liftIO $ connectPrintOperationCreateCustomWidget obj cb SignalConnectBefore
afterPrintOperationCreateCustomWidget :: (GObject a, MonadIO m) => a -> PrintOperationCreateCustomWidgetCallback -> m SignalHandlerId
afterPrintOperationCreateCustomWidget obj cb = connectPrintOperationCreateCustomWidget obj cb SignalConnectAfter

connectPrintOperationCreateCustomWidget :: (GObject a, MonadIO m) =>
                                           a -> PrintOperationCreateCustomWidgetCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationCreateCustomWidget obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationCreateCustomWidgetCallback cb
    cb'' <- mk_PrintOperationCreateCustomWidgetCallback cb'
    connectSignalFunPtr obj "create-custom-widget" cb'' after

-- signal PrintOperation::custom-widget-apply
type PrintOperationCustomWidgetApplyCallback =
    Gtk.Widget.Widget ->
    IO ()

noPrintOperationCustomWidgetApplyCallback :: Maybe PrintOperationCustomWidgetApplyCallback
noPrintOperationCustomWidgetApplyCallback = Nothing

type C_PrintOperationCustomWidgetApplyCallback =
    Ptr () ->                               -- object
    Ptr Gtk.Widget.Widget ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationCustomWidgetApplyCallback :: C_PrintOperationCustomWidgetApplyCallback -> IO (FunPtr C_PrintOperationCustomWidgetApplyCallback)

genClosure_PrintOperationCustomWidgetApply :: PrintOperationCustomWidgetApplyCallback -> IO Closure
genClosure_PrintOperationCustomWidgetApply cb = do
    let cb' = wrap_PrintOperationCustomWidgetApplyCallback cb
    mk_PrintOperationCustomWidgetApplyCallback cb' >>= newCClosure


wrap_PrintOperationCustomWidgetApplyCallback ::
    PrintOperationCustomWidgetApplyCallback ->
    Ptr () ->
    Ptr Gtk.Widget.Widget ->
    Ptr () ->
    IO ()
wrap_PrintOperationCustomWidgetApplyCallback _cb _ widget _ = do
    widget' <- (newObject Gtk.Widget.Widget) widget
    _cb  widget'


onPrintOperationCustomWidgetApply :: (GObject a, MonadIO m) => a -> PrintOperationCustomWidgetApplyCallback -> m SignalHandlerId
onPrintOperationCustomWidgetApply obj cb = liftIO $ connectPrintOperationCustomWidgetApply obj cb SignalConnectBefore
afterPrintOperationCustomWidgetApply :: (GObject a, MonadIO m) => a -> PrintOperationCustomWidgetApplyCallback -> m SignalHandlerId
afterPrintOperationCustomWidgetApply obj cb = connectPrintOperationCustomWidgetApply obj cb SignalConnectAfter

connectPrintOperationCustomWidgetApply :: (GObject a, MonadIO m) =>
                                          a -> PrintOperationCustomWidgetApplyCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationCustomWidgetApply obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationCustomWidgetApplyCallback cb
    cb'' <- mk_PrintOperationCustomWidgetApplyCallback cb'
    connectSignalFunPtr obj "custom-widget-apply" cb'' after

-- signal PrintOperation::done
type PrintOperationDoneCallback =
    Gtk.Enums.PrintOperationResult ->
    IO ()

noPrintOperationDoneCallback :: Maybe PrintOperationDoneCallback
noPrintOperationDoneCallback = Nothing

type C_PrintOperationDoneCallback =
    Ptr () ->                               -- object
    CUInt ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationDoneCallback :: C_PrintOperationDoneCallback -> IO (FunPtr C_PrintOperationDoneCallback)

genClosure_PrintOperationDone :: PrintOperationDoneCallback -> IO Closure
genClosure_PrintOperationDone cb = do
    let cb' = wrap_PrintOperationDoneCallback cb
    mk_PrintOperationDoneCallback cb' >>= newCClosure


wrap_PrintOperationDoneCallback ::
    PrintOperationDoneCallback ->
    Ptr () ->
    CUInt ->
    Ptr () ->
    IO ()
wrap_PrintOperationDoneCallback _cb _ result_ _ = do
    let result_' = (toEnum . fromIntegral) result_
    _cb  result_'


onPrintOperationDone :: (GObject a, MonadIO m) => a -> PrintOperationDoneCallback -> m SignalHandlerId
onPrintOperationDone obj cb = liftIO $ connectPrintOperationDone obj cb SignalConnectBefore
afterPrintOperationDone :: (GObject a, MonadIO m) => a -> PrintOperationDoneCallback -> m SignalHandlerId
afterPrintOperationDone obj cb = connectPrintOperationDone obj cb SignalConnectAfter

connectPrintOperationDone :: (GObject a, MonadIO m) =>
                             a -> PrintOperationDoneCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationDone obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationDoneCallback cb
    cb'' <- mk_PrintOperationDoneCallback cb'
    connectSignalFunPtr obj "done" cb'' after

-- signal PrintOperation::draw-page
type PrintOperationDrawPageCallback =
    Gtk.PrintContext.PrintContext ->
    Int32 ->
    IO ()

noPrintOperationDrawPageCallback :: Maybe PrintOperationDrawPageCallback
noPrintOperationDrawPageCallback = Nothing

type C_PrintOperationDrawPageCallback =
    Ptr () ->                               -- object
    Ptr Gtk.PrintContext.PrintContext ->
    Int32 ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationDrawPageCallback :: C_PrintOperationDrawPageCallback -> IO (FunPtr C_PrintOperationDrawPageCallback)

genClosure_PrintOperationDrawPage :: PrintOperationDrawPageCallback -> IO Closure
genClosure_PrintOperationDrawPage cb = do
    let cb' = wrap_PrintOperationDrawPageCallback cb
    mk_PrintOperationDrawPageCallback cb' >>= newCClosure


wrap_PrintOperationDrawPageCallback ::
    PrintOperationDrawPageCallback ->
    Ptr () ->
    Ptr Gtk.PrintContext.PrintContext ->
    Int32 ->
    Ptr () ->
    IO ()
wrap_PrintOperationDrawPageCallback _cb _ context pageNr _ = do
    context' <- (newObject Gtk.PrintContext.PrintContext) context
    _cb  context' pageNr


onPrintOperationDrawPage :: (GObject a, MonadIO m) => a -> PrintOperationDrawPageCallback -> m SignalHandlerId
onPrintOperationDrawPage obj cb = liftIO $ connectPrintOperationDrawPage obj cb SignalConnectBefore
afterPrintOperationDrawPage :: (GObject a, MonadIO m) => a -> PrintOperationDrawPageCallback -> m SignalHandlerId
afterPrintOperationDrawPage obj cb = connectPrintOperationDrawPage obj cb SignalConnectAfter

connectPrintOperationDrawPage :: (GObject a, MonadIO m) =>
                                 a -> PrintOperationDrawPageCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationDrawPage obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationDrawPageCallback cb
    cb'' <- mk_PrintOperationDrawPageCallback cb'
    connectSignalFunPtr obj "draw-page" cb'' after

-- signal PrintOperation::end-print
type PrintOperationEndPrintCallback =
    Gtk.PrintContext.PrintContext ->
    IO ()

noPrintOperationEndPrintCallback :: Maybe PrintOperationEndPrintCallback
noPrintOperationEndPrintCallback = Nothing

type C_PrintOperationEndPrintCallback =
    Ptr () ->                               -- object
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationEndPrintCallback :: C_PrintOperationEndPrintCallback -> IO (FunPtr C_PrintOperationEndPrintCallback)

genClosure_PrintOperationEndPrint :: PrintOperationEndPrintCallback -> IO Closure
genClosure_PrintOperationEndPrint cb = do
    let cb' = wrap_PrintOperationEndPrintCallback cb
    mk_PrintOperationEndPrintCallback cb' >>= newCClosure


wrap_PrintOperationEndPrintCallback ::
    PrintOperationEndPrintCallback ->
    Ptr () ->
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr () ->
    IO ()
wrap_PrintOperationEndPrintCallback _cb _ context _ = do
    context' <- (newObject Gtk.PrintContext.PrintContext) context
    _cb  context'


onPrintOperationEndPrint :: (GObject a, MonadIO m) => a -> PrintOperationEndPrintCallback -> m SignalHandlerId
onPrintOperationEndPrint obj cb = liftIO $ connectPrintOperationEndPrint obj cb SignalConnectBefore
afterPrintOperationEndPrint :: (GObject a, MonadIO m) => a -> PrintOperationEndPrintCallback -> m SignalHandlerId
afterPrintOperationEndPrint obj cb = connectPrintOperationEndPrint obj cb SignalConnectAfter

connectPrintOperationEndPrint :: (GObject a, MonadIO m) =>
                                 a -> PrintOperationEndPrintCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationEndPrint obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationEndPrintCallback cb
    cb'' <- mk_PrintOperationEndPrintCallback cb'
    connectSignalFunPtr obj "end-print" cb'' after

-- signal PrintOperation::paginate
type PrintOperationPaginateCallback =
    Gtk.PrintContext.PrintContext ->
    IO Bool

noPrintOperationPaginateCallback :: Maybe PrintOperationPaginateCallback
noPrintOperationPaginateCallback = Nothing

type C_PrintOperationPaginateCallback =
    Ptr () ->                               -- object
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_PrintOperationPaginateCallback :: C_PrintOperationPaginateCallback -> IO (FunPtr C_PrintOperationPaginateCallback)

genClosure_PrintOperationPaginate :: PrintOperationPaginateCallback -> IO Closure
genClosure_PrintOperationPaginate cb = do
    let cb' = wrap_PrintOperationPaginateCallback cb
    mk_PrintOperationPaginateCallback cb' >>= newCClosure


wrap_PrintOperationPaginateCallback ::
    PrintOperationPaginateCallback ->
    Ptr () ->
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr () ->
    IO CInt
wrap_PrintOperationPaginateCallback _cb _ context _ = do
    context' <- (newObject Gtk.PrintContext.PrintContext) context
    result <- _cb  context'
    let result' = (fromIntegral . fromEnum) result
    return result'


onPrintOperationPaginate :: (GObject a, MonadIO m) => a -> PrintOperationPaginateCallback -> m SignalHandlerId
onPrintOperationPaginate obj cb = liftIO $ connectPrintOperationPaginate obj cb SignalConnectBefore
afterPrintOperationPaginate :: (GObject a, MonadIO m) => a -> PrintOperationPaginateCallback -> m SignalHandlerId
afterPrintOperationPaginate obj cb = connectPrintOperationPaginate obj cb SignalConnectAfter

connectPrintOperationPaginate :: (GObject a, MonadIO m) =>
                                 a -> PrintOperationPaginateCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationPaginate obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationPaginateCallback cb
    cb'' <- mk_PrintOperationPaginateCallback cb'
    connectSignalFunPtr obj "paginate" cb'' after

-- signal PrintOperation::preview
type PrintOperationPreviewCallback =
    Gtk.PrintOperationPreview.PrintOperationPreview ->
    Gtk.PrintContext.PrintContext ->
    Maybe Gtk.Window.Window ->
    IO Bool

noPrintOperationPreviewCallback :: Maybe PrintOperationPreviewCallback
noPrintOperationPreviewCallback = Nothing

type C_PrintOperationPreviewCallback =
    Ptr () ->                               -- object
    Ptr Gtk.PrintOperationPreview.PrintOperationPreview ->
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr Gtk.Window.Window ->
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_PrintOperationPreviewCallback :: C_PrintOperationPreviewCallback -> IO (FunPtr C_PrintOperationPreviewCallback)

genClosure_PrintOperationPreview :: PrintOperationPreviewCallback -> IO Closure
genClosure_PrintOperationPreview cb = do
    let cb' = wrap_PrintOperationPreviewCallback cb
    mk_PrintOperationPreviewCallback cb' >>= newCClosure


wrap_PrintOperationPreviewCallback ::
    PrintOperationPreviewCallback ->
    Ptr () ->
    Ptr Gtk.PrintOperationPreview.PrintOperationPreview ->
    Ptr Gtk.PrintContext.PrintContext ->
    Ptr Gtk.Window.Window ->
    Ptr () ->
    IO CInt
wrap_PrintOperationPreviewCallback _cb _ preview context parent _ = do
    preview' <- (newObject Gtk.PrintOperationPreview.PrintOperationPreview) preview
    context' <- (newObject Gtk.PrintContext.PrintContext) context
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gtk.Window.Window) parent
            return $ Just parent'
    result <- _cb  preview' context' maybeParent
    let result' = (fromIntegral . fromEnum) result
    return result'


onPrintOperationPreview :: (GObject a, MonadIO m) => a -> PrintOperationPreviewCallback -> m SignalHandlerId
onPrintOperationPreview obj cb = liftIO $ connectPrintOperationPreview obj cb SignalConnectBefore
afterPrintOperationPreview :: (GObject a, MonadIO m) => a -> PrintOperationPreviewCallback -> m SignalHandlerId
afterPrintOperationPreview obj cb = connectPrintOperationPreview obj cb SignalConnectAfter

connectPrintOperationPreview :: (GObject a, MonadIO m) =>
                                a -> PrintOperationPreviewCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationPreview obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationPreviewCallback cb
    cb'' <- mk_PrintOperationPreviewCallback cb'
    connectSignalFunPtr obj "preview" cb'' after

-- signal PrintOperation::request-page-setup
type PrintOperationRequestPageSetupCallback =
    Gtk.PrintContext.PrintContext ->
    Int32 ->
    Gtk.PageSetup.PageSetup ->
    IO ()

noPrintOperationRequestPageSetupCallback :: Maybe PrintOperationRequestPageSetupCallback
noPrintOperationRequestPageSetupCallback = Nothing

type C_PrintOperationRequestPageSetupCallback =
    Ptr () ->                               -- object
    Ptr Gtk.PrintContext.PrintContext ->
    Int32 ->
    Ptr Gtk.PageSetup.PageSetup ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationRequestPageSetupCallback :: C_PrintOperationRequestPageSetupCallback -> IO (FunPtr C_PrintOperationRequestPageSetupCallback)

genClosure_PrintOperationRequestPageSetup :: PrintOperationRequestPageSetupCallback -> IO Closure
genClosure_PrintOperationRequestPageSetup cb = do
    let cb' = wrap_PrintOperationRequestPageSetupCallback cb
    mk_PrintOperationRequestPageSetupCallback cb' >>= newCClosure


wrap_PrintOperationRequestPageSetupCallback ::
    PrintOperationRequestPageSetupCallback ->
    Ptr () ->
    Ptr Gtk.PrintContext.PrintContext ->
    Int32 ->
    Ptr Gtk.PageSetup.PageSetup ->
    Ptr () ->
    IO ()
wrap_PrintOperationRequestPageSetupCallback _cb _ context pageNr setup _ = do
    context' <- (newObject Gtk.PrintContext.PrintContext) context
    setup' <- (newObject Gtk.PageSetup.PageSetup) setup
    _cb  context' pageNr setup'


onPrintOperationRequestPageSetup :: (GObject a, MonadIO m) => a -> PrintOperationRequestPageSetupCallback -> m SignalHandlerId
onPrintOperationRequestPageSetup obj cb = liftIO $ connectPrintOperationRequestPageSetup obj cb SignalConnectBefore
afterPrintOperationRequestPageSetup :: (GObject a, MonadIO m) => a -> PrintOperationRequestPageSetupCallback -> m SignalHandlerId
afterPrintOperationRequestPageSetup obj cb = connectPrintOperationRequestPageSetup obj cb SignalConnectAfter

connectPrintOperationRequestPageSetup :: (GObject a, MonadIO m) =>
                                         a -> PrintOperationRequestPageSetupCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationRequestPageSetup obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationRequestPageSetupCallback cb
    cb'' <- mk_PrintOperationRequestPageSetupCallback cb'
    connectSignalFunPtr obj "request-page-setup" cb'' after

-- signal PrintOperation::status-changed
type PrintOperationStatusChangedCallback =
    IO ()

noPrintOperationStatusChangedCallback :: Maybe PrintOperationStatusChangedCallback
noPrintOperationStatusChangedCallback = Nothing

type C_PrintOperationStatusChangedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationStatusChangedCallback :: C_PrintOperationStatusChangedCallback -> IO (FunPtr C_PrintOperationStatusChangedCallback)

genClosure_PrintOperationStatusChanged :: PrintOperationStatusChangedCallback -> IO Closure
genClosure_PrintOperationStatusChanged cb = do
    let cb' = wrap_PrintOperationStatusChangedCallback cb
    mk_PrintOperationStatusChangedCallback cb' >>= newCClosure


wrap_PrintOperationStatusChangedCallback ::
    PrintOperationStatusChangedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_PrintOperationStatusChangedCallback _cb _ _ = do
    _cb 


onPrintOperationStatusChanged :: (GObject a, MonadIO m) => a -> PrintOperationStatusChangedCallback -> m SignalHandlerId
onPrintOperationStatusChanged obj cb = liftIO $ connectPrintOperationStatusChanged obj cb SignalConnectBefore
afterPrintOperationStatusChanged :: (GObject a, MonadIO m) => a -> PrintOperationStatusChangedCallback -> m SignalHandlerId
afterPrintOperationStatusChanged obj cb = connectPrintOperationStatusChanged obj cb SignalConnectAfter

connectPrintOperationStatusChanged :: (GObject a, MonadIO m) =>
                                      a -> PrintOperationStatusChangedCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationStatusChanged obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationStatusChangedCallback cb
    cb'' <- mk_PrintOperationStatusChangedCallback cb'
    connectSignalFunPtr obj "status-changed" cb'' after

-- signal PrintOperation::update-custom-widget
type PrintOperationUpdateCustomWidgetCallback =
    Gtk.Widget.Widget ->
    Gtk.PageSetup.PageSetup ->
    Gtk.PrintSettings.PrintSettings ->
    IO ()

noPrintOperationUpdateCustomWidgetCallback :: Maybe PrintOperationUpdateCustomWidgetCallback
noPrintOperationUpdateCustomWidgetCallback = Nothing

type C_PrintOperationUpdateCustomWidgetCallback =
    Ptr () ->                               -- object
    Ptr Gtk.Widget.Widget ->
    Ptr Gtk.PageSetup.PageSetup ->
    Ptr Gtk.PrintSettings.PrintSettings ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PrintOperationUpdateCustomWidgetCallback :: C_PrintOperationUpdateCustomWidgetCallback -> IO (FunPtr C_PrintOperationUpdateCustomWidgetCallback)

genClosure_PrintOperationUpdateCustomWidget :: PrintOperationUpdateCustomWidgetCallback -> IO Closure
genClosure_PrintOperationUpdateCustomWidget cb = do
    let cb' = wrap_PrintOperationUpdateCustomWidgetCallback cb
    mk_PrintOperationUpdateCustomWidgetCallback cb' >>= newCClosure


wrap_PrintOperationUpdateCustomWidgetCallback ::
    PrintOperationUpdateCustomWidgetCallback ->
    Ptr () ->
    Ptr Gtk.Widget.Widget ->
    Ptr Gtk.PageSetup.PageSetup ->
    Ptr Gtk.PrintSettings.PrintSettings ->
    Ptr () ->
    IO ()
wrap_PrintOperationUpdateCustomWidgetCallback _cb _ widget setup settings _ = do
    widget' <- (newObject Gtk.Widget.Widget) widget
    setup' <- (newObject Gtk.PageSetup.PageSetup) setup
    settings' <- (newObject Gtk.PrintSettings.PrintSettings) settings
    _cb  widget' setup' settings'


onPrintOperationUpdateCustomWidget :: (GObject a, MonadIO m) => a -> PrintOperationUpdateCustomWidgetCallback -> m SignalHandlerId
onPrintOperationUpdateCustomWidget obj cb = liftIO $ connectPrintOperationUpdateCustomWidget obj cb SignalConnectBefore
afterPrintOperationUpdateCustomWidget :: (GObject a, MonadIO m) => a -> PrintOperationUpdateCustomWidgetCallback -> m SignalHandlerId
afterPrintOperationUpdateCustomWidget obj cb = connectPrintOperationUpdateCustomWidget obj cb SignalConnectAfter

connectPrintOperationUpdateCustomWidget :: (GObject a, MonadIO m) =>
                                           a -> PrintOperationUpdateCustomWidgetCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationUpdateCustomWidget obj cb after = liftIO $ do
    let cb' = wrap_PrintOperationUpdateCustomWidgetCallback cb
    cb'' <- mk_PrintOperationUpdateCustomWidgetCallback cb'
    connectSignalFunPtr obj "update-custom-widget" cb'' after

-- VVV Prop "allow-async"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationAllowAsync :: (MonadIO m, IsPrintOperation o) => o -> m Bool
getPrintOperationAllowAsync obj = liftIO $ getObjectPropertyBool obj "allow-async"

setPrintOperationAllowAsync :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
setPrintOperationAllowAsync obj val = liftIO $ setObjectPropertyBool obj "allow-async" val

constructPrintOperationAllowAsync :: (IsPrintOperation o) => Bool -> IO (GValueConstruct o)
constructPrintOperationAllowAsync val = constructObjectPropertyBool "allow-async" val

data PrintOperationAllowAsyncPropertyInfo
instance AttrInfo PrintOperationAllowAsyncPropertyInfo where
    type AttrAllowedOps PrintOperationAllowAsyncPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationAllowAsyncPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint PrintOperationAllowAsyncPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationAllowAsyncPropertyInfo = Bool
    type AttrLabel PrintOperationAllowAsyncPropertyInfo = "allow-async"
    type AttrOrigin PrintOperationAllowAsyncPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationAllowAsync
    attrSet _ = setPrintOperationAllowAsync
    attrConstruct _ = constructPrintOperationAllowAsync
    attrClear _ = undefined

-- VVV Prop "current-page"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationCurrentPage :: (MonadIO m, IsPrintOperation o) => o -> m Int32
getPrintOperationCurrentPage obj = liftIO $ getObjectPropertyInt32 obj "current-page"

setPrintOperationCurrentPage :: (MonadIO m, IsPrintOperation o) => o -> Int32 -> m ()
setPrintOperationCurrentPage obj val = liftIO $ setObjectPropertyInt32 obj "current-page" val

constructPrintOperationCurrentPage :: (IsPrintOperation o) => Int32 -> IO (GValueConstruct o)
constructPrintOperationCurrentPage val = constructObjectPropertyInt32 "current-page" val

data PrintOperationCurrentPagePropertyInfo
instance AttrInfo PrintOperationCurrentPagePropertyInfo where
    type AttrAllowedOps PrintOperationCurrentPagePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationCurrentPagePropertyInfo = (~) Int32
    type AttrBaseTypeConstraint PrintOperationCurrentPagePropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationCurrentPagePropertyInfo = Int32
    type AttrLabel PrintOperationCurrentPagePropertyInfo = "current-page"
    type AttrOrigin PrintOperationCurrentPagePropertyInfo = PrintOperation
    attrGet _ = getPrintOperationCurrentPage
    attrSet _ = setPrintOperationCurrentPage
    attrConstruct _ = constructPrintOperationCurrentPage
    attrClear _ = undefined

-- VVV Prop "custom-tab-label"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just True)

getPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe T.Text)
getPrintOperationCustomTabLabel obj = liftIO $ getObjectPropertyString obj "custom-tab-label"

setPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> T.Text -> m ()
setPrintOperationCustomTabLabel obj val = liftIO $ setObjectPropertyString obj "custom-tab-label" (Just val)

constructPrintOperationCustomTabLabel :: (IsPrintOperation o) => T.Text -> IO (GValueConstruct o)
constructPrintOperationCustomTabLabel val = constructObjectPropertyString "custom-tab-label" (Just val)

clearPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> m ()
clearPrintOperationCustomTabLabel obj = liftIO $ setObjectPropertyString obj "custom-tab-label" (Nothing :: Maybe T.Text)

data PrintOperationCustomTabLabelPropertyInfo
instance AttrInfo PrintOperationCustomTabLabelPropertyInfo where
    type AttrAllowedOps PrintOperationCustomTabLabelPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint PrintOperationCustomTabLabelPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint PrintOperationCustomTabLabelPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationCustomTabLabelPropertyInfo = (Maybe T.Text)
    type AttrLabel PrintOperationCustomTabLabelPropertyInfo = "custom-tab-label"
    type AttrOrigin PrintOperationCustomTabLabelPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationCustomTabLabel
    attrSet _ = setPrintOperationCustomTabLabel
    attrConstruct _ = constructPrintOperationCustomTabLabel
    attrClear _ = clearPrintOperationCustomTabLabel

-- VVV Prop "default-page-setup"
   -- Type: TInterface (Name {namespace = "Gtk", name = "PageSetup"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just True)

getPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m Gtk.PageSetup.PageSetup
getPrintOperationDefaultPageSetup obj = liftIO $ checkUnexpectedNothing "getPrintOperationDefaultPageSetup" $ getObjectPropertyObject obj "default-page-setup" Gtk.PageSetup.PageSetup

setPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o, Gtk.PageSetup.IsPageSetup a) => o -> a -> m ()
setPrintOperationDefaultPageSetup obj val = liftIO $ setObjectPropertyObject obj "default-page-setup" (Just val)

constructPrintOperationDefaultPageSetup :: (IsPrintOperation o, Gtk.PageSetup.IsPageSetup a) => a -> IO (GValueConstruct o)
constructPrintOperationDefaultPageSetup val = constructObjectPropertyObject "default-page-setup" (Just val)

clearPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m ()
clearPrintOperationDefaultPageSetup obj = liftIO $ setObjectPropertyObject obj "default-page-setup" (Nothing :: Maybe Gtk.PageSetup.PageSetup)

data PrintOperationDefaultPageSetupPropertyInfo
instance AttrInfo PrintOperationDefaultPageSetupPropertyInfo where
    type AttrAllowedOps PrintOperationDefaultPageSetupPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint PrintOperationDefaultPageSetupPropertyInfo = Gtk.PageSetup.IsPageSetup
    type AttrBaseTypeConstraint PrintOperationDefaultPageSetupPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationDefaultPageSetupPropertyInfo = Gtk.PageSetup.PageSetup
    type AttrLabel PrintOperationDefaultPageSetupPropertyInfo = "default-page-setup"
    type AttrOrigin PrintOperationDefaultPageSetupPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationDefaultPageSetup
    attrSet _ = setPrintOperationDefaultPageSetup
    attrConstruct _ = constructPrintOperationDefaultPageSetup
    attrClear _ = clearPrintOperationDefaultPageSetup

-- VVV Prop "embed-page-setup"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getPrintOperationEmbedPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m Bool
getPrintOperationEmbedPageSetup obj = liftIO $ getObjectPropertyBool obj "embed-page-setup"

setPrintOperationEmbedPageSetup :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
setPrintOperationEmbedPageSetup obj val = liftIO $ setObjectPropertyBool obj "embed-page-setup" val

constructPrintOperationEmbedPageSetup :: (IsPrintOperation o) => Bool -> IO (GValueConstruct o)
constructPrintOperationEmbedPageSetup val = constructObjectPropertyBool "embed-page-setup" val

data PrintOperationEmbedPageSetupPropertyInfo
instance AttrInfo PrintOperationEmbedPageSetupPropertyInfo where
    type AttrAllowedOps PrintOperationEmbedPageSetupPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationEmbedPageSetupPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint PrintOperationEmbedPageSetupPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationEmbedPageSetupPropertyInfo = Bool
    type AttrLabel PrintOperationEmbedPageSetupPropertyInfo = "embed-page-setup"
    type AttrOrigin PrintOperationEmbedPageSetupPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationEmbedPageSetup
    attrSet _ = setPrintOperationEmbedPageSetup
    attrConstruct _ = constructPrintOperationEmbedPageSetup
    attrClear _ = undefined

-- VVV Prop "export-filename"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe T.Text)
getPrintOperationExportFilename obj = liftIO $ getObjectPropertyString obj "export-filename"

setPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> T.Text -> m ()
setPrintOperationExportFilename obj val = liftIO $ setObjectPropertyString obj "export-filename" (Just val)

constructPrintOperationExportFilename :: (IsPrintOperation o) => T.Text -> IO (GValueConstruct o)
constructPrintOperationExportFilename val = constructObjectPropertyString "export-filename" (Just val)

clearPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> m ()
clearPrintOperationExportFilename obj = liftIO $ setObjectPropertyString obj "export-filename" (Nothing :: Maybe T.Text)

data PrintOperationExportFilenamePropertyInfo
instance AttrInfo PrintOperationExportFilenamePropertyInfo where
    type AttrAllowedOps PrintOperationExportFilenamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint PrintOperationExportFilenamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint PrintOperationExportFilenamePropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationExportFilenamePropertyInfo = (Maybe T.Text)
    type AttrLabel PrintOperationExportFilenamePropertyInfo = "export-filename"
    type AttrOrigin PrintOperationExportFilenamePropertyInfo = PrintOperation
    attrGet _ = getPrintOperationExportFilename
    attrSet _ = setPrintOperationExportFilename
    attrConstruct _ = constructPrintOperationExportFilename
    attrClear _ = clearPrintOperationExportFilename

-- VVV Prop "has-selection"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getPrintOperationHasSelection :: (MonadIO m, IsPrintOperation o) => o -> m Bool
getPrintOperationHasSelection obj = liftIO $ getObjectPropertyBool obj "has-selection"

setPrintOperationHasSelection :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
setPrintOperationHasSelection obj val = liftIO $ setObjectPropertyBool obj "has-selection" val

constructPrintOperationHasSelection :: (IsPrintOperation o) => Bool -> IO (GValueConstruct o)
constructPrintOperationHasSelection val = constructObjectPropertyBool "has-selection" val

data PrintOperationHasSelectionPropertyInfo
instance AttrInfo PrintOperationHasSelectionPropertyInfo where
    type AttrAllowedOps PrintOperationHasSelectionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationHasSelectionPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint PrintOperationHasSelectionPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationHasSelectionPropertyInfo = Bool
    type AttrLabel PrintOperationHasSelectionPropertyInfo = "has-selection"
    type AttrOrigin PrintOperationHasSelectionPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationHasSelection
    attrSet _ = setPrintOperationHasSelection
    attrConstruct _ = constructPrintOperationHasSelection
    attrClear _ = undefined

-- VVV Prop "job-name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationJobName :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe T.Text)
getPrintOperationJobName obj = liftIO $ getObjectPropertyString obj "job-name"

setPrintOperationJobName :: (MonadIO m, IsPrintOperation o) => o -> T.Text -> m ()
setPrintOperationJobName obj val = liftIO $ setObjectPropertyString obj "job-name" (Just val)

constructPrintOperationJobName :: (IsPrintOperation o) => T.Text -> IO (GValueConstruct o)
constructPrintOperationJobName val = constructObjectPropertyString "job-name" (Just val)

data PrintOperationJobNamePropertyInfo
instance AttrInfo PrintOperationJobNamePropertyInfo where
    type AttrAllowedOps PrintOperationJobNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationJobNamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint PrintOperationJobNamePropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationJobNamePropertyInfo = (Maybe T.Text)
    type AttrLabel PrintOperationJobNamePropertyInfo = "job-name"
    type AttrOrigin PrintOperationJobNamePropertyInfo = PrintOperation
    attrGet _ = getPrintOperationJobName
    attrSet _ = setPrintOperationJobName
    attrConstruct _ = constructPrintOperationJobName
    attrClear _ = undefined

-- VVV Prop "n-pages"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationNPages :: (MonadIO m, IsPrintOperation o) => o -> m Int32
getPrintOperationNPages obj = liftIO $ getObjectPropertyInt32 obj "n-pages"

setPrintOperationNPages :: (MonadIO m, IsPrintOperation o) => o -> Int32 -> m ()
setPrintOperationNPages obj val = liftIO $ setObjectPropertyInt32 obj "n-pages" val

constructPrintOperationNPages :: (IsPrintOperation o) => Int32 -> IO (GValueConstruct o)
constructPrintOperationNPages val = constructObjectPropertyInt32 "n-pages" val

data PrintOperationNPagesPropertyInfo
instance AttrInfo PrintOperationNPagesPropertyInfo where
    type AttrAllowedOps PrintOperationNPagesPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationNPagesPropertyInfo = (~) Int32
    type AttrBaseTypeConstraint PrintOperationNPagesPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationNPagesPropertyInfo = Int32
    type AttrLabel PrintOperationNPagesPropertyInfo = "n-pages"
    type AttrOrigin PrintOperationNPagesPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationNPages
    attrSet _ = setPrintOperationNPages
    attrConstruct _ = constructPrintOperationNPages
    attrClear _ = undefined

-- VVV Prop "n-pages-to-print"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getPrintOperationNPagesToPrint :: (MonadIO m, IsPrintOperation o) => o -> m Int32
getPrintOperationNPagesToPrint obj = liftIO $ getObjectPropertyInt32 obj "n-pages-to-print"

data PrintOperationNPagesToPrintPropertyInfo
instance AttrInfo PrintOperationNPagesToPrintPropertyInfo where
    type AttrAllowedOps PrintOperationNPagesToPrintPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint PrintOperationNPagesToPrintPropertyInfo = (~) ()
    type AttrBaseTypeConstraint PrintOperationNPagesToPrintPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationNPagesToPrintPropertyInfo = Int32
    type AttrLabel PrintOperationNPagesToPrintPropertyInfo = "n-pages-to-print"
    type AttrOrigin PrintOperationNPagesToPrintPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationNPagesToPrint
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "print-settings"
   -- Type: TInterface (Name {namespace = "Gtk", name = "PrintSettings"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just True)

getPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o) => o -> m Gtk.PrintSettings.PrintSettings
getPrintOperationPrintSettings obj = liftIO $ checkUnexpectedNothing "getPrintOperationPrintSettings" $ getObjectPropertyObject obj "print-settings" Gtk.PrintSettings.PrintSettings

setPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o, Gtk.PrintSettings.IsPrintSettings a) => o -> a -> m ()
setPrintOperationPrintSettings obj val = liftIO $ setObjectPropertyObject obj "print-settings" (Just val)

constructPrintOperationPrintSettings :: (IsPrintOperation o, Gtk.PrintSettings.IsPrintSettings a) => a -> IO (GValueConstruct o)
constructPrintOperationPrintSettings val = constructObjectPropertyObject "print-settings" (Just val)

clearPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o) => o -> m ()
clearPrintOperationPrintSettings obj = liftIO $ setObjectPropertyObject obj "print-settings" (Nothing :: Maybe Gtk.PrintSettings.PrintSettings)

data PrintOperationPrintSettingsPropertyInfo
instance AttrInfo PrintOperationPrintSettingsPropertyInfo where
    type AttrAllowedOps PrintOperationPrintSettingsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint PrintOperationPrintSettingsPropertyInfo = Gtk.PrintSettings.IsPrintSettings
    type AttrBaseTypeConstraint PrintOperationPrintSettingsPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationPrintSettingsPropertyInfo = Gtk.PrintSettings.PrintSettings
    type AttrLabel PrintOperationPrintSettingsPropertyInfo = "print-settings"
    type AttrOrigin PrintOperationPrintSettingsPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationPrintSettings
    attrSet _ = setPrintOperationPrintSettings
    attrConstruct _ = constructPrintOperationPrintSettings
    attrClear _ = clearPrintOperationPrintSettings

-- VVV Prop "show-progress"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationShowProgress :: (MonadIO m, IsPrintOperation o) => o -> m Bool
getPrintOperationShowProgress obj = liftIO $ getObjectPropertyBool obj "show-progress"

setPrintOperationShowProgress :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
setPrintOperationShowProgress obj val = liftIO $ setObjectPropertyBool obj "show-progress" val

constructPrintOperationShowProgress :: (IsPrintOperation o) => Bool -> IO (GValueConstruct o)
constructPrintOperationShowProgress val = constructObjectPropertyBool "show-progress" val

data PrintOperationShowProgressPropertyInfo
instance AttrInfo PrintOperationShowProgressPropertyInfo where
    type AttrAllowedOps PrintOperationShowProgressPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationShowProgressPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint PrintOperationShowProgressPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationShowProgressPropertyInfo = Bool
    type AttrLabel PrintOperationShowProgressPropertyInfo = "show-progress"
    type AttrOrigin PrintOperationShowProgressPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationShowProgress
    attrSet _ = setPrintOperationShowProgress
    attrConstruct _ = constructPrintOperationShowProgress
    attrClear _ = undefined

-- VVV Prop "status"
   -- Type: TInterface (Name {namespace = "Gtk", name = "PrintStatus"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getPrintOperationStatus :: (MonadIO m, IsPrintOperation o) => o -> m Gtk.Enums.PrintStatus
getPrintOperationStatus obj = liftIO $ getObjectPropertyEnum obj "status"

data PrintOperationStatusPropertyInfo
instance AttrInfo PrintOperationStatusPropertyInfo where
    type AttrAllowedOps PrintOperationStatusPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint PrintOperationStatusPropertyInfo = (~) ()
    type AttrBaseTypeConstraint PrintOperationStatusPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationStatusPropertyInfo = Gtk.Enums.PrintStatus
    type AttrLabel PrintOperationStatusPropertyInfo = "status"
    type AttrOrigin PrintOperationStatusPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationStatus
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "status-string"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getPrintOperationStatusString :: (MonadIO m, IsPrintOperation o) => o -> m T.Text
getPrintOperationStatusString obj = liftIO $ checkUnexpectedNothing "getPrintOperationStatusString" $ getObjectPropertyString obj "status-string"

data PrintOperationStatusStringPropertyInfo
instance AttrInfo PrintOperationStatusStringPropertyInfo where
    type AttrAllowedOps PrintOperationStatusStringPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint PrintOperationStatusStringPropertyInfo = (~) ()
    type AttrBaseTypeConstraint PrintOperationStatusStringPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationStatusStringPropertyInfo = T.Text
    type AttrLabel PrintOperationStatusStringPropertyInfo = "status-string"
    type AttrOrigin PrintOperationStatusStringPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationStatusString
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "support-selection"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getPrintOperationSupportSelection :: (MonadIO m, IsPrintOperation o) => o -> m Bool
getPrintOperationSupportSelection obj = liftIO $ getObjectPropertyBool obj "support-selection"

setPrintOperationSupportSelection :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
setPrintOperationSupportSelection obj val = liftIO $ setObjectPropertyBool obj "support-selection" val

constructPrintOperationSupportSelection :: (IsPrintOperation o) => Bool -> IO (GValueConstruct o)
constructPrintOperationSupportSelection val = constructObjectPropertyBool "support-selection" val

data PrintOperationSupportSelectionPropertyInfo
instance AttrInfo PrintOperationSupportSelectionPropertyInfo where
    type AttrAllowedOps PrintOperationSupportSelectionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationSupportSelectionPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint PrintOperationSupportSelectionPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationSupportSelectionPropertyInfo = Bool
    type AttrLabel PrintOperationSupportSelectionPropertyInfo = "support-selection"
    type AttrOrigin PrintOperationSupportSelectionPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationSupportSelection
    attrSet _ = setPrintOperationSupportSelection
    attrConstruct _ = constructPrintOperationSupportSelection
    attrClear _ = undefined

-- VVV Prop "track-print-status"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationTrackPrintStatus :: (MonadIO m, IsPrintOperation o) => o -> m Bool
getPrintOperationTrackPrintStatus obj = liftIO $ getObjectPropertyBool obj "track-print-status"

setPrintOperationTrackPrintStatus :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
setPrintOperationTrackPrintStatus obj val = liftIO $ setObjectPropertyBool obj "track-print-status" val

constructPrintOperationTrackPrintStatus :: (IsPrintOperation o) => Bool -> IO (GValueConstruct o)
constructPrintOperationTrackPrintStatus val = constructObjectPropertyBool "track-print-status" val

data PrintOperationTrackPrintStatusPropertyInfo
instance AttrInfo PrintOperationTrackPrintStatusPropertyInfo where
    type AttrAllowedOps PrintOperationTrackPrintStatusPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationTrackPrintStatusPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint PrintOperationTrackPrintStatusPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationTrackPrintStatusPropertyInfo = Bool
    type AttrLabel PrintOperationTrackPrintStatusPropertyInfo = "track-print-status"
    type AttrOrigin PrintOperationTrackPrintStatusPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationTrackPrintStatus
    attrSet _ = setPrintOperationTrackPrintStatus
    attrConstruct _ = constructPrintOperationTrackPrintStatus
    attrClear _ = undefined

-- VVV Prop "unit"
   -- Type: TInterface (Name {namespace = "Gtk", name = "Unit"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationUnit :: (MonadIO m, IsPrintOperation o) => o -> m Gtk.Enums.Unit
getPrintOperationUnit obj = liftIO $ getObjectPropertyEnum obj "unit"

setPrintOperationUnit :: (MonadIO m, IsPrintOperation o) => o -> Gtk.Enums.Unit -> m ()
setPrintOperationUnit obj val = liftIO $ setObjectPropertyEnum obj "unit" val

constructPrintOperationUnit :: (IsPrintOperation o) => Gtk.Enums.Unit -> IO (GValueConstruct o)
constructPrintOperationUnit val = constructObjectPropertyEnum "unit" val

data PrintOperationUnitPropertyInfo
instance AttrInfo PrintOperationUnitPropertyInfo where
    type AttrAllowedOps PrintOperationUnitPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationUnitPropertyInfo = (~) Gtk.Enums.Unit
    type AttrBaseTypeConstraint PrintOperationUnitPropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationUnitPropertyInfo = Gtk.Enums.Unit
    type AttrLabel PrintOperationUnitPropertyInfo = "unit"
    type AttrOrigin PrintOperationUnitPropertyInfo = PrintOperation
    attrGet _ = getPrintOperationUnit
    attrSet _ = setPrintOperationUnit
    attrConstruct _ = constructPrintOperationUnit
    attrClear _ = undefined

-- VVV Prop "use-full-page"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getPrintOperationUseFullPage :: (MonadIO m, IsPrintOperation o) => o -> m Bool
getPrintOperationUseFullPage obj = liftIO $ getObjectPropertyBool obj "use-full-page"

setPrintOperationUseFullPage :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
setPrintOperationUseFullPage obj val = liftIO $ setObjectPropertyBool obj "use-full-page" val

constructPrintOperationUseFullPage :: (IsPrintOperation o) => Bool -> IO (GValueConstruct o)
constructPrintOperationUseFullPage val = constructObjectPropertyBool "use-full-page" val

data PrintOperationUseFullPagePropertyInfo
instance AttrInfo PrintOperationUseFullPagePropertyInfo where
    type AttrAllowedOps PrintOperationUseFullPagePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint PrintOperationUseFullPagePropertyInfo = (~) Bool
    type AttrBaseTypeConstraint PrintOperationUseFullPagePropertyInfo = IsPrintOperation
    type AttrGetType PrintOperationUseFullPagePropertyInfo = Bool
    type AttrLabel PrintOperationUseFullPagePropertyInfo = "use-full-page"
    type AttrOrigin PrintOperationUseFullPagePropertyInfo = PrintOperation
    attrGet _ = getPrintOperationUseFullPage
    attrSet _ = setPrintOperationUseFullPage
    attrConstruct _ = constructPrintOperationUseFullPage
    attrClear _ = undefined

instance O.HasAttributeList PrintOperation
type instance O.AttributeList PrintOperation = PrintOperationAttributeList
type PrintOperationAttributeList = ('[ '("allowAsync", PrintOperationAllowAsyncPropertyInfo), '("currentPage", PrintOperationCurrentPagePropertyInfo), '("customTabLabel", PrintOperationCustomTabLabelPropertyInfo), '("defaultPageSetup", PrintOperationDefaultPageSetupPropertyInfo), '("embedPageSetup", PrintOperationEmbedPageSetupPropertyInfo), '("exportFilename", PrintOperationExportFilenamePropertyInfo), '("hasSelection", PrintOperationHasSelectionPropertyInfo), '("jobName", PrintOperationJobNamePropertyInfo), '("nPages", PrintOperationNPagesPropertyInfo), '("nPagesToPrint", PrintOperationNPagesToPrintPropertyInfo), '("printSettings", PrintOperationPrintSettingsPropertyInfo), '("showProgress", PrintOperationShowProgressPropertyInfo), '("status", PrintOperationStatusPropertyInfo), '("statusString", PrintOperationStatusStringPropertyInfo), '("supportSelection", PrintOperationSupportSelectionPropertyInfo), '("trackPrintStatus", PrintOperationTrackPrintStatusPropertyInfo), '("unit", PrintOperationUnitPropertyInfo), '("useFullPage", PrintOperationUseFullPagePropertyInfo)] :: [(Symbol, *)])

printOperationAllowAsync :: AttrLabelProxy "allowAsync"
printOperationAllowAsync = AttrLabelProxy

printOperationCurrentPage :: AttrLabelProxy "currentPage"
printOperationCurrentPage = AttrLabelProxy

printOperationCustomTabLabel :: AttrLabelProxy "customTabLabel"
printOperationCustomTabLabel = AttrLabelProxy

printOperationDefaultPageSetup :: AttrLabelProxy "defaultPageSetup"
printOperationDefaultPageSetup = AttrLabelProxy

printOperationEmbedPageSetup :: AttrLabelProxy "embedPageSetup"
printOperationEmbedPageSetup = AttrLabelProxy

printOperationExportFilename :: AttrLabelProxy "exportFilename"
printOperationExportFilename = AttrLabelProxy

printOperationHasSelection :: AttrLabelProxy "hasSelection"
printOperationHasSelection = AttrLabelProxy

printOperationJobName :: AttrLabelProxy "jobName"
printOperationJobName = AttrLabelProxy

printOperationNPages :: AttrLabelProxy "nPages"
printOperationNPages = AttrLabelProxy

printOperationNPagesToPrint :: AttrLabelProxy "nPagesToPrint"
printOperationNPagesToPrint = AttrLabelProxy

printOperationPrintSettings :: AttrLabelProxy "printSettings"
printOperationPrintSettings = AttrLabelProxy

printOperationShowProgress :: AttrLabelProxy "showProgress"
printOperationShowProgress = AttrLabelProxy

printOperationStatus :: AttrLabelProxy "status"
printOperationStatus = AttrLabelProxy

printOperationStatusString :: AttrLabelProxy "statusString"
printOperationStatusString = AttrLabelProxy

printOperationSupportSelection :: AttrLabelProxy "supportSelection"
printOperationSupportSelection = AttrLabelProxy

printOperationTrackPrintStatus :: AttrLabelProxy "trackPrintStatus"
printOperationTrackPrintStatus = AttrLabelProxy

printOperationUnit :: AttrLabelProxy "unit"
printOperationUnit = AttrLabelProxy

printOperationUseFullPage :: AttrLabelProxy "useFullPage"
printOperationUseFullPage = AttrLabelProxy

data PrintOperationBeginPrintSignalInfo
instance SignalInfo PrintOperationBeginPrintSignalInfo where
    type HaskellCallbackType PrintOperationBeginPrintSignalInfo = PrintOperationBeginPrintCallback
    connectSignal _ = connectPrintOperationBeginPrint

data PrintOperationCreateCustomWidgetSignalInfo
instance SignalInfo PrintOperationCreateCustomWidgetSignalInfo where
    type HaskellCallbackType PrintOperationCreateCustomWidgetSignalInfo = PrintOperationCreateCustomWidgetCallback
    connectSignal _ = connectPrintOperationCreateCustomWidget

data PrintOperationCustomWidgetApplySignalInfo
instance SignalInfo PrintOperationCustomWidgetApplySignalInfo where
    type HaskellCallbackType PrintOperationCustomWidgetApplySignalInfo = PrintOperationCustomWidgetApplyCallback
    connectSignal _ = connectPrintOperationCustomWidgetApply

data PrintOperationDoneSignalInfo
instance SignalInfo PrintOperationDoneSignalInfo where
    type HaskellCallbackType PrintOperationDoneSignalInfo = PrintOperationDoneCallback
    connectSignal _ = connectPrintOperationDone

data PrintOperationDrawPageSignalInfo
instance SignalInfo PrintOperationDrawPageSignalInfo where
    type HaskellCallbackType PrintOperationDrawPageSignalInfo = PrintOperationDrawPageCallback
    connectSignal _ = connectPrintOperationDrawPage

data PrintOperationEndPrintSignalInfo
instance SignalInfo PrintOperationEndPrintSignalInfo where
    type HaskellCallbackType PrintOperationEndPrintSignalInfo = PrintOperationEndPrintCallback
    connectSignal _ = connectPrintOperationEndPrint

data PrintOperationPaginateSignalInfo
instance SignalInfo PrintOperationPaginateSignalInfo where
    type HaskellCallbackType PrintOperationPaginateSignalInfo = PrintOperationPaginateCallback
    connectSignal _ = connectPrintOperationPaginate

data PrintOperationPreviewSignalInfo
instance SignalInfo PrintOperationPreviewSignalInfo where
    type HaskellCallbackType PrintOperationPreviewSignalInfo = PrintOperationPreviewCallback
    connectSignal _ = connectPrintOperationPreview

data PrintOperationRequestPageSetupSignalInfo
instance SignalInfo PrintOperationRequestPageSetupSignalInfo where
    type HaskellCallbackType PrintOperationRequestPageSetupSignalInfo = PrintOperationRequestPageSetupCallback
    connectSignal _ = connectPrintOperationRequestPageSetup

data PrintOperationStatusChangedSignalInfo
instance SignalInfo PrintOperationStatusChangedSignalInfo where
    type HaskellCallbackType PrintOperationStatusChangedSignalInfo = PrintOperationStatusChangedCallback
    connectSignal _ = connectPrintOperationStatusChanged

data PrintOperationUpdateCustomWidgetSignalInfo
instance SignalInfo PrintOperationUpdateCustomWidgetSignalInfo where
    type HaskellCallbackType PrintOperationUpdateCustomWidgetSignalInfo = PrintOperationUpdateCustomWidgetCallback
    connectSignal _ = connectPrintOperationUpdateCustomWidget

type instance O.SignalList PrintOperation = PrintOperationSignalList
type PrintOperationSignalList = ('[ '("beginPrint", PrintOperationBeginPrintSignalInfo), '("createCustomWidget", PrintOperationCreateCustomWidgetSignalInfo), '("customWidgetApply", PrintOperationCustomWidgetApplySignalInfo), '("done", PrintOperationDoneSignalInfo), '("drawPage", PrintOperationDrawPageSignalInfo), '("endPrint", PrintOperationEndPrintSignalInfo), '("gotPageSize", Gtk.PrintOperationPreview.PrintOperationPreviewGotPageSizeSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("paginate", PrintOperationPaginateSignalInfo), '("preview", PrintOperationPreviewSignalInfo), '("ready", Gtk.PrintOperationPreview.PrintOperationPreviewReadySignalInfo), '("requestPageSetup", PrintOperationRequestPageSetupSignalInfo), '("statusChanged", PrintOperationStatusChangedSignalInfo), '("updateCustomWidget", PrintOperationUpdateCustomWidgetSignalInfo)] :: [(Symbol, *)])

-- method PrintOperation::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "PrintOperation"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_new" gtk_print_operation_new :: 
    IO (Ptr PrintOperation)

{- |
Creates a new 'GI.Gtk.Objects.PrintOperation.PrintOperation'.

@since 2.10
-}
printOperationNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m PrintOperation
    {- ^ __Returns:__ a new 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
printOperationNew  = liftIO $ do
    result <- gtk_print_operation_new
    checkUnexpectedReturnNULL "printOperationNew" result
    result' <- (wrapObject PrintOperation) result
    return result'

-- method PrintOperation::cancel
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_cancel" gtk_print_operation_cancel :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO ()

{- |
Cancels a running print operation. This function may
be called from a 'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/begin-print/@,
'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/paginate/@ or 'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/draw-page/@
signal handler to stop the currently running print
operation.

@since 2.10
-}
printOperationCancel ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m ()
printOperationCancel op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    gtk_print_operation_cancel op'
    touchManagedPtr op
    return ()

data PrintOperationCancelMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationCancelMethodInfo a signature where
    overloadedMethod _ = printOperationCancel

-- method PrintOperation::draw_page_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_draw_page_finish" gtk_print_operation_draw_page_finish :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO ()

{- |
Signalize that drawing of particular page is complete.

It is called after completion of page drawing (e.g. drawing in another
thread).
If 'GI.Gtk.Objects.PrintOperation.printOperationSetDeferDrawing' was called before, then this function
has to be called by application. In another case it is called by the library
itself.

@since 2.16
-}
printOperationDrawPageFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m ()
printOperationDrawPageFinish op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    gtk_print_operation_draw_page_finish op'
    touchManagedPtr op
    return ()

data PrintOperationDrawPageFinishMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationDrawPageFinishMethodInfo a signature where
    overloadedMethod _ = printOperationDrawPageFinish

-- method PrintOperation::get_default_page_setup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "PageSetup"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_default_page_setup" gtk_print_operation_get_default_page_setup :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO (Ptr Gtk.PageSetup.PageSetup)

{- |
Returns the default page setup, see
'GI.Gtk.Objects.PrintOperation.printOperationSetDefaultPageSetup'.

@since 2.10
-}
printOperationGetDefaultPageSetup ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Gtk.PageSetup.PageSetup
    {- ^ __Returns:__ the default page setup -}
printOperationGetDefaultPageSetup op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_default_page_setup op'
    checkUnexpectedReturnNULL "printOperationGetDefaultPageSetup" result
    result' <- (newObject Gtk.PageSetup.PageSetup) result
    touchManagedPtr op
    return result'

data PrintOperationGetDefaultPageSetupMethodInfo
instance (signature ~ (m Gtk.PageSetup.PageSetup), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetDefaultPageSetupMethodInfo a signature where
    overloadedMethod _ = printOperationGetDefaultPageSetup

-- method PrintOperation::get_embed_page_setup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_embed_page_setup" gtk_print_operation_get_embed_page_setup :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO CInt

{- |
Gets the value of 'GI.Gtk.Objects.PrintOperation.PrintOperation':@/embed-page-setup/@ property.

@since 2.18
-}
printOperationGetEmbedPageSetup ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Bool
    {- ^ __Returns:__ whether page setup selection combos are embedded -}
printOperationGetEmbedPageSetup op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_embed_page_setup op'
    let result' = (/= 0) result
    touchManagedPtr op
    return result'

data PrintOperationGetEmbedPageSetupMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetEmbedPageSetupMethodInfo a signature where
    overloadedMethod _ = printOperationGetEmbedPageSetup

-- method PrintOperation::get_error
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "gtk_print_operation_get_error" gtk_print_operation_get_error :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

{- |
Call this when the result of a print operation is
'GI.Gtk.Enums.PrintOperationResultError', either as returned by
'GI.Gtk.Objects.PrintOperation.printOperationRun', or in the 'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/done/@ signal
handler. The returned 'GError' will contain more details on what went wrong.

@since 2.10
-}
printOperationGetError ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
printOperationGetError op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    onException (do
        propagateGError $ gtk_print_operation_get_error op'
        touchManagedPtr op
        return ()
     ) (do
        return ()
     )

data PrintOperationGetErrorMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetErrorMethodInfo a signature where
    overloadedMethod _ = printOperationGetError

-- method PrintOperation::get_has_selection
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_has_selection" gtk_print_operation_get_has_selection :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO CInt

{- |
Gets the value of 'GI.Gtk.Objects.PrintOperation.PrintOperation':@/has-selection/@ property.

@since 2.18
-}
printOperationGetHasSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Bool
    {- ^ __Returns:__ whether there is a selection -}
printOperationGetHasSelection op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_has_selection op'
    let result' = (/= 0) result
    touchManagedPtr op
    return result'

data PrintOperationGetHasSelectionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetHasSelectionMethodInfo a signature where
    overloadedMethod _ = printOperationGetHasSelection

-- method PrintOperation::get_n_pages_to_print
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_n_pages_to_print" gtk_print_operation_get_n_pages_to_print :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO Int32

{- |
Returns the number of pages that will be printed.

Note that this value is set during print preparation phase
('GI.Gtk.Enums.PrintStatusPreparing'), so this function should never be
called before the data generation phase ('GI.Gtk.Enums.PrintStatusGeneratingData').
You can connect to the 'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/status-changed/@ signal
and call 'GI.Gtk.Objects.PrintOperation.printOperationGetNPagesToPrint' when
print status is 'GI.Gtk.Enums.PrintStatusGeneratingData'.
This is typically used to track the progress of print operation.

@since 2.18
-}
printOperationGetNPagesToPrint ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Int32
    {- ^ __Returns:__ the number of pages that will be printed -}
printOperationGetNPagesToPrint op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_n_pages_to_print op'
    touchManagedPtr op
    return result

data PrintOperationGetNPagesToPrintMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetNPagesToPrintMethodInfo a signature where
    overloadedMethod _ = printOperationGetNPagesToPrint

-- method PrintOperation::get_print_settings
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "PrintSettings"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_print_settings" gtk_print_operation_get_print_settings :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO (Ptr Gtk.PrintSettings.PrintSettings)

{- |
Returns the current print settings.

Note that the return value is 'Nothing' until either
'GI.Gtk.Objects.PrintOperation.printOperationSetPrintSettings' or
'GI.Gtk.Objects.PrintOperation.printOperationRun' have been called.

@since 2.10
-}
printOperationGetPrintSettings ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Gtk.PrintSettings.PrintSettings
    {- ^ __Returns:__ the current print settings of /@op@/. -}
printOperationGetPrintSettings op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_print_settings op'
    checkUnexpectedReturnNULL "printOperationGetPrintSettings" result
    result' <- (newObject Gtk.PrintSettings.PrintSettings) result
    touchManagedPtr op
    return result'

data PrintOperationGetPrintSettingsMethodInfo
instance (signature ~ (m Gtk.PrintSettings.PrintSettings), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetPrintSettingsMethodInfo a signature where
    overloadedMethod _ = printOperationGetPrintSettings

-- method PrintOperation::get_status
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "PrintStatus"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_status" gtk_print_operation_get_status :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO CUInt

{- |
Returns the status of the print operation.
Also see 'GI.Gtk.Objects.PrintOperation.printOperationGetStatusString'.

@since 2.10
-}
printOperationGetStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Gtk.Enums.PrintStatus
    {- ^ __Returns:__ the status of the print operation -}
printOperationGetStatus op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_status op'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr op
    return result'

data PrintOperationGetStatusMethodInfo
instance (signature ~ (m Gtk.Enums.PrintStatus), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetStatusMethodInfo a signature where
    overloadedMethod _ = printOperationGetStatus

-- method PrintOperation::get_status_string
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_status_string" gtk_print_operation_get_status_string :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO CString

{- |
Returns a string representation of the status of the
print operation. The string is translated and suitable
for displaying the print status e.g. in a 'GI.Gtk.Objects.Statusbar.Statusbar'.

Use 'GI.Gtk.Objects.PrintOperation.printOperationGetStatus' to obtain a status
value that is suitable for programmatic use.

@since 2.10
-}
printOperationGetStatusString ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m T.Text
    {- ^ __Returns:__ a string representation of the status
   of the print operation -}
printOperationGetStatusString op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_status_string op'
    checkUnexpectedReturnNULL "printOperationGetStatusString" result
    result' <- cstringToText result
    touchManagedPtr op
    return result'

data PrintOperationGetStatusStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetStatusStringMethodInfo a signature where
    overloadedMethod _ = printOperationGetStatusString

-- method PrintOperation::get_support_selection
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_get_support_selection" gtk_print_operation_get_support_selection :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO CInt

{- |
Gets the value of 'GI.Gtk.Objects.PrintOperation.PrintOperation':@/support-selection/@ property.

@since 2.18
-}
printOperationGetSupportSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Bool
    {- ^ __Returns:__ whether the application supports print of selection -}
printOperationGetSupportSelection op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_get_support_selection op'
    let result' = (/= 0) result
    touchManagedPtr op
    return result'

data PrintOperationGetSupportSelectionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetSupportSelectionMethodInfo a signature where
    overloadedMethod _ = printOperationGetSupportSelection

-- method PrintOperation::is_finished
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_is_finished" gtk_print_operation_is_finished :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO CInt

{- |
A convenience function to find out if the print operation
is finished, either successfully ('GI.Gtk.Enums.PrintStatusFinished')
or unsuccessfully ('GI.Gtk.Enums.PrintStatusFinishedAborted').

Note: when you enable print status tracking the print operation
can be in a non-finished state even after done has been called, as
the operation status then tracks the print job status on the printer.

@since 2.10
-}
printOperationIsFinished ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m Bool
    {- ^ __Returns:__ 'True', if the print operation is finished. -}
printOperationIsFinished op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- gtk_print_operation_is_finished op'
    let result' = (/= 0) result
    touchManagedPtr op
    return result'

data PrintOperationIsFinishedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationIsFinishedMethodInfo a signature where
    overloadedMethod _ = printOperationIsFinished

-- method PrintOperation::run
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "action", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperationAction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the action to start", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gtk", name = "Window"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Transient parent of the dialog", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "PrintOperationResult"}))
-- throws : True
-- Skip return : False

foreign import ccall "gtk_print_operation_run" gtk_print_operation_run :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CUInt ->                                -- action : TInterface (Name {namespace = "Gtk", name = "PrintOperationAction"})
    Ptr Gtk.Window.Window ->                -- parent : TInterface (Name {namespace = "Gtk", name = "Window"})
    Ptr (Ptr GError) ->                     -- error
    IO CUInt

{- |
Runs the print operation, by first letting the user modify
print settings in the print dialog, and then print the document.

Normally that this function does not return until the rendering of all
pages is complete. You can connect to the
'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/status-changed/@ signal on /@op@/ to obtain some
information about the progress of the print operation.
Furthermore, it may use a recursive mainloop to show the print dialog.

If you call 'GI.Gtk.Objects.PrintOperation.printOperationSetAllowAsync' or set the
'GI.Gtk.Objects.PrintOperation.PrintOperation':@/allow-async/@ property the operation will run
asynchronously if this is supported on the platform. The
'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/done/@ signal will be emitted with the result of the
operation when the it is done (i.e. when the dialog is canceled, or when
the print succeeds or fails).

=== /C code/
>
>if (settings != NULL)
>  gtk_print_operation_set_print_settings (print, settings);
>  
>if (page_setup != NULL)
>  gtk_print_operation_set_default_page_setup (print, page_setup);
>  
>g_signal_connect (print, "begin-print",
>                  G_CALLBACK (begin_print), &data);
>g_signal_connect (print, "draw-page",
>                  G_CALLBACK (draw_page), &data);
> 
>res = gtk_print_operation_run (print,
>                               GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
>                               parent,
>                               &error);
> 
>if (res == GTK_PRINT_OPERATION_RESULT_ERROR)
> {
>   error_dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
>  			                     GTK_DIALOG_DESTROY_WITH_PARENT,
>					     GTK_MESSAGE_ERROR,
>					     GTK_BUTTONS_CLOSE,
>					     "Error printing file:\n%s",
>					     error->message);
>   g_signal_connect (error_dialog, "response",
>                     G_CALLBACK (gtk_widget_destroy), NULL);
>   gtk_widget_show (error_dialog);
>   g_error_free (error);
> }
>else if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
> {
>   if (settings != NULL)
>g_object_unref (settings);
>   settings = g_object_ref (gtk_print_operation_get_print_settings (print));
> }


Note that 'GI.Gtk.Objects.PrintOperation.printOperationRun' can only be called once on a
given 'GI.Gtk.Objects.PrintOperation.PrintOperation'.

@since 2.10
-}
printOperationRun ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a, Gtk.Window.IsWindow b) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Gtk.Enums.PrintOperationAction
    {- ^ /@action@/: the action to start -}
    -> Maybe (b)
    {- ^ /@parent@/: Transient parent of the dialog -}
    -> m Gtk.Enums.PrintOperationResult
    {- ^ __Returns:__ the result of the print operation. A return value of
  'GI.Gtk.Enums.PrintOperationResultApply' indicates that the printing was
  completed successfully. In this case, it is a good idea to obtain
  the used print settings with 'GI.Gtk.Objects.PrintOperation.printOperationGetPrintSettings'
  and store them for reuse with the next print operation. A value of
  'GI.Gtk.Enums.PrintOperationResultInProgress' means the operation is running
  asynchronously, and will emit the 'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/done/@ signal when
  done. /(Can throw 'Data.GI.Base.GError.GError')/ -}
printOperationRun op action parent = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let action' = (fromIntegral . fromEnum) action
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    onException (do
        result <- propagateGError $ gtk_print_operation_run op' action' maybeParent
        let result' = (toEnum . fromIntegral) result
        touchManagedPtr op
        whenJust parent touchManagedPtr
        return result'
     ) (do
        return ()
     )

data PrintOperationRunMethodInfo
instance (signature ~ (Gtk.Enums.PrintOperationAction -> Maybe (b) -> m Gtk.Enums.PrintOperationResult), MonadIO m, IsPrintOperation a, Gtk.Window.IsWindow b) => O.MethodInfo PrintOperationRunMethodInfo a signature where
    overloadedMethod _ = printOperationRun

-- method PrintOperation::set_allow_async
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "allow_async", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to allow asynchronous operation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_allow_async" gtk_print_operation_set_allow_async :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CInt ->                                 -- allow_async : TBasicType TBoolean
    IO ()

{- |
Sets whether the 'GI.Gtk.Objects.PrintOperation.printOperationRun' may return
before the print operation is completed. Note that
some platforms may not allow asynchronous operation.

@since 2.10
-}
printOperationSetAllowAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Bool
    {- ^ /@allowAsync@/: 'True' to allow asynchronous operation -}
    -> m ()
printOperationSetAllowAsync op allowAsync = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let allowAsync' = (fromIntegral . fromEnum) allowAsync
    gtk_print_operation_set_allow_async op' allowAsync'
    touchManagedPtr op
    return ()

data PrintOperationSetAllowAsyncMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetAllowAsyncMethodInfo a signature where
    overloadedMethod _ = printOperationSetAllowAsync

-- method PrintOperation::set_current_page
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "current_page", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current page, 0-based", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_current_page" gtk_print_operation_set_current_page :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    Int32 ->                                -- current_page : TBasicType TInt
    IO ()

{- |
Sets the current page.

If this is called before 'GI.Gtk.Objects.PrintOperation.printOperationRun',
the user will be able to select to print only the current page.

Note that this only makes sense for pre-paginated documents.

@since 2.10
-}
printOperationSetCurrentPage ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Int32
    {- ^ /@currentPage@/: the current page, 0-based -}
    -> m ()
printOperationSetCurrentPage op currentPage = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    gtk_print_operation_set_current_page op' currentPage
    touchManagedPtr op
    return ()

data PrintOperationSetCurrentPageMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetCurrentPageMethodInfo a signature where
    overloadedMethod _ = printOperationSetCurrentPage

-- method PrintOperation::set_custom_tab_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the label to use, or %NULL to use the default label", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_custom_tab_label" gtk_print_operation_set_custom_tab_label :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CString ->                              -- label : TBasicType TUTF8
    IO ()

{- |
Sets the label for the tab holding custom widgets.

@since 2.10
-}
printOperationSetCustomTabLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Maybe (T.Text)
    {- ^ /@label@/: the label to use, or 'Nothing' to use the default label -}
    -> m ()
printOperationSetCustomTabLabel op label = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    maybeLabel <- case label of
        Nothing -> return nullPtr
        Just jLabel -> do
            jLabel' <- textToCString jLabel
            return jLabel'
    gtk_print_operation_set_custom_tab_label op' maybeLabel
    touchManagedPtr op
    freeMem maybeLabel
    return ()

data PrintOperationSetCustomTabLabelMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetCustomTabLabelMethodInfo a signature where
    overloadedMethod _ = printOperationSetCustomTabLabel

-- method PrintOperation::set_default_page_setup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_page_setup", argType = TInterface (Name {namespace = "Gtk", name = "PageSetup"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GtkPageSetup, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_default_page_setup" gtk_print_operation_set_default_page_setup :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    Ptr Gtk.PageSetup.PageSetup ->          -- default_page_setup : TInterface (Name {namespace = "Gtk", name = "PageSetup"})
    IO ()

{- |
Makes /@defaultPageSetup@/ the default page setup for /@op@/.

This page setup will be used by 'GI.Gtk.Objects.PrintOperation.printOperationRun',
but it can be overridden on a per-page basis by connecting
to the 'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/request-page-setup/@ signal.

@since 2.10
-}
printOperationSetDefaultPageSetup ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a, Gtk.PageSetup.IsPageSetup b) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Maybe (b)
    {- ^ /@defaultPageSetup@/: a 'GI.Gtk.Objects.PageSetup.PageSetup', or 'Nothing' -}
    -> m ()
printOperationSetDefaultPageSetup op defaultPageSetup = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    maybeDefaultPageSetup <- case defaultPageSetup of
        Nothing -> return nullPtr
        Just jDefaultPageSetup -> do
            jDefaultPageSetup' <- unsafeManagedPtrCastPtr jDefaultPageSetup
            return jDefaultPageSetup'
    gtk_print_operation_set_default_page_setup op' maybeDefaultPageSetup
    touchManagedPtr op
    whenJust defaultPageSetup touchManagedPtr
    return ()

data PrintOperationSetDefaultPageSetupMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsPrintOperation a, Gtk.PageSetup.IsPageSetup b) => O.MethodInfo PrintOperationSetDefaultPageSetupMethodInfo a signature where
    overloadedMethod _ = printOperationSetDefaultPageSetup

-- method PrintOperation::set_defer_drawing
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_defer_drawing" gtk_print_operation_set_defer_drawing :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    IO ()

{- |
Sets up the 'GI.Gtk.Objects.PrintOperation.PrintOperation' to wait for calling of
'GI.Gtk.Objects.PrintOperation.printOperationDrawPageFinish' from application. It can
be used for drawing page in another thread.

This function must be called in the callback of “draw-page” signal.

@since 2.16
-}
printOperationSetDeferDrawing ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> m ()
printOperationSetDeferDrawing op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    gtk_print_operation_set_defer_drawing op'
    touchManagedPtr op
    return ()

data PrintOperationSetDeferDrawingMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetDeferDrawingMethodInfo a signature where
    overloadedMethod _ = printOperationSetDeferDrawing

-- method PrintOperation::set_embed_page_setup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "embed", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to embed page setup selection in the #GtkPrintUnixDialog", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_embed_page_setup" gtk_print_operation_set_embed_page_setup :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CInt ->                                 -- embed : TBasicType TBoolean
    IO ()

{- |
Embed page size combo box and orientation combo box into page setup page.
Selected page setup is stored as default page setup in 'GI.Gtk.Objects.PrintOperation.PrintOperation'.

@since 2.18
-}
printOperationSetEmbedPageSetup ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Bool
    {- ^ /@embed@/: 'True' to embed page setup selection in the @/GtkPrintUnixDialog/@ -}
    -> m ()
printOperationSetEmbedPageSetup op embed = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let embed' = (fromIntegral . fromEnum) embed
    gtk_print_operation_set_embed_page_setup op' embed'
    touchManagedPtr op
    return ()

data PrintOperationSetEmbedPageSetupMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetEmbedPageSetupMethodInfo a signature where
    overloadedMethod _ = printOperationSetEmbedPageSetup

-- method PrintOperation::set_export_filename
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filename", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the filename for the exported file", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_export_filename" gtk_print_operation_set_export_filename :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CString ->                              -- filename : TBasicType TFileName
    IO ()

{- |
Sets up the 'GI.Gtk.Objects.PrintOperation.PrintOperation' to generate a file instead
of showing the print dialog. The indended use of this function
is for implementing “Export to PDF” actions. Currently, PDF
is the only supported format.

“Print to PDF” support is independent of this and is done
by letting the user pick the “Print to PDF” item from the list
of printers in the print dialog.

@since 2.10
-}
printOperationSetExportFilename ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> [Char]
    {- ^ /@filename@/: the filename for the exported file -}
    -> m ()
printOperationSetExportFilename op filename = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    filename' <- stringToCString filename
    gtk_print_operation_set_export_filename op' filename'
    touchManagedPtr op
    freeMem filename'
    return ()

data PrintOperationSetExportFilenameMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetExportFilenameMethodInfo a signature where
    overloadedMethod _ = printOperationSetExportFilename

-- method PrintOperation::set_has_selection
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "has_selection", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE indicates that a selection exists", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_has_selection" gtk_print_operation_set_has_selection :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CInt ->                                 -- has_selection : TBasicType TBoolean
    IO ()

{- |
Sets whether there is a selection to print.

Application has to set number of pages to which the selection
will draw by 'GI.Gtk.Objects.PrintOperation.printOperationSetNPages' in a callback of
'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/begin-print/@.

@since 2.18
-}
printOperationSetHasSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Bool
    {- ^ /@hasSelection@/: 'True' indicates that a selection exists -}
    -> m ()
printOperationSetHasSelection op hasSelection = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let hasSelection' = (fromIntegral . fromEnum) hasSelection
    gtk_print_operation_set_has_selection op' hasSelection'
    touchManagedPtr op
    return ()

data PrintOperationSetHasSelectionMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetHasSelectionMethodInfo a signature where
    overloadedMethod _ = printOperationSetHasSelection

-- method PrintOperation::set_job_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "job_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a string that identifies the print job", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_job_name" gtk_print_operation_set_job_name :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CString ->                              -- job_name : TBasicType TUTF8
    IO ()

{- |
Sets the name of the print job. The name is used to identify
the job (e.g. in monitoring applications like eggcups).

If you don’t set a job name, GTK+ picks a default one by
numbering successive print jobs.

@since 2.10
-}
printOperationSetJobName ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> T.Text
    {- ^ /@jobName@/: a string that identifies the print job -}
    -> m ()
printOperationSetJobName op jobName = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    jobName' <- textToCString jobName
    gtk_print_operation_set_job_name op' jobName'
    touchManagedPtr op
    freeMem jobName'
    return ()

data PrintOperationSetJobNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetJobNameMethodInfo a signature where
    overloadedMethod _ = printOperationSetJobName

-- method PrintOperation::set_n_pages
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_pages", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of pages", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_n_pages" gtk_print_operation_set_n_pages :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    Int32 ->                                -- n_pages : TBasicType TInt
    IO ()

{- |
Sets the number of pages in the document.

This must be set to a positive number
before the rendering starts. It may be set in a
'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/begin-print/@ signal hander.

Note that the page numbers passed to the
'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/request-page-setup/@
and 'GI.Gtk.Objects.PrintOperation.PrintOperation'::@/draw-page/@ signals are 0-based, i.e. if
the user chooses to print all pages, the last ::draw-page signal
will be for page /@nPages@/ - 1.

@since 2.10
-}
printOperationSetNPages ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Int32
    {- ^ /@nPages@/: the number of pages -}
    -> m ()
printOperationSetNPages op nPages = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    gtk_print_operation_set_n_pages op' nPages
    touchManagedPtr op
    return ()

data PrintOperationSetNPagesMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetNPagesMethodInfo a signature where
    overloadedMethod _ = printOperationSetNPages

-- method PrintOperation::set_print_settings
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "print_settings", argType = TInterface (Name {namespace = "Gtk", name = "PrintSettings"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "#GtkPrintSettings", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_print_settings" gtk_print_operation_set_print_settings :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    Ptr Gtk.PrintSettings.PrintSettings ->  -- print_settings : TInterface (Name {namespace = "Gtk", name = "PrintSettings"})
    IO ()

{- |
Sets the print settings for /@op@/. This is typically used to
re-establish print settings from a previous print operation,
see 'GI.Gtk.Objects.PrintOperation.printOperationRun'.

@since 2.10
-}
printOperationSetPrintSettings ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a, Gtk.PrintSettings.IsPrintSettings b) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Maybe (b)
    {- ^ /@printSettings@/: 'GI.Gtk.Objects.PrintSettings.PrintSettings' -}
    -> m ()
printOperationSetPrintSettings op printSettings = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    maybePrintSettings <- case printSettings of
        Nothing -> return nullPtr
        Just jPrintSettings -> do
            jPrintSettings' <- unsafeManagedPtrCastPtr jPrintSettings
            return jPrintSettings'
    gtk_print_operation_set_print_settings op' maybePrintSettings
    touchManagedPtr op
    whenJust printSettings touchManagedPtr
    return ()

data PrintOperationSetPrintSettingsMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsPrintOperation a, Gtk.PrintSettings.IsPrintSettings b) => O.MethodInfo PrintOperationSetPrintSettingsMethodInfo a signature where
    overloadedMethod _ = printOperationSetPrintSettings

-- method PrintOperation::set_show_progress
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "show_progress", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to show a progress dialog", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_show_progress" gtk_print_operation_set_show_progress :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CInt ->                                 -- show_progress : TBasicType TBoolean
    IO ()

{- |
If /@showProgress@/ is 'True', the print operation will show a
progress dialog during the print operation.

@since 2.10
-}
printOperationSetShowProgress ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Bool
    {- ^ /@showProgress@/: 'True' to show a progress dialog -}
    -> m ()
printOperationSetShowProgress op showProgress = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let showProgress' = (fromIntegral . fromEnum) showProgress
    gtk_print_operation_set_show_progress op' showProgress'
    touchManagedPtr op
    return ()

data PrintOperationSetShowProgressMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetShowProgressMethodInfo a signature where
    overloadedMethod _ = printOperationSetShowProgress

-- method PrintOperation::set_support_selection
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "support_selection", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to support selection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_support_selection" gtk_print_operation_set_support_selection :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CInt ->                                 -- support_selection : TBasicType TBoolean
    IO ()

{- |
Sets whether selection is supported by 'GI.Gtk.Objects.PrintOperation.PrintOperation'.

@since 2.18
-}
printOperationSetSupportSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Bool
    {- ^ /@supportSelection@/: 'True' to support selection -}
    -> m ()
printOperationSetSupportSelection op supportSelection = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let supportSelection' = (fromIntegral . fromEnum) supportSelection
    gtk_print_operation_set_support_selection op' supportSelection'
    touchManagedPtr op
    return ()

data PrintOperationSetSupportSelectionMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetSupportSelectionMethodInfo a signature where
    overloadedMethod _ = printOperationSetSupportSelection

-- method PrintOperation::set_track_print_status
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "track_status", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to track status after printing", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_track_print_status" gtk_print_operation_set_track_print_status :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CInt ->                                 -- track_status : TBasicType TBoolean
    IO ()

{- |
If track_status is 'True', the print operation 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.

@since 2.10
-}
printOperationSetTrackPrintStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Bool
    {- ^ /@trackStatus@/: 'True' to track status after printing -}
    -> m ()
printOperationSetTrackPrintStatus op trackStatus = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let trackStatus' = (fromIntegral . fromEnum) trackStatus
    gtk_print_operation_set_track_print_status op' trackStatus'
    touchManagedPtr op
    return ()

data PrintOperationSetTrackPrintStatusMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetTrackPrintStatusMethodInfo a signature where
    overloadedMethod _ = printOperationSetTrackPrintStatus

-- method PrintOperation::set_unit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "unit", argType = TInterface (Name {namespace = "Gtk", name = "Unit"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the unit to use", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_unit" gtk_print_operation_set_unit :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CUInt ->                                -- unit : TInterface (Name {namespace = "Gtk", name = "Unit"})
    IO ()

{- |
Sets up the transformation for the cairo context obtained from
'GI.Gtk.Objects.PrintContext.PrintContext' in such a way that distances are measured in
units of /@unit@/.

@since 2.10
-}
printOperationSetUnit ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Gtk.Enums.Unit
    {- ^ /@unit@/: the unit to use -}
    -> m ()
printOperationSetUnit op unit = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let unit' = (fromIntegral . fromEnum) unit
    gtk_print_operation_set_unit op' unit'
    touchManagedPtr op
    return ()

data PrintOperationSetUnitMethodInfo
instance (signature ~ (Gtk.Enums.Unit -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetUnitMethodInfo a signature where
    overloadedMethod _ = printOperationSetUnit

-- method PrintOperation::set_use_full_page
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gtk", name = "PrintOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkPrintOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "full_page", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to set up the #GtkPrintContext for the full page", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_operation_set_use_full_page" gtk_print_operation_set_use_full_page :: 
    Ptr PrintOperation ->                   -- op : TInterface (Name {namespace = "Gtk", name = "PrintOperation"})
    CInt ->                                 -- full_page : TBasicType TBoolean
    IO ()

{- |
If /@fullPage@/ is 'True', the transformation for the cairo context
obtained from 'GI.Gtk.Objects.PrintContext.PrintContext' puts the origin at the top left
corner of the page (which may not be the top left corner of the
sheet, depending on page orientation and the number of pages per
sheet). Otherwise, the origin is at the top left corner of the
imageable area (i.e. inside the margins).

@since 2.10
-}
printOperationSetUseFullPage ::
    (B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gtk.Objects.PrintOperation.PrintOperation' -}
    -> Bool
    {- ^ /@fullPage@/: 'True' to set up the 'GI.Gtk.Objects.PrintContext.PrintContext' for the full page -}
    -> m ()
printOperationSetUseFullPage op fullPage = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let fullPage' = (fromIntegral . fromEnum) fullPage
    gtk_print_operation_set_use_full_page op' fullPage'
    touchManagedPtr op
    return ()

data PrintOperationSetUseFullPageMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationSetUseFullPageMethodInfo a signature where
    overloadedMethod _ = printOperationSetUseFullPage