gi-webkit2-4.0.21: GI/WebKit2/Objects/AuthenticationRequest.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.AuthenticationRequest
(
-- * Exported types
AuthenticationRequest(..) ,
IsAuthenticationRequest ,
toAuthenticationRequest ,
noAuthenticationRequest ,
-- * Methods
-- ** authenticate #method:authenticate#
#if ENABLE_OVERLOADING
AuthenticationRequestAuthenticateMethodInfo,
#endif
authenticationRequestAuthenticate ,
-- ** canSaveCredentials #method:canSaveCredentials#
#if ENABLE_OVERLOADING
AuthenticationRequestCanSaveCredentialsMethodInfo,
#endif
authenticationRequestCanSaveCredentials ,
-- ** cancel #method:cancel#
#if ENABLE_OVERLOADING
AuthenticationRequestCancelMethodInfo ,
#endif
authenticationRequestCancel ,
-- ** getHost #method:getHost#
#if ENABLE_OVERLOADING
AuthenticationRequestGetHostMethodInfo ,
#endif
authenticationRequestGetHost ,
-- ** getPort #method:getPort#
#if ENABLE_OVERLOADING
AuthenticationRequestGetPortMethodInfo ,
#endif
authenticationRequestGetPort ,
-- ** getProposedCredential #method:getProposedCredential#
#if ENABLE_OVERLOADING
AuthenticationRequestGetProposedCredentialMethodInfo,
#endif
authenticationRequestGetProposedCredential,
-- ** getRealm #method:getRealm#
#if ENABLE_OVERLOADING
AuthenticationRequestGetRealmMethodInfo ,
#endif
authenticationRequestGetRealm ,
-- ** getScheme #method:getScheme#
#if ENABLE_OVERLOADING
AuthenticationRequestGetSchemeMethodInfo,
#endif
authenticationRequestGetScheme ,
-- ** isForProxy #method:isForProxy#
#if ENABLE_OVERLOADING
AuthenticationRequestIsForProxyMethodInfo,
#endif
authenticationRequestIsForProxy ,
-- ** isRetry #method:isRetry#
#if ENABLE_OVERLOADING
AuthenticationRequestIsRetryMethodInfo ,
#endif
authenticationRequestIsRetry ,
-- * Signals
-- ** cancelled #signal:cancelled#
AuthenticationRequestCancelledCallback ,
#if ENABLE_OVERLOADING
AuthenticationRequestCancelledSignalInfo,
#endif
C_AuthenticationRequestCancelledCallback,
afterAuthenticationRequestCancelled ,
genClosure_AuthenticationRequestCancelled,
mk_AuthenticationRequestCancelledCallback,
noAuthenticationRequestCancelledCallback,
onAuthenticationRequestCancelled ,
wrap_AuthenticationRequestCancelledCallback,
) 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 {-# SOURCE #-} qualified GI.WebKit2.Enums as WebKit2.Enums
import {-# SOURCE #-} qualified GI.WebKit2.Structs.Credential as WebKit2.Credential
-- | Memory-managed wrapper type.
newtype AuthenticationRequest = AuthenticationRequest (ManagedPtr AuthenticationRequest)
foreign import ccall "webkit_authentication_request_get_type"
c_webkit_authentication_request_get_type :: IO GType
instance GObject AuthenticationRequest where
gobjectType = c_webkit_authentication_request_get_type
-- | Type class for types which can be safely cast to `AuthenticationRequest`, for instance with `toAuthenticationRequest`.
class (GObject o, O.IsDescendantOf AuthenticationRequest o) => IsAuthenticationRequest o
instance (GObject o, O.IsDescendantOf AuthenticationRequest o) => IsAuthenticationRequest o
instance O.HasParentTypes AuthenticationRequest
type instance O.ParentTypes AuthenticationRequest = '[GObject.Object.Object]
-- | Cast to `AuthenticationRequest`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toAuthenticationRequest :: (MonadIO m, IsAuthenticationRequest o) => o -> m AuthenticationRequest
toAuthenticationRequest = liftIO . unsafeCastTo AuthenticationRequest
-- | A convenience alias for `Nothing` :: `Maybe` `AuthenticationRequest`.
noAuthenticationRequest :: Maybe AuthenticationRequest
noAuthenticationRequest = Nothing
#if ENABLE_OVERLOADING
type family ResolveAuthenticationRequestMethod (t :: Symbol) (o :: *) :: * where
ResolveAuthenticationRequestMethod "authenticate" o = AuthenticationRequestAuthenticateMethodInfo
ResolveAuthenticationRequestMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAuthenticationRequestMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAuthenticationRequestMethod "canSaveCredentials" o = AuthenticationRequestCanSaveCredentialsMethodInfo
ResolveAuthenticationRequestMethod "cancel" o = AuthenticationRequestCancelMethodInfo
ResolveAuthenticationRequestMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAuthenticationRequestMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAuthenticationRequestMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAuthenticationRequestMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAuthenticationRequestMethod "isForProxy" o = AuthenticationRequestIsForProxyMethodInfo
ResolveAuthenticationRequestMethod "isRetry" o = AuthenticationRequestIsRetryMethodInfo
ResolveAuthenticationRequestMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAuthenticationRequestMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAuthenticationRequestMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAuthenticationRequestMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAuthenticationRequestMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAuthenticationRequestMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAuthenticationRequestMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAuthenticationRequestMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAuthenticationRequestMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAuthenticationRequestMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAuthenticationRequestMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAuthenticationRequestMethod "getHost" o = AuthenticationRequestGetHostMethodInfo
ResolveAuthenticationRequestMethod "getPort" o = AuthenticationRequestGetPortMethodInfo
ResolveAuthenticationRequestMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAuthenticationRequestMethod "getProposedCredential" o = AuthenticationRequestGetProposedCredentialMethodInfo
ResolveAuthenticationRequestMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAuthenticationRequestMethod "getRealm" o = AuthenticationRequestGetRealmMethodInfo
ResolveAuthenticationRequestMethod "getScheme" o = AuthenticationRequestGetSchemeMethodInfo
ResolveAuthenticationRequestMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAuthenticationRequestMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAuthenticationRequestMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAuthenticationRequestMethod t AuthenticationRequest, O.MethodInfo info AuthenticationRequest p) => OL.IsLabel t (AuthenticationRequest -> 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
-- signal AuthenticationRequest::cancelled
{- |
This signal is emitted when the user authentication request is
cancelled. It allows the application to dismiss its authentication
dialog in case of page load failure for example.
/Since: 2.2/
-}
type AuthenticationRequestCancelledCallback =
IO ()
-- | A convenience synonym for @`Nothing` :: `Maybe` `AuthenticationRequestCancelledCallback`@.
noAuthenticationRequestCancelledCallback :: Maybe AuthenticationRequestCancelledCallback
noAuthenticationRequestCancelledCallback = Nothing
-- | Type for the callback on the (unwrapped) C side.
type C_AuthenticationRequestCancelledCallback =
Ptr () -> -- object
Ptr () -> -- user_data
IO ()
-- | Generate a function pointer callable from C code, from a `C_AuthenticationRequestCancelledCallback`.
foreign import ccall "wrapper"
mk_AuthenticationRequestCancelledCallback :: C_AuthenticationRequestCancelledCallback -> IO (FunPtr C_AuthenticationRequestCancelledCallback)
-- | Wrap the callback into a `GClosure`.
genClosure_AuthenticationRequestCancelled :: MonadIO m => AuthenticationRequestCancelledCallback -> m (GClosure C_AuthenticationRequestCancelledCallback)
genClosure_AuthenticationRequestCancelled cb = liftIO $ do
let cb' = wrap_AuthenticationRequestCancelledCallback cb
mk_AuthenticationRequestCancelledCallback cb' >>= B.GClosure.newGClosure
-- | Wrap a `AuthenticationRequestCancelledCallback` into a `C_AuthenticationRequestCancelledCallback`.
wrap_AuthenticationRequestCancelledCallback ::
AuthenticationRequestCancelledCallback ->
C_AuthenticationRequestCancelledCallback
wrap_AuthenticationRequestCancelledCallback _cb _ _ = do
_cb
{- |
Connect a signal handler for the “@cancelled@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Signals.on' authenticationRequest #cancelled callback
@
-}
onAuthenticationRequestCancelled :: (IsAuthenticationRequest a, MonadIO m) => a -> AuthenticationRequestCancelledCallback -> m SignalHandlerId
onAuthenticationRequestCancelled obj cb = liftIO $ do
let cb' = wrap_AuthenticationRequestCancelledCallback cb
cb'' <- mk_AuthenticationRequestCancelledCallback cb'
connectSignalFunPtr obj "cancelled" cb'' SignalConnectBefore
{- |
Connect a signal handler for the “@cancelled@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Signals.after' authenticationRequest #cancelled callback
@
-}
afterAuthenticationRequestCancelled :: (IsAuthenticationRequest a, MonadIO m) => a -> AuthenticationRequestCancelledCallback -> m SignalHandlerId
afterAuthenticationRequestCancelled obj cb = liftIO $ do
let cb' = wrap_AuthenticationRequestCancelledCallback cb
cb'' <- mk_AuthenticationRequestCancelledCallback cb'
connectSignalFunPtr obj "cancelled" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList AuthenticationRequest
type instance O.AttributeList AuthenticationRequest = AuthenticationRequestAttributeList
type AuthenticationRequestAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data AuthenticationRequestCancelledSignalInfo
instance SignalInfo AuthenticationRequestCancelledSignalInfo where
type HaskellCallbackType AuthenticationRequestCancelledSignalInfo = AuthenticationRequestCancelledCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_AuthenticationRequestCancelledCallback cb
cb'' <- mk_AuthenticationRequestCancelledCallback cb'
connectSignalFunPtr obj "cancelled" cb'' connectMode
type instance O.SignalList AuthenticationRequest = AuthenticationRequestSignalList
type AuthenticationRequestSignalList = ('[ '("cancelled", AuthenticationRequestCancelledSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
-- method AuthenticationRequest::authenticate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "credential", argType = TInterface (Name {namespace = "WebKit2", name = "Credential"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #WebKitCredential, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "webkit_authentication_request_authenticate" webkit_authentication_request_authenticate ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
Ptr WebKit2.Credential.Credential -> -- credential : TInterface (Name {namespace = "WebKit2", name = "Credential"})
IO ()
{- |
Authenticate the 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' using the 'GI.WebKit2.Structs.Credential.Credential'
supplied. To continue without credentials, pass 'Nothing' as /@credential@/.
/Since: 2.2/
-}
authenticationRequestAuthenticate ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> Maybe (WebKit2.Credential.Credential)
{- ^ /@credential@/: A 'GI.WebKit2.Structs.Credential.Credential', or 'Nothing' -}
-> m ()
authenticationRequestAuthenticate request credential = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
maybeCredential <- case credential of
Nothing -> return nullPtr
Just jCredential -> do
jCredential' <- unsafeManagedPtrGetPtr jCredential
return jCredential'
webkit_authentication_request_authenticate request' maybeCredential
touchManagedPtr request
whenJust credential touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data AuthenticationRequestAuthenticateMethodInfo
instance (signature ~ (Maybe (WebKit2.Credential.Credential) -> m ()), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestAuthenticateMethodInfo a signature where
overloadedMethod _ = authenticationRequestAuthenticate
#endif
-- method AuthenticationRequest::can_save_credentials
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "webkit_authentication_request_can_save_credentials" webkit_authentication_request_can_save_credentials ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO CInt
{- |
Determine whether the authentication method associated with this
'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' should allow the storage of credentials.
This will return 'False' if WebKit doesn\'t support credential storing
or if private browsing is enabled.
/Since: 2.2/
-}
authenticationRequestCanSaveCredentials ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m Bool
{- ^ __Returns:__ 'True' if WebKit can store credentials or 'False' otherwise. -}
authenticationRequestCanSaveCredentials request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_can_save_credentials request'
let result' = (/= 0) result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data AuthenticationRequestCanSaveCredentialsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestCanSaveCredentialsMethodInfo a signature where
overloadedMethod _ = authenticationRequestCanSaveCredentials
#endif
-- method AuthenticationRequest::cancel
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "webkit_authentication_request_cancel" webkit_authentication_request_cancel ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO ()
{- |
Cancel the authentication challenge. This will also cancel the page loading and result in a
'GI.WebKit2.Objects.WebView.WebView'::@/load-failed/@ signal with a 'GI.WebKit2.Enums.NetworkError' of type 'GI.WebKit2.Enums.NetworkErrorCancelled' being emitted.
/Since: 2.2/
-}
authenticationRequestCancel ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m ()
authenticationRequestCancel request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
webkit_authentication_request_cancel request'
touchManagedPtr request
return ()
#if ENABLE_OVERLOADING
data AuthenticationRequestCancelMethodInfo
instance (signature ~ (m ()), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestCancelMethodInfo a signature where
overloadedMethod _ = authenticationRequestCancel
#endif
-- method AuthenticationRequest::get_host
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", 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_authentication_request_get_host" webkit_authentication_request_get_host ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO CString
{- |
Get the host that this authentication challenge is applicable to.
/Since: 2.2/
-}
authenticationRequestGetHost ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m T.Text
{- ^ __Returns:__ The host of /@request@/. -}
authenticationRequestGetHost request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_host request'
checkUnexpectedReturnNULL "authenticationRequestGetHost" result
result' <- cstringToText result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data AuthenticationRequestGetHostMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetHostMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetHost
#endif
-- method AuthenticationRequest::get_port
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", 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_authentication_request_get_port" webkit_authentication_request_get_port ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO Word32
{- |
Get the port that this authentication challenge is applicable to.
/Since: 2.2/
-}
authenticationRequestGetPort ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m Word32
{- ^ __Returns:__ The port of /@request@/. -}
authenticationRequestGetPort request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_port request'
touchManagedPtr request
return result
#if ENABLE_OVERLOADING
data AuthenticationRequestGetPortMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetPortMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetPort
#endif
-- method AuthenticationRequest::get_proposed_credential
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "Credential"}))
-- throws : False
-- Skip return : False
foreign import ccall "webkit_authentication_request_get_proposed_credential" webkit_authentication_request_get_proposed_credential ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO (Ptr WebKit2.Credential.Credential)
{- |
Get the 'GI.WebKit2.Structs.Credential.Credential' of the proposed authentication challenge that was
stored from a previous session. The client can use this directly for
authentication or construct their own 'GI.WebKit2.Structs.Credential.Credential'.
/Since: 2.2/
-}
authenticationRequestGetProposedCredential ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m WebKit2.Credential.Credential
{- ^ __Returns:__ A 'GI.WebKit2.Structs.Credential.Credential' encapsulating credential details
or 'Nothing' if there is no stored credential. -}
authenticationRequestGetProposedCredential request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_proposed_credential request'
checkUnexpectedReturnNULL "authenticationRequestGetProposedCredential" result
result' <- (wrapBoxed WebKit2.Credential.Credential) result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data AuthenticationRequestGetProposedCredentialMethodInfo
instance (signature ~ (m WebKit2.Credential.Credential), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetProposedCredentialMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetProposedCredential
#endif
-- method AuthenticationRequest::get_realm
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", 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_authentication_request_get_realm" webkit_authentication_request_get_realm ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO CString
{- |
Get the realm that this authentication challenge is applicable to.
/Since: 2.2/
-}
authenticationRequestGetRealm ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m T.Text
{- ^ __Returns:__ The realm of /@request@/. -}
authenticationRequestGetRealm request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_realm request'
checkUnexpectedReturnNULL "authenticationRequestGetRealm" result
result' <- cstringToText result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data AuthenticationRequestGetRealmMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetRealmMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetRealm
#endif
-- method AuthenticationRequest::get_scheme
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "AuthenticationScheme"}))
-- throws : False
-- Skip return : False
foreign import ccall "webkit_authentication_request_get_scheme" webkit_authentication_request_get_scheme ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO CUInt
{- |
Get the authentication scheme of the authentication challenge.
/Since: 2.2/
-}
authenticationRequestGetScheme ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m WebKit2.Enums.AuthenticationScheme
{- ^ __Returns:__ The 'GI.WebKit2.Enums.AuthenticationScheme' of /@request@/. -}
authenticationRequestGetScheme request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_scheme request'
let result' = (toEnum . fromIntegral) result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data AuthenticationRequestGetSchemeMethodInfo
instance (signature ~ (m WebKit2.Enums.AuthenticationScheme), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetSchemeMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetScheme
#endif
-- method AuthenticationRequest::is_for_proxy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "webkit_authentication_request_is_for_proxy" webkit_authentication_request_is_for_proxy ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO CInt
{- |
Determine whether the authentication challenge is associated with a proxy server rather than an \"origin\" server.
/Since: 2.2/
-}
authenticationRequestIsForProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m Bool
{- ^ __Returns:__ 'True' if authentication is for a proxy or 'False' otherwise. -}
authenticationRequestIsForProxy request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_is_for_proxy request'
let result' = (/= 0) result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data AuthenticationRequestIsForProxyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestIsForProxyMethodInfo a signature where
overloadedMethod _ = authenticationRequestIsForProxy
#endif
-- method AuthenticationRequest::is_retry
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "request", argType = TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitAuthenticationRequest", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "webkit_authentication_request_is_retry" webkit_authentication_request_is_retry ::
Ptr AuthenticationRequest -> -- request : TInterface (Name {namespace = "WebKit2", name = "AuthenticationRequest"})
IO CInt
{- |
Determine whether this this is a first attempt or a retry for this authentication challenge.
/Since: 2.2/
-}
authenticationRequestIsRetry ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
{- ^ /@request@/: a 'GI.WebKit2.Objects.AuthenticationRequest.AuthenticationRequest' -}
-> m Bool
{- ^ __Returns:__ 'True' if authentication attempt is a retry or 'False' otherwise. -}
authenticationRequestIsRetry request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_is_retry request'
let result' = (/= 0) result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data AuthenticationRequestIsRetryMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestIsRetryMethodInfo a signature where
overloadedMethod _ = authenticationRequestIsRetry
#endif