gi-secret-0.0.7: GI/Secret/Objects/Service.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 the Secret Service.
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Secret.Objects.Service
(
#if ENABLE_OVERLOADING
ServiceCreateItemDbusPathSyncMethodInfo ,
#endif
-- * Exported types
Service(..) ,
IsService ,
toService ,
noService ,
-- * Methods
-- ** clear #method:clear#
#if ENABLE_OVERLOADING
ServiceClearMethodInfo ,
#endif
serviceClear ,
-- ** clearFinish #method:clearFinish#
#if ENABLE_OVERLOADING
ServiceClearFinishMethodInfo ,
#endif
serviceClearFinish ,
-- ** clearSync #method:clearSync#
#if ENABLE_OVERLOADING
ServiceClearSyncMethodInfo ,
#endif
serviceClearSync ,
-- ** decodeDbusSecret #method:decodeDbusSecret#
#if ENABLE_OVERLOADING
ServiceDecodeDbusSecretMethodInfo ,
#endif
serviceDecodeDbusSecret ,
-- ** disconnect #method:disconnect#
serviceDisconnect ,
-- ** encodeDbusSecret #method:encodeDbusSecret#
#if ENABLE_OVERLOADING
ServiceEncodeDbusSecretMethodInfo ,
#endif
serviceEncodeDbusSecret ,
-- ** ensureSession #method:ensureSession#
#if ENABLE_OVERLOADING
ServiceEnsureSessionMethodInfo ,
#endif
serviceEnsureSession ,
-- ** ensureSessionFinish #method:ensureSessionFinish#
#if ENABLE_OVERLOADING
ServiceEnsureSessionFinishMethodInfo ,
#endif
serviceEnsureSessionFinish ,
-- ** ensureSessionSync #method:ensureSessionSync#
#if ENABLE_OVERLOADING
ServiceEnsureSessionSyncMethodInfo ,
#endif
serviceEnsureSessionSync ,
-- ** get #method:get#
serviceGet ,
-- ** getCollectionGtype #method:getCollectionGtype#
#if ENABLE_OVERLOADING
ServiceGetCollectionGtypeMethodInfo ,
#endif
serviceGetCollectionGtype ,
-- ** getCollections #method:getCollections#
#if ENABLE_OVERLOADING
ServiceGetCollectionsMethodInfo ,
#endif
serviceGetCollections ,
-- ** getFinish #method:getFinish#
serviceGetFinish ,
-- ** getFlags #method:getFlags#
#if ENABLE_OVERLOADING
ServiceGetFlagsMethodInfo ,
#endif
serviceGetFlags ,
-- ** getItemGtype #method:getItemGtype#
#if ENABLE_OVERLOADING
ServiceGetItemGtypeMethodInfo ,
#endif
serviceGetItemGtype ,
-- ** getSessionAlgorithms #method:getSessionAlgorithms#
#if ENABLE_OVERLOADING
ServiceGetSessionAlgorithmsMethodInfo ,
#endif
serviceGetSessionAlgorithms ,
-- ** getSessionDbusPath #method:getSessionDbusPath#
#if ENABLE_OVERLOADING
ServiceGetSessionDbusPathMethodInfo ,
#endif
serviceGetSessionDbusPath ,
-- ** getSync #method:getSync#
serviceGetSync ,
-- ** loadCollections #method:loadCollections#
#if ENABLE_OVERLOADING
ServiceLoadCollectionsMethodInfo ,
#endif
serviceLoadCollections ,
-- ** loadCollectionsFinish #method:loadCollectionsFinish#
#if ENABLE_OVERLOADING
ServiceLoadCollectionsFinishMethodInfo ,
#endif
serviceLoadCollectionsFinish ,
-- ** loadCollectionsSync #method:loadCollectionsSync#
#if ENABLE_OVERLOADING
ServiceLoadCollectionsSyncMethodInfo ,
#endif
serviceLoadCollectionsSync ,
-- ** lock #method:lock#
#if ENABLE_OVERLOADING
ServiceLockMethodInfo ,
#endif
serviceLock ,
-- ** lockFinish #method:lockFinish#
#if ENABLE_OVERLOADING
ServiceLockFinishMethodInfo ,
#endif
serviceLockFinish ,
-- ** lockSync #method:lockSync#
#if ENABLE_OVERLOADING
ServiceLockSyncMethodInfo ,
#endif
serviceLockSync ,
-- ** lookup #method:lookup#
#if ENABLE_OVERLOADING
ServiceLookupMethodInfo ,
#endif
serviceLookup ,
-- ** lookupFinish #method:lookupFinish#
#if ENABLE_OVERLOADING
ServiceLookupFinishMethodInfo ,
#endif
serviceLookupFinish ,
-- ** lookupSync #method:lookupSync#
#if ENABLE_OVERLOADING
ServiceLookupSyncMethodInfo ,
#endif
serviceLookupSync ,
-- ** open #method:open#
serviceOpen ,
-- ** openFinish #method:openFinish#
serviceOpenFinish ,
-- ** openSync #method:openSync#
serviceOpenSync ,
-- ** prompt #method:prompt#
#if ENABLE_OVERLOADING
ServicePromptMethodInfo ,
#endif
servicePrompt ,
-- ** promptFinish #method:promptFinish#
#if ENABLE_OVERLOADING
ServicePromptFinishMethodInfo ,
#endif
servicePromptFinish ,
-- ** promptSync #method:promptSync#
#if ENABLE_OVERLOADING
ServicePromptSyncMethodInfo ,
#endif
servicePromptSync ,
-- ** search #method:search#
#if ENABLE_OVERLOADING
ServiceSearchMethodInfo ,
#endif
serviceSearch ,
-- ** searchFinish #method:searchFinish#
#if ENABLE_OVERLOADING
ServiceSearchFinishMethodInfo ,
#endif
serviceSearchFinish ,
-- ** searchSync #method:searchSync#
#if ENABLE_OVERLOADING
ServiceSearchSyncMethodInfo ,
#endif
serviceSearchSync ,
-- ** setAlias #method:setAlias#
#if ENABLE_OVERLOADING
ServiceSetAliasMethodInfo ,
#endif
serviceSetAlias ,
-- ** setAliasFinish #method:setAliasFinish#
#if ENABLE_OVERLOADING
ServiceSetAliasFinishMethodInfo ,
#endif
serviceSetAliasFinish ,
-- ** setAliasSync #method:setAliasSync#
#if ENABLE_OVERLOADING
ServiceSetAliasSyncMethodInfo ,
#endif
serviceSetAliasSync ,
-- ** store #method:store#
#if ENABLE_OVERLOADING
ServiceStoreMethodInfo ,
#endif
serviceStore ,
-- ** storeFinish #method:storeFinish#
#if ENABLE_OVERLOADING
ServiceStoreFinishMethodInfo ,
#endif
serviceStoreFinish ,
-- ** storeSync #method:storeSync#
#if ENABLE_OVERLOADING
ServiceStoreSyncMethodInfo ,
#endif
serviceStoreSync ,
-- ** unlock #method:unlock#
#if ENABLE_OVERLOADING
ServiceUnlockMethodInfo ,
#endif
serviceUnlock ,
-- ** unlockFinish #method:unlockFinish#
#if ENABLE_OVERLOADING
ServiceUnlockFinishMethodInfo ,
#endif
serviceUnlockFinish ,
-- ** unlockSync #method:unlockSync#
#if ENABLE_OVERLOADING
ServiceUnlockSyncMethodInfo ,
#endif
serviceUnlockSync ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
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.Item as Secret.Item
import {-# SOURCE #-} qualified GI.Secret.Objects.Prompt as Secret.Prompt
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 Service = Service (ManagedPtr Service)
foreign import ccall "secret_service_get_type"
c_secret_service_get_type :: IO GType
instance GObject Service where
gobjectType = c_secret_service_get_type
-- | Type class for types which can be safely cast to `Service`, for instance with `toService`.
class (GObject o, O.IsDescendantOf Service o) => IsService o
instance (GObject o, O.IsDescendantOf Service o) => IsService o
instance O.HasParentTypes Service
type instance O.ParentTypes Service = '[Gio.DBusProxy.DBusProxy, GObject.Object.Object, Gio.AsyncInitable.AsyncInitable, Gio.DBusInterface.DBusInterface, Gio.Initable.Initable]
-- | Cast to `Service`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toService :: (MonadIO m, IsService o) => o -> m Service
toService = liftIO . unsafeCastTo Service
-- | A convenience alias for `Nothing` :: `Maybe` `Service`.
noService :: Maybe Service
noService = Nothing
#if ENABLE_OVERLOADING
type family ResolveServiceMethod (t :: Symbol) (o :: *) :: * where
ResolveServiceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveServiceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveServiceMethod "call" o = Gio.DBusProxy.DBusProxyCallMethodInfo
ResolveServiceMethod "callFinish" o = Gio.DBusProxy.DBusProxyCallFinishMethodInfo
ResolveServiceMethod "callSync" o = Gio.DBusProxy.DBusProxyCallSyncMethodInfo
ResolveServiceMethod "callWithUnixFdList" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListMethodInfo
ResolveServiceMethod "callWithUnixFdListFinish" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListFinishMethodInfo
ResolveServiceMethod "callWithUnixFdListSync" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListSyncMethodInfo
ResolveServiceMethod "clear" o = ServiceClearMethodInfo
ResolveServiceMethod "clearFinish" o = ServiceClearFinishMethodInfo
ResolveServiceMethod "clearSync" o = ServiceClearSyncMethodInfo
ResolveServiceMethod "createItemDbusPathSync" o = ServiceCreateItemDbusPathSyncMethodInfo
ResolveServiceMethod "decodeDbusSecret" o = ServiceDecodeDbusSecretMethodInfo
ResolveServiceMethod "encodeDbusSecret" o = ServiceEncodeDbusSecretMethodInfo
ResolveServiceMethod "ensureSession" o = ServiceEnsureSessionMethodInfo
ResolveServiceMethod "ensureSessionFinish" o = ServiceEnsureSessionFinishMethodInfo
ResolveServiceMethod "ensureSessionSync" o = ServiceEnsureSessionSyncMethodInfo
ResolveServiceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveServiceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveServiceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveServiceMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveServiceMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
ResolveServiceMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
ResolveServiceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveServiceMethod "loadCollections" o = ServiceLoadCollectionsMethodInfo
ResolveServiceMethod "loadCollectionsFinish" o = ServiceLoadCollectionsFinishMethodInfo
ResolveServiceMethod "loadCollectionsSync" o = ServiceLoadCollectionsSyncMethodInfo
ResolveServiceMethod "lock" o = ServiceLockMethodInfo
ResolveServiceMethod "lockFinish" o = ServiceLockFinishMethodInfo
ResolveServiceMethod "lockSync" o = ServiceLockSyncMethodInfo
ResolveServiceMethod "lookup" o = ServiceLookupMethodInfo
ResolveServiceMethod "lookupFinish" o = ServiceLookupFinishMethodInfo
ResolveServiceMethod "lookupSync" o = ServiceLookupSyncMethodInfo
ResolveServiceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveServiceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveServiceMethod "prompt" o = ServicePromptMethodInfo
ResolveServiceMethod "promptFinish" o = ServicePromptFinishMethodInfo
ResolveServiceMethod "promptSync" o = ServicePromptSyncMethodInfo
ResolveServiceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveServiceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveServiceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveServiceMethod "search" o = ServiceSearchMethodInfo
ResolveServiceMethod "searchFinish" o = ServiceSearchFinishMethodInfo
ResolveServiceMethod "searchSync" o = ServiceSearchSyncMethodInfo
ResolveServiceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveServiceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveServiceMethod "store" o = ServiceStoreMethodInfo
ResolveServiceMethod "storeFinish" o = ServiceStoreFinishMethodInfo
ResolveServiceMethod "storeSync" o = ServiceStoreSyncMethodInfo
ResolveServiceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveServiceMethod "unlock" o = ServiceUnlockMethodInfo
ResolveServiceMethod "unlockFinish" o = ServiceUnlockFinishMethodInfo
ResolveServiceMethod "unlockSync" o = ServiceUnlockSyncMethodInfo
ResolveServiceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveServiceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveServiceMethod "getCachedProperty" o = Gio.DBusProxy.DBusProxyGetCachedPropertyMethodInfo
ResolveServiceMethod "getCachedPropertyNames" o = Gio.DBusProxy.DBusProxyGetCachedPropertyNamesMethodInfo
ResolveServiceMethod "getCollectionGtype" o = ServiceGetCollectionGtypeMethodInfo
ResolveServiceMethod "getCollections" o = ServiceGetCollectionsMethodInfo
ResolveServiceMethod "getConnection" o = Gio.DBusProxy.DBusProxyGetConnectionMethodInfo
ResolveServiceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveServiceMethod "getDefaultTimeout" o = Gio.DBusProxy.DBusProxyGetDefaultTimeoutMethodInfo
ResolveServiceMethod "getFlags" o = ServiceGetFlagsMethodInfo
ResolveServiceMethod "getInfo" o = Gio.DBusInterface.DBusInterfaceGetInfoMethodInfo
ResolveServiceMethod "getInterfaceInfo" o = Gio.DBusProxy.DBusProxyGetInterfaceInfoMethodInfo
ResolveServiceMethod "getInterfaceName" o = Gio.DBusProxy.DBusProxyGetInterfaceNameMethodInfo
ResolveServiceMethod "getItemGtype" o = ServiceGetItemGtypeMethodInfo
ResolveServiceMethod "getName" o = Gio.DBusProxy.DBusProxyGetNameMethodInfo
ResolveServiceMethod "getNameOwner" o = Gio.DBusProxy.DBusProxyGetNameOwnerMethodInfo
ResolveServiceMethod "getObject" o = Gio.DBusInterface.DBusInterfaceGetObjectMethodInfo
ResolveServiceMethod "getObjectPath" o = Gio.DBusProxy.DBusProxyGetObjectPathMethodInfo
ResolveServiceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveServiceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveServiceMethod "getSessionAlgorithms" o = ServiceGetSessionAlgorithmsMethodInfo
ResolveServiceMethod "getSessionDbusPath" o = ServiceGetSessionDbusPathMethodInfo
ResolveServiceMethod "setAlias" o = ServiceSetAliasMethodInfo
ResolveServiceMethod "setAliasFinish" o = ServiceSetAliasFinishMethodInfo
ResolveServiceMethod "setAliasSync" o = ServiceSetAliasSyncMethodInfo
ResolveServiceMethod "setCachedProperty" o = Gio.DBusProxy.DBusProxySetCachedPropertyMethodInfo
ResolveServiceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveServiceMethod "setDefaultTimeout" o = Gio.DBusProxy.DBusProxySetDefaultTimeoutMethodInfo
ResolveServiceMethod "setInterfaceInfo" o = Gio.DBusProxy.DBusProxySetInterfaceInfoMethodInfo
ResolveServiceMethod "setObject" o = Gio.DBusInterface.DBusInterfaceSetObjectMethodInfo
ResolveServiceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveServiceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveServiceMethod t Service, O.MethodInfo info Service p) => OL.IsLabel t (Service -> 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
#if ENABLE_OVERLOADING
instance O.HasAttributeList Service
type instance O.AttributeList Service = ServiceAttributeList
type ServiceAttributeList = ('[ '("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)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Service = ServiceSignalList
type ServiceSignalList = ('[ '("gPropertiesChanged", Gio.DBusProxy.DBusProxyGPropertiesChangedSignalInfo), '("gSignal", Gio.DBusProxy.DBusProxyGSignalSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
-- method Service::clear
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the attribute keys and values", 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 = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to be passed 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_service_clear" secret_service_clear ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
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 ()
{- |
Remove unlocked items which match the attributes from the secret service.
The /@attributes@/ should be a set of key and value string pairs.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGet' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
This method will return immediately and complete asynchronously.
-}
serviceClear ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: the attribute keys and values -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceClear service schema attributes cancellable callback = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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_service_clear service' maybeSchema attributes'''''' maybeCancellable maybeCallback userData
touchManagedPtr service
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return ()
#if ENABLE_OVERLOADING
data ServiceClearMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceClearMethodInfo a signature where
overloadedMethod _ = serviceClear
#endif
-- method Service::clear_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the 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_service_clear_finish" secret_service_clear_finish ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Finish asynchronous operation to remove items from the secret
service.
-}
serviceClearFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@service@/: the secret service -}
-> b
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceClearFinish service result_ = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_service_clear_finish service' result_'
touchManagedPtr service
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceClearFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceClearFinishMethodInfo a signature where
overloadedMethod _ = serviceClearFinish
#endif
-- method Service::clear_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the attribute keys and values", 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_service_clear_sync" secret_service_clear_sync ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
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
{- |
Remove unlocked items which match the attributes from the secret service.
The /@attributes@/ should be a set of key and value string pairs.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGetSync' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
This method may block indefinitely and should not be used in user interface
threads.
-}
serviceClearSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: the attribute keys and values -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceClearSync service schema attributes cancellable = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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_service_clear_sync service' maybeSchema attributes'''''' maybeCancellable
touchManagedPtr service
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return ()
) (do
unrefGHashTable attributes''''''
)
#if ENABLE_OVERLOADING
data ServiceClearSyncMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceClearSyncMethodInfo a signature where
overloadedMethod _ = serviceClearSync
#endif
-- XXX Could not generate method Service::create_item_dbus_path_sync
-- Error was : Not implemented: "GHashTable element of type TVariant unsupported."
#if ENABLE_OVERLOADING
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data ServiceCreateItemDbusPathSyncMethodInfo
instance (p ~ (), o ~ O.MethodResolutionFailed "createItemDbusPathSync" Service) => O.MethodInfo ServiceCreateItemDbusPathSyncMethodInfo o p where
overloadedMethod _ = undefined
#endif
-- method Service::decode_dbus_secret
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the encoded secret", 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_service_decode_dbus_secret" secret_service_decode_dbus_secret ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr GVariant -> -- value : TVariant
IO (Ptr Secret.Value.Value)
{- |
Decode a 'GI.Secret.Structs.Value.Value' into GVariant received with the Secret Service
DBus API.
The GVariant should have a \<literal>(oayays)\<\/literal> signature.
A session must have already been established by the 'GI.Secret.Objects.Service.Service', and
the encoded secret must be valid for that session.
-}
serviceDecodeDbusSecret ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@service@/: the service -}
-> GVariant
{- ^ /@value@/: the encoded secret -}
-> m Secret.Value.Value
{- ^ __Returns:__ the decoded secret value -}
serviceDecodeDbusSecret service value = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
value' <- unsafeManagedPtrGetPtr value
result <- secret_service_decode_dbus_secret service' value'
checkUnexpectedReturnNULL "serviceDecodeDbusSecret" result
result' <- (wrapBoxed Secret.Value.Value) result
touchManagedPtr service
touchManagedPtr value
return result'
#if ENABLE_OVERLOADING
data ServiceDecodeDbusSecretMethodInfo
instance (signature ~ (GVariant -> m Secret.Value.Value), MonadIO m, IsService a) => O.MethodInfo ServiceDecodeDbusSecretMethodInfo a signature where
overloadedMethod _ = serviceDecodeDbusSecret
#endif
-- method Service::encode_dbus_secret
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the service", 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 "the secret value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just TVariant
-- throws : False
-- Skip return : False
foreign import ccall "secret_service_encode_dbus_secret" secret_service_encode_dbus_secret ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Secret.Value.Value -> -- value : TInterface (Name {namespace = "Secret", name = "Value"})
IO (Ptr GVariant)
{- |
Encodes a 'GI.Secret.Structs.Value.Value' into GVariant for use with the Secret Service
DBus API.
The resulting GVariant will have a \<literal>(oayays)\<\/literal> signature.
A session must have already been established by the 'GI.Secret.Objects.Service.Service'.
-}
serviceEncodeDbusSecret ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@service@/: the service -}
-> Secret.Value.Value
{- ^ /@value@/: the secret value -}
-> m GVariant
{- ^ __Returns:__ the encoded secret -}
serviceEncodeDbusSecret service value = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
value' <- unsafeManagedPtrGetPtr value
result <- secret_service_encode_dbus_secret service' value'
checkUnexpectedReturnNULL "serviceEncodeDbusSecret" result
result' <- B.GVariant.newGVariantFromPtr result
touchManagedPtr service
touchManagedPtr value
return result'
#if ENABLE_OVERLOADING
data ServiceEncodeDbusSecretMethodInfo
instance (signature ~ (Secret.Value.Value -> m GVariant), MonadIO m, IsService a) => O.MethodInfo ServiceEncodeDbusSecretMethodInfo a signature where
overloadedMethod _ = serviceEncodeDbusSecret
#endif
-- method Service::ensure_session
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 be passed 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_service_ensure_session" secret_service_ensure_session ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
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 ()
{- |
Ensure that the 'GI.Secret.Objects.Service.Service' proxy has established a session with the
Secret Service. This session is used to transfer secrets.
It is not normally necessary to call this method, as the session is
established as necessary. You can also pass the 'GI.Secret.Flags.ServiceFlagsOpenSession'
to 'GI.Secret.Objects.Service.serviceGet' in order to ensure that a session has been established
by the time you get the 'GI.Secret.Objects.Service.Service' proxy.
This method will return immediately and complete asynchronously.
-}
serviceEnsureSession ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: the secret service -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceEnsureSession 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_service_ensure_session self' maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data ServiceEnsureSessionMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceEnsureSessionMethodInfo a signature where
overloadedMethod _ = serviceEnsureSession
#endif
-- method Service::ensure_session_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the 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_service_ensure_session_finish" secret_service_ensure_session_finish ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Finish an asynchronous operation to ensure that the 'GI.Secret.Objects.Service.Service' proxy
has established a session with the Secret Service.
-}
serviceEnsureSessionFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: the secret service -}
-> b
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceEnsureSessionFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_service_ensure_session_finish self' result_'
touchManagedPtr self
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceEnsureSessionFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceEnsureSessionFinishMethodInfo a signature where
overloadedMethod _ = serviceEnsureSessionFinish
#endif
-- method Service::ensure_session_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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_service_ensure_session_sync" secret_service_ensure_session_sync ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Ensure that the 'GI.Secret.Objects.Service.Service' proxy has established a session with the
Secret Service. This session is used to transfer secrets.
It is not normally necessary to call this method, as the session is
established as necessary. You can also pass the 'GI.Secret.Flags.ServiceFlagsOpenSession'
to 'GI.Secret.Objects.Service.serviceGetSync' in order to ensure that a session has been
established by the time you get the 'GI.Secret.Objects.Service.Service' proxy.
This method may block indefinitely and should not be used in user interface
threads.
-}
serviceEnsureSessionSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: the secret service -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceEnsureSessionSync 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_service_ensure_session_sync self' maybeCancellable
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceEnsureSessionSyncMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceEnsureSessionSyncMethodInfo a signature where
overloadedMethod _ = serviceEnsureSessionSync
#endif
-- method Service::get_collection_gtype
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False
foreign import ccall "secret_service_get_collection_gtype" secret_service_get_collection_gtype ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
IO CGType
{- |
Get the GObject type for collections instantiated by this service.
This will always be either 'GI.Secret.Objects.Collection.Collection' or derived from it.
-}
serviceGetCollectionGtype ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@self@/: the secret service -}
-> m GType
{- ^ __Returns:__ the gobject type for collections -}
serviceGetCollectionGtype self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_service_get_collection_gtype self'
let result' = GType result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data ServiceGetCollectionGtypeMethodInfo
instance (signature ~ (m GType), MonadIO m, IsService a) => O.MethodInfo ServiceGetCollectionGtypeMethodInfo a signature where
overloadedMethod _ = serviceGetCollectionGtype
#endif
-- method Service::get_collections
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service proxy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "Secret", name = "Collection"})))
-- throws : False
-- Skip return : False
foreign import ccall "secret_service_get_collections" secret_service_get_collections ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
IO (Ptr (GList (Ptr Secret.Collection.Collection)))
{- |
Get a list of 'GI.Secret.Objects.Collection.Collection' objects representing all the collections
in the secret service.
If the 'GI.Secret.Flags.ServiceFlagsLoadCollections' flag was not specified when
initializing 'GI.Secret.Objects.Service.Service' proxy object, then this method will return
'Nothing'. Use 'GI.Secret.Objects.Service.serviceLoadCollections' to load the collections.
-}
serviceGetCollections ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@self@/: the secret service proxy -}
-> m [Secret.Collection.Collection]
{- ^ __Returns:__ a
list of the collections in the secret service -}
serviceGetCollections self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_service_get_collections self'
result' <- unpackGList result
result'' <- mapM (wrapObject Secret.Collection.Collection) result'
g_list_free result
touchManagedPtr self
return result''
#if ENABLE_OVERLOADING
data ServiceGetCollectionsMethodInfo
instance (signature ~ (m [Secret.Collection.Collection]), MonadIO m, IsService a) => O.MethodInfo ServiceGetCollectionsMethodInfo a signature where
overloadedMethod _ = serviceGetCollections
#endif
-- method Service::get_flags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service proxy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "ServiceFlags"}))
-- throws : False
-- Skip return : False
foreign import ccall "secret_service_get_flags" secret_service_get_flags ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
IO CUInt
{- |
Get the flags representing what features of the 'GI.Secret.Objects.Service.Service' proxy
have been initialized.
Use 'GI.Secret.Objects.Service.serviceEnsureSession' or 'GI.Secret.Objects.Service.serviceLoadCollections'
to initialize further features and change the flags.
-}
serviceGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@self@/: the secret service proxy -}
-> m [Secret.Flags.ServiceFlags]
{- ^ __Returns:__ the flags for features initialized -}
serviceGetFlags self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_service_get_flags self'
let result' = wordToGFlags result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data ServiceGetFlagsMethodInfo
instance (signature ~ (m [Secret.Flags.ServiceFlags]), MonadIO m, IsService a) => O.MethodInfo ServiceGetFlagsMethodInfo a signature where
overloadedMethod _ = serviceGetFlags
#endif
-- method Service::get_item_gtype
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False
foreign import ccall "secret_service_get_item_gtype" secret_service_get_item_gtype ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
IO CGType
{- |
Get the GObject type for items instantiated by this service.
This will always be either 'GI.Secret.Objects.Item.Item' or derived from it.
-}
serviceGetItemGtype ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@self@/: the service -}
-> m GType
{- ^ __Returns:__ the gobject type for items -}
serviceGetItemGtype self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_service_get_item_gtype self'
let result' = GType result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data ServiceGetItemGtypeMethodInfo
instance (signature ~ (m GType), MonadIO m, IsService a) => O.MethodInfo ServiceGetItemGtypeMethodInfo a signature where
overloadedMethod _ = serviceGetItemGtype
#endif
-- method Service::get_session_algorithms
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service proxy", 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_service_get_session_algorithms" secret_service_get_session_algorithms ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
IO CString
{- |
Get the set of algorithms being used to transfer secrets between this
secret service proxy and the Secret Service itself.
This will be 'Nothing' if no session has been established. Use
'GI.Secret.Objects.Service.serviceEnsureSession' to establish a session.
-}
serviceGetSessionAlgorithms ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@self@/: the secret service proxy -}
-> m (Maybe T.Text)
{- ^ __Returns:__ a string representing the algorithms for transferring
secrets -}
serviceGetSessionAlgorithms self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_service_get_session_algorithms self'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr self
return maybeResult
#if ENABLE_OVERLOADING
data ServiceGetSessionAlgorithmsMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsService a) => O.MethodInfo ServiceGetSessionAlgorithmsMethodInfo a signature where
overloadedMethod _ = serviceGetSessionAlgorithms
#endif
-- method Service::get_session_dbus_path
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service proxy", 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_service_get_session_dbus_path" secret_service_get_session_dbus_path ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
IO CString
{- |
Get the D-Bus object path of the session object being used to transfer
secrets between this secret service proxy and the Secret Service itself.
This will be 'Nothing' if no session has been established. Use
'GI.Secret.Objects.Service.serviceEnsureSession' to establish a session.
-}
serviceGetSessionDbusPath ::
(B.CallStack.HasCallStack, MonadIO m, IsService a) =>
a
{- ^ /@self@/: the secret service proxy -}
-> m (Maybe T.Text)
{- ^ __Returns:__ a string representing the D-Bus object path of the
session -}
serviceGetSessionDbusPath self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- secret_service_get_session_dbus_path self'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr self
return maybeResult
#if ENABLE_OVERLOADING
data ServiceGetSessionDbusPathMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsService a) => O.MethodInfo ServiceGetSessionDbusPathMethodInfo a signature where
overloadedMethod _ = serviceGetSessionDbusPath
#endif
-- method Service::load_collections
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 be passed 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_service_load_collections" secret_service_load_collections ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
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 ()
{- |
Ensure that the 'GI.Secret.Objects.Service.Service' proxy has loaded all the collections present
in the Secret Service. This affects the result of
'GI.Secret.Objects.Service.serviceGetCollections'.
You can also pass the 'GI.Secret.Flags.ServiceFlagsLoadCollections' to
'GI.Secret.Objects.Service.serviceGetSync' in order to ensure that the collections have been
loaded by the time you get the 'GI.Secret.Objects.Service.Service' proxy.
This method will return immediately and complete asynchronously.
-}
serviceLoadCollections ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: the secret service -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceLoadCollections 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_service_load_collections self' maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data ServiceLoadCollectionsMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceLoadCollectionsMethodInfo a signature where
overloadedMethod _ = serviceLoadCollections
#endif
-- method Service::load_collections_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the 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_service_load_collections_finish" secret_service_load_collections_finish ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Complete an asynchronous operation to ensure that the 'GI.Secret.Objects.Service.Service' proxy
has loaded all the collections present in the Secret Service.
-}
serviceLoadCollectionsFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: the secret service -}
-> b
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceLoadCollectionsFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_service_load_collections_finish self' result_'
touchManagedPtr self
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceLoadCollectionsFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceLoadCollectionsFinishMethodInfo a signature where
overloadedMethod _ = serviceLoadCollectionsFinish
#endif
-- method Service::load_collections_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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_service_load_collections_sync" secret_service_load_collections_sync ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Ensure that the 'GI.Secret.Objects.Service.Service' proxy has loaded all the collections present
in the Secret Service. This affects the result of
'GI.Secret.Objects.Service.serviceGetCollections'.
You can also pass the 'GI.Secret.Flags.ServiceFlagsLoadCollections' to
'GI.Secret.Objects.Service.serviceGetSync' in order to ensure that the collections have been
loaded by the time you get the 'GI.Secret.Objects.Service.Service' proxy.
This method may block indefinitely and should not be used in user interface
threads.
-}
serviceLoadCollectionsSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@self@/: the secret service -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceLoadCollectionsSync 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_service_load_collections_sync self' maybeCancellable
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceLoadCollectionsSyncMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceLoadCollectionsSyncMethodInfo a signature where
overloadedMethod _ = serviceLoadCollectionsSync
#endif
-- method Service::lock
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objects", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items or collections to lock", 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_service_lock" secret_service_lock ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr (GList (Ptr Gio.DBusProxy.DBusProxy)) -> -- objects : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
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 ()
{- |
Lock items or collections in the secret service.
The secret service may not be able to lock items individually, and may
lock an entire collection instead.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGet' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
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.
-}
serviceLock ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@service@/: the secret service -}
-> [b]
{- ^ /@objects@/: the items or collections to lock -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceLock service objects cancellable callback = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
objects' <- mapM unsafeManagedPtrCastPtr objects
objects'' <- packGList objects'
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_service_lock service' objects'' maybeCancellable maybeCallback userData
touchManagedPtr service
mapM_ touchManagedPtr objects
whenJust cancellable touchManagedPtr
g_list_free objects''
return ()
#if ENABLE_OVERLOADING
data ServiceLockMethodInfo
instance (signature ~ ([b] -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServiceLockMethodInfo a signature where
overloadedMethod _ = serviceLock
#endif
-- method Service::lock_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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},Arg {argCName = "locked", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "\n location to place list of items or collections that were locked", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_lock_finish" secret_service_lock_finish ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))) -> -- locked : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
Ptr (Ptr GError) -> -- error
IO Int32
{- |
Complete asynchronous operation to lock items or collections in the secret
service.
The secret service may not be able to lock items individually, and may
lock an entire collection instead.
-}
serviceLockFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@service@/: the secret service -}
-> b
{- ^ /@result@/: asynchronous result passed to the callback -}
-> m ((Int32, [Gio.DBusProxy.DBusProxy]))
{- ^ __Returns:__ the number of items or collections that were locked /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceLockFinish service result_ = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
result_' <- unsafeManagedPtrCastPtr result_
locked <- allocMem :: IO (Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))))
onException (do
result <- propagateGError $ secret_service_lock_finish service' result_' locked
locked' <- peek locked
locked'' <- unpackGList locked'
locked''' <- mapM (wrapObject Gio.DBusProxy.DBusProxy) locked''
g_list_free locked'
touchManagedPtr service
touchManagedPtr result_
freeMem locked
return (result, locked''')
) (do
freeMem locked
)
#if ENABLE_OVERLOADING
data ServiceLockFinishMethodInfo
instance (signature ~ (b -> m ((Int32, [Gio.DBusProxy.DBusProxy]))), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceLockFinishMethodInfo a signature where
overloadedMethod _ = serviceLockFinish
#endif
-- method Service::lock_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objects", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items or collections to lock", 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 = "locked", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "\n location to place list of items or collections that were locked", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_lock_sync" secret_service_lock_sync ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr (GList (Ptr Gio.DBusProxy.DBusProxy)) -> -- objects : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))) -> -- locked : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
Ptr (Ptr GError) -> -- error
IO Int32
{- |
Lock items or collections in the secret service.
The secret service may not be able to lock items individually, and may
lock an entire collection instead.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGetSync' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
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.
-}
serviceLockSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@service@/: the secret service -}
-> [b]
{- ^ /@objects@/: the items or collections to lock -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ((Int32, [Gio.DBusProxy.DBusProxy]))
{- ^ __Returns:__ the number of items or collections that were locked /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceLockSync service objects cancellable = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
objects' <- mapM unsafeManagedPtrCastPtr objects
objects'' <- packGList objects'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
locked <- allocMem :: IO (Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))))
onException (do
result <- propagateGError $ secret_service_lock_sync service' objects'' maybeCancellable locked
locked' <- peek locked
locked'' <- unpackGList locked'
locked''' <- mapM (wrapObject Gio.DBusProxy.DBusProxy) locked''
g_list_free locked'
touchManagedPtr service
mapM_ touchManagedPtr objects
whenJust cancellable touchManagedPtr
g_list_free objects''
freeMem locked
return (result, locked''')
) (do
g_list_free objects''
freeMem locked
)
#if ENABLE_OVERLOADING
data ServiceLockSyncMethodInfo
instance (signature ~ ([b] -> Maybe (c) -> m ((Int32, [Gio.DBusProxy.DBusProxy]))), MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServiceLockSyncMethodInfo a signature where
overloadedMethod _ = serviceLockSync
#endif
-- method Service::lookup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the attribute keys and values", 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 = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to be passed 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_service_lookup" secret_service_lookup ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
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 ()
{- |
Lookup a secret value in the secret service.
The /@attributes@/ should be a set of key and value string pairs.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGet' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
This method will return immediately and complete asynchronously.
-}
serviceLookup ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: the attribute keys and values -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceLookup service schema attributes cancellable callback = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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_service_lookup service' maybeSchema attributes'''''' maybeCancellable maybeCallback userData
touchManagedPtr service
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return ()
#if ENABLE_OVERLOADING
data ServiceLookupMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceLookupMethodInfo a signature where
overloadedMethod _ = serviceLookup
#endif
-- method Service::lookup_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "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 = "Value"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_lookup_finish" secret_service_lookup_finish ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO (Ptr Secret.Value.Value)
{- |
Finish asynchronous operation to lookup a secret value in the secret service.
If no secret is found then 'Nothing' is returned.
-}
serviceLookupFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@service@/: the secret service -}
-> b
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m Secret.Value.Value
{- ^ __Returns:__ a newly allocated 'GI.Secret.Structs.Value.Value', which should be
released with 'GI.Secret.Structs.Value.valueUnref', or 'Nothing' if no secret found /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceLookupFinish service result_ = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ secret_service_lookup_finish service' result_'
checkUnexpectedReturnNULL "serviceLookupFinish" result
result' <- (wrapBoxed Secret.Value.Value) result
touchManagedPtr service
touchManagedPtr result_
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceLookupFinishMethodInfo
instance (signature ~ (b -> m Secret.Value.Value), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceLookupFinishMethodInfo a signature where
overloadedMethod _ = serviceLookupFinish
#endif
-- method Service::lookup_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the attribute keys and values", 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 = "Value"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_lookup_sync" secret_service_lookup_sync ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
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 (Ptr Secret.Value.Value)
{- |
Lookup a secret value in the secret service.
The /@attributes@/ should be a set of key and value string pairs.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGetSync' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
This method may block indefinitely and should not be used in user interface
threads.
-}
serviceLookupSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: the attribute keys and values -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m Secret.Value.Value
{- ^ __Returns:__ a newly allocated 'GI.Secret.Structs.Value.Value', which should be
released with 'GI.Secret.Structs.Value.valueUnref', or 'Nothing' if no secret found /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceLookupSync service schema attributes cancellable = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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
result <- propagateGError $ secret_service_lookup_sync service' maybeSchema attributes'''''' maybeCancellable
checkUnexpectedReturnNULL "serviceLookupSync" result
result' <- (wrapBoxed Secret.Value.Value) result
touchManagedPtr service
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return result'
) (do
unrefGHashTable attributes''''''
)
#if ENABLE_OVERLOADING
data ServiceLookupSyncMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> m Secret.Value.Value), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceLookupSyncMethodInfo a signature where
overloadedMethod _ = serviceLookupSync
#endif
-- method Service::prompt
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "prompt", argType = TInterface (Name {namespace = "Secret", name = "Prompt"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the prompt", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "return_type", argType = TInterface (Name {namespace = "GLib", name = "VariantType"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the variant type of the prompt result", 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 = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to be passed 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_service_prompt" secret_service_prompt ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Secret.Prompt.Prompt -> -- prompt : TInterface (Name {namespace = "Secret", name = "Prompt"})
Ptr GLib.VariantType.VariantType -> -- return_type : TInterface (Name {namespace = "GLib", name = "VariantType"})
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 ()
{- |
Perform prompting for a 'GI.Secret.Objects.Prompt.Prompt'.
This function is called by other parts of this library to handle prompts
for the various actions that can require prompting.
Override the 'GI.Secret.Structs.ServiceClass.ServiceClass' \<literal>prompt_async\<\/literal> virtual method
to change the behavior of the prompting. The default behavior is to simply
run 'GI.Secret.Objects.Prompt.promptPerform' on the prompt.
-}
servicePrompt ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Secret.Prompt.IsPrompt b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@self@/: the secret service -}
-> b
{- ^ /@prompt@/: the prompt -}
-> Maybe (GLib.VariantType.VariantType)
{- ^ /@returnType@/: the variant type of the prompt result -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
servicePrompt self prompt returnType cancellable callback = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
prompt' <- unsafeManagedPtrCastPtr prompt
maybeReturnType <- case returnType of
Nothing -> return nullPtr
Just jReturnType -> do
jReturnType' <- unsafeManagedPtrGetPtr jReturnType
return jReturnType'
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_service_prompt self' prompt' maybeReturnType maybeCancellable maybeCallback userData
touchManagedPtr self
touchManagedPtr prompt
whenJust returnType touchManagedPtr
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data ServicePromptMethodInfo
instance (signature ~ (b -> Maybe (GLib.VariantType.VariantType) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Secret.Prompt.IsPrompt b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServicePromptMethodInfo a signature where
overloadedMethod _ = servicePrompt
#endif
-- method Service::prompt_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the asynchronous result passed to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just TVariant
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_prompt_finish" secret_service_prompt_finish ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO (Ptr GVariant)
{- |
Complete asynchronous operation to perform prompting for a 'GI.Secret.Objects.Prompt.Prompt'.
Returns a variant result if the prompt was completed and not dismissed. The
type of result depends on the action the prompt is completing, and is defined
in the Secret Service DBus API specification.
-}
servicePromptFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@self@/: the secret service -}
-> b
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m GVariant
{- ^ __Returns:__ 'Nothing' if the prompt was dismissed or an error occurred,
a variant result if the prompt was successful /(Can throw 'Data.GI.Base.GError.GError')/ -}
servicePromptFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ secret_service_prompt_finish self' result_'
checkUnexpectedReturnNULL "servicePromptFinish" result
result' <- B.GVariant.wrapGVariantPtr result
touchManagedPtr self
touchManagedPtr result_
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServicePromptFinishMethodInfo
instance (signature ~ (b -> m GVariant), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServicePromptFinishMethodInfo a signature where
overloadedMethod _ = servicePromptFinish
#endif
-- method Service::prompt_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "prompt", argType = TInterface (Name {namespace = "Secret", name = "Prompt"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the prompt", 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 = "return_type", argType = TInterface (Name {namespace = "GLib", name = "VariantType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the variant type of the prompt result", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just TVariant
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_prompt_sync" secret_service_prompt_sync ::
Ptr Service -> -- self : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Secret.Prompt.Prompt -> -- prompt : TInterface (Name {namespace = "Secret", name = "Prompt"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr GLib.VariantType.VariantType -> -- return_type : TInterface (Name {namespace = "GLib", name = "VariantType"})
Ptr (Ptr GError) -> -- error
IO (Ptr GVariant)
{- |
Perform prompting for a 'GI.Secret.Objects.Prompt.Prompt'.
Runs a prompt and performs the prompting. Returns a variant result if the
prompt was completed and not dismissed. The type of result depends on the
action the prompt is completing, and is defined in the Secret Service DBus
API specification.
This function is called by other parts of this library to handle prompts
for the various actions that can require prompting.
Override the 'GI.Secret.Structs.ServiceClass.ServiceClass' \<literal>prompt_sync\<\/literal> virtual method
to change the behavior of the prompting. The default behavior is to simply
run 'GI.Secret.Objects.Prompt.promptPerformSync' on the prompt with a 'Nothing' \<literal>window_id\<\/literal>.
-}
servicePromptSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Secret.Prompt.IsPrompt b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@self@/: the secret service -}
-> b
{- ^ /@prompt@/: the prompt -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> GLib.VariantType.VariantType
{- ^ /@returnType@/: the variant type of the prompt result -}
-> m GVariant
{- ^ __Returns:__ 'Nothing' if the prompt was dismissed or an error occurred,
a variant result if the prompt was successful /(Can throw 'Data.GI.Base.GError.GError')/ -}
servicePromptSync self prompt cancellable returnType = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
prompt' <- unsafeManagedPtrCastPtr prompt
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
returnType' <- unsafeManagedPtrGetPtr returnType
onException (do
result <- propagateGError $ secret_service_prompt_sync self' prompt' maybeCancellable returnType'
checkUnexpectedReturnNULL "servicePromptSync" result
result' <- B.GVariant.wrapGVariantPtr result
touchManagedPtr self
touchManagedPtr prompt
whenJust cancellable touchManagedPtr
touchManagedPtr returnType
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServicePromptSyncMethodInfo
instance (signature ~ (b -> Maybe (c) -> GLib.VariantType.VariantType -> m GVariant), MonadIO m, IsService a, Secret.Prompt.IsPrompt b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServicePromptSyncMethodInfo a signature where
overloadedMethod _ = servicePromptSync
#endif
-- method Service::search
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "search for items matching these attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "SearchFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "search option flags", 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 = 6, 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_service_search" secret_service_search ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "SearchFlags"})
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 ()
{- |
Search for items matching the /@attributes@/. All collections are searched.
The /@attributes@/ should be a table of string keys and string values.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGet' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
If 'GI.Secret.Flags.SearchFlagsAll' is set in /@flags@/, then all the items matching the
search will be returned. Otherwise only the first item will be returned.
This is almost always the unlocked item that was most recently stored.
If 'GI.Secret.Flags.SearchFlagsUnlock' is set in /@flags@/, then items will be unlocked
if necessary. In either case, locked and unlocked items will match the
search and be returned. If the unlock fails, the search does not fail.
If 'GI.Secret.Flags.SearchFlagsLoadSecrets' is set in /@flags@/, then the items will have
their secret values loaded and available via 'GI.Secret.Objects.Item.itemGetSecret'.
This function returns immediately and completes asynchronously.
-}
serviceSearch ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: search for items matching these attributes -}
-> [Secret.Flags.SearchFlags]
{- ^ /@flags@/: search option flags -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceSearch service schema attributes flags cancellable callback = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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'''''
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_service_search service' maybeSchema attributes'''''' flags' maybeCancellable maybeCallback userData
touchManagedPtr service
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return ()
#if ENABLE_OVERLOADING
data ServiceSearchMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> [Secret.Flags.SearchFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceSearchMethodInfo a signature where
overloadedMethod _ = serviceSearch
#endif
-- method Service::search_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 (TGList (TInterface (Name {namespace = "Secret", name = "Item"})))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_search_finish" secret_service_search_finish ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO (Ptr (GList (Ptr Secret.Item.Item)))
{- |
Complete asynchronous operation to search for items.
-}
serviceSearchFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@service@/: the secret service -}
-> b
{- ^ /@result@/: asynchronous result passed to callback -}
-> m [Secret.Item.Item]
{- ^ __Returns:__
a list of items that matched the search /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceSearchFinish service result_ = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ secret_service_search_finish service' result_'
result' <- unpackGList result
result'' <- mapM (wrapObject Secret.Item.Item) result'
g_list_free result
touchManagedPtr service
touchManagedPtr result_
return result''
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceSearchFinishMethodInfo
instance (signature ~ (b -> m [Secret.Item.Item]), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceSearchFinishMethodInfo a signature where
overloadedMethod _ = serviceSearchFinish
#endif
-- method Service::search_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "search for items matching these attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "SearchFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "search option flags", 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 (TGList (TInterface (Name {namespace = "Secret", name = "Item"})))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_search_sync" secret_service_search_sync ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "SearchFlags"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO (Ptr (GList (Ptr Secret.Item.Item)))
{- |
Search for items matching the /@attributes@/. All collections are searched.
The /@attributes@/ should be a table of string keys and string values.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGetSync' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
If 'GI.Secret.Flags.SearchFlagsAll' is set in /@flags@/, then all the items matching the
search will be returned. Otherwise only the first item will be returned.
This is almost always the unlocked item that was most recently stored.
If 'GI.Secret.Flags.SearchFlagsUnlock' is set in /@flags@/, then items will be unlocked
if necessary. In either case, locked and unlocked items will match the
search and be returned. If the unlock fails, the search does not fail.
If 'GI.Secret.Flags.SearchFlagsLoadSecrets' is set in /@flags@/, then the items\' secret
values will be loaded for any unlocked items. Loaded item secret values
are available via 'GI.Secret.Objects.Item.itemGetSecret'. If the load of a secret values
fail, then the
This function may block indefinitely. Use the asynchronous version
in user interface threads.
-}
serviceSearchSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: search for items matching these attributes -}
-> [Secret.Flags.SearchFlags]
{- ^ /@flags@/: search option flags -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m [Secret.Item.Item]
{- ^ __Returns:__
a list of items that matched the search /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceSearchSync service schema attributes flags cancellable = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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'''''
let flags' = gflagsToWord flags
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ secret_service_search_sync service' maybeSchema attributes'''''' flags' maybeCancellable
result' <- unpackGList result
result'' <- mapM (wrapObject Secret.Item.Item) result'
g_list_free result
touchManagedPtr service
whenJust schema touchManagedPtr
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
return result''
) (do
unrefGHashTable attributes''''''
)
#if ENABLE_OVERLOADING
data ServiceSearchSyncMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> [Secret.Flags.SearchFlags] -> Maybe (b) -> m [Secret.Item.Item]), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceSearchSyncMethodInfo a signature where
overloadedMethod _ = serviceSearchSync
#endif
-- method Service::set_alias
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a secret service object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "alias", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the alias to assign the collection to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "collection", argType = TInterface (Name {namespace = "Secret", name = "Collection"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the collection to assign to the alias", 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 = 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_service_set_alias" secret_service_set_alias ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
CString -> -- alias : TBasicType TUTF8
Ptr Secret.Collection.Collection -> -- collection : TInterface (Name {namespace = "Secret", name = "Collection"})
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 ()
{- |
Assign a collection to this alias. Aliases help determine
well known collections, such as \'default\'.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGet' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
This method will return immediately and complete asynchronously.
-}
serviceSetAlias ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Secret.Collection.IsCollection b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@service@/: a secret service object -}
-> T.Text
{- ^ /@alias@/: the alias to assign the collection to -}
-> Maybe (b)
{- ^ /@collection@/: the collection to assign to the alias -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceSetAlias service alias collection cancellable callback = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
alias' <- textToCString alias
maybeCollection <- case collection of
Nothing -> return nullPtr
Just jCollection -> do
jCollection' <- unsafeManagedPtrCastPtr jCollection
return jCollection'
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_service_set_alias service' alias' maybeCollection maybeCancellable maybeCallback userData
touchManagedPtr service
whenJust collection touchManagedPtr
whenJust cancellable touchManagedPtr
freeMem alias'
return ()
#if ENABLE_OVERLOADING
data ServiceSetAliasMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Secret.Collection.IsCollection b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServiceSetAliasMethodInfo a signature where
overloadedMethod _ = serviceSetAlias
#endif
-- method Service::set_alias_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a secret service object", 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_service_set_alias_finish" secret_service_set_alias_finish ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Finish an asynchronous operation to assign a collection to an alias.
-}
serviceSetAliasFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@service@/: a secret service object -}
-> b
{- ^ /@result@/: asynchronous result passed to callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceSetAliasFinish service result_ = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_service_set_alias_finish service' result_'
touchManagedPtr service
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceSetAliasFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceSetAliasFinishMethodInfo a signature where
overloadedMethod _ = serviceSetAliasFinish
#endif
-- method Service::set_alias_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a secret service object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "alias", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the alias to assign the collection to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "collection", argType = TInterface (Name {namespace = "Secret", name = "Collection"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the collection to assign to the alias", 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_service_set_alias_sync" secret_service_set_alias_sync ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
CString -> -- alias : TBasicType TUTF8
Ptr Secret.Collection.Collection -> -- collection : TInterface (Name {namespace = "Secret", name = "Collection"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Assign a collection to this alias. Aliases help determine
well known collections, such as \'default\'.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGetSync' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
This method may block and should not be used in user interface threads.
-}
serviceSetAliasSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Secret.Collection.IsCollection b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@service@/: a secret service object -}
-> T.Text
{- ^ /@alias@/: the alias to assign the collection to -}
-> Maybe (b)
{- ^ /@collection@/: the collection to assign to the alias -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceSetAliasSync service alias collection cancellable = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
alias' <- textToCString alias
maybeCollection <- case collection of
Nothing -> return nullPtr
Just jCollection -> do
jCollection' <- unsafeManagedPtrCastPtr jCollection
return jCollection'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_service_set_alias_sync service' alias' maybeCollection maybeCancellable
touchManagedPtr service
whenJust collection touchManagedPtr
whenJust cancellable touchManagedPtr
freeMem alias'
return ()
) (do
freeMem alias'
)
#if ENABLE_OVERLOADING
data ServiceSetAliasSyncMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsService a, Secret.Collection.IsCollection b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServiceSetAliasSyncMethodInfo a signature where
overloadedMethod _ = serviceSetAliasSync
#endif
-- method Service::store
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 to use to check 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 "the attribute keys and values", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "collection", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a collection alias, or D-Bus object path of the collection where to store the secret", 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 secret", 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 "the 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 = 8, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to be passed 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_service_store" secret_service_store ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
CString -> -- collection : TBasicType TUTF8
CString -> -- label : TBasicType TUTF8
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 ()
{- |
Store a secret value in the secret service.
The /@attributes@/ should be a set of key and value string pairs.
If the attributes match a secret item already stored in the collection, then
the item will be updated with these new values.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGet' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
If /@collection@/ is not specified, then the default collection will be
used. Use 'GI.Secret.Constants.COLLECTION_SESSION' to store the password in the session
collection, which doesn\'t get stored across login sessions.
This method will return immediately and complete asynchronously.
-}
serviceStore ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema to use to check attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: the attribute keys and values -}
-> Maybe (T.Text)
{- ^ /@collection@/: a collection alias, or D-Bus object path of the collection where to store the secret -}
-> T.Text
{- ^ /@label@/: label for the secret -}
-> Secret.Value.Value
{- ^ /@value@/: the secret value -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceStore service schema attributes collection label value cancellable callback = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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'''''
maybeCollection <- case collection of
Nothing -> return nullPtr
Just jCollection -> do
jCollection' <- textToCString jCollection
return jCollection'
label' <- textToCString label
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_service_store service' maybeSchema attributes'''''' maybeCollection label' value' maybeCancellable maybeCallback userData
touchManagedPtr service
whenJust schema touchManagedPtr
touchManagedPtr value
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
freeMem maybeCollection
freeMem label'
return ()
#if ENABLE_OVERLOADING
data ServiceStoreMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (T.Text) -> T.Text -> Secret.Value.Value -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceStoreMethodInfo a signature where
overloadedMethod _ = serviceStore
#endif
-- method Service::store_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the 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_service_store_finish" secret_service_store_finish ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO CInt
{- |
Finish asynchronous operation to store a secret value in the secret service.
-}
serviceStoreFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@service@/: the secret service -}
-> b
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceStoreFinish service result_ = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ secret_service_store_finish service' result_'
touchManagedPtr service
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data ServiceStoreFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceStoreFinishMethodInfo a signature where
overloadedMethod _ = serviceStoreFinish
#endif
-- method Service::store_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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 "the attribute keys and values", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "collection", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a collection alias, or D-Bus object path of the collection where to store the secret", 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 secret", 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 "the 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_service_store_sync" secret_service_store_sync ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Secret.Schema.Schema -> -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
Ptr (GHashTable CString CString) -> -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
CString -> -- collection : TBasicType TUTF8
CString -> -- label : TBasicType TUTF8
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
{- |
Store a secret value in the secret service.
The /@attributes@/ should be a set of key and value string pairs.
If the attributes match a secret item already stored in the collection, then
the item will be updated with these new values.
If /@collection@/ is 'Nothing', then the default collection will be
used. Use 'GI.Secret.Constants.COLLECTION_SESSION' to store the password in the session
collection, which doesn\'t get stored across login sessions.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGetSync' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
This method may block indefinitely and should not be used in user interface
threads.
-}
serviceStoreSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) =>
a
{- ^ /@service@/: the secret service -}
-> Maybe (Secret.Schema.Schema)
{- ^ /@schema@/: the schema for the attributes -}
-> Map.Map T.Text T.Text
{- ^ /@attributes@/: the attribute keys and values -}
-> Maybe (T.Text)
{- ^ /@collection@/: a collection alias, or D-Bus object path of the collection where to store the secret -}
-> T.Text
{- ^ /@label@/: label for the secret -}
-> Secret.Value.Value
{- ^ /@value@/: the secret value -}
-> Maybe (b)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ()
{- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceStoreSync service schema attributes collection label value cancellable = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
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'''''
maybeCollection <- case collection of
Nothing -> return nullPtr
Just jCollection -> do
jCollection' <- textToCString jCollection
return jCollection'
label' <- textToCString label
value' <- unsafeManagedPtrGetPtr value
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ secret_service_store_sync service' maybeSchema attributes'''''' maybeCollection label' value' maybeCancellable
touchManagedPtr service
whenJust schema touchManagedPtr
touchManagedPtr value
whenJust cancellable touchManagedPtr
unrefGHashTable attributes''''''
freeMem maybeCollection
freeMem label'
return ()
) (do
unrefGHashTable attributes''''''
freeMem maybeCollection
freeMem label'
)
#if ENABLE_OVERLOADING
data ServiceStoreSyncMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (T.Text) -> T.Text -> Secret.Value.Value -> Maybe (b) -> m ()), MonadIO m, IsService a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ServiceStoreSyncMethodInfo a signature where
overloadedMethod _ = serviceStoreSync
#endif
-- method Service::unlock
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objects", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items or collections to unlock", 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_service_unlock" secret_service_unlock ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr (GList (Ptr Gio.DBusProxy.DBusProxy)) -> -- objects : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
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 ()
{- |
Unlock items or collections in the secret service.
The secret service may not be able to unlock items individually, and may
unlock an entire collection instead.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGet' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
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.
-}
serviceUnlock ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@service@/: the secret service -}
-> [b]
{- ^ /@objects@/: the items or collections to unlock -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceUnlock service objects cancellable callback = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
objects' <- mapM unsafeManagedPtrCastPtr objects
objects'' <- packGList objects'
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_service_unlock service' objects'' maybeCancellable maybeCallback userData
touchManagedPtr service
mapM_ touchManagedPtr objects
whenJust cancellable touchManagedPtr
g_list_free objects''
return ()
#if ENABLE_OVERLOADING
data ServiceUnlockMethodInfo
instance (signature ~ ([b] -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServiceUnlockMethodInfo a signature where
overloadedMethod _ = serviceUnlock
#endif
-- method Service::unlock_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", 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},Arg {argCName = "unlocked", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "\n location to place list of items or collections that were unlocked", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_unlock_finish" secret_service_unlock_finish ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))) -> -- unlocked : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
Ptr (Ptr GError) -> -- error
IO Int32
{- |
Complete asynchronous operation to unlock items or collections in the secret
service.
The secret service may not be able to unlock items individually, and may
unlock an entire collection instead.
-}
serviceUnlockFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) =>
a
{- ^ /@service@/: the secret service -}
-> b
{- ^ /@result@/: asynchronous result passed to the callback -}
-> m ((Int32, [Gio.DBusProxy.DBusProxy]))
{- ^ __Returns:__ the number of items or collections that were unlocked /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceUnlockFinish service result_ = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
result_' <- unsafeManagedPtrCastPtr result_
unlocked <- allocMem :: IO (Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))))
onException (do
result <- propagateGError $ secret_service_unlock_finish service' result_' unlocked
unlocked' <- peek unlocked
unlocked'' <- unpackGList unlocked'
unlocked''' <- mapM (wrapObject Gio.DBusProxy.DBusProxy) unlocked''
g_list_free unlocked'
touchManagedPtr service
touchManagedPtr result_
freeMem unlocked
return (result, unlocked''')
) (do
freeMem unlocked
)
#if ENABLE_OVERLOADING
data ServiceUnlockFinishMethodInfo
instance (signature ~ (b -> m ((Int32, [Gio.DBusProxy.DBusProxy]))), MonadIO m, IsService a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ServiceUnlockFinishMethodInfo a signature where
overloadedMethod _ = serviceUnlockFinish
#endif
-- method Service::unlock_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "service", argType = TInterface (Name {namespace = "Secret", name = "Service"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objects", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items or collections to unlock", 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 = "unlocked", argType = TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"})), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "\n location to place list of items or collections that were unlocked", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_unlock_sync" secret_service_unlock_sync ::
Ptr Service -> -- service : TInterface (Name {namespace = "Secret", name = "Service"})
Ptr (GList (Ptr Gio.DBusProxy.DBusProxy)) -> -- objects : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))) -> -- unlocked : TGList (TInterface (Name {namespace = "Gio", name = "DBusProxy"}))
Ptr (Ptr GError) -> -- error
IO Int32
{- |
Unlock items or collections in the secret service.
The secret service may not be able to unlock items individually, and may
unlock an entire collection instead.
If /@service@/ is NULL, then 'GI.Secret.Objects.Service.serviceGetSync' will be called to get
the default 'GI.Secret.Objects.Service.Service' proxy.
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.
-}
serviceUnlockSync ::
(B.CallStack.HasCallStack, MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) =>
a
{- ^ /@service@/: the secret service -}
-> [b]
{- ^ /@objects@/: the items or collections to unlock -}
-> Maybe (c)
{- ^ /@cancellable@/: optional cancellation object -}
-> m ((Int32, [Gio.DBusProxy.DBusProxy]))
{- ^ __Returns:__ the number of items or collections that were unlocked /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceUnlockSync service objects cancellable = liftIO $ do
service' <- unsafeManagedPtrCastPtr service
objects' <- mapM unsafeManagedPtrCastPtr objects
objects'' <- packGList objects'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
unlocked <- allocMem :: IO (Ptr (Ptr (GList (Ptr Gio.DBusProxy.DBusProxy))))
onException (do
result <- propagateGError $ secret_service_unlock_sync service' objects'' maybeCancellable unlocked
unlocked' <- peek unlocked
unlocked'' <- unpackGList unlocked'
unlocked''' <- mapM (wrapObject Gio.DBusProxy.DBusProxy) unlocked''
g_list_free unlocked'
touchManagedPtr service
mapM_ touchManagedPtr objects
whenJust cancellable touchManagedPtr
g_list_free objects''
freeMem unlocked
return (result, unlocked''')
) (do
g_list_free objects''
freeMem unlocked
)
#if ENABLE_OVERLOADING
data ServiceUnlockSyncMethodInfo
instance (signature ~ ([b] -> Maybe (c) -> m ((Int32, [Gio.DBusProxy.DBusProxy]))), MonadIO m, IsService a, Gio.DBusProxy.IsDBusProxy b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ServiceUnlockSyncMethodInfo a signature where
overloadedMethod _ = serviceUnlockSync
#endif
-- method Service::disconnect
-- method type : MemberFunction
-- Args : []
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "secret_service_disconnect" secret_service_disconnect ::
IO ()
{- |
Disconnect the default 'GI.Secret.Objects.Service.Service' proxy returned by 'GI.Secret.Objects.Service.serviceGet'
and 'GI.Secret.Objects.Service.serviceGetSync'.
It is not necessary to call this function, but you may choose to do so at
program exit. It is useful for testing that memory is not leaked.
This function is safe to call at any time. But if other objects in this
library are still referenced, then this will not result in all memory
being freed.
-}
serviceDisconnect ::
(B.CallStack.HasCallStack, MonadIO m) =>
m ()
serviceDisconnect = liftIO $ do
secret_service_disconnect
return ()
#if ENABLE_OVERLOADING
#endif
-- method Service::get
-- method type : MemberFunction
-- Args : [Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ServiceFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for which service functionality to ensure is initialized", 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 be passed 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_service_get" secret_service_get ::
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "ServiceFlags"})
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 ()
{- |
Get a 'GI.Secret.Objects.Service.Service' proxy for the Secret Service. If such a proxy object
already exists, then the same proxy is returned.
If /@flags@/ contains any flags of which parts of the secret service to
ensure are initialized, then those will be initialized before completing.
This method will return immediately and complete asynchronously.
-}
serviceGet ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
[Secret.Flags.ServiceFlags]
{- ^ /@flags@/: flags for which service functionality to ensure is initialized -}
-> Maybe (a)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceGet flags cancellable callback = liftIO $ do
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_service_get flags' maybeCancellable maybeCallback userData
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
#endif
-- method Service::get_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 = "Service"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_get_finish" secret_service_get_finish ::
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO (Ptr Service)
{- |
Complete an asynchronous operation to get a 'GI.Secret.Objects.Service.Service' proxy for the
Secret Service.
-}
serviceGetFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m Service
{- ^ __Returns:__ a new reference to a 'GI.Secret.Objects.Service.Service' proxy, which
should be released with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceGetFinish result_ = liftIO $ do
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ secret_service_get_finish result_'
checkUnexpectedReturnNULL "serviceGetFinish" result
result' <- (wrapObject Service) result
touchManagedPtr result_
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
#endif
-- method Service::get_sync
-- method type : MemberFunction
-- Args : [Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ServiceFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for which service functionality to ensure is initialized", 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 = "Service"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_get_sync" secret_service_get_sync ::
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "ServiceFlags"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO (Ptr Service)
{- |
Get a 'GI.Secret.Objects.Service.Service' proxy for the Secret Service. If such a proxy object
already exists, then the same proxy is returned.
If /@flags@/ contains any flags of which parts of the secret service to
ensure are initialized, then those will be initialized before returning.
This method may block indefinitely and should not be used in user interface
threads.
-}
serviceGetSync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
[Secret.Flags.ServiceFlags]
{- ^ /@flags@/: flags for which service functionality to ensure is initialized -}
-> Maybe (a)
{- ^ /@cancellable@/: optional cancellation object -}
-> m Service
{- ^ __Returns:__ a new reference to a 'GI.Secret.Objects.Service.Service' proxy, which
should be released with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceGetSync flags cancellable = liftIO $ do
let flags' = gflagsToWord flags
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ secret_service_get_sync flags' maybeCancellable
checkUnexpectedReturnNULL "serviceGetSync" result
result' <- (wrapObject Service) result
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
#endif
-- method Service::open
-- method type : MemberFunction
-- Args : [Arg {argCName = "service_gtype", argType = TBasicType TGType, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the GType of the new secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "service_bus_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the D-Bus service name of the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ServiceFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for which service functionality to ensure is initialized", 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 = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to be passed 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_service_open" secret_service_open ::
CGType -> -- service_gtype : TBasicType TGType
CString -> -- service_bus_name : TBasicType TUTF8
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "ServiceFlags"})
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 'GI.Secret.Objects.Service.Service' proxy for the Secret Service.
This function is rarely used, see 'GI.Secret.Objects.Service.serviceGet' instead.
The /@serviceGtype@/ argument should be set to @/SECRET_TYPE_SERVICE/@ or a the type
of a derived class.
If /@flags@/ contains any flags of which parts of the secret service to
ensure are initialized, then those will be initialized before returning.
If /@serviceBusName@/ is 'Nothing' then the default is used.
This method will return immediately and complete asynchronously.
-}
serviceOpen ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
GType
{- ^ /@serviceGtype@/: the GType of the new secret service -}
-> Maybe (T.Text)
{- ^ /@serviceBusName@/: the D-Bus service name of the secret service -}
-> [Secret.Flags.ServiceFlags]
{- ^ /@flags@/: flags for which service functionality to ensure is initialized -}
-> Maybe (a)
{- ^ /@cancellable@/: optional cancellation object -}
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
{- ^ /@callback@/: called when the operation completes -}
-> m ()
serviceOpen serviceGtype serviceBusName flags cancellable callback = liftIO $ do
let serviceGtype' = gtypeToCGType serviceGtype
maybeServiceBusName <- case serviceBusName of
Nothing -> return nullPtr
Just jServiceBusName -> do
jServiceBusName' <- textToCString jServiceBusName
return jServiceBusName'
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_service_open serviceGtype' maybeServiceBusName flags' maybeCancellable maybeCallback userData
whenJust cancellable touchManagedPtr
freeMem maybeServiceBusName
return ()
#if ENABLE_OVERLOADING
#endif
-- method Service::open_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 = "Service"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_open_finish" secret_service_open_finish ::
Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
Ptr (Ptr GError) -> -- error
IO (Ptr Service)
{- |
Complete an asynchronous operation to create a new 'GI.Secret.Objects.Service.Service' proxy for
the Secret Service.
-}
serviceOpenFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
{- ^ /@result@/: the asynchronous result passed to the callback -}
-> m Service
{- ^ __Returns:__ a new reference to a 'GI.Secret.Objects.Service.Service' proxy, which
should be released with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceOpenFinish result_ = liftIO $ do
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ secret_service_open_finish result_'
checkUnexpectedReturnNULL "serviceOpenFinish" result
result' <- (wrapObject Service) result
touchManagedPtr result_
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
#endif
-- method Service::open_sync
-- method type : MemberFunction
-- Args : [Arg {argCName = "service_gtype", argType = TBasicType TGType, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the GType of the new secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "service_bus_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the D-Bus service name of the secret service", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ServiceFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for which service functionality to ensure is initialized", 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 = "Service"}))
-- throws : True
-- Skip return : False
foreign import ccall "secret_service_open_sync" secret_service_open_sync ::
CGType -> -- service_gtype : TBasicType TGType
CString -> -- service_bus_name : TBasicType TUTF8
CUInt -> -- flags : TInterface (Name {namespace = "Secret", name = "ServiceFlags"})
Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
Ptr (Ptr GError) -> -- error
IO (Ptr Service)
{- |
Create a new 'GI.Secret.Objects.Service.Service' proxy for the Secret Service.
This function is rarely used, see 'GI.Secret.Objects.Service.serviceGetSync' instead.
The /@serviceGtype@/ argument should be set to @/SECRET_TYPE_SERVICE/@ or a the
type of a derived class.
If /@flags@/ contains any flags of which parts of the secret service to
ensure are initialized, then those will be initialized before returning.
If /@serviceBusName@/ is 'Nothing' then the default is used.
This method may block indefinitely and should not be used in user interface
threads.
-}
serviceOpenSync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
GType
{- ^ /@serviceGtype@/: the GType of the new secret service -}
-> Maybe (T.Text)
{- ^ /@serviceBusName@/: the D-Bus service name of the secret service -}
-> [Secret.Flags.ServiceFlags]
{- ^ /@flags@/: flags for which service functionality to ensure is initialized -}
-> Maybe (a)
{- ^ /@cancellable@/: optional cancellation object -}
-> m Service
{- ^ __Returns:__ a new reference to a 'GI.Secret.Objects.Service.Service' proxy, which
should be released with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
serviceOpenSync serviceGtype serviceBusName flags cancellable = liftIO $ do
let serviceGtype' = gtypeToCGType serviceGtype
maybeServiceBusName <- case serviceBusName of
Nothing -> return nullPtr
Just jServiceBusName -> do
jServiceBusName' <- textToCString jServiceBusName
return jServiceBusName'
let flags' = gflagsToWord flags
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ secret_service_open_sync serviceGtype' maybeServiceBusName flags' maybeCancellable
checkUnexpectedReturnNULL "serviceOpenSync" result
result' <- (wrapObject Service) result
whenJust cancellable touchManagedPtr
freeMem maybeServiceBusName
return result'
) (do
freeMem maybeServiceBusName
)
#if ENABLE_OVERLOADING
#endif