{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Soup.Objects.AuthDigest
    ( 

-- * Exported types
    AuthDigest(..)                          ,
    IsAuthDigest                            ,
    toAuthDigest                            ,
    noAuthDigest                            ,


    ) 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 {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth

newtype AuthDigest = AuthDigest (ManagedPtr AuthDigest)
foreign import ccall "soup_auth_digest_get_type"
    c_soup_auth_digest_get_type :: IO GType

instance GObject AuthDigest where
    gobjectType _ = c_soup_auth_digest_get_type
    

class GObject o => IsAuthDigest o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError AuthDigest a) =>
    IsAuthDigest a
#endif
instance IsAuthDigest AuthDigest
instance Soup.Auth.IsAuth AuthDigest
instance GObject.Object.IsObject AuthDigest

toAuthDigest :: (MonadIO m, IsAuthDigest o) => o -> m AuthDigest
toAuthDigest = liftIO . unsafeCastTo AuthDigest

noAuthDigest :: Maybe AuthDigest
noAuthDigest = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveAuthDigestMethod (t :: Symbol) (o :: *) :: * where
    ResolveAuthDigestMethod "authenticate" o = Soup.Auth.AuthAuthenticateMethodInfo
    ResolveAuthDigestMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAuthDigestMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAuthDigestMethod "canAuthenticate" o = Soup.Auth.AuthCanAuthenticateMethodInfo
    ResolveAuthDigestMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAuthDigestMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAuthDigestMethod "hasSavedPassword" o = Soup.Auth.AuthHasSavedPasswordMethodInfo
    ResolveAuthDigestMethod "isAuthenticated" o = Soup.Auth.AuthIsAuthenticatedMethodInfo
    ResolveAuthDigestMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAuthDigestMethod "isForProxy" o = Soup.Auth.AuthIsForProxyMethodInfo
    ResolveAuthDigestMethod "isReady" o = Soup.Auth.AuthIsReadyMethodInfo
    ResolveAuthDigestMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAuthDigestMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAuthDigestMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveAuthDigestMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAuthDigestMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveAuthDigestMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveAuthDigestMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAuthDigestMethod "savePassword" o = Soup.Auth.AuthSavePasswordMethodInfo
    ResolveAuthDigestMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAuthDigestMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAuthDigestMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAuthDigestMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveAuthDigestMethod "update" o = Soup.Auth.AuthUpdateMethodInfo
    ResolveAuthDigestMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAuthDigestMethod "getAuthorization" o = Soup.Auth.AuthGetAuthorizationMethodInfo
    ResolveAuthDigestMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAuthDigestMethod "getHost" o = Soup.Auth.AuthGetHostMethodInfo
    ResolveAuthDigestMethod "getInfo" o = Soup.Auth.AuthGetInfoMethodInfo
    ResolveAuthDigestMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAuthDigestMethod "getProtectionSpace" o = Soup.Auth.AuthGetProtectionSpaceMethodInfo
    ResolveAuthDigestMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAuthDigestMethod "getRealm" o = Soup.Auth.AuthGetRealmMethodInfo
    ResolveAuthDigestMethod "getSavedPassword" o = Soup.Auth.AuthGetSavedPasswordMethodInfo
    ResolveAuthDigestMethod "getSavedUsers" o = Soup.Auth.AuthGetSavedUsersMethodInfo
    ResolveAuthDigestMethod "getSchemeName" o = Soup.Auth.AuthGetSchemeNameMethodInfo
    ResolveAuthDigestMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAuthDigestMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAuthDigestMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveAuthDigestMethod t AuthDigest, O.MethodInfo info AuthDigest p) => O.IsLabelProxy t (AuthDigest -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAuthDigestMethod t AuthDigest, O.MethodInfo info AuthDigest p) => O.IsLabel t (AuthDigest -> 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

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList AuthDigest
type instance O.AttributeList AuthDigest = AuthDigestAttributeList
type AuthDigestAttributeList = ('[ '("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) && !defined(__HADDOCK_VERSION__)
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList AuthDigest = AuthDigestSignalList
type AuthDigestSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif