{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.AuthNegotiate
(
AuthNegotiate(..) ,
IsAuthNegotiate ,
toAuthNegotiate ,
#if defined(ENABLE_OVERLOADING)
ResolveAuthNegotiateMethod ,
#endif
authNegotiateSupported ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.Uri as GLib.Uri
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Enums as Gio.Enums
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.TlsClientConnection as Gio.TlsClientConnection
import qualified GI.Gio.Objects.IOStream as Gio.IOStream
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import qualified GI.Gio.Objects.TlsCertificate as Gio.TlsCertificate
import qualified GI.Gio.Objects.TlsPassword as Gio.TlsPassword
import qualified GI.Soup.Callbacks as Soup.Callbacks
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Flags as Soup.Flags
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageMetrics as Soup.MessageMetrics
import {-# SOURCE #-} qualified GI.Soup.Structs.Multipart as Soup.Multipart
import {-# SOURCE #-} qualified GI.Soup.Structs.Range as Soup.Range
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
#endif
newtype AuthNegotiate = AuthNegotiate (SP.ManagedPtr AuthNegotiate)
deriving (AuthNegotiate -> AuthNegotiate -> Bool
(AuthNegotiate -> AuthNegotiate -> Bool)
-> (AuthNegotiate -> AuthNegotiate -> Bool) -> Eq AuthNegotiate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthNegotiate -> AuthNegotiate -> Bool
== :: AuthNegotiate -> AuthNegotiate -> Bool
$c/= :: AuthNegotiate -> AuthNegotiate -> Bool
/= :: AuthNegotiate -> AuthNegotiate -> Bool
Eq)
instance SP.ManagedPtrNewtype AuthNegotiate where
toManagedPtr :: AuthNegotiate -> ManagedPtr AuthNegotiate
toManagedPtr (AuthNegotiate ManagedPtr AuthNegotiate
p) = ManagedPtr AuthNegotiate
p
foreign import ccall "soup_auth_negotiate_get_type"
c_soup_auth_negotiate_get_type :: IO B.Types.GType
instance B.Types.TypedObject AuthNegotiate where
glibType :: IO GType
glibType = IO GType
c_soup_auth_negotiate_get_type
instance B.Types.GObject AuthNegotiate
class (SP.GObject o, O.IsDescendantOf AuthNegotiate o) => IsAuthNegotiate o
instance (SP.GObject o, O.IsDescendantOf AuthNegotiate o) => IsAuthNegotiate o
instance O.HasParentTypes AuthNegotiate
type instance O.ParentTypes AuthNegotiate = '[Soup.Auth.Auth, GObject.Object.Object]
toAuthNegotiate :: (MIO.MonadIO m, IsAuthNegotiate o) => o -> m AuthNegotiate
toAuthNegotiate :: forall (m :: * -> *) o.
(MonadIO m, IsAuthNegotiate o) =>
o -> m AuthNegotiate
toAuthNegotiate = IO AuthNegotiate -> m AuthNegotiate
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO AuthNegotiate -> m AuthNegotiate)
-> (o -> IO AuthNegotiate) -> o -> m AuthNegotiate
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AuthNegotiate -> AuthNegotiate)
-> o -> IO AuthNegotiate
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr AuthNegotiate -> AuthNegotiate
AuthNegotiate
instance B.GValue.IsGValue (Maybe AuthNegotiate) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_auth_negotiate_get_type
gvalueSet_ :: Ptr GValue -> Maybe AuthNegotiate -> IO ()
gvalueSet_ Ptr GValue
gv Maybe AuthNegotiate
P.Nothing = Ptr GValue -> Ptr AuthNegotiate -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr AuthNegotiate
forall a. Ptr a
FP.nullPtr :: FP.Ptr AuthNegotiate)
gvalueSet_ Ptr GValue
gv (P.Just AuthNegotiate
obj) = AuthNegotiate -> (Ptr AuthNegotiate -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AuthNegotiate
obj (Ptr GValue -> Ptr AuthNegotiate -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe AuthNegotiate)
gvalueGet_ Ptr GValue
gv = do
Ptr AuthNegotiate
ptr <- Ptr GValue -> IO (Ptr AuthNegotiate)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr AuthNegotiate)
if Ptr AuthNegotiate
ptr Ptr AuthNegotiate -> Ptr AuthNegotiate -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr AuthNegotiate
forall a. Ptr a
FP.nullPtr
then AuthNegotiate -> Maybe AuthNegotiate
forall a. a -> Maybe a
P.Just (AuthNegotiate -> Maybe AuthNegotiate)
-> IO AuthNegotiate -> IO (Maybe AuthNegotiate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr AuthNegotiate -> AuthNegotiate)
-> Ptr AuthNegotiate -> IO AuthNegotiate
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AuthNegotiate -> AuthNegotiate
AuthNegotiate Ptr AuthNegotiate
ptr
else Maybe AuthNegotiate -> IO (Maybe AuthNegotiate)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe AuthNegotiate
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAuthNegotiateMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveAuthNegotiateMethod "authenticate" o = Soup.Auth.AuthAuthenticateMethodInfo
ResolveAuthNegotiateMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAuthNegotiateMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAuthNegotiateMethod "canAuthenticate" o = Soup.Auth.AuthCanAuthenticateMethodInfo
ResolveAuthNegotiateMethod "cancel" o = Soup.Auth.AuthCancelMethodInfo
ResolveAuthNegotiateMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAuthNegotiateMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAuthNegotiateMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAuthNegotiateMethod "isAuthenticated" o = Soup.Auth.AuthIsAuthenticatedMethodInfo
ResolveAuthNegotiateMethod "isCancelled" o = Soup.Auth.AuthIsCancelledMethodInfo
ResolveAuthNegotiateMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAuthNegotiateMethod "isForProxy" o = Soup.Auth.AuthIsForProxyMethodInfo
ResolveAuthNegotiateMethod "isReady" o = Soup.Auth.AuthIsReadyMethodInfo
ResolveAuthNegotiateMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAuthNegotiateMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAuthNegotiateMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAuthNegotiateMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAuthNegotiateMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAuthNegotiateMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAuthNegotiateMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAuthNegotiateMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAuthNegotiateMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAuthNegotiateMethod "update" o = Soup.Auth.AuthUpdateMethodInfo
ResolveAuthNegotiateMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAuthNegotiateMethod "getAuthority" o = Soup.Auth.AuthGetAuthorityMethodInfo
ResolveAuthNegotiateMethod "getAuthorization" o = Soup.Auth.AuthGetAuthorizationMethodInfo
ResolveAuthNegotiateMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAuthNegotiateMethod "getInfo" o = Soup.Auth.AuthGetInfoMethodInfo
ResolveAuthNegotiateMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAuthNegotiateMethod "getProtectionSpace" o = Soup.Auth.AuthGetProtectionSpaceMethodInfo
ResolveAuthNegotiateMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAuthNegotiateMethod "getRealm" o = Soup.Auth.AuthGetRealmMethodInfo
ResolveAuthNegotiateMethod "getSchemeName" o = Soup.Auth.AuthGetSchemeNameMethodInfo
ResolveAuthNegotiateMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAuthNegotiateMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAuthNegotiateMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAuthNegotiateMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAuthNegotiateMethod t AuthNegotiate, O.OverloadedMethod info AuthNegotiate p) => OL.IsLabel t (AuthNegotiate -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveAuthNegotiateMethod t AuthNegotiate, O.OverloadedMethod info AuthNegotiate p, R.HasField t AuthNegotiate p) => R.HasField t AuthNegotiate p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAuthNegotiateMethod t AuthNegotiate, O.OverloadedMethodInfo info AuthNegotiate) => OL.IsLabel t (O.MethodProxy info AuthNegotiate) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AuthNegotiate
type instance O.AttributeList AuthNegotiate = AuthNegotiateAttributeList
type AuthNegotiateAttributeList = ('[ '("authority", Soup.Auth.AuthAuthorityPropertyInfo), '("isAuthenticated", Soup.Auth.AuthIsAuthenticatedPropertyInfo), '("isCancelled", Soup.Auth.AuthIsCancelledPropertyInfo), '("isForProxy", Soup.Auth.AuthIsForProxyPropertyInfo), '("realm", Soup.Auth.AuthRealmPropertyInfo), '("schemeName", Soup.Auth.AuthSchemeNamePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AuthNegotiate = AuthNegotiateSignalList
type AuthNegotiateSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "soup_auth_negotiate_supported" soup_auth_negotiate_supported ::
IO CInt
authNegotiateSupported ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Bool
authNegotiateSupported :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Bool
authNegotiateSupported = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
CInt
result <- IO CInt
soup_auth_negotiate_supported
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif