gi-webkit2-4.0.21: GI/WebKit2/Objects/URIResponse.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
/No description available in the introspection data./
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.WebKit2.Objects.URIResponse
(
-- * Exported types
URIResponse(..) ,
IsURIResponse ,
toURIResponse ,
noURIResponse ,
-- * Methods
-- ** getContentLength #method:getContentLength#
#if ENABLE_OVERLOADING
URIResponseGetContentLengthMethodInfo ,
#endif
uRIResponseGetContentLength ,
-- ** getHttpHeaders #method:getHttpHeaders#
#if ENABLE_OVERLOADING
URIResponseGetHttpHeadersMethodInfo ,
#endif
uRIResponseGetHttpHeaders ,
-- ** getMimeType #method:getMimeType#
#if ENABLE_OVERLOADING
URIResponseGetMimeTypeMethodInfo ,
#endif
uRIResponseGetMimeType ,
-- ** getStatusCode #method:getStatusCode#
#if ENABLE_OVERLOADING
URIResponseGetStatusCodeMethodInfo ,
#endif
uRIResponseGetStatusCode ,
-- ** getSuggestedFilename #method:getSuggestedFilename#
#if ENABLE_OVERLOADING
URIResponseGetSuggestedFilenameMethodInfo,
#endif
uRIResponseGetSuggestedFilename ,
-- ** getUri #method:getUri#
#if ENABLE_OVERLOADING
URIResponseGetUriMethodInfo ,
#endif
uRIResponseGetUri ,
-- * Properties
-- ** contentLength #attr:contentLength#
{- | The expected content length of the response.
-}
#if ENABLE_OVERLOADING
URIResponseContentLengthPropertyInfo ,
#endif
getURIResponseContentLength ,
#if ENABLE_OVERLOADING
uRIResponseContentLength ,
#endif
-- ** httpHeaders #attr:httpHeaders#
{- | The HTTP headers of the response, or 'Nothing' if the response is not an HTTP response.
/Since: 2.6/
-}
#if ENABLE_OVERLOADING
URIResponseHttpHeadersPropertyInfo ,
#endif
getURIResponseHttpHeaders ,
#if ENABLE_OVERLOADING
uRIResponseHttpHeaders ,
#endif
-- ** mimeType #attr:mimeType#
{- | The MIME type of the response.
-}
#if ENABLE_OVERLOADING
URIResponseMimeTypePropertyInfo ,
#endif
getURIResponseMimeType ,
#if ENABLE_OVERLOADING
uRIResponseMimeType ,
#endif
-- ** statusCode #attr:statusCode#
{- | The status code of the response as returned by the server.
-}
#if ENABLE_OVERLOADING
URIResponseStatusCodePropertyInfo ,
#endif
getURIResponseStatusCode ,
#if ENABLE_OVERLOADING
uRIResponseStatusCode ,
#endif
-- ** suggestedFilename #attr:suggestedFilename#
{- | The suggested filename for the URI response.
-}
#if ENABLE_OVERLOADING
URIResponseSuggestedFilenamePropertyInfo,
#endif
getURIResponseSuggestedFilename ,
#if ENABLE_OVERLOADING
uRIResponseSuggestedFilename ,
#endif
-- ** uri #attr:uri#
{- | The URI for which the response was made.
-}
#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
-- | Memory-managed wrapper type.
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
-- | Type class for types which can be safely cast to `URIResponse`, for instance with `toURIResponse`.
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]
-- | Cast to `URIResponse`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toURIResponse :: (MonadIO m, IsURIResponse o) => o -> m URIResponse
toURIResponse = liftIO . unsafeCastTo URIResponse
-- | A convenience alias for `Nothing` :: `Maybe` `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
-- VVV Prop "content-length"
-- Type: TBasicType TUInt64
-- Flags: [PropertyReadable]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@content-length@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' uRIResponse #contentLength
@
-}
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
-- VVV Prop "http-headers"
-- Type: TInterface (Name {namespace = "Soup", name = "MessageHeaders"})
-- Flags: [PropertyReadable]
-- Nullable: (Just True,Nothing)
{- |
Get the value of the “@http-headers@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' uRIResponse #httpHeaders
@
-}
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
-- VVV Prop "mime-type"
-- Type: TBasicType TUTF8
-- Flags: [PropertyReadable]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@mime-type@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' uRIResponse #mimeType
@
-}
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
-- VVV Prop "status-code"
-- Type: TBasicType TUInt
-- Flags: [PropertyReadable]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@status-code@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' uRIResponse #statusCode
@
-}
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
-- VVV Prop "suggested-filename"
-- Type: TBasicType TUTF8
-- Flags: [PropertyReadable]
-- Nullable: (Just True,Nothing)
{- |
Get the value of the “@suggested-filename@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' uRIResponse #suggestedFilename
@
-}
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
-- VVV Prop "uri"
-- Type: TBasicType TUTF8
-- Flags: [PropertyReadable]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@uri@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' uRIResponse #uri
@
-}
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
-- method URIResponse::get_content_length
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False
foreign import ccall "webkit_uri_response_get_content_length" webkit_uri_response_get_content_length ::
Ptr URIResponse -> -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
IO Word64
{- |
Get the expected content length of the 'GI.WebKit2.Objects.URIResponse.URIResponse'. It can
be 0 if the server provided an incorrect or missing Content-Length.
-}
uRIResponseGetContentLength ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
{- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
-> m Word64
{- ^ __Returns:__ the expected content length of /@response@/. -}
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
-- method URIResponse::get_http_headers
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Soup", name = "MessageHeaders"}))
-- throws : False
-- Skip return : False
foreign import ccall "webkit_uri_response_get_http_headers" webkit_uri_response_get_http_headers ::
Ptr URIResponse -> -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
IO (Ptr Soup.MessageHeaders.MessageHeaders)
{- |
Get the HTTP headers of a 'GI.WebKit2.Objects.URIResponse.URIResponse' as a 'GI.Soup.Structs.MessageHeaders.MessageHeaders'.
/Since: 2.6/
-}
uRIResponseGetHttpHeaders ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
{- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
-> m (Maybe Soup.MessageHeaders.MessageHeaders)
{- ^ __Returns:__ a 'GI.Soup.Structs.MessageHeaders.MessageHeaders' with the HTTP headers of /@response@/
or 'Nothing' if /@response@/ is not an HTTP response. -}
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
-- method URIResponse::get_mime_type
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", 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 "webkit_uri_response_get_mime_type" webkit_uri_response_get_mime_type ::
Ptr URIResponse -> -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
IO CString
{- |
/No description available in the introspection data./
-}
uRIResponseGetMimeType ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
{- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
-> m T.Text
{- ^ __Returns:__ the MIME type of the 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
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
-- method URIResponse::get_status_code
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False
foreign import ccall "webkit_uri_response_get_status_code" webkit_uri_response_get_status_code ::
Ptr URIResponse -> -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
IO Word32
{- |
Get the status code of the 'GI.WebKit2.Objects.URIResponse.URIResponse' as returned by
the server. It will normally be a 'GI.Soup.Enums.KnownStatusCode', for
example 'GI.Soup.Enums.StatusOk', though the server can respond with any
unsigned integer.
-}
uRIResponseGetStatusCode ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
{- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
-> m Word32
{- ^ __Returns:__ the status code of /@response@/ -}
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
-- method URIResponse::get_suggested_filename
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", 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 "webkit_uri_response_get_suggested_filename" webkit_uri_response_get_suggested_filename ::
Ptr URIResponse -> -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
IO CString
{- |
Get the suggested filename for /@response@/, as specified by
the \'Content-Disposition\' HTTP header, or 'Nothing' if it\'s not
present.
-}
uRIResponseGetSuggestedFilename ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
{- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
-> m (Maybe T.Text)
{- ^ __Returns:__ the suggested filename or 'Nothing' if
the \'Content-Disposition\' HTTP header is not present. -}
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
-- method URIResponse::get_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", 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 "webkit_uri_response_get_uri" webkit_uri_response_get_uri ::
Ptr URIResponse -> -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
IO CString
{- |
/No description available in the introspection data./
-}
uRIResponseGetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
a
{- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
-> m T.Text
{- ^ __Returns:__ the uri of the 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
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