#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.TlsPassword
(
TlsPassword(..) ,
IsTlsPassword ,
toTlsPassword ,
noTlsPassword ,
#if ENABLE_OVERLOADING
TlsPasswordGetDescriptionMethodInfo ,
#endif
tlsPasswordGetDescription ,
#if ENABLE_OVERLOADING
TlsPasswordGetFlagsMethodInfo ,
#endif
tlsPasswordGetFlags ,
#if ENABLE_OVERLOADING
TlsPasswordGetWarningMethodInfo ,
#endif
tlsPasswordGetWarning ,
tlsPasswordNew ,
#if ENABLE_OVERLOADING
TlsPasswordSetDescriptionMethodInfo ,
#endif
tlsPasswordSetDescription ,
#if ENABLE_OVERLOADING
TlsPasswordSetFlagsMethodInfo ,
#endif
tlsPasswordSetFlags ,
#if ENABLE_OVERLOADING
TlsPasswordSetValueMethodInfo ,
#endif
tlsPasswordSetValue ,
#if ENABLE_OVERLOADING
TlsPasswordSetValueFullMethodInfo ,
#endif
tlsPasswordSetValueFull ,
#if ENABLE_OVERLOADING
TlsPasswordSetWarningMethodInfo ,
#endif
tlsPasswordSetWarning ,
#if ENABLE_OVERLOADING
TlsPasswordDescriptionPropertyInfo ,
#endif
constructTlsPasswordDescription ,
getTlsPasswordDescription ,
setTlsPasswordDescription ,
#if ENABLE_OVERLOADING
tlsPasswordDescription ,
#endif
#if ENABLE_OVERLOADING
TlsPasswordFlagsPropertyInfo ,
#endif
constructTlsPasswordFlags ,
getTlsPasswordFlags ,
setTlsPasswordFlags ,
#if ENABLE_OVERLOADING
tlsPasswordFlags ,
#endif
#if ENABLE_OVERLOADING
TlsPasswordWarningPropertyInfo ,
#endif
constructTlsPasswordWarning ,
getTlsPasswordWarning ,
setTlsPasswordWarning ,
#if 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.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.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.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
newtype TlsPassword = TlsPassword (ManagedPtr TlsPassword)
foreign import ccall "g_tls_password_get_type"
c_g_tls_password_get_type :: IO GType
instance GObject TlsPassword where
gobjectType = c_g_tls_password_get_type
class (GObject o, O.IsDescendantOf TlsPassword o) => IsTlsPassword o
instance (GObject o, O.IsDescendantOf TlsPassword o) => IsTlsPassword o
instance O.HasParentTypes TlsPassword
type instance O.ParentTypes TlsPassword = '[GObject.Object.Object]
toTlsPassword :: (MonadIO m, IsTlsPassword o) => o -> m TlsPassword
toTlsPassword = liftIO . unsafeCastTo TlsPassword
noTlsPassword :: Maybe TlsPassword
noTlsPassword = Nothing
#if ENABLE_OVERLOADING
type family ResolveTlsPasswordMethod (t :: Symbol) (o :: *) :: * 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.MethodInfo info TlsPassword p) => OL.IsLabel t (TlsPassword -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getTlsPasswordDescription :: (MonadIO m, IsTlsPassword o) => o -> m T.Text
getTlsPasswordDescription obj = liftIO $ checkUnexpectedNothing "getTlsPasswordDescription" $ B.Properties.getObjectPropertyString obj "description"
setTlsPasswordDescription :: (MonadIO m, IsTlsPassword o) => o -> T.Text -> m ()
setTlsPasswordDescription obj val = liftIO $ B.Properties.setObjectPropertyString obj "description" (Just val)
constructTlsPasswordDescription :: (IsTlsPassword o) => T.Text -> IO (GValueConstruct o)
constructTlsPasswordDescription val = B.Properties.constructObjectPropertyString "description" (Just val)
#if ENABLE_OVERLOADING
data TlsPasswordDescriptionPropertyInfo
instance AttrInfo TlsPasswordDescriptionPropertyInfo where
type AttrAllowedOps TlsPasswordDescriptionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint TlsPasswordDescriptionPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint TlsPasswordDescriptionPropertyInfo = IsTlsPassword
type AttrGetType TlsPasswordDescriptionPropertyInfo = T.Text
type AttrLabel TlsPasswordDescriptionPropertyInfo = "description"
type AttrOrigin TlsPasswordDescriptionPropertyInfo = TlsPassword
attrGet _ = getTlsPasswordDescription
attrSet _ = setTlsPasswordDescription
attrConstruct _ = constructTlsPasswordDescription
attrClear _ = undefined
#endif
getTlsPasswordFlags :: (MonadIO m, IsTlsPassword o) => o -> m [Gio.Flags.TlsPasswordFlags]
getTlsPasswordFlags obj = liftIO $ B.Properties.getObjectPropertyFlags obj "flags"
setTlsPasswordFlags :: (MonadIO m, IsTlsPassword o) => o -> [Gio.Flags.TlsPasswordFlags] -> m ()
setTlsPasswordFlags obj val = liftIO $ B.Properties.setObjectPropertyFlags obj "flags" val
constructTlsPasswordFlags :: (IsTlsPassword o) => [Gio.Flags.TlsPasswordFlags] -> IO (GValueConstruct o)
constructTlsPasswordFlags val = B.Properties.constructObjectPropertyFlags "flags" val
#if ENABLE_OVERLOADING
data TlsPasswordFlagsPropertyInfo
instance AttrInfo TlsPasswordFlagsPropertyInfo where
type AttrAllowedOps TlsPasswordFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint TlsPasswordFlagsPropertyInfo = (~) [Gio.Flags.TlsPasswordFlags]
type AttrBaseTypeConstraint TlsPasswordFlagsPropertyInfo = IsTlsPassword
type AttrGetType TlsPasswordFlagsPropertyInfo = [Gio.Flags.TlsPasswordFlags]
type AttrLabel TlsPasswordFlagsPropertyInfo = "flags"
type AttrOrigin TlsPasswordFlagsPropertyInfo = TlsPassword
attrGet _ = getTlsPasswordFlags
attrSet _ = setTlsPasswordFlags
attrConstruct _ = constructTlsPasswordFlags
attrClear _ = undefined
#endif
getTlsPasswordWarning :: (MonadIO m, IsTlsPassword o) => o -> m T.Text
getTlsPasswordWarning obj = liftIO $ checkUnexpectedNothing "getTlsPasswordWarning" $ B.Properties.getObjectPropertyString obj "warning"
setTlsPasswordWarning :: (MonadIO m, IsTlsPassword o) => o -> T.Text -> m ()
setTlsPasswordWarning obj val = liftIO $ B.Properties.setObjectPropertyString obj "warning" (Just val)
constructTlsPasswordWarning :: (IsTlsPassword o) => T.Text -> IO (GValueConstruct o)
constructTlsPasswordWarning val = B.Properties.constructObjectPropertyString "warning" (Just val)
#if ENABLE_OVERLOADING
data TlsPasswordWarningPropertyInfo
instance AttrInfo TlsPasswordWarningPropertyInfo where
type AttrAllowedOps TlsPasswordWarningPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint TlsPasswordWarningPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint TlsPasswordWarningPropertyInfo = IsTlsPassword
type AttrGetType TlsPasswordWarningPropertyInfo = T.Text
type AttrLabel TlsPasswordWarningPropertyInfo = "warning"
type AttrOrigin TlsPasswordWarningPropertyInfo = TlsPassword
attrGet _ = getTlsPasswordWarning
attrSet _ = setTlsPasswordWarning
attrConstruct _ = constructTlsPasswordWarning
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList TlsPassword
type instance O.AttributeList TlsPassword = TlsPasswordAttributeList
type TlsPasswordAttributeList = ('[ '("description", TlsPasswordDescriptionPropertyInfo), '("flags", TlsPasswordFlagsPropertyInfo), '("warning", TlsPasswordWarningPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
tlsPasswordDescription :: AttrLabelProxy "description"
tlsPasswordDescription = AttrLabelProxy
tlsPasswordFlags :: AttrLabelProxy "flags"
tlsPasswordFlags = AttrLabelProxy
tlsPasswordWarning :: AttrLabelProxy "warning"
tlsPasswordWarning = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList TlsPassword = TlsPasswordSignalList
type TlsPasswordSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#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 flags description = liftIO $ do
let flags' = gflagsToWord flags
description' <- textToCString description
result <- g_tls_password_new flags' description'
checkUnexpectedReturnNULL "tlsPasswordNew" result
result' <- (wrapObject TlsPassword) result
freeMem description'
return result'
#if 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 password = liftIO $ do
password' <- unsafeManagedPtrCastPtr password
result <- g_tls_password_get_description password'
checkUnexpectedReturnNULL "tlsPasswordGetDescription" result
result' <- cstringToText result
touchManagedPtr password
return result'
#if ENABLE_OVERLOADING
data TlsPasswordGetDescriptionMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordGetDescriptionMethodInfo a signature where
overloadedMethod _ = 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 password = liftIO $ do
password' <- unsafeManagedPtrCastPtr password
result <- g_tls_password_get_flags password'
let result' = wordToGFlags result
touchManagedPtr password
return result'
#if ENABLE_OVERLOADING
data TlsPasswordGetFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.TlsPasswordFlags]), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordGetFlagsMethodInfo a signature where
overloadedMethod _ = 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 password = liftIO $ do
password' <- unsafeManagedPtrCastPtr password
result <- g_tls_password_get_warning password'
checkUnexpectedReturnNULL "tlsPasswordGetWarning" result
result' <- cstringToText result
touchManagedPtr password
return result'
#if ENABLE_OVERLOADING
data TlsPasswordGetWarningMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordGetWarningMethodInfo a signature where
overloadedMethod _ = 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 password description = liftIO $ do
password' <- unsafeManagedPtrCastPtr password
description' <- textToCString description
g_tls_password_set_description password' description'
touchManagedPtr password
freeMem description'
return ()
#if ENABLE_OVERLOADING
data TlsPasswordSetDescriptionMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordSetDescriptionMethodInfo a signature where
overloadedMethod _ = 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 password flags = liftIO $ do
password' <- unsafeManagedPtrCastPtr password
let flags' = gflagsToWord flags
g_tls_password_set_flags password' flags'
touchManagedPtr password
return ()
#if ENABLE_OVERLOADING
data TlsPasswordSetFlagsMethodInfo
instance (signature ~ ([Gio.Flags.TlsPasswordFlags] -> m ()), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordSetFlagsMethodInfo a signature where
overloadedMethod _ = tlsPasswordSetFlags
#endif
foreign import ccall "g_tls_password_set_value" g_tls_password_set_value ::
Ptr TlsPassword ->
Ptr Word8 ->
Int64 ->
IO ()
tlsPasswordSetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> ByteString
-> m ()
tlsPasswordSetValue password value = liftIO $ do
let length_ = fromIntegral $ B.length value
password' <- unsafeManagedPtrCastPtr password
value' <- packByteString value
g_tls_password_set_value password' value' length_
touchManagedPtr password
freeMem value'
return ()
#if ENABLE_OVERLOADING
data TlsPasswordSetValueMethodInfo
instance (signature ~ (ByteString -> m ()), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordSetValueMethodInfo a signature where
overloadedMethod _ = tlsPasswordSetValue
#endif
foreign import ccall "g_tls_password_set_value_full" g_tls_password_set_value_full ::
Ptr TlsPassword ->
Ptr Word8 ->
Int64 ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
tlsPasswordSetValueFull ::
(B.CallStack.HasCallStack, MonadIO m, IsTlsPassword a) =>
a
-> ByteString
-> Maybe (GLib.Callbacks.DestroyNotify)
-> m ()
tlsPasswordSetValueFull password value destroy = liftIO $ do
let length_ = fromIntegral $ B.length value
password' <- unsafeManagedPtrCastPtr password
value' <- packByteString value
maybeDestroy <- case destroy of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jDestroy -> do
ptrdestroy <- 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 ENABLE_OVERLOADING
data TlsPasswordSetValueFullMethodInfo
instance (signature ~ (ByteString -> Maybe (GLib.Callbacks.DestroyNotify) -> m ()), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordSetValueFullMethodInfo a signature where
overloadedMethod _ = 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 password warning = liftIO $ do
password' <- unsafeManagedPtrCastPtr password
warning' <- textToCString warning
g_tls_password_set_warning password' warning'
touchManagedPtr password
freeMem warning'
return ()
#if ENABLE_OVERLOADING
data TlsPasswordSetWarningMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsTlsPassword a) => O.MethodInfo TlsPasswordSetWarningMethodInfo a signature where
overloadedMethod _ = tlsPasswordSetWarning
#endif