#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.WebKit2.Objects.URIResponse
(
URIResponse(..) ,
IsURIResponse ,
toURIResponse ,
noURIResponse ,
#if ENABLE_OVERLOADING
URIResponseGetContentLengthMethodInfo ,
#endif
uRIResponseGetContentLength ,
#if ENABLE_OVERLOADING
URIResponseGetHttpHeadersMethodInfo ,
#endif
uRIResponseGetHttpHeaders ,
#if ENABLE_OVERLOADING
URIResponseGetMimeTypeMethodInfo ,
#endif
uRIResponseGetMimeType ,
#if ENABLE_OVERLOADING
URIResponseGetStatusCodeMethodInfo ,
#endif
uRIResponseGetStatusCode ,
#if ENABLE_OVERLOADING
URIResponseGetSuggestedFilenameMethodInfo,
#endif
uRIResponseGetSuggestedFilename ,
#if ENABLE_OVERLOADING
URIResponseGetUriMethodInfo ,
#endif
uRIResponseGetUri ,
#if ENABLE_OVERLOADING
URIResponseContentLengthPropertyInfo ,
#endif
getURIResponseContentLength ,
#if ENABLE_OVERLOADING
uRIResponseContentLength ,
#endif
#if ENABLE_OVERLOADING
URIResponseHttpHeadersPropertyInfo ,
#endif
getURIResponseHttpHeaders ,
#if ENABLE_OVERLOADING
uRIResponseHttpHeaders ,
#endif
#if ENABLE_OVERLOADING
URIResponseMimeTypePropertyInfo ,
#endif
getURIResponseMimeType ,
#if ENABLE_OVERLOADING
uRIResponseMimeType ,
#endif
#if ENABLE_OVERLOADING
URIResponseStatusCodePropertyInfo ,
#endif
getURIResponseStatusCode ,
#if ENABLE_OVERLOADING
uRIResponseStatusCode ,
#endif
#if ENABLE_OVERLOADING
URIResponseSuggestedFilenamePropertyInfo,
#endif
getURIResponseSuggestedFilename ,
#if ENABLE_OVERLOADING
uRIResponseSuggestedFilename ,
#endif
#if ENABLE_OVERLOADING
URIResponseUriPropertyInfo ,
#endif
getURIResponseUri ,
#if ENABLE_OVERLOADING
uRIResponseUri ,
#endif
) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
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 GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders
newtype URIResponse = URIResponse (ManagedPtr URIResponse)
foreign import ccall "webkit_uri_response_get_type"
c_webkit_uri_response_get_type :: IO GType
instance GObject URIResponse where
gobjectType = c_webkit_uri_response_get_type
class (GObject o, O.IsDescendantOf URIResponse o) => IsURIResponse o
instance (GObject o, O.IsDescendantOf URIResponse o) => IsURIResponse o
instance O.HasParentTypes URIResponse
type instance O.ParentTypes URIResponse = '[GObject.Object.Object]
toURIResponse :: (MonadIO m, IsURIResponse o) => o -> m URIResponse
toURIResponse = liftIO . unsafeCastTo URIResponse
noURIResponse :: Maybe URIResponse
noURIResponse = Nothing
#if ENABLE_OVERLOADING
type family ResolveURIResponseMethod (t :: Symbol) (o :: *) :: * where
ResolveURIResponseMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveURIResponseMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveURIResponseMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveURIResponseMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveURIResponseMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveURIResponseMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveURIResponseMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveURIResponseMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveURIResponseMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveURIResponseMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveURIResponseMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveURIResponseMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveURIResponseMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveURIResponseMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveURIResponseMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveURIResponseMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveURIResponseMethod "getContentLength" o = URIResponseGetContentLengthMethodInfo
ResolveURIResponseMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveURIResponseMethod "getHttpHeaders" o = URIResponseGetHttpHeadersMethodInfo
ResolveURIResponseMethod "getMimeType" o = URIResponseGetMimeTypeMethodInfo
ResolveURIResponseMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveURIResponseMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveURIResponseMethod "getStatusCode" o = URIResponseGetStatusCodeMethodInfo
ResolveURIResponseMethod "getSuggestedFilename" o = URIResponseGetSuggestedFilenameMethodInfo
ResolveURIResponseMethod "getUri" o = URIResponseGetUriMethodInfo
ResolveURIResponseMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveURIResponseMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveURIResponseMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveURIResponseMethod t URIResponse, O.MethodInfo info URIResponse p) => OL.IsLabel t (URIResponse -> 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
getURIResponseContentLength :: (MonadIO m, IsURIResponse o) => o -> m Word64
getURIResponseContentLength obj = liftIO $ B.Properties.getObjectPropertyUInt64 obj "content-length"
#if ENABLE_OVERLOADING
data URIResponseContentLengthPropertyInfo
instance AttrInfo URIResponseContentLengthPropertyInfo where
type AttrAllowedOps URIResponseContentLengthPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseContentLengthPropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseContentLengthPropertyInfo = IsURIResponse
type AttrGetType URIResponseContentLengthPropertyInfo = Word64
type AttrLabel URIResponseContentLengthPropertyInfo = "content-length"
type AttrOrigin URIResponseContentLengthPropertyInfo = URIResponse
attrGet _ = getURIResponseContentLength
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getURIResponseHttpHeaders :: (MonadIO m, IsURIResponse o) => o -> m (Maybe Soup.MessageHeaders.MessageHeaders)
getURIResponseHttpHeaders obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "http-headers" Soup.MessageHeaders.MessageHeaders
#if ENABLE_OVERLOADING
data URIResponseHttpHeadersPropertyInfo
instance AttrInfo URIResponseHttpHeadersPropertyInfo where
type AttrAllowedOps URIResponseHttpHeadersPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint URIResponseHttpHeadersPropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseHttpHeadersPropertyInfo = IsURIResponse
type AttrGetType URIResponseHttpHeadersPropertyInfo = (Maybe Soup.MessageHeaders.MessageHeaders)
type AttrLabel URIResponseHttpHeadersPropertyInfo = "http-headers"
type AttrOrigin URIResponseHttpHeadersPropertyInfo = URIResponse
attrGet _ = getURIResponseHttpHeaders
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getURIResponseMimeType :: (MonadIO m, IsURIResponse o) => o -> m T.Text
getURIResponseMimeType obj = liftIO $ checkUnexpectedNothing "getURIResponseMimeType" $ B.Properties.getObjectPropertyString obj "mime-type"
#if ENABLE_OVERLOADING
data URIResponseMimeTypePropertyInfo
instance AttrInfo URIResponseMimeTypePropertyInfo where
type AttrAllowedOps URIResponseMimeTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint URIResponseMimeTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseMimeTypePropertyInfo = IsURIResponse
type AttrGetType URIResponseMimeTypePropertyInfo = T.Text
type AttrLabel URIResponseMimeTypePropertyInfo = "mime-type"
type AttrOrigin URIResponseMimeTypePropertyInfo = URIResponse
attrGet _ = getURIResponseMimeType
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getURIResponseStatusCode :: (MonadIO m, IsURIResponse o) => o -> m Word32
getURIResponseStatusCode obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "status-code"
#if ENABLE_OVERLOADING
data URIResponseStatusCodePropertyInfo
instance AttrInfo URIResponseStatusCodePropertyInfo where
type AttrAllowedOps URIResponseStatusCodePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseStatusCodePropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseStatusCodePropertyInfo = IsURIResponse
type AttrGetType URIResponseStatusCodePropertyInfo = Word32
type AttrLabel URIResponseStatusCodePropertyInfo = "status-code"
type AttrOrigin URIResponseStatusCodePropertyInfo = URIResponse
attrGet _ = getURIResponseStatusCode
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getURIResponseSuggestedFilename :: (MonadIO m, IsURIResponse o) => o -> m (Maybe T.Text)
getURIResponseSuggestedFilename obj = liftIO $ B.Properties.getObjectPropertyString obj "suggested-filename"
#if ENABLE_OVERLOADING
data URIResponseSuggestedFilenamePropertyInfo
instance AttrInfo URIResponseSuggestedFilenamePropertyInfo where
type AttrAllowedOps URIResponseSuggestedFilenamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint URIResponseSuggestedFilenamePropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseSuggestedFilenamePropertyInfo = IsURIResponse
type AttrGetType URIResponseSuggestedFilenamePropertyInfo = (Maybe T.Text)
type AttrLabel URIResponseSuggestedFilenamePropertyInfo = "suggested-filename"
type AttrOrigin URIResponseSuggestedFilenamePropertyInfo = URIResponse
attrGet _ = getURIResponseSuggestedFilename
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getURIResponseUri :: (MonadIO m, IsURIResponse o) => o -> m T.Text
getURIResponseUri obj = liftIO $ checkUnexpectedNothing "getURIResponseUri" $ B.Properties.getObjectPropertyString obj "uri"
#if ENABLE_OVERLOADING
data URIResponseUriPropertyInfo
instance AttrInfo URIResponseUriPropertyInfo where
type AttrAllowedOps URIResponseUriPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint URIResponseUriPropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseUriPropertyInfo = IsURIResponse
type AttrGetType URIResponseUriPropertyInfo = T.Text
type AttrLabel URIResponseUriPropertyInfo = "uri"
type AttrOrigin URIResponseUriPropertyInfo = URIResponse
attrGet _ = getURIResponseUri
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList URIResponse
type instance O.AttributeList URIResponse = URIResponseAttributeList
type URIResponseAttributeList = ('[ '("contentLength", URIResponseContentLengthPropertyInfo), '("httpHeaders", URIResponseHttpHeadersPropertyInfo), '("mimeType", URIResponseMimeTypePropertyInfo), '("statusCode", URIResponseStatusCodePropertyInfo), '("suggestedFilename", URIResponseSuggestedFilenamePropertyInfo), '("uri", URIResponseUriPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
uRIResponseContentLength :: AttrLabelProxy "contentLength"
uRIResponseContentLength = AttrLabelProxy
uRIResponseHttpHeaders :: AttrLabelProxy "httpHeaders"
uRIResponseHttpHeaders = AttrLabelProxy
uRIResponseMimeType :: AttrLabelProxy "mimeType"
uRIResponseMimeType = AttrLabelProxy
uRIResponseStatusCode :: AttrLabelProxy "statusCode"
uRIResponseStatusCode = AttrLabelProxy
uRIResponseSuggestedFilename :: AttrLabelProxy "suggestedFilename"
uRIResponseSuggestedFilename = AttrLabelProxy
uRIResponseUri :: AttrLabelProxy "uri"
uRIResponseUri = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList URIResponse = URIResponseSignalList
type URIResponseSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_uri_response_get_content_length" webkit_uri_response_get_content_length ::
Ptr URIResponse ->
IO Word64
uRIResponseGetContentLength ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
-> m Word64
uRIResponseGetContentLength response = liftIO $ do
response' <- unsafeManagedPtrCastPtr response
result <- webkit_uri_response_get_content_length response'
touchManagedPtr response
return result
#if ENABLE_OVERLOADING
data URIResponseGetContentLengthMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetContentLengthMethodInfo a signature where
overloadedMethod _ = uRIResponseGetContentLength
#endif
foreign import ccall "webkit_uri_response_get_http_headers" webkit_uri_response_get_http_headers ::
Ptr URIResponse ->
IO (Ptr Soup.MessageHeaders.MessageHeaders)
uRIResponseGetHttpHeaders ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
-> m (Maybe Soup.MessageHeaders.MessageHeaders)
uRIResponseGetHttpHeaders response = liftIO $ do
response' <- unsafeManagedPtrCastPtr response
result <- webkit_uri_response_get_http_headers response'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Soup.MessageHeaders.MessageHeaders) result'
return result''
touchManagedPtr response
return maybeResult
#if ENABLE_OVERLOADING
data URIResponseGetHttpHeadersMethodInfo
instance (signature ~ (m (Maybe Soup.MessageHeaders.MessageHeaders)), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetHttpHeadersMethodInfo a signature where
overloadedMethod _ = uRIResponseGetHttpHeaders
#endif
foreign import ccall "webkit_uri_response_get_mime_type" webkit_uri_response_get_mime_type ::
Ptr URIResponse ->
IO CString
uRIResponseGetMimeType ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
-> m T.Text
uRIResponseGetMimeType response = liftIO $ do
response' <- unsafeManagedPtrCastPtr response
result <- webkit_uri_response_get_mime_type response'
checkUnexpectedReturnNULL "uRIResponseGetMimeType" result
result' <- cstringToText result
touchManagedPtr response
return result'
#if ENABLE_OVERLOADING
data URIResponseGetMimeTypeMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetMimeTypeMethodInfo a signature where
overloadedMethod _ = uRIResponseGetMimeType
#endif
foreign import ccall "webkit_uri_response_get_status_code" webkit_uri_response_get_status_code ::
Ptr URIResponse ->
IO Word32
uRIResponseGetStatusCode ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
-> m Word32
uRIResponseGetStatusCode response = liftIO $ do
response' <- unsafeManagedPtrCastPtr response
result <- webkit_uri_response_get_status_code response'
touchManagedPtr response
return result
#if ENABLE_OVERLOADING
data URIResponseGetStatusCodeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetStatusCodeMethodInfo a signature where
overloadedMethod _ = uRIResponseGetStatusCode
#endif
foreign import ccall "webkit_uri_response_get_suggested_filename" webkit_uri_response_get_suggested_filename ::
Ptr URIResponse ->
IO CString
uRIResponseGetSuggestedFilename ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
-> m (Maybe T.Text)
uRIResponseGetSuggestedFilename response = liftIO $ do
response' <- unsafeManagedPtrCastPtr response
result <- webkit_uri_response_get_suggested_filename response'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr response
return maybeResult
#if ENABLE_OVERLOADING
data URIResponseGetSuggestedFilenameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetSuggestedFilenameMethodInfo a signature where
overloadedMethod _ = uRIResponseGetSuggestedFilename
#endif
foreign import ccall "webkit_uri_response_get_uri" webkit_uri_response_get_uri ::
Ptr URIResponse ->
IO CString
uRIResponseGetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
-> m T.Text
uRIResponseGetUri response = liftIO $ do
response' <- unsafeManagedPtrCastPtr response
result <- webkit_uri_response_get_uri response'
checkUnexpectedReturnNULL "uRIResponseGetUri" result
result' <- cstringToText result
touchManagedPtr response
return result'
#if ENABLE_OVERLOADING
data URIResponseGetUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetUriMethodInfo a signature where
overloadedMethod _ = uRIResponseGetUri
#endif