Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
A proxy object representing a collection of secrets in the Secret Service.
- newtype Collection = Collection (ManagedPtr Collection)
- class GObject o => IsCollection o
- toCollection :: IsCollection o => o -> IO Collection
- noCollection :: Maybe Collection
- collectionCreate :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> Maybe Text -> [CollectionCreateFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionCreateFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m Collection
- collectionCreateSync :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> Maybe Text -> [CollectionCreateFlags] -> Maybe b -> m Collection
- data CollectionDeleteMethodInfo
- collectionDelete :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data CollectionDeleteFinishMethodInfo
- collectionDeleteFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m ()
- data CollectionDeleteSyncMethodInfo
- collectionDeleteSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> m ()
- collectionForAlias :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> [CollectionFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionForAliasFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m Collection
- collectionForAliasSync :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> [CollectionFlags] -> Maybe b -> m Collection
- data CollectionGetCreatedMethodInfo
- collectionGetCreated :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Word64
- data CollectionGetFlagsMethodInfo
- collectionGetFlags :: (HasCallStack, MonadIO m, IsCollection a) => a -> m [CollectionFlags]
- data CollectionGetItemsMethodInfo
- collectionGetItems :: (HasCallStack, MonadIO m, IsCollection a) => a -> m [Item]
- data CollectionGetLabelMethodInfo
- collectionGetLabel :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Text
- data CollectionGetLockedMethodInfo
- collectionGetLocked :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Bool
- data CollectionGetModifiedMethodInfo
- collectionGetModified :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Word64
- data CollectionGetServiceMethodInfo
- collectionGetService :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Service
- data CollectionLoadItemsMethodInfo
- collectionLoadItems :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data CollectionLoadItemsFinishMethodInfo
- collectionLoadItemsFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m ()
- data CollectionLoadItemsSyncMethodInfo
- collectionLoadItemsSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> m ()
- data CollectionRefreshMethodInfo
- collectionRefresh :: (HasCallStack, MonadIO m, IsCollection a) => a -> m ()
- data CollectionSearchMethodInfo
- collectionSearch :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> [SearchFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data CollectionSearchFinishMethodInfo
- collectionSearchFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m [Item]
- data CollectionSearchSyncMethodInfo
- collectionSearchSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> [SearchFlags] -> Maybe b -> m [Item]
- data CollectionSetLabelMethodInfo
- collectionSetLabel :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data CollectionSetLabelFinishMethodInfo
- collectionSetLabelFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m ()
- data CollectionSetLabelSyncMethodInfo
- collectionSetLabelSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Text -> Maybe b -> m ()
- data CollectionCreatedPropertyInfo
- collectionCreated :: AttrLabelProxy "created"
- constructCollectionCreated :: IsCollection o => Word64 -> IO (GValueConstruct o)
- getCollectionCreated :: (MonadIO m, IsCollection o) => o -> m Word64
- setCollectionCreated :: (MonadIO m, IsCollection o) => o -> Word64 -> m ()
- data CollectionLabelPropertyInfo
- clearCollectionLabel :: (MonadIO m, IsCollection o) => o -> m ()
- collectionLabel :: AttrLabelProxy "label"
- constructCollectionLabel :: IsCollection o => Text -> IO (GValueConstruct o)
- getCollectionLabel :: (MonadIO m, IsCollection o) => o -> m (Maybe Text)
- setCollectionLabel :: (MonadIO m, IsCollection o) => o -> Text -> m ()
- data CollectionLockedPropertyInfo
- collectionLocked :: AttrLabelProxy "locked"
- getCollectionLocked :: (MonadIO m, IsCollection o) => o -> m Bool
- data CollectionModifiedPropertyInfo
- collectionModified :: AttrLabelProxy "modified"
- constructCollectionModified :: IsCollection o => Word64 -> IO (GValueConstruct o)
- getCollectionModified :: (MonadIO m, IsCollection o) => o -> m Word64
- setCollectionModified :: (MonadIO m, IsCollection o) => o -> Word64 -> m ()
- data CollectionServicePropertyInfo
- collectionService :: AttrLabelProxy "service"
- constructCollectionService :: (IsCollection o, IsService a) => a -> IO (GValueConstruct o)
- getCollectionService :: (MonadIO m, IsCollection o) => o -> m Service
Exported types
newtype Collection Source #
GObject Collection Source # | |
IsAsyncInitable Collection Source # | |
IsDBusInterface Collection Source # | |
IsInitable Collection Source # | |
IsDBusProxy Collection Source # | |
IsObject Collection Source # | |
IsCollection Collection Source # | |
((~) * info (ResolveCollectionMethod t Collection), MethodInfo * info Collection p) => IsLabel t (Collection -> p) Source # | |
((~) * info (ResolveCollectionMethod t Collection), MethodInfo * info Collection p) => IsLabelProxy t (Collection -> p) Source # | |
HasAttributeList * Collection Source # | |
type AttributeList Collection Source # | |
type SignalList Collection Source # | |
class GObject o => IsCollection o Source #
toCollection :: IsCollection o => o -> IO Collection Source #
Methods
create
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> Maybe Text |
|
-> [CollectionCreateFlags] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Create a new collection in the secret service.
This method returns immediately and completes asynchronously. The secret
service may prompt the user. servicePrompt
will be used to handle
any prompts that are required.
An alias
is a well-known tag for a collection, such as 'default' (ie: the
default collection to store items in). This allows other applications to
easily identify and share a collection. If you specify an alias
, and a
collection with that alias already exists, then a new collection will not
be created. The previous one will be returned instead.
If service
is NULL, then serviceGet
will be called to get
the default Service
proxy.
createFinish
collectionCreateFinish Source #
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m Collection | Returns: the new collection, which should be unreferenced
with |
Finish operation to create a new collection in the secret service.
createSync
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> Maybe Text |
|
-> [CollectionCreateFlags] |
|
-> Maybe b |
|
-> m Collection | Returns: the new collection, which should be unreferenced
with |
Create a new collection in the secret service.
This method may block indefinitely and should not be used in user interface
threads. The secret service may prompt the user. servicePrompt
will be used to handle any prompts that are required.
An alias
is a well-known tag for a collection, such as 'default' (ie: the
default collection to store items in). This allows other applications to
easily identify and share a collection. If you specify an alias
, and a
collection with that alias already exists, then a new collection will not
be created. The previous one will be returned instead.
If service
is NULL, then serviceGetSync
will be called to get
the default Service
proxy.
delete
data CollectionDeleteMethodInfo Source #
((~) * signature (Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionDeleteMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Delete this collection.
This method returns immediately and completes asynchronously. The secret
service may prompt the user. servicePrompt
will be used to handle
any prompts that show up.
deleteFinish
data CollectionDeleteFinishMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsCollection a, IsAsyncResult b) => MethodInfo * CollectionDeleteFinishMethodInfo a signature Source # | |
collectionDeleteFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete operation to delete this collection.
deleteSync
data CollectionDeleteSyncMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionDeleteSyncMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m () | (Can throw |
Delete this collection.
This method may block indefinitely and should not be used in user
interface threads. The secret service may prompt the user.
servicePrompt
will be used to handle any prompts that show up.
forAlias
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> [CollectionFlags] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'.
If service
is NULL, then serviceGet
will be called to get
the default Service
proxy.
This method will return immediately and complete asynchronously.
forAliasFinish
collectionForAliasFinish Source #
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m Collection | Returns: the collection, or |
Finish an asynchronous operation to lookup which collection is assigned to an alias.
forAliasSync
collectionForAliasSync Source #
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> [CollectionFlags] |
|
-> Maybe b |
|
-> m Collection | Returns: the collection, or |
Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'.
If service
is NULL, then serviceGetSync
will be called to get
the default Service
proxy.
This method may block and should not be used in user interface threads.
getCreated
data CollectionGetCreatedMethodInfo Source #
((~) * signature (m Word64), MonadIO m, IsCollection a) => MethodInfo * CollectionGetCreatedMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Word64 | Returns: the created date and time |
Get the created date and time of the collection. The return value is the number of seconds since the unix epoch, January 1st 1970.
getFlags
data CollectionGetFlagsMethodInfo Source #
((~) * signature (m [CollectionFlags]), MonadIO m, IsCollection a) => MethodInfo * CollectionGetFlagsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m [CollectionFlags] | Returns: the flags for features initialized |
Get the flags representing what features of the Collection
proxy
have been initialized.
Use collectionLoadItems
to initialize further features
and change the flags.
getItems
data CollectionGetItemsMethodInfo Source #
((~) * signature (m [Item]), MonadIO m, IsCollection a) => MethodInfo * CollectionGetItemsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m [Item] | Returns: a list of items,
when done, the list should be freed with g_list_free, and each item should
be released with |
Get the list of items in this collection.
getLabel
data CollectionGetLabelMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsCollection a) => MethodInfo * CollectionGetLabelMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Text | Returns: the label, which should be freed with |
Get the label of this collection.
getLocked
data CollectionGetLockedMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsCollection a) => MethodInfo * CollectionGetLockedMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Bool | Returns: whether the collection is locked or not |
Get whether the collection is locked or not.
Use serviceLock
or serviceUnlock
to lock or unlock the
collection.
getModified
data CollectionGetModifiedMethodInfo Source #
((~) * signature (m Word64), MonadIO m, IsCollection a) => MethodInfo * CollectionGetModifiedMethodInfo a signature Source # | |
collectionGetModified Source #
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Word64 | Returns: the modified date and time |
Get the modified date and time of the collection. The return value is the number of seconds since the unix epoch, January 1st 1970.
getService
data CollectionGetServiceMethodInfo Source #
((~) * signature (m Service), MonadIO m, IsCollection a) => MethodInfo * CollectionGetServiceMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Service | Returns: the Secret Service object |
Get the Secret Service object that this collection was created with.
loadItems
data CollectionLoadItemsMethodInfo Source #
((~) * signature (Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionLoadItemsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Ensure that the Collection
proxy has loaded all the items present
in the Secret Service. This affects the result of
collectionGetItems
.
For collections returned from serviceGetCollections
the items
will have already been loaded.
This method will return immediately and complete asynchronously.
loadItemsFinish
data CollectionLoadItemsFinishMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsCollection a, IsAsyncResult b) => MethodInfo * CollectionLoadItemsFinishMethodInfo a signature Source # | |
collectionLoadItemsFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete an asynchronous operation to ensure that the Collection
proxy
has loaded all the items present in the Secret Service.
loadItemsSync
data CollectionLoadItemsSyncMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionLoadItemsSyncMethodInfo a signature Source # | |
collectionLoadItemsSync Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m () | (Can throw |
Ensure that the Collection
proxy has loaded all the items present
in the Secret Service. This affects the result of
collectionGetItems
.
For collections returned from serviceGetCollections
the items
will have already been loaded.
This method may block indefinitely and should not be used in user interface threads.
refresh
data CollectionRefreshMethodInfo Source #
((~) * signature (m ()), MonadIO m, IsCollection a) => MethodInfo * CollectionRefreshMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m () |
Refresh the properties on this collection. This fires off a request to refresh, and the properties will be updated later.
Calling this method is not normally necessary, as the secret service will notify the client when properties change.
search
data CollectionSearchMethodInfo Source #
((~) * signature (Maybe Schema -> Map Text Text -> [SearchFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionSearchMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> [SearchFlags] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Search for items matching the attributes
in the collection
.
The attributes
should be a table of string keys and string values.
If 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 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 SearchFlagsLoadSecrets
is set in flags
, then the items will have
their secret values loaded and available via itemGetSecret
.
This function returns immediately and completes asynchronously.
searchFinish
data CollectionSearchFinishMethodInfo Source #
((~) * signature (b -> m [Item]), MonadIO m, IsCollection a, IsAsyncResult b) => MethodInfo * CollectionSearchFinishMethodInfo a signature Source # | |
collectionSearchFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m [Item] | Returns:
a list of items that matched the search (Can throw |
Complete asynchronous operation to search for items in a collection.
searchSync
data CollectionSearchSyncMethodInfo Source #
((~) * signature (Maybe Schema -> Map Text Text -> [SearchFlags] -> Maybe b -> m [Item]), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionSearchSyncMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> [SearchFlags] |
|
-> Maybe b |
|
-> m [Item] | Returns:
a list of items that matched the search (Can throw |
Search for items matching the attributes
in the collection
.
The attributes
should be a table of string keys and string values.
If 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 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 SearchFlagsLoadSecrets
is set in flags
, then the items will have
their secret values loaded and available via itemGetSecret
.
This function may block indefinetely. Use the asynchronous version in user interface threads.
setLabel
data CollectionSetLabelMethodInfo Source #
((~) * signature (Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionSetLabelMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Set the label of this collection.
This function returns immediately and completes asynchronously.
setLabelFinish
data CollectionSetLabelFinishMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsCollection a, IsAsyncResult b) => MethodInfo * CollectionSetLabelFinishMethodInfo a signature Source # | |
collectionSetLabelFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete asynchronous operation to set the label of this collection.
setLabelSync
data CollectionSetLabelSyncMethodInfo Source #
((~) * signature (Text -> Maybe b -> m ()), MonadIO m, IsCollection a, IsCancellable b) => MethodInfo * CollectionSetLabelSyncMethodInfo a signature Source # | |
collectionSetLabelSync Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> m () | (Can throw |
Set the label of this collection.
This function may block indefinetely. Use the asynchronous version in user interface threads.
Properties
created
data CollectionCreatedPropertyInfo Source #
collectionCreated :: AttrLabelProxy "created" Source #
constructCollectionCreated :: IsCollection o => Word64 -> IO (GValueConstruct o) Source #
getCollectionCreated :: (MonadIO m, IsCollection o) => o -> m Word64 Source #
setCollectionCreated :: (MonadIO m, IsCollection o) => o -> Word64 -> m () Source #
label
data CollectionLabelPropertyInfo Source #
clearCollectionLabel :: (MonadIO m, IsCollection o) => o -> m () Source #
collectionLabel :: AttrLabelProxy "label" Source #
constructCollectionLabel :: IsCollection o => Text -> IO (GValueConstruct o) Source #
getCollectionLabel :: (MonadIO m, IsCollection o) => o -> m (Maybe Text) Source #
setCollectionLabel :: (MonadIO m, IsCollection o) => o -> Text -> m () Source #
locked
data CollectionLockedPropertyInfo Source #
collectionLocked :: AttrLabelProxy "locked" Source #
getCollectionLocked :: (MonadIO m, IsCollection o) => o -> m Bool Source #
modified
data CollectionModifiedPropertyInfo Source #
collectionModified :: AttrLabelProxy "modified" Source #
constructCollectionModified :: IsCollection o => Word64 -> IO (GValueConstruct o) Source #
getCollectionModified :: (MonadIO m, IsCollection o) => o -> m Word64 Source #
setCollectionModified :: (MonadIO m, IsCollection o) => o -> Word64 -> m () Source #
service
data CollectionServicePropertyInfo Source #
collectionService :: AttrLabelProxy "service" Source #
constructCollectionService :: (IsCollection o, IsService a) => a -> IO (GValueConstruct o) Source #
getCollectionService :: (MonadIO m, IsCollection o) => o -> m Service Source #