module GI.WebKit2.Objects.PrintOperation
(
PrintOperation(..) ,
IsPrintOperation ,
toPrintOperation ,
noPrintOperation ,
PrintOperationGetPageSetupMethodInfo ,
printOperationGetPageSetup ,
PrintOperationGetPrintSettingsMethodInfo,
printOperationGetPrintSettings ,
printOperationNew ,
PrintOperationPrintMethodInfo ,
printOperationPrint ,
PrintOperationRunDialogMethodInfo ,
printOperationRunDialog ,
PrintOperationSetPageSetupMethodInfo ,
printOperationSetPageSetup ,
PrintOperationSetPrintSettingsMethodInfo,
printOperationSetPrintSettings ,
PrintOperationPageSetupPropertyInfo ,
constructPrintOperationPageSetup ,
getPrintOperationPageSetup ,
printOperationPageSetup ,
setPrintOperationPageSetup ,
PrintOperationPrintSettingsPropertyInfo ,
constructPrintOperationPrintSettings ,
getPrintOperationPrintSettings ,
printOperationPrintSettings ,
setPrintOperationPrintSettings ,
PrintOperationWebViewPropertyInfo ,
constructPrintOperationWebView ,
getPrintOperationWebView ,
printOperationWebView ,
C_PrintOperationFailedCallback ,
PrintOperationFailedCallback ,
PrintOperationFailedSignalInfo ,
afterPrintOperationFailed ,
genClosure_PrintOperationFailed ,
mk_PrintOperationFailedCallback ,
noPrintOperationFailedCallback ,
onPrintOperationFailed ,
wrap_PrintOperationFailedCallback ,
C_PrintOperationFinishedCallback ,
PrintOperationFinishedCallback ,
PrintOperationFinishedSignalInfo ,
afterPrintOperationFinished ,
genClosure_PrintOperationFinished ,
mk_PrintOperationFinishedCallback ,
noPrintOperationFinishedCallback ,
onPrintOperationFinished ,
wrap_PrintOperationFinishedCallback ,
) 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 qualified GI.Gtk.Objects.PageSetup as Gtk.PageSetup
import qualified GI.Gtk.Objects.PrintSettings as Gtk.PrintSettings
import qualified GI.Gtk.Objects.Window as Gtk.Window
import qualified GI.WebKit2.Enums as WebKit2.Enums
import qualified GI.WebKit2.Objects.WebView as WebKit2.WebView
newtype PrintOperation = PrintOperation (ManagedPtr PrintOperation)
foreign import ccall "webkit_print_operation_get_type"
c_webkit_print_operation_get_type :: IO GType
instance GObject PrintOperation where
gobjectType _ = c_webkit_print_operation_get_type
class GObject o => IsPrintOperation o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError PrintOperation a) =>
IsPrintOperation a
#endif
instance IsPrintOperation PrintOperation
instance GObject.Object.IsObject 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 "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePrintOperationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePrintOperationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePrintOperationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePrintOperationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePrintOperationMethod "print" o = PrintOperationPrintMethodInfo
ResolvePrintOperationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePrintOperationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePrintOperationMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolvePrintOperationMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolvePrintOperationMethod "runDialog" o = PrintOperationRunDialogMethodInfo
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 "getPageSetup" o = PrintOperationGetPageSetupMethodInfo
ResolvePrintOperationMethod "getPrintSettings" o = PrintOperationGetPrintSettingsMethodInfo
ResolvePrintOperationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePrintOperationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePrintOperationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePrintOperationMethod "setPageSetup" o = PrintOperationSetPageSetupMethodInfo
ResolvePrintOperationMethod "setPrintSettings" o = PrintOperationSetPrintSettingsMethodInfo
ResolvePrintOperationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
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
type PrintOperationFailedCallback =
GError ->
IO ()
noPrintOperationFailedCallback :: Maybe PrintOperationFailedCallback
noPrintOperationFailedCallback = Nothing
type C_PrintOperationFailedCallback =
Ptr () ->
Ptr GError ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_PrintOperationFailedCallback :: C_PrintOperationFailedCallback -> IO (FunPtr C_PrintOperationFailedCallback)
genClosure_PrintOperationFailed :: PrintOperationFailedCallback -> IO Closure
genClosure_PrintOperationFailed cb = do
let cb' = wrap_PrintOperationFailedCallback cb
mk_PrintOperationFailedCallback cb' >>= newCClosure
wrap_PrintOperationFailedCallback ::
PrintOperationFailedCallback ->
Ptr () ->
Ptr GError ->
Ptr () ->
IO ()
wrap_PrintOperationFailedCallback _cb _ error_ _ = do
error_' <- (newBoxed GError) error_
_cb error_'
onPrintOperationFailed :: (GObject a, MonadIO m) => a -> PrintOperationFailedCallback -> m SignalHandlerId
onPrintOperationFailed obj cb = liftIO $ connectPrintOperationFailed obj cb SignalConnectBefore
afterPrintOperationFailed :: (GObject a, MonadIO m) => a -> PrintOperationFailedCallback -> m SignalHandlerId
afterPrintOperationFailed obj cb = connectPrintOperationFailed obj cb SignalConnectAfter
connectPrintOperationFailed :: (GObject a, MonadIO m) =>
a -> PrintOperationFailedCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationFailed obj cb after = liftIO $ do
let cb' = wrap_PrintOperationFailedCallback cb
cb'' <- mk_PrintOperationFailedCallback cb'
connectSignalFunPtr obj "failed" cb'' after
type PrintOperationFinishedCallback =
IO ()
noPrintOperationFinishedCallback :: Maybe PrintOperationFinishedCallback
noPrintOperationFinishedCallback = Nothing
type C_PrintOperationFinishedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_PrintOperationFinishedCallback :: C_PrintOperationFinishedCallback -> IO (FunPtr C_PrintOperationFinishedCallback)
genClosure_PrintOperationFinished :: PrintOperationFinishedCallback -> IO Closure
genClosure_PrintOperationFinished cb = do
let cb' = wrap_PrintOperationFinishedCallback cb
mk_PrintOperationFinishedCallback cb' >>= newCClosure
wrap_PrintOperationFinishedCallback ::
PrintOperationFinishedCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_PrintOperationFinishedCallback _cb _ _ = do
_cb
onPrintOperationFinished :: (GObject a, MonadIO m) => a -> PrintOperationFinishedCallback -> m SignalHandlerId
onPrintOperationFinished obj cb = liftIO $ connectPrintOperationFinished obj cb SignalConnectBefore
afterPrintOperationFinished :: (GObject a, MonadIO m) => a -> PrintOperationFinishedCallback -> m SignalHandlerId
afterPrintOperationFinished obj cb = connectPrintOperationFinished obj cb SignalConnectAfter
connectPrintOperationFinished :: (GObject a, MonadIO m) =>
a -> PrintOperationFinishedCallback -> SignalConnectMode -> m SignalHandlerId
connectPrintOperationFinished obj cb after = liftIO $ do
let cb' = wrap_PrintOperationFinishedCallback cb
cb'' <- mk_PrintOperationFinishedCallback cb'
connectSignalFunPtr obj "finished" cb'' after
getPrintOperationPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m Gtk.PageSetup.PageSetup
getPrintOperationPageSetup obj = liftIO $ checkUnexpectedNothing "getPrintOperationPageSetup" $ getObjectPropertyObject obj "page-setup" Gtk.PageSetup.PageSetup
setPrintOperationPageSetup :: (MonadIO m, IsPrintOperation o, Gtk.PageSetup.IsPageSetup a) => o -> a -> m ()
setPrintOperationPageSetup obj val = liftIO $ setObjectPropertyObject obj "page-setup" (Just val)
constructPrintOperationPageSetup :: (IsPrintOperation o, Gtk.PageSetup.IsPageSetup a) => a -> IO (GValueConstruct o)
constructPrintOperationPageSetup val = constructObjectPropertyObject "page-setup" (Just val)
data PrintOperationPageSetupPropertyInfo
instance AttrInfo PrintOperationPageSetupPropertyInfo where
type AttrAllowedOps PrintOperationPageSetupPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint PrintOperationPageSetupPropertyInfo = Gtk.PageSetup.IsPageSetup
type AttrBaseTypeConstraint PrintOperationPageSetupPropertyInfo = IsPrintOperation
type AttrGetType PrintOperationPageSetupPropertyInfo = Gtk.PageSetup.PageSetup
type AttrLabel PrintOperationPageSetupPropertyInfo = "page-setup"
type AttrOrigin PrintOperationPageSetupPropertyInfo = PrintOperation
attrGet _ = getPrintOperationPageSetup
attrSet _ = setPrintOperationPageSetup
attrConstruct _ = constructPrintOperationPageSetup
attrClear _ = undefined
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)
data PrintOperationPrintSettingsPropertyInfo
instance AttrInfo PrintOperationPrintSettingsPropertyInfo where
type AttrAllowedOps PrintOperationPrintSettingsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
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 _ = undefined
getPrintOperationWebView :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe WebKit2.WebView.WebView)
getPrintOperationWebView obj = liftIO $ getObjectPropertyObject obj "web-view" WebKit2.WebView.WebView
constructPrintOperationWebView :: (IsPrintOperation o, WebKit2.WebView.IsWebView a) => a -> IO (GValueConstruct o)
constructPrintOperationWebView val = constructObjectPropertyObject "web-view" (Just val)
data PrintOperationWebViewPropertyInfo
instance AttrInfo PrintOperationWebViewPropertyInfo where
type AttrAllowedOps PrintOperationWebViewPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PrintOperationWebViewPropertyInfo = WebKit2.WebView.IsWebView
type AttrBaseTypeConstraint PrintOperationWebViewPropertyInfo = IsPrintOperation
type AttrGetType PrintOperationWebViewPropertyInfo = (Maybe WebKit2.WebView.WebView)
type AttrLabel PrintOperationWebViewPropertyInfo = "web-view"
type AttrOrigin PrintOperationWebViewPropertyInfo = PrintOperation
attrGet _ = getPrintOperationWebView
attrSet _ = undefined
attrConstruct _ = constructPrintOperationWebView
attrClear _ = undefined
instance O.HasAttributeList PrintOperation
type instance O.AttributeList PrintOperation = PrintOperationAttributeList
type PrintOperationAttributeList = ('[ '("pageSetup", PrintOperationPageSetupPropertyInfo), '("printSettings", PrintOperationPrintSettingsPropertyInfo), '("webView", PrintOperationWebViewPropertyInfo)] :: [(Symbol, *)])
printOperationPageSetup :: AttrLabelProxy "pageSetup"
printOperationPageSetup = AttrLabelProxy
printOperationPrintSettings :: AttrLabelProxy "printSettings"
printOperationPrintSettings = AttrLabelProxy
printOperationWebView :: AttrLabelProxy "webView"
printOperationWebView = AttrLabelProxy
data PrintOperationFailedSignalInfo
instance SignalInfo PrintOperationFailedSignalInfo where
type HaskellCallbackType PrintOperationFailedSignalInfo = PrintOperationFailedCallback
connectSignal _ = connectPrintOperationFailed
data PrintOperationFinishedSignalInfo
instance SignalInfo PrintOperationFinishedSignalInfo where
type HaskellCallbackType PrintOperationFinishedSignalInfo = PrintOperationFinishedCallback
connectSignal _ = connectPrintOperationFinished
type instance O.SignalList PrintOperation = PrintOperationSignalList
type PrintOperationSignalList = ('[ '("failed", PrintOperationFailedSignalInfo), '("finished", PrintOperationFinishedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_print_operation_new" webkit_print_operation_new ::
Ptr WebKit2.WebView.WebView ->
IO (Ptr PrintOperation)
printOperationNew ::
(B.CallStack.HasCallStack, MonadIO m, WebKit2.WebView.IsWebView a) =>
a
-> m PrintOperation
printOperationNew webView = liftIO $ do
webView' <- unsafeManagedPtrCastPtr webView
result <- webkit_print_operation_new webView'
checkUnexpectedReturnNULL "printOperationNew" result
result' <- (wrapObject PrintOperation) result
touchManagedPtr webView
return result'
foreign import ccall "webkit_print_operation_get_page_setup" webkit_print_operation_get_page_setup ::
Ptr PrintOperation ->
IO (Ptr Gtk.PageSetup.PageSetup)
printOperationGetPageSetup ::
(B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
a
-> m Gtk.PageSetup.PageSetup
printOperationGetPageSetup printOperation = liftIO $ do
printOperation' <- unsafeManagedPtrCastPtr printOperation
result <- webkit_print_operation_get_page_setup printOperation'
checkUnexpectedReturnNULL "printOperationGetPageSetup" result
result' <- (newObject Gtk.PageSetup.PageSetup) result
touchManagedPtr printOperation
return result'
data PrintOperationGetPageSetupMethodInfo
instance (signature ~ (m Gtk.PageSetup.PageSetup), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetPageSetupMethodInfo a signature where
overloadedMethod _ = printOperationGetPageSetup
foreign import ccall "webkit_print_operation_get_print_settings" webkit_print_operation_get_print_settings ::
Ptr PrintOperation ->
IO (Ptr Gtk.PrintSettings.PrintSettings)
printOperationGetPrintSettings ::
(B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
a
-> m Gtk.PrintSettings.PrintSettings
printOperationGetPrintSettings printOperation = liftIO $ do
printOperation' <- unsafeManagedPtrCastPtr printOperation
result <- webkit_print_operation_get_print_settings printOperation'
checkUnexpectedReturnNULL "printOperationGetPrintSettings" result
result' <- (newObject Gtk.PrintSettings.PrintSettings) result
touchManagedPtr printOperation
return result'
data PrintOperationGetPrintSettingsMethodInfo
instance (signature ~ (m Gtk.PrintSettings.PrintSettings), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationGetPrintSettingsMethodInfo a signature where
overloadedMethod _ = printOperationGetPrintSettings
foreign import ccall "webkit_print_operation_print" webkit_print_operation_print ::
Ptr PrintOperation ->
IO ()
printOperationPrint ::
(B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a) =>
a
-> m ()
printOperationPrint printOperation = liftIO $ do
printOperation' <- unsafeManagedPtrCastPtr printOperation
webkit_print_operation_print printOperation'
touchManagedPtr printOperation
return ()
data PrintOperationPrintMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPrintOperation a) => O.MethodInfo PrintOperationPrintMethodInfo a signature where
overloadedMethod _ = printOperationPrint
foreign import ccall "webkit_print_operation_run_dialog" webkit_print_operation_run_dialog ::
Ptr PrintOperation ->
Ptr Gtk.Window.Window ->
IO CUInt
printOperationRunDialog ::
(B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a, Gtk.Window.IsWindow b) =>
a
-> Maybe (b)
-> m WebKit2.Enums.PrintOperationResponse
printOperationRunDialog printOperation parent = liftIO $ do
printOperation' <- unsafeManagedPtrCastPtr printOperation
maybeParent <- case parent of
Nothing -> return nullPtr
Just jParent -> do
jParent' <- unsafeManagedPtrCastPtr jParent
return jParent'
result <- webkit_print_operation_run_dialog printOperation' maybeParent
let result' = (toEnum . fromIntegral) result
touchManagedPtr printOperation
whenJust parent touchManagedPtr
return result'
data PrintOperationRunDialogMethodInfo
instance (signature ~ (Maybe (b) -> m WebKit2.Enums.PrintOperationResponse), MonadIO m, IsPrintOperation a, Gtk.Window.IsWindow b) => O.MethodInfo PrintOperationRunDialogMethodInfo a signature where
overloadedMethod _ = printOperationRunDialog
foreign import ccall "webkit_print_operation_set_page_setup" webkit_print_operation_set_page_setup ::
Ptr PrintOperation ->
Ptr Gtk.PageSetup.PageSetup ->
IO ()
printOperationSetPageSetup ::
(B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a, Gtk.PageSetup.IsPageSetup b) =>
a
-> b
-> m ()
printOperationSetPageSetup printOperation pageSetup = liftIO $ do
printOperation' <- unsafeManagedPtrCastPtr printOperation
pageSetup' <- unsafeManagedPtrCastPtr pageSetup
webkit_print_operation_set_page_setup printOperation' pageSetup'
touchManagedPtr printOperation
touchManagedPtr pageSetup
return ()
data PrintOperationSetPageSetupMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsPrintOperation a, Gtk.PageSetup.IsPageSetup b) => O.MethodInfo PrintOperationSetPageSetupMethodInfo a signature where
overloadedMethod _ = printOperationSetPageSetup
foreign import ccall "webkit_print_operation_set_print_settings" webkit_print_operation_set_print_settings ::
Ptr PrintOperation ->
Ptr Gtk.PrintSettings.PrintSettings ->
IO ()
printOperationSetPrintSettings ::
(B.CallStack.HasCallStack, MonadIO m, IsPrintOperation a, Gtk.PrintSettings.IsPrintSettings b) =>
a
-> b
-> m ()
printOperationSetPrintSettings printOperation printSettings = liftIO $ do
printOperation' <- unsafeManagedPtrCastPtr printOperation
printSettings' <- unsafeManagedPtrCastPtr printSettings
webkit_print_operation_set_print_settings printOperation' printSettings'
touchManagedPtr printOperation
touchManagedPtr printSettings
return ()
data PrintOperationSetPrintSettingsMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsPrintOperation a, Gtk.PrintSettings.IsPrintSettings b) => O.MethodInfo PrintOperationSetPrintSettingsMethodInfo a signature where
overloadedMethod _ = printOperationSetPrintSettings