{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.TlsPassword
(
TlsPassword(..) ,
IsTlsPassword ,
toTlsPassword ,
#if defined(ENABLE_OVERLOADING)
ResolveTlsPasswordMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TlsPasswordGetDescriptionMethodInfo ,
#endif
tlsPasswordGetDescription ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordGetFlagsMethodInfo ,
#endif
tlsPasswordGetFlags ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordGetWarningMethodInfo ,
#endif
tlsPasswordGetWarning ,
tlsPasswordNew ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordSetDescriptionMethodInfo ,
#endif
tlsPasswordSetDescription ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordSetFlagsMethodInfo ,
#endif
tlsPasswordSetFlags ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordSetValueMethodInfo ,
#endif
tlsPasswordSetValue ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordSetValueFullMethodInfo ,
#endif
tlsPasswordSetValueFull ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordSetWarningMethodInfo ,
#endif
tlsPasswordSetWarning ,
#if defined(ENABLE_OVERLOADING)
TlsPasswordDescriptionPropertyInfo ,
#endif
constructTlsPasswordDescription ,
getTlsPasswordDescription ,
setTlsPasswordDescription ,
#if defined(ENABLE_OVERLOADING)
tlsPasswordDescription ,
#endif
#if defined(ENABLE_OVERLOADING)
TlsPasswordFlagsPropertyInfo ,
#endif
constructTlsPasswordFlags ,
getTlsPasswordFlags ,
setTlsPasswordFlags ,
#if defined(ENABLE_OVERLOADING)
tlsPasswordFlags ,
#endif
#if defined(ENABLE_OVERLOADING)
TlsPasswordWarningPropertyInfo ,
#endif
constructTlsPasswordWarning ,
getTlsPasswordWarning ,
setTlsPasswordWarning ,
#if defined(ENABLE_OVERLOADING)
tlsPasswordWarning ,
#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.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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
#else
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
#endif
newtype TlsPassword = TlsPassword (SP.ManagedPtr TlsPassword)
deriving (TlsPassword -> TlsPassword -> Bool
(TlsPassword -> TlsPassword -> Bool)
-> (TlsPassword -> TlsPassword -> Bool) -> Eq TlsPassword
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TlsPassword -> TlsPassword -> Bool
== :: TlsPassword -> TlsPassword -> Bool
$c/= :: TlsPassword -> TlsPassword -> Bool
/= :: TlsPassword -> TlsPassword -> Bool
Eq)
instance SP.ManagedPtrNewtype TlsPassword where
toManagedPtr :: TlsPassword -> ManagedPtr TlsPassword
toManagedPtr (TlsPassword ManagedPtr TlsPassword
p) = ManagedPtr TlsPassword
p
foreign import ccall "g_tls_password_get_type"
c_g_tls_password_get_type :: IO B.Types.GType
instance B.Types.TypedObject TlsPassword where
glibType :: IO GType
glibType = IO GType
c_g_tls_password_get_type
instance B.Types.GObject TlsPassword
class (SP.GObject o, O.IsDescendantOf TlsPassword o) => IsTlsPassword o
instance (SP.GObject o, O.IsDescendantOf TlsPassword o) => IsTlsPassword o
instance O.HasParentTypes TlsPassword
type instance O.ParentTypes TlsPassword = '[GObject.Object.Object]
toTlsPassword :: (MIO.MonadIO m, IsTlsPassword o) => o -> m TlsPassword
toTlsPassword :: forall (m :: * -> *) o.
(MonadIO m, IsTlsPassword o) =>
o -> m TlsPassword
toTlsPassword = IO TlsPassword -> m TlsPassword
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO TlsPassword -> m TlsPassword)
-> (o -> IO TlsPassword) -> o -> m TlsPassword
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr TlsPassword -> TlsPassword) -> o -> IO TlsPassword
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr TlsPassword -> TlsPassword
TlsPassword
instance B.GValue.IsGValue (Maybe TlsPassword) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_tls_password_get_type
gvalueSet_ :: Ptr GValue -> Maybe TlsPassword -> IO ()
gvalueSet_ Ptr GValue
gv Maybe TlsPassword
P.Nothing = Ptr GValue -> Ptr TlsPassword -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr TlsPassword
forall a. Ptr a
FP.nullPtr :: FP.Ptr TlsPassword)
gvalueSet_ Ptr GValue
gv (P.Just TlsPassword
obj) = TlsPassword -> (Ptr TlsPassword -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TlsPassword
obj (Ptr GValue -> Ptr TlsPassword -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe TlsPassword)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr TlsPassword)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr TlsPassword)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject TlsPassword ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveTlsPasswordMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveTlsPasswordMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTlsPasswordMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTlsPasswordMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTlsPasswordMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTlsPasswordMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTlsPasswordMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTlsPasswordMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTlsPasswordMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTlsPasswordMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTlsPasswordMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTlsPasswordMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTlsPasswordMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTlsPasswordMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTlsPasswordMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTlsPasswordMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTlsPasswordMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTlsPasswordMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTlsPasswordMethod "getDescription" o = TlsPasswordGetDescriptionMethodInfo
ResolveTlsPasswordMethod "getFlags" o = TlsPasswordGetFlagsMethodInfo
ResolveTlsPasswordMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTlsPasswordMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTlsPasswordMethod "getWarning" o = TlsPasswordGetWarningMethodInfo
ResolveTlsPasswordMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTlsPasswordMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTlsPasswordMethod "setDescription" o = TlsPasswordSetDescriptionMethodInfo
ResolveTlsPasswordMethod "setFlags" o = TlsPasswordSetFlagsMethodInfo
ResolveTlsPasswordMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTlsPasswordMethod "setValue" o = TlsPasswordSetValueMethodInfo
ResolveTlsPasswordMethod "setValueFull" o = TlsPasswordSetValueFullMethodInfo
ResolveTlsPasswordMethod "setWarning" o = TlsPasswordSetWarningMethodInfo
ResolveTlsPasswordMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTlsPasswordMethod t TlsPassword, O.OverloadedMethod info TlsPassword p) => OL.IsLabel t (TlsPassword -> 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 ~ ResolveTlsPasswordMethod t TlsPassword, O.OverloadedMethod info TlsPassword p, R.HasField t TlsPassword p) => R.HasField t TlsPassword p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTlsPasswordMethod t TlsPassword, O.OverloadedMethodInfo info TlsPassword) => OL.IsLabel t (O.MethodProxy info TlsPassword) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getTlsPasswordDescription :: (MonadIO m, IsTlsPassword o) => o -> m T.Text
getTlsPasswordDescription :: forall (m :: * -> *) o. (MonadIO m, IsTlsPassword o) => o -> m Text
getTlsPasswordDescription o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getTlsPasswordDescription" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"description"
setTlsPasswordDescription :: (MonadIO m, IsTlsPassword o) => o -> T.Text -> m ()
setTlsPasswordDescription :: forall (m :: * -> *) o.
(MonadIO m, IsTlsPassword o) =>
o -> Text -> m ()
setTlsPasswordDescription o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"description" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructTlsPasswordDescription :: (IsTlsPassword o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructTlsPasswordDescription :: forall o (m :: * -> *).
(IsTlsPassword o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructTlsPasswordDescription Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"description" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data TlsPasswordDescriptionPropertyInfo
instance AttrInfo TlsPasswordDescriptionPropertyInfo where
type AttrAllowedOps TlsPasswordDescriptionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint TlsPasswordDescriptionPropertyInfo = IsTlsPassword
type AttrSetTypeConstraint TlsPasswordDescriptionPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint TlsPasswordDescriptionPropertyInfo = (~) T.Text
type AttrTransferType TlsPasswordDescriptionPropertyInfo = T.Text
type AttrGetType TlsPasswordDescriptionPropertyInfo = T.Text
type AttrLabel TlsPasswordDescriptionPropertyInfo = "description"
type AttrOrigin TlsPasswordDescriptionPropertyInfo = TlsPassword
attrGet = getTlsPasswordDescription
attrSet = setTlsPasswordDescription
attrTransfer _ v = do
return v
attrConstruct = constructTlsPasswordDescription
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.description"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#g:attr:description"
})
#endif
getTlsPasswordFlags :: (MonadIO m, IsTlsPassword o) => o -> m [Gio.Flags.TlsPasswordFlags]
getTlsPasswordFlags :: forall (m :: * -> *) o.
(MonadIO m, IsTlsPassword o) =>
o -> m [TlsPasswordFlags]
getTlsPasswordFlags o
obj = IO [TlsPasswordFlags] -> m [TlsPasswordFlags]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO [TlsPasswordFlags] -> m [TlsPasswordFlags])
-> IO [TlsPasswordFlags] -> m [TlsPasswordFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [TlsPasswordFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"flags"
setTlsPasswordFlags :: (MonadIO m, IsTlsPassword o) => o -> [Gio.Flags.TlsPasswordFlags] -> m ()
setTlsPasswordFlags :: forall (m :: * -> *) o.
(MonadIO m, IsTlsPassword o) =>
o -> [TlsPasswordFlags] -> m ()
setTlsPasswordFlags o
obj [TlsPasswordFlags]
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> [TlsPasswordFlags] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj String
"flags" [TlsPasswordFlags]
val
constructTlsPasswordFlags :: (IsTlsPassword o, MIO.MonadIO m) => [Gio.Flags.TlsPasswordFlags] -> m (GValueConstruct o)
constructTlsPasswordFlags :: forall o (m :: * -> *).
(IsTlsPassword o, MonadIO m) =>
[TlsPasswordFlags] -> m (GValueConstruct o)
constructTlsPasswordFlags [TlsPasswordFlags]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [TlsPasswordFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"flags" [TlsPasswordFlags]
val
#if defined(ENABLE_OVERLOADING)
data TlsPasswordFlagsPropertyInfo
instance AttrInfo TlsPasswordFlagsPropertyInfo where
type AttrAllowedOps TlsPasswordFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint TlsPasswordFlagsPropertyInfo = IsTlsPassword
type AttrSetTypeConstraint TlsPasswordFlagsPropertyInfo = (~) [Gio.Flags.TlsPasswordFlags]
type AttrTransferTypeConstraint TlsPasswordFlagsPropertyInfo = (~) [Gio.Flags.TlsPasswordFlags]
type AttrTransferType TlsPasswordFlagsPropertyInfo = [Gio.Flags.TlsPasswordFlags]
type AttrGetType TlsPasswordFlagsPropertyInfo = [Gio.Flags.TlsPasswordFlags]
type AttrLabel TlsPasswordFlagsPropertyInfo = "flags"
type AttrOrigin TlsPasswordFlagsPropertyInfo = TlsPassword
attrGet = getTlsPasswordFlags
attrSet = setTlsPasswordFlags
attrTransfer _ v = do
return v
attrConstruct = constructTlsPasswordFlags
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.flags"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#g:attr:flags"
})
#endif
getTlsPasswordWarning :: (MonadIO m, IsTlsPassword o) => o -> m T.Text
getTlsPasswordWarning :: forall (m :: * -> *) o. (MonadIO m, IsTlsPassword o) => o -> m Text
getTlsPasswordWarning o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getTlsPasswordWarning" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"warning"
setTlsPasswordWarning :: (MonadIO m, IsTlsPassword o) => o -> T.Text -> m ()
setTlsPasswordWarning :: forall (m :: * -> *) o.
(MonadIO m, IsTlsPassword o) =>
o -> Text -> m ()
setTlsPasswordWarning o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"warning" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructTlsPasswordWarning :: (IsTlsPassword o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructTlsPasswordWarning :: forall o (m :: * -> *).
(IsTlsPassword o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructTlsPasswordWarning Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"warning" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data TlsPasswordWarningPropertyInfo
instance AttrInfo TlsPasswordWarningPropertyInfo where
type AttrAllowedOps TlsPasswordWarningPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint TlsPasswordWarningPropertyInfo = IsTlsPassword
type AttrSetTypeConstraint TlsPasswordWarningPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint TlsPasswordWarningPropertyInfo = (~) T.Text
type AttrTransferType TlsPasswordWarningPropertyInfo = T.Text
type AttrGetType TlsPasswordWarningPropertyInfo = T.Text
type AttrLabel TlsPasswordWarningPropertyInfo = "warning"
type AttrOrigin TlsPasswordWarningPropertyInfo = TlsPassword
attrGet = getTlsPasswordWarning
attrSet = setTlsPasswordWarning
attrTransfer _ v = do
return v
attrConstruct = constructTlsPasswordWarning
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.warning"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#g:attr:warning"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TlsPassword
type instance O.AttributeList TlsPassword = TlsPasswordAttributeList
type TlsPasswordAttributeList = ('[ '("description", TlsPasswordDescriptionPropertyInfo), '("flags", TlsPasswordFlagsPropertyInfo), '("warning", TlsPasswordWarningPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
tlsPasswordDescription :: AttrLabelProxy "description"
tlsPasswordDescription = AttrLabelProxy
tlsPasswordFlags :: AttrLabelProxy "flags"
tlsPasswordFlags = AttrLabelProxy
tlsPasswordWarning :: AttrLabelProxy "warning"
tlsPasswordWarning = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList TlsPassword = TlsPasswordSignalList
type TlsPasswordSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_tls_password_new" g_tls_password_new ::
CUInt ->
CString ->
IO (Ptr TlsPassword)
tlsPasswordNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Gio.Flags.TlsPasswordFlags]
-> T.Text
-> m TlsPassword
tlsPasswordNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
[TlsPasswordFlags] -> Text -> m TlsPassword
tlsPasswordNew [TlsPasswordFlags]
flags Text
description = IO TlsPassword -> m TlsPassword
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsPassword -> m TlsPassword)
-> IO TlsPassword -> m TlsPassword
forall a b. (a -> b) -> a -> b
$ do
let flags' :: CUInt
flags' = [TlsPasswordFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [TlsPasswordFlags]
flags
description' <- Text -> IO CString
textToCString Text
description
result <- g_tls_password_new flags' description'
checkUnexpectedReturnNULL "tlsPasswordNew" result
result' <- (wrapObject TlsPassword) result
freeMem description'
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_tls_password_get_description" g_tls_password_get_description ::
Ptr TlsPassword ->
IO CString
tlsPasswordGetDescription ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> m T.Text
tlsPasswordGetDescription :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> m Text
tlsPasswordGetDescription a
password = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
result <- g_tls_password_get_description password'
checkUnexpectedReturnNULL "tlsPasswordGetDescription" result
result' <- cstringToText result
touchManagedPtr password
return result'
#if defined(ENABLE_OVERLOADING)
data TlsPasswordGetDescriptionMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordGetDescriptionMethodInfo a signature where
overloadedMethod = tlsPasswordGetDescription
instance O.OverloadedMethodInfo TlsPasswordGetDescriptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordGetDescription",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordGetDescription"
})
#endif
foreign import ccall "g_tls_password_get_flags" g_tls_password_get_flags ::
Ptr TlsPassword ->
IO CUInt
tlsPasswordGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> m [Gio.Flags.TlsPasswordFlags]
tlsPasswordGetFlags :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> m [TlsPasswordFlags]
tlsPasswordGetFlags a
password = IO [TlsPasswordFlags] -> m [TlsPasswordFlags]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [TlsPasswordFlags] -> m [TlsPasswordFlags])
-> IO [TlsPasswordFlags] -> m [TlsPasswordFlags]
forall a b. (a -> b) -> a -> b
$ do
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
result <- g_tls_password_get_flags password'
let result' = CUInt -> [TlsPasswordFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
touchManagedPtr password
return result'
#if defined(ENABLE_OVERLOADING)
data TlsPasswordGetFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.TlsPasswordFlags]), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordGetFlagsMethodInfo a signature where
overloadedMethod = tlsPasswordGetFlags
instance O.OverloadedMethodInfo TlsPasswordGetFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordGetFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordGetFlags"
})
#endif
foreign import ccall "g_tls_password_get_warning" g_tls_password_get_warning ::
Ptr TlsPassword ->
IO CString
tlsPasswordGetWarning ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> m T.Text
tlsPasswordGetWarning :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> m Text
tlsPasswordGetWarning a
password = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
result <- g_tls_password_get_warning password'
checkUnexpectedReturnNULL "tlsPasswordGetWarning" result
result' <- cstringToText result
touchManagedPtr password
return result'
#if defined(ENABLE_OVERLOADING)
data TlsPasswordGetWarningMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordGetWarningMethodInfo a signature where
overloadedMethod = tlsPasswordGetWarning
instance O.OverloadedMethodInfo TlsPasswordGetWarningMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordGetWarning",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordGetWarning"
})
#endif
foreign import ccall "g_tls_password_set_description" g_tls_password_set_description ::
Ptr TlsPassword ->
CString ->
IO ()
tlsPasswordSetDescription ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> T.Text
-> m ()
tlsPasswordSetDescription :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> Text -> m ()
tlsPasswordSetDescription a
password Text
description = 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
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
description' <- textToCString description
g_tls_password_set_description password' description'
touchManagedPtr password
freeMem description'
return ()
#if defined(ENABLE_OVERLOADING)
data TlsPasswordSetDescriptionMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordSetDescriptionMethodInfo a signature where
overloadedMethod = tlsPasswordSetDescription
instance O.OverloadedMethodInfo TlsPasswordSetDescriptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordSetDescription",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordSetDescription"
})
#endif
foreign import ccall "g_tls_password_set_flags" g_tls_password_set_flags ::
Ptr TlsPassword ->
CUInt ->
IO ()
tlsPasswordSetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> [Gio.Flags.TlsPasswordFlags]
-> m ()
tlsPasswordSetFlags :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> [TlsPasswordFlags] -> m ()
tlsPasswordSetFlags a
password [TlsPasswordFlags]
flags = 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
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
let flags' = [TlsPasswordFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [TlsPasswordFlags]
flags
g_tls_password_set_flags password' flags'
touchManagedPtr password
return ()
#if defined(ENABLE_OVERLOADING)
data TlsPasswordSetFlagsMethodInfo
instance (signature ~ ([Gio.Flags.TlsPasswordFlags] -> m ()), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordSetFlagsMethodInfo a signature where
overloadedMethod = tlsPasswordSetFlags
instance O.OverloadedMethodInfo TlsPasswordSetFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordSetFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordSetFlags"
})
#endif
foreign import ccall "g_tls_password_set_value" g_tls_password_set_value ::
Ptr TlsPassword ->
Ptr Word8 ->
DI.Int64 ->
IO ()
tlsPasswordSetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> ByteString
-> m ()
tlsPasswordSetValue :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> ByteString -> m ()
tlsPasswordSetValue a
password ByteString
value = 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
let length_ :: Int64
length_ = Int -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int64) -> Int -> Int64
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
value
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
value' <- packByteString value
g_tls_password_set_value password' value' length_
touchManagedPtr password
freeMem value'
return ()
#if defined(ENABLE_OVERLOADING)
data TlsPasswordSetValueMethodInfo
instance (signature ~ (ByteString -> m ()), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordSetValueMethodInfo a signature where
overloadedMethod = tlsPasswordSetValue
instance O.OverloadedMethodInfo TlsPasswordSetValueMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordSetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordSetValue"
})
#endif
foreign import ccall "g_tls_password_set_value_full" g_tls_password_set_value_full ::
Ptr TlsPassword ->
Ptr Word8 ->
DI.Int64 ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
tlsPasswordSetValueFull ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> ByteString
-> Maybe (GLib.Callbacks.DestroyNotify)
-> m ()
tlsPasswordSetValueFull :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> ByteString -> Maybe DestroyNotify -> m ()
tlsPasswordSetValueFull a
password ByteString
value Maybe DestroyNotify
destroy = 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
let length_ :: Int64
length_ = Int -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int64) -> Int -> Int64
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
value
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
value' <- packByteString value
maybeDestroy <- case destroy of
Maybe DestroyNotify
Nothing -> FunPtr DestroyNotify -> IO (FunPtr DestroyNotify)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr DestroyNotify
forall a. FunPtr a
FP.nullFunPtr
Just DestroyNotify
jDestroy -> do
ptrdestroy <- IO (Ptr (FunPtr DestroyNotify))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_DestroyNotify))
jDestroy' <- GLib.Callbacks.mk_DestroyNotify (GLib.Callbacks.wrap_DestroyNotify (Just ptrdestroy) jDestroy)
poke ptrdestroy jDestroy'
return jDestroy'
g_tls_password_set_value_full password' value' length_ maybeDestroy
touchManagedPtr password
freeMem value'
return ()
#if defined(ENABLE_OVERLOADING)
data TlsPasswordSetValueFullMethodInfo
instance (signature ~ (ByteString -> Maybe (GLib.Callbacks.DestroyNotify) -> m ()), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordSetValueFullMethodInfo a signature where
overloadedMethod = tlsPasswordSetValueFull
instance O.OverloadedMethodInfo TlsPasswordSetValueFullMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordSetValueFull",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordSetValueFull"
})
#endif
foreign import ccall "g_tls_password_set_warning" g_tls_password_set_warning ::
Ptr TlsPassword ->
CString ->
IO ()
tlsPasswordSetWarning ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> T.Text
-> m ()
tlsPasswordSetWarning :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTlsPassword a) =>
a -> Text -> m ()
tlsPasswordSetWarning a
password Text
warning = 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
password' <- a -> IO (Ptr TlsPassword)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
password
warning' <- textToCString warning
g_tls_password_set_warning password' warning'
touchManagedPtr password
freeMem warning'
return ()
#if defined(ENABLE_OVERLOADING)
data TlsPasswordSetWarningMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsTlsPassword a) => O.OverloadedMethod TlsPasswordSetWarningMethodInfo a signature where
overloadedMethod = tlsPasswordSetWarning
instance O.OverloadedMethodInfo TlsPasswordSetWarningMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.TlsPassword.tlsPasswordSetWarning",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-TlsPassword.html#v:tlsPasswordSetWarning"
})
#endif