1 | /* libsecret - GLib wrapper for Secret Service |
2 | * |
3 | * Copyright 2011 Collabora Ltd. |
4 | * Copyright 2012 Red Hat Inc. |
5 | * |
6 | * This program is free software: you can redistribute it and/or modify |
7 | * it under the terms of the GNU Lesser General Public License as published |
8 | * by the Free Software Foundation; either version 2.1 of the licence or (at |
9 | * your option) any later version. |
10 | * |
11 | * See the included COPYING file for more information. |
12 | * |
13 | * Author: Stef Walter <stefw@gnome.org> |
14 | */ |
15 | |
16 | #if !defined (__SECRET_INSIDE_HEADER__) && !defined (SECRET_COMPILATION) |
17 | #error "Only <libsecret/secret.h> can be included directly." |
18 | #endif |
19 | |
20 | #ifndef __SECRET_PATHS_H__ |
21 | #define __SECRET_PATHS_H__ |
22 | |
23 | #include <gio/gio.h> |
24 | |
25 | #include "secret-collection.h" |
26 | #include "secret-item.h" |
27 | #include "secret-prompt.h" |
28 | #include "secret-schema.h" |
29 | #include "secret-types.h" |
30 | #include "secret-value.h" |
31 | |
32 | G_BEGIN_DECLS |
33 | |
34 | |
35 | void secret_collection_new_for_dbus_path (SecretService *service, |
36 | const gchar *collection_path, |
37 | SecretCollectionFlags flags, |
38 | GCancellable *cancellable, |
39 | GAsyncReadyCallback callback, |
40 | gpointer user_data); |
41 | |
42 | SecretCollection * secret_collection_new_for_dbus_path_finish (GAsyncResult *result, |
43 | GError **error); |
44 | |
45 | SecretCollection * secret_collection_new_for_dbus_path_sync (SecretService *service, |
46 | const gchar *collection_path, |
47 | SecretCollectionFlags flags, |
48 | GCancellable *cancellable, |
49 | GError **error); |
50 | |
51 | void secret_collection_search_for_dbus_paths (SecretCollection *collection, |
52 | const SecretSchema *schema, |
53 | GHashTable *attributes, |
54 | GCancellable *cancellable, |
55 | GAsyncReadyCallback callback, |
56 | gpointer user_data); |
57 | |
58 | gchar ** secret_collection_search_for_dbus_paths_finish (SecretCollection *collection, |
59 | GAsyncResult *result, |
60 | GError **error); |
61 | |
62 | gchar ** secret_collection_search_for_dbus_paths_sync (SecretCollection *collection, |
63 | const SecretSchema *schema, |
64 | GHashTable *attributes, |
65 | GCancellable *cancellable, |
66 | GError **error); |
67 | |
68 | void secret_item_new_for_dbus_path (SecretService *service, |
69 | const gchar *item_path, |
70 | SecretItemFlags flags, |
71 | GCancellable *cancellable, |
72 | GAsyncReadyCallback callback, |
73 | gpointer user_data); |
74 | |
75 | SecretItem * secret_item_new_for_dbus_path_finish (GAsyncResult *result, |
76 | GError **error); |
77 | |
78 | SecretItem * secret_item_new_for_dbus_path_sync (SecretService *service, |
79 | const gchar *item_path, |
80 | SecretItemFlags flags, |
81 | GCancellable *cancellable, |
82 | GError **error); |
83 | |
84 | const gchar * secret_service_get_session_dbus_path (SecretService *self); |
85 | |
86 | void secret_service_search_for_dbus_paths (SecretService *self, |
87 | const SecretSchema *schema, |
88 | GHashTable *attributes, |
89 | GCancellable *cancellable, |
90 | GAsyncReadyCallback callback, |
91 | gpointer user_data); |
92 | |
93 | gboolean secret_service_search_for_dbus_paths_finish (SecretService *self, |
94 | GAsyncResult *result, |
95 | gchar ***unlocked, |
96 | gchar ***locked, |
97 | GError **error); |
98 | |
99 | gboolean secret_service_search_for_dbus_paths_sync (SecretService *self, |
100 | const SecretSchema *schema, |
101 | GHashTable *attributes, |
102 | GCancellable *cancellable, |
103 | gchar ***unlocked, |
104 | gchar ***locked, |
105 | GError **error); |
106 | |
107 | void secret_service_get_secret_for_dbus_path (SecretService *self, |
108 | const gchar *item_path, |
109 | GCancellable *cancellable, |
110 | GAsyncReadyCallback callback, |
111 | gpointer user_data); |
112 | |
113 | SecretValue * secret_service_get_secret_for_dbus_path_finish (SecretService *self, |
114 | GAsyncResult *result, |
115 | GError **error); |
116 | |
117 | SecretValue * secret_service_get_secret_for_dbus_path_sync (SecretService *self, |
118 | const gchar *item_path, |
119 | GCancellable *cancellable, |
120 | GError **error); |
121 | |
122 | void secret_service_get_secrets_for_dbus_paths (SecretService *self, |
123 | const gchar **item_paths, |
124 | GCancellable *cancellable, |
125 | GAsyncReadyCallback callback, |
126 | gpointer user_data); |
127 | |
128 | GHashTable * secret_service_get_secrets_for_dbus_paths_finish (SecretService *self, |
129 | GAsyncResult *result, |
130 | GError **error); |
131 | |
132 | GHashTable * secret_service_get_secrets_for_dbus_paths_sync (SecretService *self, |
133 | const gchar **item_paths, |
134 | GCancellable *cancellable, |
135 | GError **error); |
136 | |
137 | gint secret_service_lock_dbus_paths_sync (SecretService *self, |
138 | const gchar **paths, |
139 | GCancellable *cancellable, |
140 | gchar ***locked, |
141 | GError **error); |
142 | |
143 | void secret_service_lock_dbus_paths (SecretService *self, |
144 | const gchar **paths, |
145 | GCancellable *cancellable, |
146 | GAsyncReadyCallback callback, |
147 | gpointer user_data); |
148 | |
149 | gint secret_service_lock_dbus_paths_finish (SecretService *self, |
150 | GAsyncResult *result, |
151 | gchar ***locked, |
152 | GError **error); |
153 | |
154 | gint secret_service_unlock_dbus_paths_sync (SecretService *self, |
155 | const gchar **paths, |
156 | GCancellable *cancellable, |
157 | gchar ***unlocked, |
158 | GError **error); |
159 | |
160 | void secret_service_unlock_dbus_paths (SecretService *self, |
161 | const gchar **paths, |
162 | GCancellable *cancellable, |
163 | GAsyncReadyCallback callback, |
164 | gpointer user_data); |
165 | |
166 | gint secret_service_unlock_dbus_paths_finish (SecretService *self, |
167 | GAsyncResult *result, |
168 | gchar ***unlocked, |
169 | GError **error); |
170 | |
171 | GVariant * secret_service_prompt_at_dbus_path_sync (SecretService *self, |
172 | const gchar *prompt_path, |
173 | GCancellable *cancellable, |
174 | const GVariantType *return_type, |
175 | GError **error); |
176 | |
177 | void secret_service_prompt_at_dbus_path (SecretService *self, |
178 | const gchar *prompt_path, |
179 | const GVariantType *return_type, |
180 | GCancellable *cancellable, |
181 | GAsyncReadyCallback callback, |
182 | gpointer user_data); |
183 | |
184 | GVariant * secret_service_prompt_at_dbus_path_finish (SecretService *self, |
185 | GAsyncResult *result, |
186 | GError **error); |
187 | |
188 | void secret_service_delete_item_dbus_path (SecretService *self, |
189 | const gchar *item_path, |
190 | GCancellable *cancellable, |
191 | GAsyncReadyCallback callback, |
192 | gpointer user_data); |
193 | |
194 | gboolean secret_service_delete_item_dbus_path_finish (SecretService *self, |
195 | GAsyncResult *result, |
196 | GError **error); |
197 | |
198 | gboolean secret_service_delete_item_dbus_path_sync (SecretService *self, |
199 | const gchar *item_path, |
200 | GCancellable *cancellable, |
201 | GError **error); |
202 | |
203 | void secret_service_create_collection_dbus_path (SecretService *self, |
204 | GHashTable *properties, |
205 | const gchar *alias, |
206 | SecretCollectionCreateFlags flags, |
207 | GCancellable *cancellable, |
208 | GAsyncReadyCallback callback, |
209 | gpointer user_data); |
210 | |
211 | gchar * secret_service_create_collection_dbus_path_finish (SecretService *self, |
212 | GAsyncResult *result, |
213 | GError **error); |
214 | |
215 | gchar * secret_service_create_collection_dbus_path_sync (SecretService *self, |
216 | GHashTable *properties, |
217 | const gchar *alias, |
218 | SecretCollectionCreateFlags flags, |
219 | GCancellable *cancellable, |
220 | GError **error); |
221 | |
222 | void secret_service_create_item_dbus_path (SecretService *self, |
223 | const gchar *collection_path, |
224 | GHashTable *properties, |
225 | SecretValue *value, |
226 | SecretItemCreateFlags flags, |
227 | GCancellable *cancellable, |
228 | GAsyncReadyCallback callback, |
229 | gpointer user_data); |
230 | |
231 | gchar * secret_service_create_item_dbus_path_finish (SecretService *self, |
232 | GAsyncResult *result, |
233 | GError **error); |
234 | |
235 | gchar * secret_service_create_item_dbus_path_sync (SecretService *self, |
236 | const gchar *collection_path, |
237 | GHashTable *properties, |
238 | SecretValue *value, |
239 | SecretItemCreateFlags flags, |
240 | GCancellable *cancellable, |
241 | GError **error); |
242 | |
243 | void secret_service_read_alias_dbus_path (SecretService *self, |
244 | const gchar *alias, |
245 | GCancellable *cancellable, |
246 | GAsyncReadyCallback callback, |
247 | gpointer user_data); |
248 | |
249 | gchar * secret_service_read_alias_dbus_path_finish (SecretService *self, |
250 | GAsyncResult *result, |
251 | GError **error); |
252 | |
253 | gchar * secret_service_read_alias_dbus_path_sync (SecretService *self, |
254 | const gchar *alias, |
255 | GCancellable *cancellable, |
256 | GError **error); |
257 | |
258 | void secret_service_set_alias_to_dbus_path (SecretService *self, |
259 | const gchar *alias, |
260 | const gchar *collection_path, |
261 | GCancellable *cancellable, |
262 | GAsyncReadyCallback callback, |
263 | gpointer user_data); |
264 | |
265 | gboolean secret_service_set_alias_to_dbus_path_finish (SecretService *self, |
266 | GAsyncResult *result, |
267 | GError **error); |
268 | |
269 | gboolean secret_service_set_alias_to_dbus_path_sync (SecretService *self, |
270 | const gchar *alias, |
271 | const gchar *collection_path, |
272 | GCancellable *cancellable, |
273 | GError **error); |
274 | |
275 | GVariant * secret_service_encode_dbus_secret (SecretService *service, |
276 | SecretValue *value); |
277 | |
278 | SecretValue * secret_service_decode_dbus_secret (SecretService *service, |
279 | GVariant *value); |
280 | |
281 | G_END_DECLS |
282 | |
283 | #endif /* __SECRET_SERVICE_H___ */ |
284 | |