module GI.WebKit2.Objects.AuthenticationRequest
(
AuthenticationRequest(..) ,
IsAuthenticationRequest ,
toAuthenticationRequest ,
noAuthenticationRequest ,
AuthenticationRequestAuthenticateMethodInfo,
authenticationRequestAuthenticate ,
AuthenticationRequestCanSaveCredentialsMethodInfo,
authenticationRequestCanSaveCredentials ,
AuthenticationRequestCancelMethodInfo ,
authenticationRequestCancel ,
AuthenticationRequestGetHostMethodInfo ,
authenticationRequestGetHost ,
AuthenticationRequestGetPortMethodInfo ,
authenticationRequestGetPort ,
AuthenticationRequestGetProposedCredentialMethodInfo,
authenticationRequestGetProposedCredential,
AuthenticationRequestGetRealmMethodInfo ,
authenticationRequestGetRealm ,
AuthenticationRequestGetSchemeMethodInfo,
authenticationRequestGetScheme ,
AuthenticationRequestIsForProxyMethodInfo,
authenticationRequestIsForProxy ,
AuthenticationRequestIsRetryMethodInfo ,
authenticationRequestIsRetry ,
AuthenticationRequestCancelledCallback ,
AuthenticationRequestCancelledSignalInfo,
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.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.WebKit2.Enums as WebKit2.Enums
import qualified GI.WebKit2.Structs.Credential as WebKit2.Credential
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
class GObject o => IsAuthenticationRequest o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError AuthenticationRequest a) =>
IsAuthenticationRequest a
#endif
instance IsAuthenticationRequest AuthenticationRequest
instance GObject.Object.IsObject AuthenticationRequest
toAuthenticationRequest :: IsAuthenticationRequest o => o -> IO AuthenticationRequest
toAuthenticationRequest = unsafeCastTo AuthenticationRequest
noAuthenticationRequest :: Maybe AuthenticationRequest
noAuthenticationRequest = Nothing
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveAuthenticationRequestMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
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) => O.IsLabelProxy t (AuthenticationRequest -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAuthenticationRequestMethod t AuthenticationRequest, O.MethodInfo info AuthenticationRequest p) => O.IsLabel t (AuthenticationRequest -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
type AuthenticationRequestCancelledCallback =
IO ()
noAuthenticationRequestCancelledCallback :: Maybe AuthenticationRequestCancelledCallback
noAuthenticationRequestCancelledCallback = Nothing
type C_AuthenticationRequestCancelledCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_AuthenticationRequestCancelledCallback :: C_AuthenticationRequestCancelledCallback -> IO (FunPtr C_AuthenticationRequestCancelledCallback)
genClosure_AuthenticationRequestCancelled :: AuthenticationRequestCancelledCallback -> IO Closure
genClosure_AuthenticationRequestCancelled cb = do
let cb' = wrap_AuthenticationRequestCancelledCallback cb
mk_AuthenticationRequestCancelledCallback cb' >>= newCClosure
wrap_AuthenticationRequestCancelledCallback ::
AuthenticationRequestCancelledCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_AuthenticationRequestCancelledCallback _cb _ _ = do
_cb
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
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
instance O.HasAttributeList AuthenticationRequest
type instance O.AttributeList AuthenticationRequest = AuthenticationRequestAttributeList
type AuthenticationRequestAttributeList = ('[ ] :: [(Symbol, *)])
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, *)])
foreign import ccall "webkit_authentication_request_authenticate" webkit_authentication_request_authenticate ::
Ptr AuthenticationRequest ->
Ptr WebKit2.Credential.Credential ->
IO ()
authenticationRequestAuthenticate ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> Maybe (WebKit2.Credential.Credential)
-> 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 ()
data AuthenticationRequestAuthenticateMethodInfo
instance (signature ~ (Maybe (WebKit2.Credential.Credential) -> m ()), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestAuthenticateMethodInfo a signature where
overloadedMethod _ = authenticationRequestAuthenticate
foreign import ccall "webkit_authentication_request_can_save_credentials" webkit_authentication_request_can_save_credentials ::
Ptr AuthenticationRequest ->
IO CInt
authenticationRequestCanSaveCredentials ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m Bool
authenticationRequestCanSaveCredentials request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_can_save_credentials request'
let result' = (/= 0) result
touchManagedPtr request
return result'
data AuthenticationRequestCanSaveCredentialsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestCanSaveCredentialsMethodInfo a signature where
overloadedMethod _ = authenticationRequestCanSaveCredentials
foreign import ccall "webkit_authentication_request_cancel" webkit_authentication_request_cancel ::
Ptr AuthenticationRequest ->
IO ()
authenticationRequestCancel ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m ()
authenticationRequestCancel request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
webkit_authentication_request_cancel request'
touchManagedPtr request
return ()
data AuthenticationRequestCancelMethodInfo
instance (signature ~ (m ()), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestCancelMethodInfo a signature where
overloadedMethod _ = authenticationRequestCancel
foreign import ccall "webkit_authentication_request_get_host" webkit_authentication_request_get_host ::
Ptr AuthenticationRequest ->
IO CString
authenticationRequestGetHost ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m T.Text
authenticationRequestGetHost request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_host request'
checkUnexpectedReturnNULL "authenticationRequestGetHost" result
result' <- cstringToText result
touchManagedPtr request
return result'
data AuthenticationRequestGetHostMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetHostMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetHost
foreign import ccall "webkit_authentication_request_get_port" webkit_authentication_request_get_port ::
Ptr AuthenticationRequest ->
IO Word32
authenticationRequestGetPort ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m Word32
authenticationRequestGetPort request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_port request'
touchManagedPtr request
return result
data AuthenticationRequestGetPortMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetPortMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetPort
foreign import ccall "webkit_authentication_request_get_proposed_credential" webkit_authentication_request_get_proposed_credential ::
Ptr AuthenticationRequest ->
IO (Ptr WebKit2.Credential.Credential)
authenticationRequestGetProposedCredential ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m WebKit2.Credential.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'
data AuthenticationRequestGetProposedCredentialMethodInfo
instance (signature ~ (m WebKit2.Credential.Credential), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetProposedCredentialMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetProposedCredential
foreign import ccall "webkit_authentication_request_get_realm" webkit_authentication_request_get_realm ::
Ptr AuthenticationRequest ->
IO CString
authenticationRequestGetRealm ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m T.Text
authenticationRequestGetRealm request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_realm request'
checkUnexpectedReturnNULL "authenticationRequestGetRealm" result
result' <- cstringToText result
touchManagedPtr request
return result'
data AuthenticationRequestGetRealmMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetRealmMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetRealm
foreign import ccall "webkit_authentication_request_get_scheme" webkit_authentication_request_get_scheme ::
Ptr AuthenticationRequest ->
IO CUInt
authenticationRequestGetScheme ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m WebKit2.Enums.AuthenticationScheme
authenticationRequestGetScheme request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_get_scheme request'
let result' = (toEnum . fromIntegral) result
touchManagedPtr request
return result'
data AuthenticationRequestGetSchemeMethodInfo
instance (signature ~ (m WebKit2.Enums.AuthenticationScheme), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestGetSchemeMethodInfo a signature where
overloadedMethod _ = authenticationRequestGetScheme
foreign import ccall "webkit_authentication_request_is_for_proxy" webkit_authentication_request_is_for_proxy ::
Ptr AuthenticationRequest ->
IO CInt
authenticationRequestIsForProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m Bool
authenticationRequestIsForProxy request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_is_for_proxy request'
let result' = (/= 0) result
touchManagedPtr request
return result'
data AuthenticationRequestIsForProxyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestIsForProxyMethodInfo a signature where
overloadedMethod _ = authenticationRequestIsForProxy
foreign import ccall "webkit_authentication_request_is_retry" webkit_authentication_request_is_retry ::
Ptr AuthenticationRequest ->
IO CInt
authenticationRequestIsRetry ::
(B.CallStack.HasCallStack, MonadIO m, IsAuthenticationRequest a) =>
a
-> m Bool
authenticationRequestIsRetry request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_authentication_request_is_retry request'
let result' = (/= 0) result
touchManagedPtr request
return result'
data AuthenticationRequestIsRetryMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuthenticationRequest a) => O.MethodInfo AuthenticationRequestIsRetryMethodInfo a signature where
overloadedMethod _ = authenticationRequestIsRetry