![]() |
![]() |
![]() |
Libsecret Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <secret/secret-unstable.h> SecretCollection; struct SecretCollectionClass; void secret_collection_new (SecretService *service
,const gchar *collection_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); SecretCollection * secret_collection_new_finish (GAsyncResult *result
,GError **error
); SecretCollection * secret_collection_new_sync (SecretService *service
,const gchar *collection_path
,GCancellable *cancellable
,GError **error
); void secret_collection_create (SecretService *service
,const gchar *label
,const gchar *alias
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); SecretCollection * secret_collection_create_finish (GAsyncResult *result
,GError **error
); SecretCollection * secret_collection_create_sync (SecretService *service
,const gchar *label
,const gchar *alias
,GCancellable *cancellable
,GError **error
); void secret_collection_delete (SecretCollection *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean secret_collection_delete_finish (SecretCollection *self
,GAsyncResult *result
,GError **error
); gboolean secret_collection_delete_sync (SecretCollection *self
,GCancellable *cancellable
,GError **error
); guint64 secret_collection_get_created (SecretCollection *self
); SecretService * secret_collection_get_service (SecretCollection *self
); GList * secret_collection_get_items (SecretCollection *self
); gchar * secret_collection_get_label (SecretCollection *self
); void secret_collection_set_label (SecretCollection *self
,const gchar *label
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean secret_collection_set_label_finish (SecretCollection *self
,GAsyncResult *result
,GError **error
); gboolean secret_collection_set_label_sync (SecretCollection *self
,const gchar *label
,GCancellable *cancellable
,GError **error
); gboolean secret_collection_get_locked (SecretCollection *self
); guint64 secret_collection_get_modified (SecretCollection *self
); void secret_collection_refresh (SecretCollection *self
);
"created" guint64 : Read / Write "items" SecretObjectList* : Read "label" gchar* : Read / Write "locked" gboolean : Read "modified" guint64 : Read / Write "service" SecretService* : Read / Write / Construct Only
SecretCollection represents a collection of secret items stored in the Secret Service.
A collection can be in a locked or unlocked state. Use secret_service_lock()
or secret_service_unlock()
to lock or unlock the collection.
Use the SecretCollection::items property or secret_collection_get_items()
to
lookup the items in the collection. There may not be any items exposed when
the collection is locked.
typedef struct _SecretCollection SecretCollection;
A proxy object representing a collection of secrets in the Secret Service.
struct SecretCollectionClass { GDBusProxyClass parent_class; };
The class for SecretCollection.
void secret_collection_new (SecretService *service
,const gchar *collection_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Get a new collection proxy for a collection in the secret service.
This method will return immediately and complete asynchronously.
|
a secret service object |
|
the D-Bus path of the collection |
|
optional cancellation object |
|
called when the operation completes |
|
data to be passed to the callback |
SecretCollection * secret_collection_new_finish (GAsyncResult *result
,GError **error
);
Finish asynchronous operation to get a new collection proxy for a collection in the secret service.
|
the asynchronous result passed to the callback |
|
location to place an error on failure |
Returns : |
the new collection, which should be unreferenced
with g_object_unref() . [transfer full]
|
SecretCollection * secret_collection_new_sync (SecretService *service
,const gchar *collection_path
,GCancellable *cancellable
,GError **error
);
Get a new collection proxy for a collection in the secret service.
This method may block indefinitely and should not be used in user interface threads.
|
a secret service object |
|
the D-Bus path of the collection |
|
optional cancellation object |
|
location to place an error on failure |
Returns : |
the new collection, which should be unreferenced
with g_object_unref() . [transfer full]
|
void secret_collection_create (SecretService *service
,const gchar *label
,const gchar *alias
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Create a new collection in the secret service.
This method returns immediately and completes asynchronously. The secret
service may prompt the user. secret_service_prompt()
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.
|
a secret service object |
|
label for the new collection |
|
alias to assign to the collection. [allow-none] |
|
optional cancellation object |
|
called when the operation completes |
|
data to pass to the callback |
SecretCollection * secret_collection_create_finish (GAsyncResult *result
,GError **error
);
Finish operation to create a new collection in the secret service.
|
the asynchronous result passed to the callback |
|
location to place an error on failure |
Returns : |
the new collection, which should be unreferenced
with g_object_unref() . [transfer full]
|
SecretCollection * secret_collection_create_sync (SecretService *service
,const gchar *label
,const gchar *alias
,GCancellable *cancellable
,GError **error
);
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. secret_service_prompt()
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.
|
a secret service object |
|
label for the new collection |
|
alias to assign to the collection. [allow-none] |
|
optional cancellation object |
|
location to place an error on failure |
Returns : |
the new collection, which should be unreferenced
with g_object_unref() . [transfer full]
|
void secret_collection_delete (SecretCollection *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Delete this collection.
This method returns immediately and completes asynchronously. The secret
service may prompt the user. secret_service_prompt()
will be used to handle
any prompts that show up.
|
a collection |
|
optional cancellation object |
|
called when the operation completes |
|
data to pass to the callback |
gboolean secret_collection_delete_finish (SecretCollection *self
,GAsyncResult *result
,GError **error
);
Complete operation to delete this collection.
|
a collection |
|
asynchronous result passed to the callback |
|
location to place an error on failure |
Returns : |
whether the collection was successfully deleted or not |
gboolean secret_collection_delete_sync (SecretCollection *self
,GCancellable *cancellable
,GError **error
);
Delete this collection.
This method may block indefinitely and should not be used in user
interface threads. The secret service may prompt the user.
secret_service_prompt()
will be used to handle any prompts that show up.
|
a collection |
|
optional cancellation object |
|
location to place an error on failure |
Returns : |
whether the collection was successfully deleted or not |
guint64 secret_collection_get_created (SecretCollection *self
);
Get the created date and time of the collection. The return value is the number of seconds since the unix epoch, January 1st 1970.
|
a collection |
Returns : |
the created date and time |
SecretService * secret_collection_get_service (SecretCollection *self
);
Get the Secret Service object that this collection was created with.
|
a collection |
Returns : |
the Secret Service object. [transfer none] |
GList * secret_collection_get_items (SecretCollection *self
);
Get the list of items in this collection.
|
a collection |
Returns : |
a list of items,
when done, the list should be freed with g_list_free, and each item should
be released with g_object_unref() . [transfer full][element-type Secret.Item]
|
gchar * secret_collection_get_label (SecretCollection *self
);
Get the label of this collection.
|
a collection |
Returns : |
the label, which should be freed with g_free() . [transfer full]
|
void secret_collection_set_label (SecretCollection *self
,const gchar *label
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Set the label of this collection.
This function returns immediately and completes asynchronously.
|
a collection |
|
a new label |
|
optional cancellation object |
|
called when the operation completes |
|
data to pass to the callback |
gboolean secret_collection_set_label_finish (SecretCollection *self
,GAsyncResult *result
,GError **error
);
Complete asynchronous operation to set the label of this collection.
|
a collection |
|
asynchronous result passed to callback |
|
location to place error on failure |
Returns : |
whether the change was successful or not |
gboolean secret_collection_set_label_sync (SecretCollection *self
,const gchar *label
,GCancellable *cancellable
,GError **error
);
Set the label of this collection.
This function may block indefinetely. Use the asynchronous version in user interface threads.
|
a collection |
|
a new label |
|
optional cancellation object |
|
location to place error on failure |
Returns : |
whether the change was successful or not |
gboolean secret_collection_get_locked (SecretCollection *self
);
Get whether the collection is locked or not.
Use secret_service_lock()
or secret_service_unlock()
to lock or unlock the
collection.
|
a collection |
Returns : |
whether the collection is locked or not |
guint64 secret_collection_get_modified (SecretCollection *self
);
Get the modified date and time of the collection. The return value is the number of seconds since the unix epoch, January 1st 1970.
|
a collection |
Returns : |
the modified date and time |
void secret_collection_refresh (SecretCollection *self
);
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.
|
the collection |
"created"
property "created" guint64 : Read / Write
The date and time (in seconds since the UNIX epoch) that this collection was created.
Default value: 0
"items"
property "items" SecretObjectList* : Read
A list of SecretItem objects representing the items that are in this collection. This list will be empty if the collection is locked.
"label"
property "label" gchar* : Read / Write
The human readable label for the collection.
Setting this property will result in the label of the collection being
set asynchronously. To properly track the changing of the label use the
secret_collection_set_label()
function.
Default value: NULL
"locked"
property "locked" gboolean : Read
Whether the collection is locked or not.
To lock or unlock a collection use the secret_service_lock()
or
secret_service_unlock()
functions.
Default value: TRUE
"modified"
property "modified" guint64 : Read / Write
The date and time (in seconds since the UNIX epoch) that this collection was last modified.
Default value: 0
"service"
property"service" SecretService* : Read / Write / Construct Only
The SecretService object that this collection is associated with and uses to interact with the actual D-Bus Secret Service.