{- |
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.AuthNTLM
    ( 

-- * Exported types
    AuthNTLM(..)                            ,
    IsAuthNTLM                              ,
    toAuthNTLM                              ,
    noAuthNTLM                              ,


    ) 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 AuthNTLM = AuthNTLM (ManagedPtr AuthNTLM)
foreign import ccall "soup_auth_ntlm_get_type"
    c_soup_auth_ntlm_get_type :: IO GType

instance GObject AuthNTLM where
    gobjectType _ = c_soup_auth_ntlm_get_type
    

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

toAuthNTLM :: (MonadIO m, IsAuthNTLM o) => o -> m AuthNTLM
toAuthNTLM = liftIO . unsafeCastTo AuthNTLM

noAuthNTLM :: Maybe AuthNTLM
noAuthNTLM = Nothing

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

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

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAuthNTLMMethod t AuthNTLM, O.MethodInfo info AuthNTLM p) => O.IsLabel t (AuthNTLM -> 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 AuthNTLM
type instance O.AttributeList AuthNTLM = AuthNTLMAttributeList
type AuthNTLMAttributeList = ('[ '("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 AuthNTLM = AuthNTLMSignalList
type AuthNTLMSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif