module GI.WebKit2.Objects.URIResponse
(
URIResponse(..) ,
URIResponseK ,
toURIResponse ,
noURIResponse ,
uRIResponseGetContentLength ,
uRIResponseGetHttpHeaders ,
uRIResponseGetMimeType ,
uRIResponseGetStatusCode ,
uRIResponseGetSuggestedFilename ,
uRIResponseGetUri ,
URIResponseContentLengthPropertyInfo ,
getURIResponseContentLength ,
URIResponseHttpHeadersPropertyInfo ,
getURIResponseHttpHeaders ,
URIResponseMimeTypePropertyInfo ,
getURIResponseMimeType ,
URIResponseStatusCodePropertyInfo ,
getURIResponseStatusCode ,
URIResponseSuggestedFilenamePropertyInfo,
getURIResponseSuggestedFilename ,
URIResponseUriPropertyInfo ,
getURIResponseUri ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.WebKit2.Types
import GI.WebKit2.Callbacks
import qualified GI.GObject as GObject
import qualified GI.Soup as Soup
newtype URIResponse = URIResponse (ForeignPtr URIResponse)
foreign import ccall "webkit_uri_response_get_type"
c_webkit_uri_response_get_type :: IO GType
type instance ParentTypes URIResponse = URIResponseParentTypes
type URIResponseParentTypes = '[GObject.Object]
instance GObject URIResponse where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_uri_response_get_type
class GObject o => URIResponseK o
instance (GObject o, IsDescendantOf URIResponse o) => URIResponseK o
toURIResponse :: URIResponseK o => o -> IO URIResponse
toURIResponse = unsafeCastTo URIResponse
noURIResponse :: Maybe URIResponse
noURIResponse = Nothing
getURIResponseContentLength :: (MonadIO m, URIResponseK o) => o -> m Word64
getURIResponseContentLength obj = liftIO $ getObjectPropertyUInt64 obj "content-length"
data URIResponseContentLengthPropertyInfo
instance AttrInfo URIResponseContentLengthPropertyInfo where
type AttrAllowedOps URIResponseContentLengthPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseContentLengthPropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseContentLengthPropertyInfo = URIResponseK
type AttrGetType URIResponseContentLengthPropertyInfo = Word64
type AttrLabel URIResponseContentLengthPropertyInfo = "URIResponse::content-length"
attrGet _ = getURIResponseContentLength
attrSet _ = undefined
attrConstruct _ = undefined
getURIResponseHttpHeaders :: (MonadIO m, URIResponseK o) => o -> m Soup.MessageHeaders
getURIResponseHttpHeaders obj = liftIO $ getObjectPropertyBoxed obj "http-headers" Soup.MessageHeaders
data URIResponseHttpHeadersPropertyInfo
instance AttrInfo URIResponseHttpHeadersPropertyInfo where
type AttrAllowedOps URIResponseHttpHeadersPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseHttpHeadersPropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseHttpHeadersPropertyInfo = URIResponseK
type AttrGetType URIResponseHttpHeadersPropertyInfo = Soup.MessageHeaders
type AttrLabel URIResponseHttpHeadersPropertyInfo = "URIResponse::http-headers"
attrGet _ = getURIResponseHttpHeaders
attrSet _ = undefined
attrConstruct _ = undefined
getURIResponseMimeType :: (MonadIO m, URIResponseK o) => o -> m T.Text
getURIResponseMimeType obj = liftIO $ getObjectPropertyString obj "mime-type"
data URIResponseMimeTypePropertyInfo
instance AttrInfo URIResponseMimeTypePropertyInfo where
type AttrAllowedOps URIResponseMimeTypePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseMimeTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseMimeTypePropertyInfo = URIResponseK
type AttrGetType URIResponseMimeTypePropertyInfo = T.Text
type AttrLabel URIResponseMimeTypePropertyInfo = "URIResponse::mime-type"
attrGet _ = getURIResponseMimeType
attrSet _ = undefined
attrConstruct _ = undefined
getURIResponseStatusCode :: (MonadIO m, URIResponseK o) => o -> m Word32
getURIResponseStatusCode obj = liftIO $ getObjectPropertyCUInt obj "status-code"
data URIResponseStatusCodePropertyInfo
instance AttrInfo URIResponseStatusCodePropertyInfo where
type AttrAllowedOps URIResponseStatusCodePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseStatusCodePropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseStatusCodePropertyInfo = URIResponseK
type AttrGetType URIResponseStatusCodePropertyInfo = Word32
type AttrLabel URIResponseStatusCodePropertyInfo = "URIResponse::status-code"
attrGet _ = getURIResponseStatusCode
attrSet _ = undefined
attrConstruct _ = undefined
getURIResponseSuggestedFilename :: (MonadIO m, URIResponseK o) => o -> m T.Text
getURIResponseSuggestedFilename obj = liftIO $ getObjectPropertyString obj "suggested-filename"
data URIResponseSuggestedFilenamePropertyInfo
instance AttrInfo URIResponseSuggestedFilenamePropertyInfo where
type AttrAllowedOps URIResponseSuggestedFilenamePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseSuggestedFilenamePropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseSuggestedFilenamePropertyInfo = URIResponseK
type AttrGetType URIResponseSuggestedFilenamePropertyInfo = T.Text
type AttrLabel URIResponseSuggestedFilenamePropertyInfo = "URIResponse::suggested-filename"
attrGet _ = getURIResponseSuggestedFilename
attrSet _ = undefined
attrConstruct _ = undefined
getURIResponseUri :: (MonadIO m, URIResponseK o) => o -> m T.Text
getURIResponseUri obj = liftIO $ getObjectPropertyString obj "uri"
data URIResponseUriPropertyInfo
instance AttrInfo URIResponseUriPropertyInfo where
type AttrAllowedOps URIResponseUriPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint URIResponseUriPropertyInfo = (~) ()
type AttrBaseTypeConstraint URIResponseUriPropertyInfo = URIResponseK
type AttrGetType URIResponseUriPropertyInfo = T.Text
type AttrLabel URIResponseUriPropertyInfo = "URIResponse::uri"
attrGet _ = getURIResponseUri
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList URIResponse = URIResponseAttributeList
type URIResponseAttributeList = ('[ '("content-length", URIResponseContentLengthPropertyInfo), '("http-headers", URIResponseHttpHeadersPropertyInfo), '("mime-type", URIResponseMimeTypePropertyInfo), '("status-code", URIResponseStatusCodePropertyInfo), '("suggested-filename", URIResponseSuggestedFilenamePropertyInfo), '("uri", URIResponseUriPropertyInfo)] :: [(Symbol, *)])
type instance SignalList URIResponse = URIResponseSignalList
type URIResponseSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_uri_response_get_content_length" webkit_uri_response_get_content_length ::
Ptr URIResponse ->
IO Word64
uRIResponseGetContentLength ::
(MonadIO m, URIResponseK a) =>
a ->
m Word64
uRIResponseGetContentLength _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_uri_response_get_content_length _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_uri_response_get_http_headers" webkit_uri_response_get_http_headers ::
Ptr URIResponse ->
IO (Ptr Soup.MessageHeaders)
uRIResponseGetHttpHeaders ::
(MonadIO m, URIResponseK a) =>
a ->
m Soup.MessageHeaders
uRIResponseGetHttpHeaders _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_uri_response_get_http_headers _obj'
checkUnexpectedReturnNULL "webkit_uri_response_get_http_headers" result
result' <- (newBoxed Soup.MessageHeaders) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_uri_response_get_mime_type" webkit_uri_response_get_mime_type ::
Ptr URIResponse ->
IO CString
uRIResponseGetMimeType ::
(MonadIO m, URIResponseK a) =>
a ->
m T.Text
uRIResponseGetMimeType _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_uri_response_get_mime_type _obj'
checkUnexpectedReturnNULL "webkit_uri_response_get_mime_type" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_uri_response_get_status_code" webkit_uri_response_get_status_code ::
Ptr URIResponse ->
IO Word32
uRIResponseGetStatusCode ::
(MonadIO m, URIResponseK a) =>
a ->
m Word32
uRIResponseGetStatusCode _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_uri_response_get_status_code _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_uri_response_get_suggested_filename" webkit_uri_response_get_suggested_filename ::
Ptr URIResponse ->
IO CString
uRIResponseGetSuggestedFilename ::
(MonadIO m, URIResponseK a) =>
a ->
m T.Text
uRIResponseGetSuggestedFilename _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_uri_response_get_suggested_filename _obj'
checkUnexpectedReturnNULL "webkit_uri_response_get_suggested_filename" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_uri_response_get_uri" webkit_uri_response_get_uri ::
Ptr URIResponse ->
IO CString
uRIResponseGetUri ::
(MonadIO m, URIResponseK a) =>
a ->
m T.Text
uRIResponseGetUri _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_uri_response_get_uri _obj'
checkUnexpectedReturnNULL "webkit_uri_response_get_uri" result
result' <- cstringToText result
touchManagedPtr _obj
return result'