{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Interfaces.PasswordManager
(
PasswordManager(..) ,
IsPasswordManager ,
toPasswordManager ,
#if defined(ENABLE_OVERLOADING)
ResolvePasswordManagerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PasswordManagerGetPasswordsAsyncMethodInfo,
#endif
passwordManagerGetPasswordsAsync ,
#if defined(ENABLE_OVERLOADING)
PasswordManagerGetPasswordsSyncMethodInfo,
#endif
passwordManagerGetPasswordsSync ,
) 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.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Soup.Callbacks as Soup.Callbacks
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
newtype PasswordManager = PasswordManager (SP.ManagedPtr PasswordManager)
deriving (PasswordManager -> PasswordManager -> Bool
(PasswordManager -> PasswordManager -> Bool)
-> (PasswordManager -> PasswordManager -> Bool)
-> Eq PasswordManager
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PasswordManager -> PasswordManager -> Bool
$c/= :: PasswordManager -> PasswordManager -> Bool
== :: PasswordManager -> PasswordManager -> Bool
$c== :: PasswordManager -> PasswordManager -> Bool
Eq)
instance SP.ManagedPtrNewtype PasswordManager where
toManagedPtr :: PasswordManager -> ManagedPtr PasswordManager
toManagedPtr (PasswordManager ManagedPtr PasswordManager
p) = ManagedPtr PasswordManager
p
foreign import ccall "soup_password_manager_get_type"
c_soup_password_manager_get_type :: IO B.Types.GType
instance B.Types.TypedObject PasswordManager where
glibType :: IO GType
glibType = IO GType
c_soup_password_manager_get_type
instance B.Types.GObject PasswordManager
instance B.GValue.IsGValue PasswordManager where
toGValue :: PasswordManager -> IO GValue
toGValue PasswordManager
o = do
GType
gtype <- IO GType
c_soup_password_manager_get_type
PasswordManager -> (Ptr PasswordManager -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PasswordManager
o (GType
-> (GValue -> Ptr PasswordManager -> IO ())
-> Ptr PasswordManager
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr PasswordManager -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO PasswordManager
fromGValue GValue
gv = do
Ptr PasswordManager
ptr <- GValue -> IO (Ptr PasswordManager)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr PasswordManager)
(ManagedPtr PasswordManager -> PasswordManager)
-> Ptr PasswordManager -> IO PasswordManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr PasswordManager -> PasswordManager
PasswordManager Ptr PasswordManager
ptr
class (SP.GObject o, O.IsDescendantOf PasswordManager o) => IsPasswordManager o
instance (SP.GObject o, O.IsDescendantOf PasswordManager o) => IsPasswordManager o
instance O.HasParentTypes PasswordManager
type instance O.ParentTypes PasswordManager = '[Soup.SessionFeature.SessionFeature, GObject.Object.Object]
toPasswordManager :: (MonadIO m, IsPasswordManager o) => o -> m PasswordManager
toPasswordManager :: o -> m PasswordManager
toPasswordManager = IO PasswordManager -> m PasswordManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PasswordManager -> m PasswordManager)
-> (o -> IO PasswordManager) -> o -> m PasswordManager
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr PasswordManager -> PasswordManager)
-> o -> IO PasswordManager
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr PasswordManager -> PasswordManager
PasswordManager
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PasswordManager
type instance O.AttributeList PasswordManager = PasswordManagerAttributeList
type PasswordManagerAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePasswordManagerMethod (t :: Symbol) (o :: *) :: * where
ResolvePasswordManagerMethod "addFeature" o = Soup.SessionFeature.SessionFeatureAddFeatureMethodInfo
ResolvePasswordManagerMethod "attach" o = Soup.SessionFeature.SessionFeatureAttachMethodInfo
ResolvePasswordManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePasswordManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePasswordManagerMethod "detach" o = Soup.SessionFeature.SessionFeatureDetachMethodInfo
ResolvePasswordManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePasswordManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePasswordManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePasswordManagerMethod "hasFeature" o = Soup.SessionFeature.SessionFeatureHasFeatureMethodInfo
ResolvePasswordManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePasswordManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePasswordManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePasswordManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePasswordManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePasswordManagerMethod "removeFeature" o = Soup.SessionFeature.SessionFeatureRemoveFeatureMethodInfo
ResolvePasswordManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePasswordManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePasswordManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePasswordManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePasswordManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePasswordManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePasswordManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePasswordManagerMethod "getPasswordsAsync" o = PasswordManagerGetPasswordsAsyncMethodInfo
ResolvePasswordManagerMethod "getPasswordsSync" o = PasswordManagerGetPasswordsSyncMethodInfo
ResolvePasswordManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePasswordManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePasswordManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePasswordManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePasswordManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePasswordManagerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePasswordManagerMethod t PasswordManager, O.MethodInfo info PasswordManager p) => OL.IsLabel t (PasswordManager -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "soup_password_manager_get_passwords_async" soup_password_manager_get_passwords_async ::
Ptr PasswordManager ->
Ptr Soup.Message.Message ->
Ptr Soup.Auth.Auth ->
CInt ->
Ptr GLib.MainContext.MainContext ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Soup.Callbacks.C_PasswordManagerCallback ->
Ptr () ->
IO ()
passwordManagerGetPasswordsAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsPasswordManager a, Soup.Message.IsMessage b, Soup.Auth.IsAuth c, Gio.Cancellable.IsCancellable d) =>
a
-> b
-> c
-> Bool
-> GLib.MainContext.MainContext
-> Maybe (d)
-> Soup.Callbacks.PasswordManagerCallback
-> m ()
passwordManagerGetPasswordsAsync :: a
-> b
-> c
-> Bool
-> MainContext
-> Maybe d
-> PasswordManagerCallback
-> m ()
passwordManagerGetPasswordsAsync a
passwordManager b
msg c
auth Bool
retrying MainContext
asyncContext Maybe d
cancellable PasswordManagerCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr PasswordManager
passwordManager' <- a -> IO (Ptr PasswordManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
passwordManager
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
Ptr Auth
auth' <- c -> IO (Ptr Auth)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
auth
let retrying' :: CInt
retrying' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
retrying
Ptr MainContext
asyncContext' <- MainContext -> IO (Ptr MainContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MainContext
asyncContext
Ptr Cancellable
maybeCancellable <- case Maybe d
cancellable of
Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
Ptr (FunPtr C_PasswordManagerCallback)
ptrcallback <- IO (Ptr (FunPtr C_PasswordManagerCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Soup.Callbacks.C_PasswordManagerCallback))
FunPtr C_PasswordManagerCallback
callback' <- C_PasswordManagerCallback -> IO (FunPtr C_PasswordManagerCallback)
Soup.Callbacks.mk_PasswordManagerCallback (Maybe (Ptr (FunPtr C_PasswordManagerCallback))
-> PasswordManagerCallback_WithClosures
-> C_PasswordManagerCallback
Soup.Callbacks.wrap_PasswordManagerCallback (Ptr (FunPtr C_PasswordManagerCallback)
-> Maybe (Ptr (FunPtr C_PasswordManagerCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_PasswordManagerCallback)
ptrcallback) (PasswordManagerCallback -> PasswordManagerCallback_WithClosures
Soup.Callbacks.drop_closures_PasswordManagerCallback PasswordManagerCallback
callback))
Ptr (FunPtr C_PasswordManagerCallback)
-> FunPtr C_PasswordManagerCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_PasswordManagerCallback)
ptrcallback FunPtr C_PasswordManagerCallback
callback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr PasswordManager
-> Ptr Message
-> Ptr Auth
-> CInt
-> Ptr MainContext
-> Ptr Cancellable
-> FunPtr C_PasswordManagerCallback
-> Ptr ()
-> IO ()
soup_password_manager_get_passwords_async Ptr PasswordManager
passwordManager' Ptr Message
msg' Ptr Auth
auth' CInt
retrying' Ptr MainContext
asyncContext' Ptr Cancellable
maybeCancellable FunPtr C_PasswordManagerCallback
callback' Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
passwordManager
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
auth
MainContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MainContext
asyncContext
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PasswordManagerGetPasswordsAsyncMethodInfo
instance (signature ~ (b -> c -> Bool -> GLib.MainContext.MainContext -> Maybe (d) -> Soup.Callbacks.PasswordManagerCallback -> m ()), MonadIO m, IsPasswordManager a, Soup.Message.IsMessage b, Soup.Auth.IsAuth c, Gio.Cancellable.IsCancellable d) => O.MethodInfo PasswordManagerGetPasswordsAsyncMethodInfo a signature where
overloadedMethod = passwordManagerGetPasswordsAsync
#endif
foreign import ccall "soup_password_manager_get_passwords_sync" soup_password_manager_get_passwords_sync ::
Ptr PasswordManager ->
Ptr Soup.Message.Message ->
Ptr Soup.Auth.Auth ->
Ptr Gio.Cancellable.Cancellable ->
IO ()
passwordManagerGetPasswordsSync ::
(B.CallStack.HasCallStack, MonadIO m, IsPasswordManager a, Soup.Message.IsMessage b, Soup.Auth.IsAuth c, Gio.Cancellable.IsCancellable d) =>
a
-> b
-> c
-> Maybe (d)
-> m ()
passwordManagerGetPasswordsSync :: a -> b -> c -> Maybe d -> m ()
passwordManagerGetPasswordsSync a
passwordManager b
msg c
auth Maybe d
cancellable = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr PasswordManager
passwordManager' <- a -> IO (Ptr PasswordManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
passwordManager
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
Ptr Auth
auth' <- c -> IO (Ptr Auth)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
auth
Ptr Cancellable
maybeCancellable <- case Maybe d
cancellable of
Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
Ptr PasswordManager
-> Ptr Message -> Ptr Auth -> Ptr Cancellable -> IO ()
soup_password_manager_get_passwords_sync Ptr PasswordManager
passwordManager' Ptr Message
msg' Ptr Auth
auth' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
passwordManager
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
auth
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PasswordManagerGetPasswordsSyncMethodInfo
instance (signature ~ (b -> c -> Maybe (d) -> m ()), MonadIO m, IsPasswordManager a, Soup.Message.IsMessage b, Soup.Auth.IsAuth c, Gio.Cancellable.IsCancellable d) => O.MethodInfo PasswordManagerGetPasswordsSyncMethodInfo a signature where
overloadedMethod = passwordManagerGetPasswordsSync
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList PasswordManager = PasswordManagerSignalList
type PasswordManagerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif