1 /* libsecret - GLib wrapper for Secret Service
3 * Copyright 2012 Red Hat Inc.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation; either version 2.1 of the licence or (at
8 * your option) any later version.
10 * See the included COPYING file for more information.
12 * Author: Stef Walter <stefw@gnome.org>
15 #if !defined (__SECRET_INSIDE_HEADER__) && !defined (SECRET_COMPILATION)
16 #error "Only <libsecret/secret.h> can be included directly."
19 #ifndef __SECRET_COLLECTION_H__
20 #define __SECRET_COLLECTION_H__
24 #include "secret-schema.h"
25 #include "secret-service.h"
26 #include "secret-types.h"
31 SECRET_COLLECTION_NONE = 0,
32 SECRET_COLLECTION_LOAD_ITEMS = 1 << 1,
33 } SecretCollectionFlags;
36 SECRET_COLLECTION_CREATE_NONE = 0,
37 } SecretCollectionCreateFlags;
39 #define SECRET_TYPE_COLLECTION (secret_collection_get_type ())
40 #define SECRET_COLLECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), SECRET_TYPE_COLLECTION, SecretCollection))
41 #define SECRET_COLLECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), SECRET_TYPE_COLLECTION, SecretCollectionClass))
42 #define SECRET_IS_COLLECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), SECRET_TYPE_COLLECTION))
43 #define SECRET_IS_COLLECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), SECRET_TYPE_COLLECTION))
44 #define SECRET_COLLECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), SECRET_TYPE_COLLECTION, SecretCollectionClass))
46 typedef struct _SecretItem SecretItem;
47 typedef struct _SecretCollection SecretCollection;
48 typedef struct _SecretCollectionClass SecretCollectionClass;
49 typedef struct _SecretCollectionPrivate SecretCollectionPrivate;
51 struct _SecretCollection {
55 SecretCollectionPrivate *pv;
58 struct _SecretCollectionClass {
59 GDBusProxyClass parent_class;
65 GType secret_collection_get_type (void) G_GNUC_CONST;
67 void secret_collection_for_alias (SecretService *service,
69 GCancellable *cancellable,
70 GAsyncReadyCallback callback,
73 SecretCollection * secret_collection_for_alias_finish (GAsyncResult *result,
76 SecretCollection * secret_collection_for_alias_sync (SecretService *service,
78 GCancellable *cancellable,
81 void secret_collection_load_items (SecretCollection *self,
82 GCancellable *cancellable,
83 GAsyncReadyCallback callback,
86 gboolean secret_collection_load_items_finish (SecretCollection *self,
90 gboolean secret_collection_load_items_sync (SecretCollection *self,
91 GCancellable *cancellable,
94 void secret_collection_refresh (SecretCollection *self);
96 void secret_collection_create (SecretService *service,
99 SecretCollectionCreateFlags flags,
100 GCancellable *cancellable,
101 GAsyncReadyCallback callback,
104 SecretCollection * secret_collection_create_finish (GAsyncResult *result,
107 SecretCollection * secret_collection_create_sync (SecretService *service,
110 SecretCollectionCreateFlags flags,
111 GCancellable *cancellable,
114 void secret_collection_search (SecretCollection *self,
115 const SecretSchema *schema,
116 GHashTable *attributes,
117 SecretSearchFlags flags,
118 GCancellable *cancellable,
119 GAsyncReadyCallback callback,
122 GList * secret_collection_search_finish (SecretCollection *self,
123 GAsyncResult *result,
126 GList * secret_collection_search_sync (SecretCollection *self,
127 const SecretSchema *schema,
128 GHashTable *attributes,
129 SecretSearchFlags flags,
130 GCancellable *cancellable,
133 void secret_collection_delete (SecretCollection *self,
134 GCancellable *cancellable,
135 GAsyncReadyCallback callback,
138 gboolean secret_collection_delete_finish (SecretCollection *self,
139 GAsyncResult *result,
142 gboolean secret_collection_delete_sync (SecretCollection *self,
143 GCancellable *cancellable,
146 SecretService * secret_collection_get_service (SecretCollection *self);
148 SecretCollectionFlags secret_collection_get_flags (SecretCollection *self);
150 GList * secret_collection_get_items (SecretCollection *self);
152 gchar * secret_collection_get_label (SecretCollection *self);
154 void secret_collection_set_label (SecretCollection *self,
156 GCancellable *cancellable,
157 GAsyncReadyCallback callback,
160 gboolean secret_collection_set_label_finish (SecretCollection *self,
161 GAsyncResult *result,
164 gboolean secret_collection_set_label_sync (SecretCollection *self,
166 GCancellable *cancellable,
169 gboolean secret_collection_get_locked (SecretCollection *self);
171 guint64 secret_collection_get_created (SecretCollection *self);
173 guint64 secret_collection_get_modified (SecretCollection *self);
177 #endif /* __SECRET_COLLECTION_H___ */