OLD | NEW |
| (Empty) |
1 /* libsecret - GLib wrapper for Secret Service | |
2 * | |
3 * Copyright 2012 Red Hat Inc. | |
4 * | |
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. | |
9 * | |
10 * See the included COPYING file for more information. | |
11 * | |
12 * Author: Stef Walter <stefw@gnome.org> | |
13 */ | |
14 | |
15 #if !defined (__SECRET_INSIDE_HEADER__) && !defined (SECRET_COMPILATION) | |
16 #error "Only <libsecret/secret.h> can be included directly." | |
17 #endif | |
18 | |
19 #ifndef __SECRET_COLLECTION_H__ | |
20 #define __SECRET_COLLECTION_H__ | |
21 | |
22 #include <gio/gio.h> | |
23 | |
24 #include "secret-schema.h" | |
25 #include "secret-service.h" | |
26 #include "secret-types.h" | |
27 | |
28 G_BEGIN_DECLS | |
29 | |
30 typedef enum { | |
31 SECRET_COLLECTION_NONE = 0 << 0, | |
32 SECRET_COLLECTION_LOAD_ITEMS = 1 << 1, | |
33 } SecretCollectionFlags; | |
34 | |
35 typedef enum { | |
36 SECRET_COLLECTION_CREATE_NONE = 0 << 0, | |
37 } SecretCollectionCreateFlags; | |
38 | |
39 #define SECRET_TYPE_COLLECTION (secret_collection_get_type ()) | |
40 #define SECRET_COLLECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), S
ECRET_TYPE_COLLECTION, SecretCollection)) | |
41 #define SECRET_COLLECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), SEC
RET_TYPE_COLLECTION, SecretCollectionClass)) | |
42 #define SECRET_IS_COLLECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), S
ECRET_TYPE_COLLECTION)) | |
43 #define SECRET_IS_COLLECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), SEC
RET_TYPE_COLLECTION)) | |
44 #define SECRET_COLLECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), SE
CRET_TYPE_COLLECTION, SecretCollectionClass)) | |
45 | |
46 typedef struct _SecretItem SecretItem; | |
47 typedef struct _SecretCollectionClass SecretCollectionClass; | |
48 typedef struct _SecretCollectionPrivate SecretCollectionPrivate; | |
49 | |
50 struct _SecretCollection { | |
51 GDBusProxy parent; | |
52 | |
53 /*< private >*/ | |
54 SecretCollectionPrivate *pv; | |
55 }; | |
56 | |
57 struct _SecretCollectionClass { | |
58 GDBusProxyClass parent_class; | |
59 | |
60 /*< private >*/ | |
61 gpointer padding[8]; | |
62 }; | |
63 | |
64 GType secret_collection_get_type (void) G_GNUC_CON
ST; | |
65 | |
66 void secret_collection_for_alias (SecretService *s
ervice, | |
67 const gchar *ali
as, | |
68 SecretCollection
Flags flags, | |
69 GCancellable *ca
ncellable, | |
70 GAsyncReadyCallb
ack callback, | |
71 gpointer user_da
ta); | |
72 | |
73 SecretCollection * secret_collection_for_alias_finish (GAsyncResult *re
sult, | |
74 GError **error); | |
75 | |
76 SecretCollection * secret_collection_for_alias_sync (SecretService *s
ervice, | |
77 const gchar *ali
as, | |
78 SecretCollection
Flags flags, | |
79 GCancellable *ca
ncellable, | |
80 GError **error); | |
81 | |
82 void secret_collection_load_items (SecretCollection
*self, | |
83 GCancellable *ca
ncellable, | |
84 GAsyncReadyCallb
ack callback, | |
85 gpointer user_da
ta); | |
86 | |
87 gboolean secret_collection_load_items_finish (SecretCollection
*self, | |
88 GAsyncResult *re
sult, | |
89 GError **error); | |
90 | |
91 gboolean secret_collection_load_items_sync (SecretCollection
*self, | |
92 GCancellable *ca
ncellable, | |
93 GError **error); | |
94 | |
95 void secret_collection_refresh (SecretCollection
*self); | |
96 | |
97 void secret_collection_create (SecretService *s
ervice, | |
98 const gchar *lab
el, | |
99 const gchar *ali
as, | |
100 SecretCollection
CreateFlags flags, | |
101 GCancellable *ca
ncellable, | |
102 GAsyncReadyCallb
ack callback, | |
103 gpointer user_da
ta); | |
104 | |
105 SecretCollection * secret_collection_create_finish (GAsyncResult *re
sult, | |
106 GError **error); | |
107 | |
108 SecretCollection * secret_collection_create_sync (SecretService *s
ervice, | |
109 const gchar *lab
el, | |
110 const gchar *ali
as, | |
111 SecretCollection
CreateFlags flags, | |
112 GCancellable *ca
ncellable, | |
113 GError **error); | |
114 | |
115 void secret_collection_search (SecretCollection
*self, | |
116 const SecretSche
ma *schema, | |
117 GHashTable *attr
ibutes, | |
118 SecretSearchFlag
s flags, | |
119 GCancellable *ca
ncellable, | |
120 GAsyncReadyCallb
ack callback, | |
121 gpointer user_da
ta); | |
122 | |
123 GList * secret_collection_search_finish (SecretCollection
*self, | |
124 GAsyncResult *re
sult, | |
125 GError **error); | |
126 | |
127 GList * secret_collection_search_sync (SecretCollection
*self, | |
128 const SecretSche
ma *schema, | |
129 GHashTable *attr
ibutes, | |
130 SecretSearchFlag
s flags, | |
131 GCancellable *ca
ncellable, | |
132 GError **error); | |
133 | |
134 void secret_collection_delete (SecretCollection
*self, | |
135 GCancellable *ca
ncellable, | |
136 GAsyncReadyCallb
ack callback, | |
137 gpointer user_da
ta); | |
138 | |
139 gboolean secret_collection_delete_finish (SecretCollection
*self, | |
140 GAsyncResult *re
sult, | |
141 GError **error); | |
142 | |
143 gboolean secret_collection_delete_sync (SecretCollection
*self, | |
144 GCancellable *ca
ncellable, | |
145 GError **error); | |
146 | |
147 SecretService * secret_collection_get_service (SecretCollection
*self); | |
148 | |
149 SecretCollectionFlags secret_collection_get_flags (SecretCollection
*self); | |
150 | |
151 GList * secret_collection_get_items (SecretCollection
*self); | |
152 | |
153 gchar * secret_collection_get_label (SecretCollection
*self); | |
154 | |
155 void secret_collection_set_label (SecretCollection
*self, | |
156 const gchar *lab
el, | |
157 GCancellable *ca
ncellable, | |
158 GAsyncReadyCallb
ack callback, | |
159 gpointer user_da
ta); | |
160 | |
161 gboolean secret_collection_set_label_finish (SecretCollection
*self, | |
162 GAsyncResult *re
sult, | |
163 GError **error); | |
164 | |
165 gboolean secret_collection_set_label_sync (SecretCollection
*self, | |
166 const gchar *lab
el, | |
167 GCancellable *ca
ncellable, | |
168 GError **error); | |
169 | |
170 gboolean secret_collection_get_locked (SecretCollection
*self); | |
171 | |
172 guint64 secret_collection_get_created (SecretCollection
*self); | |
173 | |
174 guint64 secret_collection_get_modified (SecretCollection
*self); | |
175 | |
176 G_END_DECLS | |
177 | |
178 #endif /* __SECRET_COLLECTION_H___ */ | |
OLD | NEW |