{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.TlsInteraction
(
TlsInteraction(..) ,
IsTlsInteraction ,
toTlsInteraction ,
#if defined(ENABLE_OVERLOADING)
ResolveTlsInteractionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TlsInteractionAskPasswordMethodInfo ,
#endif
tlsInteractionAskPassword ,
#if defined(ENABLE_OVERLOADING)
TlsInteractionAskPasswordAsyncMethodInfo,
#endif
tlsInteractionAskPasswordAsync ,
#if defined(ENABLE_OVERLOADING)
TlsInteractionAskPasswordFinishMethodInfo,
#endif
tlsInteractionAskPasswordFinish ,
#if defined(ENABLE_OVERLOADING)
TlsInteractionInvokeAskPasswordMethodInfo,
#endif
tlsInteractionInvokeAskPassword ,
#if defined(ENABLE_OVERLOADING)
TlsInteractionInvokeRequestCertificateMethodInfo,
#endif
tlsInteractionInvokeRequestCertificate ,
#if defined(ENABLE_OVERLOADING)
TlsInteractionRequestCertificateMethodInfo,
#endif
tlsInteractionRequestCertificate ,
#if defined(ENABLE_OVERLOADING)
TlsInteractionRequestCertificateAsyncMethodInfo,
#endif
tlsInteractionRequestCertificateAsync ,
#if defined(ENABLE_OVERLOADING)
TlsInteractionRequestCertificateFinishMethodInfo,
#endif
tlsInteractionRequestCertificateFinish ,
) 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.Kind as DK
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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddressEnumerator as Gio.SocketAddressEnumerator
import {-# SOURCE #-} qualified GI.Gio.Objects.TlsCertificate as Gio.TlsCertificate
import {-# SOURCE #-} qualified GI.Gio.Objects.TlsConnection as Gio.TlsConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.TlsDatabase as Gio.TlsDatabase
import {-# SOURCE #-} qualified GI.Gio.Objects.TlsPassword as Gio.TlsPassword
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.TlsConnection as Gio.TlsConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.TlsPassword as Gio.TlsPassword
#endif
newtype TlsInteraction = TlsInteraction (SP.ManagedPtr TlsInteraction)
deriving (TlsInteraction -> TlsInteraction -> Bool
(TlsInteraction -> TlsInteraction -> Bool)
-> (TlsInteraction -> TlsInteraction -> Bool) -> Eq TlsInteraction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TlsInteraction -> TlsInteraction -> Bool
== :: TlsInteraction -> TlsInteraction -> Bool
$c/= :: TlsInteraction -> TlsInteraction -> Bool
/= :: TlsInteraction -> TlsInteraction -> Bool
Eq)
instance SP.ManagedPtrNewtype TlsInteraction where
toManagedPtr :: TlsInteraction -> ManagedPtr TlsInteraction
toManagedPtr (TlsInteraction ManagedPtr TlsInteraction
p) = ManagedPtr TlsInteraction
p
foreign import ccall "g_tls_interaction_get_type"
c_g_tls_interaction_get_type :: IO B.Types.GType
instance B.Types.TypedObject TlsInteraction where
glibType :: IO GType
glibType = IO GType
c_g_tls_interaction_get_type
instance B.Types.GObject TlsInteraction
class (SP.GObject o, O.IsDescendantOf TlsInteraction o) => IsTlsInteraction o
instance (SP.GObject o, O.IsDescendantOf TlsInteraction o) => IsTlsInteraction o
instance O.HasParentTypes TlsInteraction
type instance O.ParentTypes TlsInteraction = '[GObject.Object.Object]
toTlsInteraction :: (MIO.MonadIO m, IsTlsInteraction o) => o -> m TlsInteraction
toTlsInteraction :: forall (m :: * -> *) o.
(MonadIO m, IsTlsInteraction o) =>
o -> m TlsInteraction
toTlsInteraction = IO TlsInteraction -> m TlsInteraction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO TlsInteraction -> m TlsInteraction)
-> (o -> IO TlsInteraction) -> o -> m TlsInteraction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr TlsInteraction -> TlsInteraction)
-> o -> IO TlsInteraction
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr TlsInteraction -> TlsInteraction
TlsInteraction
instance B.GValue.IsGValue (Maybe TlsInteraction) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_tls_interaction_get_type
gvalueSet_ :: Ptr GValue -> Maybe TlsInteraction -> IO ()
gvalueSet_ Ptr GValue
gv Maybe TlsInteraction
P.Nothing = Ptr GValue -> Ptr TlsInteraction -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr TlsInteraction
forall a. Ptr a
FP.nullPtr :: FP.Ptr TlsInteraction)
gvalueSet_ Ptr GValue
gv (P.Just TlsInteraction
obj) = TlsInteraction -> (Ptr TlsInteraction -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TlsInteraction
obj (Ptr GValue -> Ptr TlsInteraction -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe TlsInteraction)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr TlsInteraction)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr TlsInteraction)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject TlsInteraction ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveTlsInteractionMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveTlsInteractionMethod "askPassword" o = TlsInteractionAskPasswordMethodInfo
ResolveTlsInteractionMethod "askPasswordAsync" o = TlsInteractionAskPasswordAsyncMethodInfo
ResolveTlsInteractionMethod "askPasswordFinish" o = TlsInteractionAskPasswordFinishMethodInfo
ResolveTlsInteractionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTlsInteractionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTlsInteractionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTlsInteractionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTlsInteractionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTlsInteractionMethod "invokeAskPassword" o = TlsInteractionInvokeAskPasswordMethodInfo
ResolveTlsInteractionMethod "invokeRequestCertificate" o = TlsInteractionInvokeRequestCertificateMethodInfo
ResolveTlsInteractionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTlsInteractionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTlsInteractionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTlsInteractionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTlsInteractionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTlsInteractionMethod "requestCertificate" o = TlsInteractionRequestCertificateMethodInfo
ResolveTlsInteractionMethod "requestCertificateAsync" o = TlsInteractionRequestCertificateAsyncMethodInfo
ResolveTlsInteractionMethod "requestCertificateFinish" o = TlsInteractionRequestCertificateFinishMethodInfo
ResolveTlsInteractionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTlsInteractionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTlsInteractionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTlsInteractionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTlsInteractionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTlsInteractionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTlsInteractionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTlsInteractionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTlsInteractionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTlsInteractionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTlsInteractionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTlsInteractionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTlsInteractionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTlsInteractionMethod t TlsInteraction, O.OverloadedMethod info TlsInteraction p) => OL.IsLabel t (TlsInteraction -> 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 ~ ResolveTlsInteractionMethod t TlsInteraction, O.OverloadedMethod info TlsInteraction p, R.HasField t TlsInteraction p) => R.HasField t TlsInteraction p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTlsInteractionMethod t TlsInteraction, O.OverloadedMethodInfo info TlsInteraction) => OL.IsLabel t (O.MethodProxy info TlsInteraction) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TlsInteraction
type instance O.AttributeList TlsInteraction = TlsInteractionAttributeList
type TlsInteractionAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList TlsInteraction = TlsInteractionSignalList
type TlsInteractionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_tls_interaction_ask_password" g_tls_interaction_ask_password ::
Ptr TlsInteraction ->
Ptr Gio.TlsPassword.TlsPassword ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CUInt
tlsInteractionAskPassword ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.TlsPassword.IsTlsPassword b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m Gio.Enums.TlsInteractionResult
tlsInteractionAskPassword :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsTlsPassword b,
IsCancellable c) =>
a -> b -> Maybe c -> m TlsInteractionResult
tlsInteractionAskPassword a
interaction b
password Maybe c
cancellable = IO TlsInteractionResult -> m TlsInteractionResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsInteractionResult -> m TlsInteractionResult)
-> IO TlsInteractionResult -> m TlsInteractionResult
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
password' <- unsafeManagedPtrCastPtr password
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_tls_interaction_ask_password interaction' password' maybeCancellable
let result' = (Int -> TlsInteractionResult
forall a. Enum a => Int -> a
toEnum (Int -> TlsInteractionResult)
-> (CUInt -> Int) -> CUInt -> TlsInteractionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr interaction
touchManagedPtr password
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data TlsInteractionAskPasswordMethodInfo
instance (signature ~ (b -> Maybe (c) -> m Gio.Enums.TlsInteractionResult), MonadIO m, IsTlsInteraction a, Gio.TlsPassword.IsTlsPassword b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod TlsInteractionAskPasswordMethodInfo a signature where
overloadedMethod = tlsInteractionAskPassword
instance O.OverloadedMethodInfo TlsInteractionAskPasswordMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionAskPassword",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionAskPassword"
})
#endif
foreign import ccall "g_tls_interaction_ask_password_async" g_tls_interaction_ask_password_async ::
Ptr TlsInteraction ->
Ptr Gio.TlsPassword.TlsPassword ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
tlsInteractionAskPasswordAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.TlsPassword.IsTlsPassword b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
tlsInteractionAskPasswordAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsTlsPassword b,
IsCancellable c) =>
a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
tlsInteractionAskPasswordAsync a
interaction b
password Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
password' <- unsafeManagedPtrCastPtr password
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_tls_interaction_ask_password_async interaction' password' maybeCancellable maybeCallback userData
touchManagedPtr interaction
touchManagedPtr password
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data TlsInteractionAskPasswordAsyncMethodInfo
instance (signature ~ (b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsTlsInteraction a, Gio.TlsPassword.IsTlsPassword b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod TlsInteractionAskPasswordAsyncMethodInfo a signature where
overloadedMethod = tlsInteractionAskPasswordAsync
instance O.OverloadedMethodInfo TlsInteractionAskPasswordAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionAskPasswordAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionAskPasswordAsync"
})
#endif
foreign import ccall "g_tls_interaction_ask_password_finish" g_tls_interaction_ask_password_finish ::
Ptr TlsInteraction ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CUInt
tlsInteractionAskPasswordFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.Enums.TlsInteractionResult
tlsInteractionAskPasswordFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsAsyncResult b) =>
a -> b -> m TlsInteractionResult
tlsInteractionAskPasswordFinish a
interaction b
result_ = IO TlsInteractionResult -> m TlsInteractionResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsInteractionResult -> m TlsInteractionResult)
-> IO TlsInteractionResult -> m TlsInteractionResult
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_tls_interaction_ask_password_finish interaction' result_'
let result' = (Int -> TlsInteractionResult
forall a. Enum a => Int -> a
toEnum (Int -> TlsInteractionResult)
-> (CUInt -> Int) -> CUInt -> TlsInteractionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr interaction
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data TlsInteractionAskPasswordFinishMethodInfo
instance (signature ~ (b -> m Gio.Enums.TlsInteractionResult), MonadIO m, IsTlsInteraction a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod TlsInteractionAskPasswordFinishMethodInfo a signature where
overloadedMethod = tlsInteractionAskPasswordFinish
instance O.OverloadedMethodInfo TlsInteractionAskPasswordFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionAskPasswordFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionAskPasswordFinish"
})
#endif
foreign import ccall "g_tls_interaction_invoke_ask_password" g_tls_interaction_invoke_ask_password ::
Ptr TlsInteraction ->
Ptr Gio.TlsPassword.TlsPassword ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CUInt
tlsInteractionInvokeAskPassword ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.TlsPassword.IsTlsPassword b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m Gio.Enums.TlsInteractionResult
tlsInteractionInvokeAskPassword :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsTlsPassword b,
IsCancellable c) =>
a -> b -> Maybe c -> m TlsInteractionResult
tlsInteractionInvokeAskPassword a
interaction b
password Maybe c
cancellable = IO TlsInteractionResult -> m TlsInteractionResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsInteractionResult -> m TlsInteractionResult)
-> IO TlsInteractionResult -> m TlsInteractionResult
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
password' <- unsafeManagedPtrCastPtr password
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_tls_interaction_invoke_ask_password interaction' password' maybeCancellable
let result' = (Int -> TlsInteractionResult
forall a. Enum a => Int -> a
toEnum (Int -> TlsInteractionResult)
-> (CUInt -> Int) -> CUInt -> TlsInteractionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr interaction
touchManagedPtr password
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data TlsInteractionInvokeAskPasswordMethodInfo
instance (signature ~ (b -> Maybe (c) -> m Gio.Enums.TlsInteractionResult), MonadIO m, IsTlsInteraction a, Gio.TlsPassword.IsTlsPassword b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod TlsInteractionInvokeAskPasswordMethodInfo a signature where
overloadedMethod = tlsInteractionInvokeAskPassword
instance O.OverloadedMethodInfo TlsInteractionInvokeAskPasswordMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionInvokeAskPassword",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionInvokeAskPassword"
})
#endif
foreign import ccall "g_tls_interaction_invoke_request_certificate" g_tls_interaction_invoke_request_certificate ::
Ptr TlsInteraction ->
Ptr Gio.TlsConnection.TlsConnection ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CUInt
tlsInteractionInvokeRequestCertificate ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.TlsConnection.IsTlsConnection b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Gio.Enums.TlsCertificateRequestFlags
-> Maybe (c)
-> m Gio.Enums.TlsInteractionResult
tlsInteractionInvokeRequestCertificate :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsTlsConnection b,
IsCancellable c) =>
a
-> b
-> TlsCertificateRequestFlags
-> Maybe c
-> m TlsInteractionResult
tlsInteractionInvokeRequestCertificate a
interaction b
connection TlsCertificateRequestFlags
flags Maybe c
cancellable = IO TlsInteractionResult -> m TlsInteractionResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsInteractionResult -> m TlsInteractionResult)
-> IO TlsInteractionResult -> m TlsInteractionResult
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
connection' <- unsafeManagedPtrCastPtr connection
let flags' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (TlsCertificateRequestFlags -> Int)
-> TlsCertificateRequestFlags
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TlsCertificateRequestFlags -> Int
forall a. Enum a => a -> Int
fromEnum) TlsCertificateRequestFlags
flags
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_tls_interaction_invoke_request_certificate interaction' connection' flags' maybeCancellable
let result' = (Int -> TlsInteractionResult
forall a. Enum a => Int -> a
toEnum (Int -> TlsInteractionResult)
-> (CUInt -> Int) -> CUInt -> TlsInteractionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr interaction
touchManagedPtr connection
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data TlsInteractionInvokeRequestCertificateMethodInfo
instance (signature ~ (b -> Gio.Enums.TlsCertificateRequestFlags -> Maybe (c) -> m Gio.Enums.TlsInteractionResult), MonadIO m, IsTlsInteraction a, Gio.TlsConnection.IsTlsConnection b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod TlsInteractionInvokeRequestCertificateMethodInfo a signature where
overloadedMethod = tlsInteractionInvokeRequestCertificate
instance O.OverloadedMethodInfo TlsInteractionInvokeRequestCertificateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionInvokeRequestCertificate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionInvokeRequestCertificate"
})
#endif
foreign import ccall "g_tls_interaction_request_certificate" g_tls_interaction_request_certificate ::
Ptr TlsInteraction ->
Ptr Gio.TlsConnection.TlsConnection ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CUInt
tlsInteractionRequestCertificate ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.TlsConnection.IsTlsConnection b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Gio.Enums.TlsCertificateRequestFlags
-> Maybe (c)
-> m Gio.Enums.TlsInteractionResult
tlsInteractionRequestCertificate :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsTlsConnection b,
IsCancellable c) =>
a
-> b
-> TlsCertificateRequestFlags
-> Maybe c
-> m TlsInteractionResult
tlsInteractionRequestCertificate a
interaction b
connection TlsCertificateRequestFlags
flags Maybe c
cancellable = IO TlsInteractionResult -> m TlsInteractionResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsInteractionResult -> m TlsInteractionResult)
-> IO TlsInteractionResult -> m TlsInteractionResult
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
connection' <- unsafeManagedPtrCastPtr connection
let flags' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (TlsCertificateRequestFlags -> Int)
-> TlsCertificateRequestFlags
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TlsCertificateRequestFlags -> Int
forall a. Enum a => a -> Int
fromEnum) TlsCertificateRequestFlags
flags
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_tls_interaction_request_certificate interaction' connection' flags' maybeCancellable
let result' = (Int -> TlsInteractionResult
forall a. Enum a => Int -> a
toEnum (Int -> TlsInteractionResult)
-> (CUInt -> Int) -> CUInt -> TlsInteractionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr interaction
touchManagedPtr connection
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data TlsInteractionRequestCertificateMethodInfo
instance (signature ~ (b -> Gio.Enums.TlsCertificateRequestFlags -> Maybe (c) -> m Gio.Enums.TlsInteractionResult), MonadIO m, IsTlsInteraction a, Gio.TlsConnection.IsTlsConnection b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod TlsInteractionRequestCertificateMethodInfo a signature where
overloadedMethod = tlsInteractionRequestCertificate
instance O.OverloadedMethodInfo TlsInteractionRequestCertificateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionRequestCertificate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionRequestCertificate"
})
#endif
foreign import ccall "g_tls_interaction_request_certificate_async" g_tls_interaction_request_certificate_async ::
Ptr TlsInteraction ->
Ptr Gio.TlsConnection.TlsConnection ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
tlsInteractionRequestCertificateAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.TlsConnection.IsTlsConnection b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Gio.Enums.TlsCertificateRequestFlags
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
tlsInteractionRequestCertificateAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsTlsConnection b,
IsCancellable c) =>
a
-> b
-> TlsCertificateRequestFlags
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
tlsInteractionRequestCertificateAsync a
interaction b
connection TlsCertificateRequestFlags
flags Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
connection' <- unsafeManagedPtrCastPtr connection
let flags' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (TlsCertificateRequestFlags -> Int)
-> TlsCertificateRequestFlags
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TlsCertificateRequestFlags -> Int
forall a. Enum a => a -> Int
fromEnum) TlsCertificateRequestFlags
flags
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_tls_interaction_request_certificate_async interaction' connection' flags' maybeCancellable maybeCallback userData
touchManagedPtr interaction
touchManagedPtr connection
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data TlsInteractionRequestCertificateAsyncMethodInfo
instance (signature ~ (b -> Gio.Enums.TlsCertificateRequestFlags -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsTlsInteraction a, Gio.TlsConnection.IsTlsConnection b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod TlsInteractionRequestCertificateAsyncMethodInfo a signature where
overloadedMethod = tlsInteractionRequestCertificateAsync
instance O.OverloadedMethodInfo TlsInteractionRequestCertificateAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionRequestCertificateAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionRequestCertificateAsync"
})
#endif
foreign import ccall "g_tls_interaction_request_certificate_finish" g_tls_interaction_request_certificate_finish ::
Ptr TlsInteraction ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CUInt
tlsInteractionRequestCertificateFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsInteraction a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.Enums.TlsInteractionResult
tlsInteractionRequestCertificateFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsTlsInteraction a, IsAsyncResult b) =>
a -> b -> m TlsInteractionResult
tlsInteractionRequestCertificateFinish a
interaction b
result_ = IO TlsInteractionResult -> m TlsInteractionResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsInteractionResult -> m TlsInteractionResult)
-> IO TlsInteractionResult -> m TlsInteractionResult
forall a b. (a -> b) -> a -> b
$ do
interaction' <- a -> IO (Ptr TlsInteraction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
interaction
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_tls_interaction_request_certificate_finish interaction' result_'
let result' = (Int -> TlsInteractionResult
forall a. Enum a => Int -> a
toEnum (Int -> TlsInteractionResult)
-> (CUInt -> Int) -> CUInt -> TlsInteractionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr interaction
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data TlsInteractionRequestCertificateFinishMethodInfo
instance (signature ~ (b -> m Gio.Enums.TlsInteractionResult), MonadIO m, IsTlsInteraction a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod TlsInteractionRequestCertificateFinishMethodInfo a signature where
overloadedMethod = tlsInteractionRequestCertificateFinish
instance O.OverloadedMethodInfo TlsInteractionRequestCertificateFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsInteraction.tlsInteractionRequestCertificateFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsInteraction.html#v:tlsInteractionRequestCertificateFinish"
})
#endif