gi-secret-0.0.7: GI/Secret/Objects/Item.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
A proxy object representing a secret item in the Secret Service.
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Secret.Objects.Item
(
-- * Exported types
Item(..) ,
IsItem ,
toItem ,
noItem ,
-- * Methods
-- ** create #method:create#
itemCreate ,
-- ** createFinish #method:createFinish#
itemCreateFinish ,
-- ** createSync #method:createSync#
itemCreateSync ,
-- ** delete #method:delete#
#if ENABLE_OVERLOADING
ItemDeleteMethodInfo ,
#endif
itemDelete ,
-- ** deleteFinish #method:deleteFinish#
#if ENABLE_OVERLOADING
ItemDeleteFinishMethodInfo ,
#endif
itemDeleteFinish ,
-- ** deleteSync #method:deleteSync#
#if ENABLE_OVERLOADING
ItemDeleteSyncMethodInfo ,
#endif
itemDeleteSync ,
-- ** getAttributes #method:getAttributes#
#if ENABLE_OVERLOADING
ItemGetAttributesMethodInfo ,
#endif
itemGetAttributes ,
-- ** getCreated #method:getCreated#
#if ENABLE_OVERLOADING
ItemGetCreatedMethodInfo ,
#endif
itemGetCreated ,
-- ** getFlags #method:getFlags#
#if ENABLE_OVERLOADING
ItemGetFlagsMethodInfo ,
#endif
itemGetFlags ,
-- ** getLabel #method:getLabel#
#if ENABLE_OVERLOADING
ItemGetLabelMethodInfo ,
#endif
itemGetLabel ,
-- ** getLocked #method:getLocked#
#if ENABLE_OVERLOADING
ItemGetLockedMethodInfo ,
#endif
itemGetLocked ,
-- ** getModified #method:getModified#
#if ENABLE_OVERLOADING
ItemGetModifiedMethodInfo ,
#endif
itemGetModified ,
-- ** getSchemaName #method:getSchemaName#
#if ENABLE_OVERLOADING
ItemGetSchemaNameMethodInfo ,
#endif
itemGetSchemaName ,
-- ** getSecret #method:getSecret#
#if ENABLE_OVERLOADING
ItemGetSecretMethodInfo ,
#endif
itemGetSecret ,
-- ** getService #method:getService#
#if ENABLE_OVERLOADING
ItemGetServiceMethodInfo ,
#endif
itemGetService ,
-- ** loadSecret #method:loadSecret#
#if ENABLE_OVERLOADING
ItemLoadSecretMethodInfo ,
#endif
itemLoadSecret ,
-- ** loadSecretFinish #method:loadSecretFinish#
#if ENABLE_OVERLOADING
ItemLoadSecretFinishMethodInfo ,
#endif
itemLoadSecretFinish ,
-- ** loadSecretSync #method:loadSecretSync#
#if ENABLE_OVERLOADING
ItemLoadSecretSyncMethodInfo ,
#endif
itemLoadSecretSync ,
-- ** loadSecrets #method:loadSecrets#
itemLoadSecrets ,
-- ** loadSecretsFinish #method:loadSecretsFinish#
itemLoadSecretsFinish ,
-- ** loadSecretsSync #method:loadSecretsSync#
itemLoadSecretsSync ,
-- ** refresh #method:refresh#
#if ENABLE_OVERLOADING
ItemRefreshMethodInfo ,
#endif
itemRefresh ,
-- ** setAttributes #method:setAttributes#
#if ENABLE_OVERLOADING
ItemSetAttributesMethodInfo ,
#endif
itemSetAttributes ,
-- ** setAttributesFinish #method:setAttributesFinish#
#if ENABLE_OVERLOADING
ItemSetAttributesFinishMethodInfo ,
#endif
itemSetAttributesFinish ,
-- ** setAttributesSync #method:setAttributesSync#
#if ENABLE_OVERLOADING
ItemSetAttributesSyncMethodInfo ,
#endif
itemSetAttributesSync ,
-- ** setLabel #method:setLabel#
#if ENABLE_OVERLOADING
ItemSetLabelMethodInfo ,
#endif
itemSetLabel ,
-- ** setLabelFinish #method:setLabelFinish#
#if ENABLE_OVERLOADING
ItemSetLabelFinishMethodInfo ,
#endif
itemSetLabelFinish ,
-- ** setLabelSync #method:setLabelSync#
#if ENABLE_OVERLOADING
ItemSetLabelSyncMethodInfo ,
#endif
itemSetLabelSync ,
-- ** setSecret #method:setSecret#
#if ENABLE_OVERLOADING
ItemSetSecretMethodInfo ,
#endif
itemSetSecret ,
-- ** setSecretFinish #method:setSecretFinish#
#if ENABLE_OVERLOADING
ItemSetSecretFinishMethodInfo ,
#endif
itemSetSecretFinish ,
-- ** setSecretSync #method:setSecretSync#
#if ENABLE_OVERLOADING
ItemSetSecretSyncMethodInfo ,
#endif
itemSetSecretSync ,
-- * Properties
-- ** attributes #attr:attributes#
#if ENABLE_OVERLOADING
ItemAttributesPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
itemAttributes ,
#endif
-- ** created #attr:created#
{- | The date and time (in seconds since the UNIX epoch) that this
item was created.
-}
#if ENABLE_OVERLOADING
ItemCreatedPropertyInfo ,
#endif
constructItemCreated ,
getItemCreated ,
#if ENABLE_OVERLOADING
itemCreated ,
#endif
setItemCreated ,
-- ** label #attr:label#
{- | The human readable label for the item.
Setting this property will result in the label of the item being
set asynchronously. To properly track the changing of the label use the
'GI.Secret.Objects.Item.itemSetLabel' function.
-}
#if ENABLE_OVERLOADING
ItemLabelPropertyInfo ,
#endif
clearItemLabel ,
constructItemLabel ,
getItemLabel ,
#if ENABLE_OVERLOADING
itemLabel ,
#endif
setItemLabel ,
-- ** locked #attr:locked#
{- | Whether the item is locked or not. An item may not be independently
lockable separate from other items in its collection.
To lock or unlock a item use the 'GI.Secret.Objects.Service.serviceLock' or
'GI.Secret.Objects.Service.serviceUnlock' functions.
-}
#if ENABLE_OVERLOADING
ItemLockedPropertyInfo ,
#endif
getItemLocked ,
#if ENABLE_OVERLOADING
itemLocked ,
#endif
-- ** modified #attr:modified#
{- | The date and time (in seconds since the UNIX epoch) that this
item was last modified.
-}
#if ENABLE_OVERLOADING
ItemModifiedPropertyInfo ,
#endif
constructItemModified ,
getItemModified ,
#if ENABLE_OVERLOADING
itemModified ,
#endif
setItemModified ,
-- ** service #attr:service#
{- | The 'GI.Secret.Objects.Service.Service' object that this item is associated with and
uses to interact with the actual D-Bus Secret Service.
-}
#if ENABLE_OVERLOADING
ItemServicePropertyInfo ,
#endif
constructItemService ,
getItemService ,
#if ENABLE_OVERLOADING
itemService ,
#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.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.DBusInterface as Gio.DBusInterface
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.DBusProxy as Gio.DBusProxy
import {-# SOURCE #-} qualified GI.Secret.Flags as Secret.Flags
import {-# SOURCE #-} qualified GI.Secret.Objects.Collection as Secret.Collection
import {-# SOURCE #-} qualified GI.Secret.Objects.Service as Secret.Service
import {-# SOURCE #-} qualified GI.Secret.Structs.Schema as Secret.Schema
import {-# SOURCE #-} qualified GI.Secret.Structs.Value as Secret.Value
-- | Memory-managed wrapper type.
newtype Item = Item (ManagedPtr Item)
foreign import ccall "secret_item_get_type"
c_secret_item_get_type :: IO GType
instance GObject Item where
gobjectType = c_secret_item_get_type
-- | Type class for types which can be safely cast to `Item`, for instance with `toItem`.
class (GObject o, O.IsDescendantOf Item o) => IsItem o
instance (GObject o, O.IsDescendantOf Item o) => IsItem o
instance O.HasParentTypes Item
type instance O.ParentTypes Item = '[Gio.DBusProxy.DBusProxy, GObject.Object.Object, Gio.AsyncInitable.AsyncInitable, Gio.DBusInterface.DBusInterface, Gio.Initable.Initable]
-- | Cast to `Item`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toItem :: (MonadIO m, IsItem o) => o -> m Item
toItem = liftIO . unsafeCastTo Item
-- | A convenience alias for `Nothing` :: `Maybe` `Item`.
noItem :: Maybe Item
noItem = Nothing
#if ENABLE_OVERLOADING
type family ResolveItemMethod (t :: Symbol) (o :: *) :: * where
ResolveItemMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveItemMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveItemMethod "call" o = Gio.DBusProxy.DBusProxyCallMethodInfo
ResolveItemMethod "callFinish" o = Gio.DBusProxy.DBusProxyCallFinishMethodInfo
ResolveItemMethod "callSync" o = Gio.DBusProxy.DBusProxyCallSyncMethodInfo
ResolveItemMethod "callWithUnixFdList" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListMethodInfo
ResolveItemMethod "callWithUnixFdListFinish" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListFinishMethodInfo
ResolveItemMethod "callWithUnixFdListSync" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListSyncMethodInfo
ResolveItemMethod "delete" o = ItemDeleteMethodInfo
ResolveItemMethod "deleteFinish" o = ItemDeleteFinishMethodInfo
ResolveItemMethod "deleteSync" o = ItemDeleteSyncMethodInfo
ResolveItemMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveItemMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveItemMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveItemMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveItemMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
ResolveItemMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
ResolveItemMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveItemMethod "loadSecret" o = ItemLoadSecretMethodInfo
ResolveItemMethod "loadSecretFinish" o = ItemLoadSecretFinishMethodInfo
ResolveItemMethod "loadSecretSync" o = ItemLoadSecretSyncMethodInfo
ResolveItemMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveItemMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveItemMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveItemMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveItemMethod "refresh" o = ItemRefreshMethodInfo
ResolveItemMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveItemMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveItemMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveItemMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveItemMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveItemMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveItemMethod "getAttributes" o = ItemGetAttributesMethodInfo
ResolveItemMethod "getCachedProperty" o = Gio.DBusProxy.DBusProxyGetCachedPropertyMethodInfo
ResolveItemMethod "getCachedPropertyNames" o = Gio.DBusProxy.DBusProxyGetCachedPropertyNamesMethodInfo
ResolveItemMethod "getConnection" o = Gio.DBusProxy.DBusProxyGetConnectionMethodInfo
ResolveItemMethod "getCreated" o = ItemGetCreatedMethodInfo
ResolveItemMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveItemMethod "getDefaultTimeout" o = Gio.DBusProxy.DBusProxyGetDefaultTimeoutMethodInfo
ResolveItemMethod "getFlags" o = ItemGetFlagsMethodInfo
ResolveItemMethod "getInfo" o = Gio.DBusInterface.DBusInterfaceGetInfoMethodInfo
ResolveItemMethod "getInterfaceInfo" o = Gio.DBusProxy.DBusProxyGetInterfaceInfoMethodInfo
ResolveItemMethod "getInterfaceName" o = Gio.DBusProxy.DBusProxyGetInterfaceNameMethodInfo
ResolveItemMethod "getLabel" o = ItemGetLabelMethodInfo
ResolveItemMethod "getLocked" o = ItemGetLockedMethodInfo
ResolveItemMethod "getModified" o = ItemGetModifiedMethodInfo
ResolveItemMethod "getName" o = Gio.DBusProxy.DBusProxyGetNameMethodInfo
ResolveItemMethod "getNameOwner" o = Gio.DBusProxy.DBusProxyGetNameOwnerMethodInfo
ResolveItemMethod "getObject" o = Gio.DBusInterface.DBusInterfaceGetObjectMethodInfo
ResolveItemMethod "getObjectPath" o = Gio.DBusProxy.DBusProxyGetObjectPathMethodInfo
ResolveItemMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveItemMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveItemMethod "getSchemaName" o = ItemGetSchemaNameMethodInfo
ResolveItemMethod "getSecret" o = ItemGetSecretMethodInfo
ResolveItemMethod "getService" o = ItemGetServiceMethodInfo
ResolveItemMethod "setAttributes" o = ItemSetAttributesMethodInfo
ResolveItemMethod "setAttributesFinish" o = ItemSetAttributesFinishMethodInfo
ResolveItemMethod "setAttributesSync" o = ItemSetAttributesSyncMethodInfo
ResolveItemMethod "setCachedProperty" o = Gio.DBusProxy.DBusProxySetCachedPropertyMethodInfo
ResolveItemMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveItemMethod "setDefaultTimeout" o = Gio.DBusProxy.DBusProxySetDefaultTimeoutMethodInfo
ResolveItemMethod "setInterfaceInfo" o = Gio.DBusProxy.DBusProxySetInterfaceInfoMethodInfo
ResolveItemMethod "setLabel" o = ItemSetLabelMethodInfo
ResolveItemMethod "setLabelFinish" o = ItemSetLabelFinishMethodInfo
ResolveItemMethod "setLabelSync" o = ItemSetLabelSyncMethodInfo
ResolveItemMethod "setObject" o = Gio.DBusInterface.DBusInterfaceSetObjectMethodInfo
ResolveItemMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveItemMethod "setSecret" o = ItemSetSecretMethodInfo
ResolveItemMethod "setSecretFinish" o = ItemSetSecretFinishMethodInfo
ResolveItemMethod "setSecretSync" o = ItemSetSecretSyncMethodInfo
ResolveItemMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveItemMethod t Item, O.MethodInfo info Item p) => OL.IsLabel t (Item -> 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
-- XXX Generation of property "attributes" of object "Item" failed: Not implemented: "Property ItemAttributes has unsupported transfer type TransferEverything"
#if ENABLE_OVERLOADING
-- XXX Placeholder
data ItemAttributesPropertyInfo
instance AttrInfo ItemAttributesPropertyInfo where
type AttrAllowedOps ItemAttributesPropertyInfo = '[]
type AttrSetTypeConstraint ItemAttributesPropertyInfo = (~) ()
type AttrBaseTypeConstraint ItemAttributesPropertyInfo = (~) ()
type AttrGetType ItemAttributesPropertyInfo = ()
type AttrLabel ItemAttributesPropertyInfo = ""
type AttrOrigin ItemAttributesPropertyInfo = Item
attrGet = undefined
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
#endif
-- VVV Prop "created"
-- Type: TBasicType TUInt64
-- Flags: [PropertyReadable,PropertyWritable]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@created@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' item #created
@
-}
getItemCreated :: (MonadIO m, IsItem o) => o -> m Word64
getItemCreated obj = liftIO $ B.Properties.getObjectPropertyUInt64 obj "created"
{- |
Set the value of the “@created@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' item [ #created 'Data.GI.Base.Attributes.:=' value ]
@
-}
setItemCreated :: (MonadIO m, IsItem o) => o -> Word64 -> m ()
setItemCreated obj val = liftIO $ B.Properties.setObjectPropertyUInt64 obj "created" val
{- |
Construct a `GValueConstruct` with valid value for the “@created@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructItemCreated :: (IsItem o) => Word64 -> IO (GValueConstruct o)
constructItemCreated val = B.Properties.constructObjectPropertyUInt64 "created" val
#if ENABLE_OVERLOADING
data ItemCreatedPropertyInfo
instance AttrInfo ItemCreatedPropertyInfo where
type AttrAllowedOps ItemCreatedPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ItemCreatedPropertyInfo = (~) Word64
type AttrBaseTypeConstraint ItemCreatedPropertyInfo = IsItem
type AttrGetType ItemCreatedPropertyInfo = Word64
type AttrLabel ItemCreatedPropertyInfo = "created"
type AttrOrigin ItemCreatedPropertyInfo = Item
attrGet _ = getItemCreated
attrSet _ = setItemCreated
attrConstruct _ = constructItemCreated
attrClear _ = undefined
#endif
-- VVV Prop "label"
-- Type: TBasicType TUTF8
-- Flags: [PropertyReadable,PropertyWritable]
-- Nullable: (Nothing,Nothing)
{- |
Get the value of the “@label@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' item #label
@
-}
getItemLabel :: (MonadIO m, IsItem o) => o -> m (Maybe T.Text)
getItemLabel obj = liftIO $ B.Properties.getObjectPropertyString obj "label"
{- |
Set the value of the “@label@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' item [ #label 'Data.GI.Base.Attributes.:=' value ]
@
-}
setItemLabel :: (MonadIO m, IsItem o) => o -> T.Text -> m ()
setItemLabel obj val = liftIO $ B.Properties.setObjectPropertyString obj "label" (Just val)
{- |
Construct a `GValueConstruct` with valid value for the “@label@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructItemLabel :: (IsItem o) => T.Text -> IO (GValueConstruct o)
constructItemLabel val = B.Properties.constructObjectPropertyString "label" (Just val)
{- |
Set the value of the “@label@” property to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.clear' #label
@
-}
clearItemLabel :: (MonadIO m, IsItem o) => o -> m ()
clearItemLabel obj = liftIO $ B.Properties.setObjectPropertyString obj "label" (Nothing :: Maybe T.Text)
#if ENABLE_OVERLOADING
data ItemLabelPropertyInfo
instance AttrInfo ItemLabelPropertyInfo where
type AttrAllowedOps ItemLabelPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ItemLabelPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ItemLabelPropertyInfo = IsItem
type AttrGetType ItemLabelPropertyInfo = (Maybe T.Text)
type AttrLabel ItemLabelPropertyInfo = "label"
type AttrOrigin ItemLabelPropertyInfo = Item
attrGet _ = getItemLabel
attrSet _ = setItemLabel
attrConstruct _ = constructItemLabel
attrClear _ = clearItemLabel
#endif
-- VVV Prop "locked"
-- Type: TBasicType TBoolean
-- Flags: [PropertyReadable]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@locked@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' item #locked
@
-}
getItemLocked :: (MonadIO m, IsItem o) => o -> m Bool
getItemLocked obj = liftIO $ B.Properties.getObjectPropertyBool obj "locked"
#if ENABLE_OVERLOADING
data ItemLockedPropertyInfo
instance AttrInfo ItemLockedPropertyInfo where
type AttrAllowedOps ItemLockedPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint ItemLockedPropertyInfo = (~) ()
type AttrBaseTypeConstraint ItemLockedPropertyInfo = IsItem
type AttrGetType ItemLockedPropertyInfo = Bool
type AttrLabel ItemLockedPropertyInfo = "locked"
type AttrOrigin ItemLockedPropertyInfo = Item
attrGet _ = getItemLocked
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
-- VVV Prop "modified"
-- Type: TBasicType TUInt64
-- Flags: [PropertyReadable,PropertyWritable]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@modified@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' item #modified
@
-}
getItemModified :: (MonadIO m, IsItem o) => o -> m Word64
getItemModified obj = liftIO $ B.Properties.getObjectPropertyUInt64 obj "modified"
{- |
Set the value of the “@modified@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' item [ #modified 'Data.GI.Base.Attributes.:=' value ]
@
-}
setItemModified :: (MonadIO m, IsItem o) => o -> Word64 -> m ()
setItemModified obj val = liftIO $ B.Properties.setObjectPropertyUInt64 obj "modified" val
{- |
Construct a `GValueConstruct` with valid value for the “@modified@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructItemModified :: (IsItem o) => Word64 -> IO (GValueConstruct o)
constructItemModified val = B.Properties.constructObjectPropertyUInt64 "modified" val
#if ENABLE_OVERLOADING
data ItemModifiedPropertyInfo
instance AttrInfo ItemModifiedPropertyInfo where
type AttrAllowedOps ItemModifiedPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ItemModifiedPropertyInfo = (~) Word64
type AttrBaseTypeConstraint ItemModifiedPropertyInfo = IsItem
type AttrGetType ItemModifiedPropertyInfo = Word64
type AttrLabel ItemModifiedPropertyInfo = "modified"
type AttrOrigin ItemModifiedPropertyInfo = Item
attrGet _ = getItemModified
attrSet _ = setItemModified
attrConstruct _ = constructItemModified
attrClear _ = undefined
#endif
-- VVV Prop "service"
-- Type: TInterface (Name {namespace = "Secret", name = "Service"})
-- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
-- Nullable: (Just False,Nothing)
{- |
Get the value of the “@service@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' item #service
@
-}
getItemService :: (MonadIO m, IsItem o) => o -> m Secret.Service.Service
getItemService obj = liftIO $ checkUnexpectedNothing "getItemService" $ B.Properties.getObjectPropertyObject obj "service" Secret.Service.Service
{- |
Construct a `GValueConstruct` with valid value for the “@service@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructItemService :: (IsItem o, Secret.Service.IsService a) => a -> IO (GValueConstruct o)
constructItemService val = B.Properties.constructObjectPropertyObject "service" (Just val)
#if ENABLE_OVERLOADING
data ItemServicePropertyInfo
instance AttrInfo ItemServicePropertyInfo where
type AttrAllowedOps ItemServicePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ItemServicePropertyInfo = Secret.Service.IsService
type AttrBaseTypeConstraint ItemServicePropertyInfo = IsItem
type AttrGetType ItemServicePropertyInfo = Secret.Service.Service
type AttrLabel ItemServicePropertyInfo = "service"
type AttrOrigin ItemServicePropertyInfo = Item
attrGet _ = getItemService
attrSet _ = undefined
attrConstruct _ = constructItemService
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Item
type instance O.AttributeList Item = ItemAttributeList
type ItemAttributeList = ('[ '("attributes", ItemAttributesPropertyInfo), '("created", ItemCreatedPropertyInfo), '("gBusType", Gio.DBusProxy.DBusProxyGBusTypePropertyInfo), '("gConnection", Gio.DBusProxy.DBusProxyGConnectionPropertyInfo), '("gDefaultTimeout", Gio.DBusProxy.DBusProxyGDefaultTimeoutPropertyInfo), '("gFlags", Gio.DBusProxy.DBusProxyGFlagsPropertyInfo), '("gInterfaceInfo", Gio.DBusProxy.DBusProxyGInterfaceInfoPropertyInfo), '("gInterfaceName", Gio.DBusProxy.DBusProxyGInterfaceNamePropertyInfo), '("gName", Gio.DBusProxy.DBusProxyGNamePropertyInfo), '("gNameOwner", Gio.DBusProxy.DBusProxyGNameOwnerPropertyInfo), '("gObjectPath", Gio.DBusProxy.DBusProxyGObjectPathPropertyInfo), '("label", ItemLabelPropertyInfo), '("locked", ItemLockedPropertyInfo), '("modified", ItemModifiedPropertyInfo), '("service", ItemServicePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
itemAttributes :: AttrLabelProxy "attributes"
itemAttributes = AttrLabelProxy
itemCreated :: AttrLabelProxy "created"
itemCreated = AttrLabelProxy
itemLabel :: AttrLabelProxy "label"
itemLabel = AttrLabelProxy
itemLocked :: AttrLabelProxy "locked"
itemLocked = AttrLabelProxy
itemModified :: AttrLabelProxy "modified"
itemModified = AttrLabelProxy
itemService :: AttrLabelProxy "service"
itemService = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Item = ItemSignalList
type ItemSignalList = ('[ '("gPropertiesChanged", Gio.DBusProxy.DBusProxyGPropertiesChangedSignalInfo), '("gSignal", Gio.DBusProxy.DBusProxyGSignalSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
-- method Item::delete
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_delete" secret_item_delete ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
Ptr () -> -- user_data : TBasicType TPtr
IO ()
{- |
Delete this item.
This method returns immediately and completes asynchronously. The secret
service may prompt the user. 'GI.Secret.Objects.Service.servicePrompt' will be used to handle
any prompts that show up.
-}
itemDelete ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
itemDelete self cancellable callback = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- 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 = nullPtr
secret_item_delete self' maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data ItemDeleteMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemDeleteMethodInfo a signature where
overloadedMethod _ = itemDelete
#endif
-- method Item::delete_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_delete_finish" secret_item_delete_finish ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Complete asynchronous operation to delete the secret item.
-}
itemDeleteFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: an item -}
-> b
{- ^ /@result@/: asynchronous result passed to the callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemDeleteFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_item_delete_finish self' result_'
touchManagedPtr self
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemDeleteFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemDeleteFinishMethodInfo a signature where
overloadedMethod _ = itemDeleteFinish
#endif
-- method Item::delete_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_delete_sync" secret_item_delete_sync ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Delete this secret item.
This method may block indefinitely and should not be used in user
interface threads. The secret service may prompt the user.
'GI.Secret.Objects.Service.servicePrompt' will be used to handle any prompts that show up.
-}
itemDeleteSync ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemDeleteSync self cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_item_delete_sync self' maybeCancellable
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemDeleteSyncMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemDeleteSyncMethodInfo a signature where
overloadedMethod _ = itemDeleteSync
#endif
-- method Item::get_attributes
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGHash (TBasicType TUTF8) (TBasicType TUTF8))
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_attributes" secret_item_get_attributes ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO (Ptr (GHashTable CString CString))
{- |
Set the attributes of this item.
The /@attributes@/ are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.
Do not modify the attributes returned by this method. Use
'GI.Secret.Objects.Item.itemSetAttributes' instead.
-}
itemGetAttributes ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m (Map.Map T.Text T.Text)
{- ^ __Returns:__ a new reference
to the attributes, which should not be modified, and
released with 'GI.GLib.Functions.hashTableUnref' -}
itemGetAttributes self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_attributes self'
checkUnexpectedReturnNULL "itemGetAttributes" result
result' <- unpackGHashTable result
let result'' = mapFirst cstringUnpackPtr result'
result''' <- mapFirstA cstringToText result''
let result'''' = mapSecond cstringUnpackPtr result'''
result''''' <- mapSecondA cstringToText result''''
let result'''''' = Map.fromList result'''''
unrefGHashTable result
touchManagedPtr self
return result''''''
#if ENABLE_OVERLOADING
data ItemGetAttributesMethodInfo
instance (signature ~ (m (Map.Map T.Text T.Text)), MonadIO m, IsItem a) => O.MethodInfo ItemGetAttributesMethodInfo a signature where
overloadedMethod _ = itemGetAttributes
#endif
-- method Item::get_created
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_created" secret_item_get_created ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO Word64
{- |
Get the created date and time of the item. The return value is
the number of seconds since the unix epoch, January 1st 1970.
-}
itemGetCreated ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m Word64
{- ^ __Returns:__ the created date and time -}
itemGetCreated self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_created self'
touchManagedPtr self
return result
#if ENABLE_OVERLOADING
data ItemGetCreatedMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsItem a) => O.MethodInfo ItemGetCreatedMethodInfo a signature where
overloadedMethod _ = itemGetCreated
#endif
-- method Item::get_flags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret item proxy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "ItemFlags"}))
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_flags" secret_item_get_flags ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO CUInt
{- |
Get the flags representing what features of the 'GI.Secret.Objects.Item.Item' proxy
have been initialized.
Use 'GI.Secret.Objects.Item.itemLoadSecret' to initialize further features
and change the flags.
-}
itemGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: the secret item proxy -}
-> m [Secret.Flags.ItemFlags]
{- ^ __Returns:__ the flags for features initialized -}
itemGetFlags self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_flags self'
let result' = wordToGFlags result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data ItemGetFlagsMethodInfo
instance (signature ~ (m [Secret.Flags.ItemFlags]), MonadIO m, IsItem a) => O.MethodInfo ItemGetFlagsMethodInfo a signature where
overloadedMethod _ = itemGetFlags
#endif
-- method Item::get_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_label" secret_item_get_label ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO CString
{- |
Get the label of this item.
-}
itemGetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m T.Text
{- ^ __Returns:__ the label, which should be freed with 'GI.GLib.Functions.free' -}
itemGetLabel self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_label self'
checkUnexpectedReturnNULL "itemGetLabel" result
result' <- cstringToText result
freeMem result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data ItemGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsItem a) => O.MethodInfo ItemGetLabelMethodInfo a signature where
overloadedMethod _ = itemGetLabel
#endif
-- method Item::get_locked
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_locked" secret_item_get_locked ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO CInt
{- |
Get whether the item is locked or not.
Depending on the secret service an item may not be able to be locked
independently from the collection that it is in.
-}
itemGetLocked ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m Bool
{- ^ __Returns:__ whether the item is locked or not -}
itemGetLocked self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_locked self'
let result' = (/= 0) result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data ItemGetLockedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsItem a) => O.MethodInfo ItemGetLockedMethodInfo a signature where
overloadedMethod _ = itemGetLocked
#endif
-- method Item::get_modified
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_modified" secret_item_get_modified ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO Word64
{- |
Get the modified date and time of the item. The return value is
the number of seconds since the unix epoch, January 1st 1970.
-}
itemGetModified ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m Word64
{- ^ __Returns:__ the modified date and time -}
itemGetModified self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_modified self'
touchManagedPtr self
return result
#if ENABLE_OVERLOADING
data ItemGetModifiedMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsItem a) => O.MethodInfo ItemGetModifiedMethodInfo a signature where
overloadedMethod _ = itemGetModified
#endif
-- method Item::get_schema_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_schema_name" secret_item_get_schema_name ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO CString
{- |
Gets the name of the schema that this item was stored with. This is also
available at the \<literal>xdg:schema\<\/literal> attribute.
-}
itemGetSchemaName ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m (Maybe T.Text)
{- ^ __Returns:__ the schema name -}
itemGetSchemaName self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_schema_name self'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
freeMem result'
return result''
touchManagedPtr self
return maybeResult
#if ENABLE_OVERLOADING
data ItemGetSchemaNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsItem a) => O.MethodInfo ItemGetSchemaNameMethodInfo a signature where
overloadedMethod _ = itemGetSchemaName
#endif
-- method Item::get_secret
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "Value"}))
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_secret" secret_item_get_secret ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO (Ptr Secret.Value.Value)
{- |
Get the secret value of this item. If this item is locked or the secret
has not yet been loaded then this will return 'Nothing'.
To load the secret call the 'GI.Secret.Objects.Item.itemLoadSecret' method.
-}
itemGetSecret ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m (Maybe Secret.Value.Value)
{- ^ __Returns:__ the secret value which should be
released with 'GI.Secret.Structs.Value.valueUnref', or 'Nothing' -}
itemGetSecret self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_secret self'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Secret.Value.Value) result'
return result''
touchManagedPtr self
return maybeResult
#if ENABLE_OVERLOADING
data ItemGetSecretMethodInfo
instance (signature ~ (m (Maybe Secret.Value.Value)), MonadIO m, IsItem a) => O.MethodInfo ItemGetSecretMethodInfo a signature where
overloadedMethod _ = itemGetSecret
#endif
-- method Item::get_service
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "Service"}))
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_get_service" secret_item_get_service ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO (Ptr Secret.Service.Service)
{- |
Get the Secret Service object that this item was created with.
-}
itemGetService ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: an item -}
-> m Secret.Service.Service
{- ^ __Returns:__ the Secret Service object -}
itemGetService self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_item_get_service self'
checkUnexpectedReturnNULL "itemGetService" result
result' <- (newObject Secret.Service.Service) result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data ItemGetServiceMethodInfo
instance (signature ~ (m Secret.Service.Service), MonadIO m, IsItem a) => O.MethodInfo ItemGetServiceMethodInfo a signature where
overloadedMethod _ = itemGetService
#endif
-- method Item::load_secret
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item proxy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_load_secret" secret_item_load_secret ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
Ptr () -> -- user_data : TBasicType TPtr
IO ()
{- |
Load the secret value of this item.
Each item has a single secret which might be a password or some
other secret binary value.
This function will fail if the secret item is locked.
This function returns immediately and completes asynchronously.
-}
itemLoadSecret ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item proxy -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
itemLoadSecret self cancellable callback = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- 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 = nullPtr
secret_item_load_secret self' maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data ItemLoadSecretMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemLoadSecretMethodInfo a signature where
overloadedMethod _ = itemLoadSecret
#endif
-- method Item::load_secret_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item proxy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_load_secret_finish" secret_item_load_secret_finish ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Complete asynchronous operation to load the secret value of this item.
The newly loaded secret value can be accessed by calling
'GI.Secret.Objects.Item.itemGetSecret'.
-}
itemLoadSecretFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: an item proxy -}
-> b
{- ^ /@result@/: asynchronous result passed to callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_item_load_secret_finish self' result_'
touchManagedPtr self
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemLoadSecretFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemLoadSecretFinishMethodInfo a signature where
overloadedMethod _ = itemLoadSecretFinish
#endif
-- method Item::load_secret_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_load_secret_sync" secret_item_load_secret_sync ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Load the secret value of this item.
Each item has a single secret which might be a password or some
other secret binary value.
This function may block indefinitely. Use the asynchronous version
in user interface threads.
-}
itemLoadSecretSync ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretSync self cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_item_load_secret_sync self' maybeCancellable
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemLoadSecretSyncMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemLoadSecretSyncMethodInfo a signature where
overloadedMethod _ = itemLoadSecretSync
#endif
-- method Item::refresh
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the collection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_refresh" secret_item_refresh ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
IO ()
{- |
Refresh the properties on this item. This fires off a request to
refresh, and the properties will be updated later.
Calling this method is not normally necessary, as the secret service
will notify the client when properties change.
-}
itemRefresh ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
a
{- ^ /@self@/: the collection -}
-> m ()
itemRefresh self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
secret_item_refresh self'
touchManagedPtr self
return ()
#if ENABLE_OVERLOADING
data ItemRefreshMethodInfo
instance (signature ~ (m ()), MonadIO m, IsItem a) => O.MethodInfo ItemRefreshMethodInfo a signature where
overloadedMethod _ = itemRefresh
#endif
-- method Item::set_attributes
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new set of attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the asynchronous operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_set_attributes" secret_item_set_attributes ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
Ptr () -> -- user_data : TBasicType TPtr
IO ()
{- |
Set the attributes of this item.
The /@attributes@/ are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.
This function returns immediately and completes asynchronously.
-}
itemSetAttributes ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: a new set of attributes -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the asynchronous operation completes -}
-> m ()
itemSetAttributes self schema attributes cancellable callback = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeSchema <- case schema of
Nothing -> return nullPtr
Just jSchema -> do
jSchema' <- unsafeManagedPtrGetPtr jSchema
return jSchema'
let attributes' = Map.toList attributes
attributes'' <- mapFirstA textToCString attributes'
attributes''' <- mapSecondA textToCString attributes''
let attributes'''' = mapFirst cstringPackPtr attributes'''
let attributes''''' = mapSecond cstringPackPtr attributes''''
attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- 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 = nullPtr
secret_item_set_attributes self' maybeSchema attributes'''''' maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return ()
#if ENABLE_OVERLOADING
data ItemSetAttributesMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetAttributesMethodInfo a signature where
overloadedMethod _ = itemSetAttributes
#endif
-- method Item::set_attributes_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_set_attributes_finish" secret_item_set_attributes_finish ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Complete operation to set the attributes of this item.
-}
itemSetAttributesFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: an item -}
-> b
{- ^ /@result@/: asynchronous result passed to the callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetAttributesFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_item_set_attributes_finish self' result_'
touchManagedPtr self
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemSetAttributesFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemSetAttributesFinishMethodInfo a signature where
overloadedMethod _ = itemSetAttributesFinish
#endif
-- method Item::set_attributes_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new set of attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_set_attributes_sync" secret_item_set_attributes_sync ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Set the attributes of this item.
The /@attributes@/ are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.
This function may block indefinitely. Use the asynchronous version
in user interface threads.
-}
itemSetAttributesSync ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: a new set of attributes -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetAttributesSync self schema attributes cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeSchema <- case schema of
Nothing -> return nullPtr
Just jSchema -> do
jSchema' <- unsafeManagedPtrGetPtr jSchema
return jSchema'
let attributes' = Map.toList attributes
attributes'' <- mapFirstA textToCString attributes'
attributes''' <- mapSecondA textToCString attributes''
let attributes'''' = mapFirst cstringPackPtr attributes'''
let attributes''''' = mapSecond cstringPackPtr attributes''''
attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_item_set_attributes_sync self' maybeSchema attributes'''''' maybeCancellable
touchManagedPtr self
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return ()
) (do
unrefGHashTable attributes''''''
)
#if ENABLE_OVERLOADING
data ItemSetAttributesSyncMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetAttributesSyncMethodInfo a signature where
overloadedMethod _ = itemSetAttributesSync
#endif
-- method Item::set_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new label", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_set_label" secret_item_set_label ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
CString -> -- label : TBasicType TUTF8
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
Ptr () -> -- user_data : TBasicType TPtr
IO ()
{- |
Set the label of this item.
This function returns immediately and completes asynchronously.
-}
itemSetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> T.Text
{- ^ /@label@/: a new label -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
itemSetLabel self label cancellable callback = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
label' <- textToCString label
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- 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 = nullPtr
secret_item_set_label self' label' maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust cancellable touchManagedPtr
freeMem label'
return ()
#if ENABLE_OVERLOADING
data ItemSetLabelMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetLabelMethodInfo a signature where
overloadedMethod _ = itemSetLabel
#endif
-- method Item::set_label_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_set_label_finish" secret_item_set_label_finish ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Complete asynchronous operation to set the label of this collection.
-}
itemSetLabelFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: an item -}
-> b
{- ^ /@result@/: asynchronous result passed to callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetLabelFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_item_set_label_finish self' result_'
touchManagedPtr self
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemSetLabelFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemSetLabelFinishMethodInfo a signature where
overloadedMethod _ = itemSetLabelFinish
#endif
-- method Item::set_label_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new label", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_set_label_sync" secret_item_set_label_sync ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
CString -> -- label : TBasicType TUTF8
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Set the label of this item.
This function may block indefinitely. Use the asynchronous version
in user interface threads.
-}
itemSetLabelSync ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> T.Text
{- ^ /@label@/: a new label -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetLabelSync self label cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
label' <- textToCString label
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_item_set_label_sync self' label' maybeCancellable
touchManagedPtr self
whenJust cancellable touchManagedPtr
freeMem label'
return ()
) (do
freeMem label'
)
#if ENABLE_OVERLOADING
data ItemSetLabelSyncMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetLabelSyncMethodInfo a signature where
overloadedMethod _ = itemSetLabelSync
#endif
-- method Item::set_secret
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new secret value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_set_secret" secret_item_set_secret ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Secret.Value.Value -> -- value : TInterface (Name {namespace = "Secret", name = "Value"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
Ptr () -> -- user_data : TBasicType TPtr
IO ()
{- |
Set the secret value of this item.
Each item has a single secret which might be a password or some
other secret binary value.
This function returns immediately and completes asynchronously.
-}
itemSetSecret ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> Secret.Value.Value
{- ^ /@value@/: a new secret value -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
itemSetSecret self value cancellable callback = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
value' <- unsafeManagedPtrGetPtr value
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- 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 = nullPtr
secret_item_set_secret self' value' maybeCancellable maybeCallback userData
touchManagedPtr self
touchManagedPtr value
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data ItemSetSecretMethodInfo
instance (signature ~ (Secret.Value.Value -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetSecretMethodInfo a signature where
overloadedMethod _ = itemSetSecret
#endif
-- method Item::set_secret_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_set_secret_finish" secret_item_set_secret_finish ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Complete asynchronous operation to set the secret value of this item.
-}
itemSetSecretFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: an item -}
-> b
{- ^ /@result@/: asynchronous result passed to callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetSecretFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_item_set_secret_finish self' result_'
touchManagedPtr self
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemSetSecretFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemSetSecretFinishMethodInfo a signature where
overloadedMethod _ = itemSetSecretFinish
#endif
-- method Item::set_secret_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new secret value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_set_secret_sync" secret_item_set_secret_sync ::
Ptr Item -> -- self : TInterface (Name {namespace = "Secret", name = "Item"})
Ptr Secret.Value.Value -> -- value : TInterface (Name {namespace = "Secret", name = "Value"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Set the secret value of this item.
Each item has a single secret which might be a password or some
other secret binary value.
This function may block indefinitely. Use the asynchronous version
in user interface threads.
-}
itemSetSecretSync ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: an item -}
-> Secret.Value.Value
{- ^ /@value@/: a new secret value -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetSecretSync self value cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
value' <- unsafeManagedPtrGetPtr value
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_item_set_secret_sync self' value' maybeCancellable
touchManagedPtr self
touchManagedPtr value
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ItemSetSecretSyncMethodInfo
instance (signature ~ (Secret.Value.Value -> Maybe (b) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetSecretSyncMethodInfo a signature where
overloadedMethod _ = itemSetSecretSync
#endif
-- method Item::create
-- method type : MemberFunction
-- Args : [Arg {argCName = "collection", argType = TInterface (Name {namespace = "Secret", name = "Collection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a secret collection to create this item in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "attributes for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "label for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "secret value for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for the creation of the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 8, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_create" secret_item_create ::
Ptr Secret.Collection.Collection -> -- collection : TInterface (Name {namespace = "Secret", name = "Collection"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
CString -> -- label : TBasicType TUTF8
Ptr Secret.Value.Value -> -- value : TInterface (Name {namespace = "Secret", name = "Value"})
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
Ptr () -> -- user_data : TBasicType TPtr
IO ()
{- |
Create a new item in the secret service.
If the /@flags@/ contains 'GI.Secret.Flags.ItemCreateFlagsReplace', then the secret
service will search for an item matching the /@attributes@/, and update that item
instead of creating a new one.
This method may block indefinitely and should not be used in user interface
threads. The secret service may prompt the user. 'GI.Secret.Objects.Service.servicePrompt'
will be used to handle any prompts that are required.
-}
itemCreate ::
(B.CallStack.HasCallStack, MonadIO m, Secret.Collection.IsCollection a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@collection@/: a secret collection to create this item in -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: attributes for the new item -}
-> T.Text
{- ^ /@label@/: label for the new item -}
-> Secret.Value.Value
{- ^ /@value@/: secret value for the new item -}
-> [Secret.Flags.ItemCreateFlags]
{- ^ /@flags@/: flags for the creation of the new item -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
itemCreate collection schema attributes label value flags cancellable callback = liftIO $ do
collection' <- unsafeManagedPtrCastPtr collection
maybeSchema <- case schema of
Nothing -> return nullPtr
Just jSchema -> do
jSchema' <- unsafeManagedPtrGetPtr jSchema
return jSchema'
let attributes' = Map.toList attributes
attributes'' <- mapFirstA textToCString attributes'
attributes''' <- mapSecondA textToCString attributes''
let attributes'''' = mapFirst cstringPackPtr attributes'''
let attributes''''' = mapSecond cstringPackPtr attributes''''
attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
label' <- textToCString label
value' <- unsafeManagedPtrGetPtr value
let flags' = gflagsToWord flags
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- 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 = nullPtr
secret_item_create collection' maybeSchema attributes'''''' label' value' flags' maybeCancellable maybeCallback userData
touchManagedPtr collection
whenJust schema touchManagedPtr
touchManagedPtr value
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
freeMem label'
return ()
#if ENABLE_OVERLOADING
#endif
-- method Item::create_finish
-- method type : MemberFunction
-- Args : [Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the asynchronous result passed to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "Item"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_create_finish" secret_item_create_finish ::
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO (Ptr Item)
{- |
Finish operation to create a new item in the secret service.
-}
itemCreateFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m Item
{- ^ __Returns:__ the new item, which should be unreferenced
with 'GI.GObject.Objects.Object.objectUnref' /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemCreateFinish result_ = liftIO $ do
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ secret_item_create_finish result_'
checkUnexpectedReturnNULL "itemCreateFinish" result
result' <- (wrapObject Item) result
touchManagedPtr result_
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
#endif
-- method Item::create_sync
-- method type : MemberFunction
-- Args : [Arg {argCName = "collection", argType = TInterface (Name {namespace = "Secret", name = "Collection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a secret collection to create this item in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "attributes for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "label for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "secret value for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for the creation of the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "Item"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_create_sync" secret_item_create_sync ::
Ptr Secret.Collection.Collection -> -- collection : TInterface (Name {namespace = "Secret", name = "Collection"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
CString -> -- label : TBasicType TUTF8
Ptr Secret.Value.Value -> -- value : TInterface (Name {namespace = "Secret", name = "Value"})
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO (Ptr Item)
{- |
Create a new item in the secret service.
If the /@flags@/ contains 'GI.Secret.Flags.ItemCreateFlagsReplace', then the secret
service will search for an item matching the /@attributes@/, and update that item
instead of creating a new one.
This method may block indefinitely and should not be used in user interface
threads. The secret service may prompt the user. 'GI.Secret.Objects.Service.servicePrompt'
will be used to handle any prompts that are required.
-}
itemCreateSync ::
(B.CallStack.HasCallStack, MonadIO m, Secret.Collection.IsCollection a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@collection@/: a secret collection to create this item in -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: attributes for the new item -}
-> T.Text
{- ^ /@label@/: label for the new item -}
-> Secret.Value.Value
{- ^ /@value@/: secret value for the new item -}
-> [Secret.Flags.ItemCreateFlags]
{- ^ /@flags@/: flags for the creation of the new item -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m Item
{- ^ __Returns:__ the new item, which should be unreferenced
with 'GI.GObject.Objects.Object.objectUnref' /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemCreateSync collection schema attributes label value flags cancellable = liftIO $ do
collection' <- unsafeManagedPtrCastPtr collection
maybeSchema <- case schema of
Nothing -> return nullPtr
Just jSchema -> do
jSchema' <- unsafeManagedPtrGetPtr jSchema
return jSchema'
let attributes' = Map.toList attributes
attributes'' <- mapFirstA textToCString attributes'
attributes''' <- mapSecondA textToCString attributes''
let attributes'''' = mapFirst cstringPackPtr attributes'''
let attributes''''' = mapSecond cstringPackPtr attributes''''
attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
label' <- textToCString label
value' <- unsafeManagedPtrGetPtr value
let flags' = gflagsToWord flags
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ secret_item_create_sync collection' maybeSchema attributes'''''' label' value' flags' maybeCancellable
checkUnexpectedReturnNULL "itemCreateSync" result
result' <- (wrapObject Item) result
touchManagedPtr collection
whenJust schema touchManagedPtr
touchManagedPtr value
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
freeMem label'
return result'
) (do
unrefGHashTable attributes''''''
freeMem label'
)
#if ENABLE_OVERLOADING
#endif
-- method Item::load_secrets
-- method type : MemberFunction
-- Args : [Arg {argCName = "items", argType = TGList (TInterface (Name {namespace = "Secret", name = "Item"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items to retrieve secrets for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_item_load_secrets" secret_item_load_secrets ::
Ptr (GList (Ptr Item)) -> -- items : TGList (TInterface (Name {namespace = "Secret", name = "Item"}))
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
Ptr () -> -- user_data : TBasicType TPtr
IO ()
{- |
Load the secret values for a secret item stored in the service.
The /@items@/ must all have the same SecretItem::service property.
This function returns immediately and completes asynchronously.
-}
itemLoadSecrets ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
[a]
{- ^ /@items@/: the items to retrieve secrets for -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
itemLoadSecrets items cancellable callback = liftIO $ do
items' <- mapM unsafeManagedPtrCastPtr items
items'' <- packGList items'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- 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 = nullPtr
secret_item_load_secrets items'' maybeCancellable maybeCallback userData
mapM_ touchManagedPtr items
whenJust cancellable touchManagedPtr
g_list_free items''
return ()
#if ENABLE_OVERLOADING
#endif
-- method Item::load_secrets_finish
-- method type : MemberFunction
-- Args : [Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_load_secrets_finish" secret_item_load_secrets_finish ::
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Complete asynchronous operation to load the secret values for
secret items stored in the service.
Items that are locked will not have their secrets loaded.
-}
itemLoadSecretsFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
{- ^ /@result@/: asynchronous result passed to callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretsFinish result_ = liftIO $ do
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_item_load_secrets_finish result_'
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
#endif
-- method Item::load_secrets_sync
-- method type : MemberFunction
-- Args : [Arg {argCName = "items", argType = TGList (TInterface (Name {namespace = "Secret", name = "Item"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items to retrieve secrets for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False
foreign import ccall "secret_item_load_secrets_sync" secret_item_load_secrets_sync ::
Ptr (GList (Ptr Item)) -> -- items : TGList (TInterface (Name {namespace = "Secret", name = "Item"}))
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Load the secret values for a secret item stored in the service.
The /@items@/ must all have the same SecretItem::service property.
This method may block indefinitely and should not be used in user interface
threads.
Items that are locked will not have their secrets loaded.
-}
itemLoadSecretsSync ::
(B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
[a]
{- ^ /@items@/: the items to retrieve secrets for -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretsSync items cancellable = liftIO $ do
items' <- mapM unsafeManagedPtrCastPtr items
items'' <- packGList items'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_item_load_secrets_sync items'' maybeCancellable
mapM_ touchManagedPtr items
whenJust cancellable touchManagedPtr
g_list_free items''
return ()
) (do
g_list_free items''
)
#if ENABLE_OVERLOADING
#endif