{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Soup.Objects.AuthNTLM
    ( 

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


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveAuthNTLMMethod                   ,
#endif




    ) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth

-- | Memory-managed wrapper type.
newtype AuthNTLM = AuthNTLM (SP.ManagedPtr AuthNTLM)
    deriving (AuthNTLM -> AuthNTLM -> Bool
(AuthNTLM -> AuthNTLM -> Bool)
-> (AuthNTLM -> AuthNTLM -> Bool) -> Eq AuthNTLM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthNTLM -> AuthNTLM -> Bool
$c/= :: AuthNTLM -> AuthNTLM -> Bool
== :: AuthNTLM -> AuthNTLM -> Bool
$c== :: AuthNTLM -> AuthNTLM -> Bool
Eq)

instance SP.ManagedPtrNewtype AuthNTLM where
    toManagedPtr :: AuthNTLM -> ManagedPtr AuthNTLM
toManagedPtr (AuthNTLM ManagedPtr AuthNTLM
p) = ManagedPtr AuthNTLM
p

foreign import ccall "soup_auth_ntlm_get_type"
    c_soup_auth_ntlm_get_type :: IO B.Types.GType

instance B.Types.TypedObject AuthNTLM where
    glibType :: IO GType
glibType = IO GType
c_soup_auth_ntlm_get_type

instance B.Types.GObject AuthNTLM

-- | Convert 'AuthNTLM' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue AuthNTLM where
    toGValue :: AuthNTLM -> IO GValue
toGValue AuthNTLM
o = do
        GType
gtype <- IO GType
c_soup_auth_ntlm_get_type
        AuthNTLM -> (Ptr AuthNTLM -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AuthNTLM
o (GType
-> (GValue -> Ptr AuthNTLM -> IO ()) -> Ptr AuthNTLM -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr AuthNTLM -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO AuthNTLM
fromGValue GValue
gv = do
        Ptr AuthNTLM
ptr <- GValue -> IO (Ptr AuthNTLM)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr AuthNTLM)
        (ManagedPtr AuthNTLM -> AuthNTLM) -> Ptr AuthNTLM -> IO AuthNTLM
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AuthNTLM -> AuthNTLM
AuthNTLM Ptr AuthNTLM
ptr
        
    

-- | Type class for types which can be safely cast to `AuthNTLM`, for instance with `toAuthNTLM`.
class (SP.GObject o, O.IsDescendantOf AuthNTLM o) => IsAuthNTLM o
instance (SP.GObject o, O.IsDescendantOf AuthNTLM o) => IsAuthNTLM o

instance O.HasParentTypes AuthNTLM
type instance O.ParentTypes AuthNTLM = '[Soup.Auth.Auth, GObject.Object.Object]

-- | Cast to `AuthNTLM`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toAuthNTLM :: (MonadIO m, IsAuthNTLM o) => o -> m AuthNTLM
toAuthNTLM :: o -> m AuthNTLM
toAuthNTLM = IO AuthNTLM -> m AuthNTLM
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AuthNTLM -> m AuthNTLM)
-> (o -> IO AuthNTLM) -> o -> m AuthNTLM
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AuthNTLM -> AuthNTLM) -> o -> IO AuthNTLM
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr AuthNTLM -> AuthNTLM
AuthNTLM

#if defined(ENABLE_OVERLOADING)
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 "getv" o = GObject.Object.ObjectGetvMethodInfo
    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 "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 "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveAuthNTLMMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAuthNTLMMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveAuthNTLMMethod t AuthNTLM, O.MethodInfo info AuthNTLM p) => OL.IsLabel t (AuthNTLM -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

#if defined(ENABLE_OVERLOADING)
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)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AuthNTLM = AuthNTLMSignalList
type AuthNTLMSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif