module GI.WebKit.Objects.Download
(
Download(..) ,
IsDownload ,
toDownload ,
noDownload ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadCancelMethodInfo ,
#endif
downloadCancel ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetCurrentSizeMethodInfo ,
#endif
downloadGetCurrentSize ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetDestinationUriMethodInfo ,
#endif
downloadGetDestinationUri ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetElapsedTimeMethodInfo ,
#endif
downloadGetElapsedTime ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetNetworkRequestMethodInfo ,
#endif
downloadGetNetworkRequest ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetNetworkResponseMethodInfo ,
#endif
downloadGetNetworkResponse ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetProgressMethodInfo ,
#endif
downloadGetProgress ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetStatusMethodInfo ,
#endif
downloadGetStatus ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetSuggestedFilenameMethodInfo ,
#endif
downloadGetSuggestedFilename ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetTotalSizeMethodInfo ,
#endif
downloadGetTotalSize ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadGetUriMethodInfo ,
#endif
downloadGetUri ,
downloadNew ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadSetDestinationUriMethodInfo ,
#endif
downloadSetDestinationUri ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadStartMethodInfo ,
#endif
downloadStart ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadCurrentSizePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadCurrentSize ,
#endif
getDownloadCurrentSize ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadDestinationUriPropertyInfo ,
#endif
constructDownloadDestinationUri ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadDestinationUri ,
#endif
getDownloadDestinationUri ,
setDownloadDestinationUri ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadNetworkRequestPropertyInfo ,
#endif
constructDownloadNetworkRequest ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadNetworkRequest ,
#endif
getDownloadNetworkRequest ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadNetworkResponsePropertyInfo ,
#endif
constructDownloadNetworkResponse ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadNetworkResponse ,
#endif
getDownloadNetworkResponse ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadProgressPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadProgress ,
#endif
getDownloadProgress ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadStatusPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadStatus ,
#endif
getDownloadStatus ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadSuggestedFilenamePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadSuggestedFilename ,
#endif
getDownloadSuggestedFilename ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadTotalSizePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadTotalSize ,
#endif
getDownloadTotalSize ,
C_DownloadErrorCallback ,
DownloadErrorCallback ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DownloadErrorSignalInfo ,
#endif
afterDownloadError ,
genClosure_DownloadError ,
mk_DownloadErrorCallback ,
noDownloadErrorCallback ,
onDownloadError ,
wrap_DownloadErrorCallback ,
) 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.WebKit.Enums as WebKit.Enums
import qualified GI.WebKit.Objects.NetworkRequest as WebKit.NetworkRequest
import qualified GI.WebKit.Objects.NetworkResponse as WebKit.NetworkResponse
newtype Download = Download (ManagedPtr Download)
foreign import ccall "webkit_download_get_type"
c_webkit_download_get_type :: IO GType
instance GObject Download where
gobjectType _ = c_webkit_download_get_type
class GObject o => IsDownload o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError Download a) =>
IsDownload a
#endif
instance IsDownload Download
instance GObject.Object.IsObject Download
toDownload :: (MonadIO m, IsDownload o) => o -> m Download
toDownload = liftIO . unsafeCastTo Download
noDownload :: Maybe Download
noDownload = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveDownloadMethod (t :: Symbol) (o :: *) :: * where
ResolveDownloadMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDownloadMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDownloadMethod "cancel" o = DownloadCancelMethodInfo
ResolveDownloadMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDownloadMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDownloadMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDownloadMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDownloadMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDownloadMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDownloadMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDownloadMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveDownloadMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveDownloadMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDownloadMethod "start" o = DownloadStartMethodInfo
ResolveDownloadMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDownloadMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDownloadMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDownloadMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDownloadMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDownloadMethod "getCurrentSize" o = DownloadGetCurrentSizeMethodInfo
ResolveDownloadMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDownloadMethod "getDestinationUri" o = DownloadGetDestinationUriMethodInfo
ResolveDownloadMethod "getElapsedTime" o = DownloadGetElapsedTimeMethodInfo
ResolveDownloadMethod "getNetworkRequest" o = DownloadGetNetworkRequestMethodInfo
ResolveDownloadMethod "getNetworkResponse" o = DownloadGetNetworkResponseMethodInfo
ResolveDownloadMethod "getProgress" o = DownloadGetProgressMethodInfo
ResolveDownloadMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDownloadMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDownloadMethod "getStatus" o = DownloadGetStatusMethodInfo
ResolveDownloadMethod "getSuggestedFilename" o = DownloadGetSuggestedFilenameMethodInfo
ResolveDownloadMethod "getTotalSize" o = DownloadGetTotalSizeMethodInfo
ResolveDownloadMethod "getUri" o = DownloadGetUriMethodInfo
ResolveDownloadMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDownloadMethod "setDestinationUri" o = DownloadSetDestinationUriMethodInfo
ResolveDownloadMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDownloadMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDownloadMethod t Download, O.MethodInfo info Download p) => O.IsLabelProxy t (Download -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDownloadMethod t Download, O.MethodInfo info Download p) => O.IsLabel t (Download -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
type DownloadErrorCallback =
Int32 ->
Int32 ->
T.Text ->
IO Bool
noDownloadErrorCallback :: Maybe DownloadErrorCallback
noDownloadErrorCallback = Nothing
type C_DownloadErrorCallback =
Ptr () ->
Int32 ->
Int32 ->
CString ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_DownloadErrorCallback :: C_DownloadErrorCallback -> IO (FunPtr C_DownloadErrorCallback)
genClosure_DownloadError :: DownloadErrorCallback -> IO Closure
genClosure_DownloadError cb = do
let cb' = wrap_DownloadErrorCallback cb
mk_DownloadErrorCallback cb' >>= newCClosure
wrap_DownloadErrorCallback ::
DownloadErrorCallback ->
Ptr () ->
Int32 ->
Int32 ->
CString ->
Ptr () ->
IO CInt
wrap_DownloadErrorCallback _cb _ errorCode errorDetail reason _ = do
reason' <- cstringToText reason
result <- _cb errorCode errorDetail reason'
let result' = (fromIntegral . fromEnum) result
return result'
onDownloadError :: (IsDownload a, MonadIO m) => a -> DownloadErrorCallback -> m SignalHandlerId
onDownloadError obj cb = liftIO $ do
let cb' = wrap_DownloadErrorCallback cb
cb'' <- mk_DownloadErrorCallback cb'
connectSignalFunPtr obj "error" cb'' SignalConnectBefore
afterDownloadError :: (IsDownload a, MonadIO m) => a -> DownloadErrorCallback -> m SignalHandlerId
afterDownloadError obj cb = liftIO $ do
let cb' = wrap_DownloadErrorCallback cb
cb'' <- mk_DownloadErrorCallback cb'
connectSignalFunPtr obj "error" cb'' SignalConnectAfter
getDownloadCurrentSize :: (MonadIO m, IsDownload o) => o -> m Word64
getDownloadCurrentSize obj = liftIO $ getObjectPropertyUInt64 obj "current-size"
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadCurrentSizePropertyInfo
instance AttrInfo DownloadCurrentSizePropertyInfo where
type AttrAllowedOps DownloadCurrentSizePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DownloadCurrentSizePropertyInfo = (~) ()
type AttrBaseTypeConstraint DownloadCurrentSizePropertyInfo = IsDownload
type AttrGetType DownloadCurrentSizePropertyInfo = Word64
type AttrLabel DownloadCurrentSizePropertyInfo = "current-size"
type AttrOrigin DownloadCurrentSizePropertyInfo = Download
attrGet _ = getDownloadCurrentSize
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDownloadDestinationUri :: (MonadIO m, IsDownload o) => o -> m T.Text
getDownloadDestinationUri obj = liftIO $ checkUnexpectedNothing "getDownloadDestinationUri" $ getObjectPropertyString obj "destination-uri"
setDownloadDestinationUri :: (MonadIO m, IsDownload o) => o -> T.Text -> m ()
setDownloadDestinationUri obj val = liftIO $ setObjectPropertyString obj "destination-uri" (Just val)
constructDownloadDestinationUri :: (IsDownload o) => T.Text -> IO (GValueConstruct o)
constructDownloadDestinationUri val = constructObjectPropertyString "destination-uri" (Just val)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadDestinationUriPropertyInfo
instance AttrInfo DownloadDestinationUriPropertyInfo where
type AttrAllowedOps DownloadDestinationUriPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DownloadDestinationUriPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DownloadDestinationUriPropertyInfo = IsDownload
type AttrGetType DownloadDestinationUriPropertyInfo = T.Text
type AttrLabel DownloadDestinationUriPropertyInfo = "destination-uri"
type AttrOrigin DownloadDestinationUriPropertyInfo = Download
attrGet _ = getDownloadDestinationUri
attrSet _ = setDownloadDestinationUri
attrConstruct _ = constructDownloadDestinationUri
attrClear _ = undefined
#endif
getDownloadNetworkRequest :: (MonadIO m, IsDownload o) => o -> m WebKit.NetworkRequest.NetworkRequest
getDownloadNetworkRequest obj = liftIO $ checkUnexpectedNothing "getDownloadNetworkRequest" $ getObjectPropertyObject obj "network-request" WebKit.NetworkRequest.NetworkRequest
constructDownloadNetworkRequest :: (IsDownload o, WebKit.NetworkRequest.IsNetworkRequest a) => a -> IO (GValueConstruct o)
constructDownloadNetworkRequest val = constructObjectPropertyObject "network-request" (Just val)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadNetworkRequestPropertyInfo
instance AttrInfo DownloadNetworkRequestPropertyInfo where
type AttrAllowedOps DownloadNetworkRequestPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DownloadNetworkRequestPropertyInfo = WebKit.NetworkRequest.IsNetworkRequest
type AttrBaseTypeConstraint DownloadNetworkRequestPropertyInfo = IsDownload
type AttrGetType DownloadNetworkRequestPropertyInfo = WebKit.NetworkRequest.NetworkRequest
type AttrLabel DownloadNetworkRequestPropertyInfo = "network-request"
type AttrOrigin DownloadNetworkRequestPropertyInfo = Download
attrGet _ = getDownloadNetworkRequest
attrSet _ = undefined
attrConstruct _ = constructDownloadNetworkRequest
attrClear _ = undefined
#endif
getDownloadNetworkResponse :: (MonadIO m, IsDownload o) => o -> m WebKit.NetworkResponse.NetworkResponse
getDownloadNetworkResponse obj = liftIO $ checkUnexpectedNothing "getDownloadNetworkResponse" $ getObjectPropertyObject obj "network-response" WebKit.NetworkResponse.NetworkResponse
constructDownloadNetworkResponse :: (IsDownload o, WebKit.NetworkResponse.IsNetworkResponse a) => a -> IO (GValueConstruct o)
constructDownloadNetworkResponse val = constructObjectPropertyObject "network-response" (Just val)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadNetworkResponsePropertyInfo
instance AttrInfo DownloadNetworkResponsePropertyInfo where
type AttrAllowedOps DownloadNetworkResponsePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DownloadNetworkResponsePropertyInfo = WebKit.NetworkResponse.IsNetworkResponse
type AttrBaseTypeConstraint DownloadNetworkResponsePropertyInfo = IsDownload
type AttrGetType DownloadNetworkResponsePropertyInfo = WebKit.NetworkResponse.NetworkResponse
type AttrLabel DownloadNetworkResponsePropertyInfo = "network-response"
type AttrOrigin DownloadNetworkResponsePropertyInfo = Download
attrGet _ = getDownloadNetworkResponse
attrSet _ = undefined
attrConstruct _ = constructDownloadNetworkResponse
attrClear _ = undefined
#endif
getDownloadProgress :: (MonadIO m, IsDownload o) => o -> m Double
getDownloadProgress obj = liftIO $ getObjectPropertyDouble obj "progress"
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadProgressPropertyInfo
instance AttrInfo DownloadProgressPropertyInfo where
type AttrAllowedOps DownloadProgressPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DownloadProgressPropertyInfo = (~) ()
type AttrBaseTypeConstraint DownloadProgressPropertyInfo = IsDownload
type AttrGetType DownloadProgressPropertyInfo = Double
type AttrLabel DownloadProgressPropertyInfo = "progress"
type AttrOrigin DownloadProgressPropertyInfo = Download
attrGet _ = getDownloadProgress
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDownloadStatus :: (MonadIO m, IsDownload o) => o -> m WebKit.Enums.DownloadStatus
getDownloadStatus obj = liftIO $ getObjectPropertyEnum obj "status"
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadStatusPropertyInfo
instance AttrInfo DownloadStatusPropertyInfo where
type AttrAllowedOps DownloadStatusPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DownloadStatusPropertyInfo = (~) ()
type AttrBaseTypeConstraint DownloadStatusPropertyInfo = IsDownload
type AttrGetType DownloadStatusPropertyInfo = WebKit.Enums.DownloadStatus
type AttrLabel DownloadStatusPropertyInfo = "status"
type AttrOrigin DownloadStatusPropertyInfo = Download
attrGet _ = getDownloadStatus
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDownloadSuggestedFilename :: (MonadIO m, IsDownload o) => o -> m T.Text
getDownloadSuggestedFilename obj = liftIO $ checkUnexpectedNothing "getDownloadSuggestedFilename" $ getObjectPropertyString obj "suggested-filename"
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadSuggestedFilenamePropertyInfo
instance AttrInfo DownloadSuggestedFilenamePropertyInfo where
type AttrAllowedOps DownloadSuggestedFilenamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DownloadSuggestedFilenamePropertyInfo = (~) ()
type AttrBaseTypeConstraint DownloadSuggestedFilenamePropertyInfo = IsDownload
type AttrGetType DownloadSuggestedFilenamePropertyInfo = T.Text
type AttrLabel DownloadSuggestedFilenamePropertyInfo = "suggested-filename"
type AttrOrigin DownloadSuggestedFilenamePropertyInfo = Download
attrGet _ = getDownloadSuggestedFilename
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDownloadTotalSize :: (MonadIO m, IsDownload o) => o -> m Word64
getDownloadTotalSize obj = liftIO $ getObjectPropertyUInt64 obj "total-size"
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadTotalSizePropertyInfo
instance AttrInfo DownloadTotalSizePropertyInfo where
type AttrAllowedOps DownloadTotalSizePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DownloadTotalSizePropertyInfo = (~) ()
type AttrBaseTypeConstraint DownloadTotalSizePropertyInfo = IsDownload
type AttrGetType DownloadTotalSizePropertyInfo = Word64
type AttrLabel DownloadTotalSizePropertyInfo = "total-size"
type AttrOrigin DownloadTotalSizePropertyInfo = Download
attrGet _ = getDownloadTotalSize
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList Download
type instance O.AttributeList Download = DownloadAttributeList
type DownloadAttributeList = ('[ '("currentSize", DownloadCurrentSizePropertyInfo), '("destinationUri", DownloadDestinationUriPropertyInfo), '("networkRequest", DownloadNetworkRequestPropertyInfo), '("networkResponse", DownloadNetworkResponsePropertyInfo), '("progress", DownloadProgressPropertyInfo), '("status", DownloadStatusPropertyInfo), '("suggestedFilename", DownloadSuggestedFilenamePropertyInfo), '("totalSize", DownloadTotalSizePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
downloadCurrentSize :: AttrLabelProxy "currentSize"
downloadCurrentSize = AttrLabelProxy
downloadDestinationUri :: AttrLabelProxy "destinationUri"
downloadDestinationUri = AttrLabelProxy
downloadNetworkRequest :: AttrLabelProxy "networkRequest"
downloadNetworkRequest = AttrLabelProxy
downloadNetworkResponse :: AttrLabelProxy "networkResponse"
downloadNetworkResponse = AttrLabelProxy
downloadProgress :: AttrLabelProxy "progress"
downloadProgress = AttrLabelProxy
downloadStatus :: AttrLabelProxy "status"
downloadStatus = AttrLabelProxy
downloadSuggestedFilename :: AttrLabelProxy "suggestedFilename"
downloadSuggestedFilename = AttrLabelProxy
downloadTotalSize :: AttrLabelProxy "totalSize"
downloadTotalSize = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadErrorSignalInfo
instance SignalInfo DownloadErrorSignalInfo where
type HaskellCallbackType DownloadErrorSignalInfo = DownloadErrorCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DownloadErrorCallback cb
cb'' <- mk_DownloadErrorCallback cb'
connectSignalFunPtr obj "error" cb'' connectMode
type instance O.SignalList Download = DownloadSignalList
type DownloadSignalList = ('[ '("error", DownloadErrorSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_download_new" webkit_download_new ::
Ptr WebKit.NetworkRequest.NetworkRequest ->
IO (Ptr Download)
downloadNew ::
(B.CallStack.HasCallStack, MonadIO m, WebKit.NetworkRequest.IsNetworkRequest a) =>
a
-> m Download
downloadNew request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_download_new request'
checkUnexpectedReturnNULL "downloadNew" result
result' <- (wrapObject Download) result
touchManagedPtr request
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
foreign import ccall "webkit_download_cancel" webkit_download_cancel ::
Ptr Download ->
IO ()
downloadCancel ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m ()
downloadCancel download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
webkit_download_cancel download'
touchManagedPtr download
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadCancelMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDownload a) => O.MethodInfo DownloadCancelMethodInfo a signature where
overloadedMethod _ = downloadCancel
#endif
foreign import ccall "webkit_download_get_current_size" webkit_download_get_current_size ::
Ptr Download ->
IO Word64
downloadGetCurrentSize ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m Word64
downloadGetCurrentSize download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_current_size download'
touchManagedPtr download
return result
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetCurrentSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetCurrentSizeMethodInfo a signature where
overloadedMethod _ = downloadGetCurrentSize
#endif
foreign import ccall "webkit_download_get_destination_uri" webkit_download_get_destination_uri ::
Ptr Download ->
IO CString
downloadGetDestinationUri ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m T.Text
downloadGetDestinationUri download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_destination_uri download'
checkUnexpectedReturnNULL "downloadGetDestinationUri" result
result' <- cstringToText result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetDestinationUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetDestinationUriMethodInfo a signature where
overloadedMethod _ = downloadGetDestinationUri
#endif
foreign import ccall "webkit_download_get_elapsed_time" webkit_download_get_elapsed_time ::
Ptr Download ->
IO CDouble
downloadGetElapsedTime ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m Double
downloadGetElapsedTime download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_elapsed_time download'
let result' = realToFrac result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetElapsedTimeMethodInfo
instance (signature ~ (m Double), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetElapsedTimeMethodInfo a signature where
overloadedMethod _ = downloadGetElapsedTime
#endif
foreign import ccall "webkit_download_get_network_request" webkit_download_get_network_request ::
Ptr Download ->
IO (Ptr WebKit.NetworkRequest.NetworkRequest)
downloadGetNetworkRequest ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m WebKit.NetworkRequest.NetworkRequest
downloadGetNetworkRequest download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_network_request download'
checkUnexpectedReturnNULL "downloadGetNetworkRequest" result
result' <- (newObject WebKit.NetworkRequest.NetworkRequest) result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetNetworkRequestMethodInfo
instance (signature ~ (m WebKit.NetworkRequest.NetworkRequest), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetNetworkRequestMethodInfo a signature where
overloadedMethod _ = downloadGetNetworkRequest
#endif
foreign import ccall "webkit_download_get_network_response" webkit_download_get_network_response ::
Ptr Download ->
IO (Ptr WebKit.NetworkResponse.NetworkResponse)
downloadGetNetworkResponse ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m WebKit.NetworkResponse.NetworkResponse
downloadGetNetworkResponse download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_network_response download'
checkUnexpectedReturnNULL "downloadGetNetworkResponse" result
result' <- (newObject WebKit.NetworkResponse.NetworkResponse) result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetNetworkResponseMethodInfo
instance (signature ~ (m WebKit.NetworkResponse.NetworkResponse), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetNetworkResponseMethodInfo a signature where
overloadedMethod _ = downloadGetNetworkResponse
#endif
foreign import ccall "webkit_download_get_progress" webkit_download_get_progress ::
Ptr Download ->
IO CDouble
downloadGetProgress ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m Double
downloadGetProgress download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_progress download'
let result' = realToFrac result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetProgressMethodInfo
instance (signature ~ (m Double), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetProgressMethodInfo a signature where
overloadedMethod _ = downloadGetProgress
#endif
foreign import ccall "webkit_download_get_status" webkit_download_get_status ::
Ptr Download ->
IO CUInt
downloadGetStatus ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m WebKit.Enums.DownloadStatus
downloadGetStatus download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_status download'
let result' = (toEnum . fromIntegral) result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetStatusMethodInfo
instance (signature ~ (m WebKit.Enums.DownloadStatus), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetStatusMethodInfo a signature where
overloadedMethod _ = downloadGetStatus
#endif
foreign import ccall "webkit_download_get_suggested_filename" webkit_download_get_suggested_filename ::
Ptr Download ->
IO CString
downloadGetSuggestedFilename ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m T.Text
downloadGetSuggestedFilename download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_suggested_filename download'
checkUnexpectedReturnNULL "downloadGetSuggestedFilename" result
result' <- cstringToText result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetSuggestedFilenameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetSuggestedFilenameMethodInfo a signature where
overloadedMethod _ = downloadGetSuggestedFilename
#endif
foreign import ccall "webkit_download_get_total_size" webkit_download_get_total_size ::
Ptr Download ->
IO Word64
downloadGetTotalSize ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m Word64
downloadGetTotalSize download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_total_size download'
touchManagedPtr download
return result
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetTotalSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetTotalSizeMethodInfo a signature where
overloadedMethod _ = downloadGetTotalSize
#endif
foreign import ccall "webkit_download_get_uri" webkit_download_get_uri ::
Ptr Download ->
IO CString
downloadGetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m T.Text
downloadGetUri download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
result <- webkit_download_get_uri download'
checkUnexpectedReturnNULL "downloadGetUri" result
result' <- cstringToText result
touchManagedPtr download
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadGetUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDownload a) => O.MethodInfo DownloadGetUriMethodInfo a signature where
overloadedMethod _ = downloadGetUri
#endif
foreign import ccall "webkit_download_set_destination_uri" webkit_download_set_destination_uri ::
Ptr Download ->
CString ->
IO ()
downloadSetDestinationUri ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> T.Text
-> m ()
downloadSetDestinationUri download destinationUri = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
destinationUri' <- textToCString destinationUri
webkit_download_set_destination_uri download' destinationUri'
touchManagedPtr download
freeMem destinationUri'
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadSetDestinationUriMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDownload a) => O.MethodInfo DownloadSetDestinationUriMethodInfo a signature where
overloadedMethod _ = downloadSetDestinationUri
#endif
foreign import ccall "webkit_download_start" webkit_download_start ::
Ptr Download ->
IO ()
downloadStart ::
(B.CallStack.HasCallStack, MonadIO m, IsDownload a) =>
a
-> m ()
downloadStart download = liftIO $ do
download' <- unsafeManagedPtrCastPtr download
webkit_download_start download'
touchManagedPtr download
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DownloadStartMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDownload a) => O.MethodInfo DownloadStartMethodInfo a signature where
overloadedMethod _ = downloadStart
#endif