{-# 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.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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
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 :: *) :: * 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 "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAuthNegotiateMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAuthNegotiateMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAuthNegotiateMethod "hasSavedPassword" o = Soup.Auth.AuthHasSavedPasswordMethodInfo
ResolveAuthNegotiateMethod "isAuthenticated" o = Soup.Auth.AuthIsAuthenticatedMethodInfo
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 "savePassword" o = Soup.Auth.AuthSavePasswordMethodInfo
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 "getAuthorization" o = Soup.Auth.AuthGetAuthorizationMethodInfo
ResolveAuthNegotiateMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAuthNegotiateMethod "getHost" o = Soup.Auth.AuthGetHostMethodInfo
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 "getSavedPassword" o = Soup.Auth.AuthGetSavedPasswordMethodInfo
ResolveAuthNegotiateMethod "getSavedUsers" o = Soup.Auth.AuthGetSavedUsersMethodInfo
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 = ('[ '("host", Soup.Auth.AuthHostPropertyInfo), '("isAuthenticated", Soup.Auth.AuthIsAuthenticatedPropertyInfo), '("isForProxy", Soup.Auth.AuthIsForProxyPropertyInfo), '("realm", Soup.Auth.AuthRealmPropertyInfo), '("schemeName", Soup.Auth.AuthSchemeNamePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AuthNegotiate = AuthNegotiateSignalList
type AuthNegotiateSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#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