1 /*
2  * This file is part of libsecret-d.
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/
7  */
8 
9 // generated automatically - do not change
10 // find conversion definition on APILookup.txt
11 
12 
13 module libsecret.c.types;
14 
15 public import gio.c.types;
16 public import gobject.c.types;
17 
18 
19 /**
20  * Flags for secret_collection_create().
21  */
22 public enum SecretCollectionCreateFlags
23 {
24 	/**
25 	 * no flags
26 	 */
27 	COLLECTION_CREATE_NONE = 0,
28 }
29 alias SecretCollectionCreateFlags CollectionCreateFlags;
30 
31 /**
32  * Flags which determine which parts of the #SecretCollection proxy are initialized.
33  */
34 public enum SecretCollectionFlags
35 {
36 	/**
37 	 * no flags
38 	 */
39 	NONE = 0,
40 	/**
41 	 * items have or should be loaded
42 	 */
43 	LOAD_ITEMS = 2,
44 }
45 alias SecretCollectionFlags CollectionFlags;
46 
47 public enum SecretError
48 {
49 	PROTOCOL = 1,
50 	IS_LOCKED = 2,
51 	NO_SUCH_OBJECT = 3,
52 	ALREADY_EXISTS = 4,
53 }
54 alias SecretError Error;
55 
56 /**
57  * Flags for secret_item_create().
58  */
59 public enum SecretItemCreateFlags
60 {
61 	/**
62 	 * no flags
63 	 */
64 	NONE = 0,
65 	/**
66 	 * replace an item with the same attributes.
67 	 */
68 	REPLACE = 2,
69 }
70 alias SecretItemCreateFlags ItemCreateFlags;
71 
72 /**
73  * Flags which determine which parts of the #SecretItem proxy are initialized.
74  */
75 public enum SecretItemFlags
76 {
77 	/**
78 	 * no flags
79 	 */
80 	NONE = 0,
81 	/**
82 	 * a secret has been (or should be) loaded for #SecretItem
83 	 */
84 	LOAD_SECRET = 2,
85 }
86 alias SecretItemFlags ItemFlags;
87 
88 /**
89  * The type of an attribute in a #SecretSchema. Attributes are stored as strings
90  * in the Secret Service, and the attribute types simply define standard ways
91  * to store integer and boolean values as strings.
92  */
93 public enum SecretSchemaAttributeType
94 {
95 	/**
96 	 * a utf-8 string attribute
97 	 */
98 	STRING = 0,
99 	/**
100 	 * an integer attribute, stored as a decimal
101 	 */
102 	INTEGER = 1,
103 	/**
104 	 * a boolean attribute, stored as 'true' or 'false'
105 	 */
106 	BOOLEAN = 2,
107 }
108 alias SecretSchemaAttributeType SchemaAttributeType;
109 
110 /**
111  * Flags for a #SecretSchema definition.
112  */
113 public enum SecretSchemaFlags
114 {
115 	/**
116 	 * no flags for the schema
117 	 */
118 	NONE = 0,
119 	/**
120 	 * don't match the schema name when looking up or
121 	 * removing passwords
122 	 */
123 	DONT_MATCH_NAME = 2,
124 }
125 alias SecretSchemaFlags SchemaFlags;
126 
127 /**
128  * Different types of schemas for storing secrets, intended for use with
129  * secret_get_schema().
130  *
131  * Since: 0.18.6
132  */
133 public enum SecretSchemaType
134 {
135 	/**
136 	 * Personal passwords; see %SECRET_SCHEMA_NOTE
137 	 */
138 	NOTE = 0,
139 	/**
140 	 * Network passwords from older
141 	 * libgnome-keyring storage; see %SECRET_SCHEMA_COMPAT_NETWORK
142 	 */
143 	COMPAT_NETWORK = 1,
144 }
145 alias SecretSchemaType SchemaType;
146 
147 /**
148  * Various flags to be used with secret_service_search() and secret_service_search_sync().
149  */
150 public enum SecretSearchFlags
151 {
152 	/**
153 	 * no flags
154 	 */
155 	NONE = 0,
156 	/**
157 	 * all the items matching the search will be returned, instead of just the first one
158 	 */
159 	ALL = 2,
160 	/**
161 	 * unlock locked items while searching
162 	 */
163 	UNLOCK = 4,
164 	/**
165 	 * while searching load secrets for items that are not locked
166 	 */
167 	LOAD_SECRETS = 8,
168 }
169 alias SecretSearchFlags SearchFlags;
170 
171 /**
172  * Flags which determine which parts of the #SecretService proxy are initialized
173  * during a secret_service_get() or secret_service_open() operation.
174  */
175 public enum SecretServiceFlags
176 {
177 	/**
178 	 * no flags for initializing the #SecretService
179 	 */
180 	NONE = 0,
181 	/**
182 	 * establish a session for transfer of secrets
183 	 * while initializing the #SecretService
184 	 */
185 	OPEN_SESSION = 2,
186 	/**
187 	 * load collections while initializing the
188 	 * #SecretService
189 	 */
190 	LOAD_COLLECTIONS = 4,
191 }
192 alias SecretServiceFlags ServiceFlags;
193 
194 struct SecretCollection
195 {
196 	GDBusProxy parent;
197 	SecretCollectionPrivate* pv;
198 }
199 
200 /**
201  * The class for #SecretCollection.
202  */
203 struct SecretCollectionClass
204 {
205 	/**
206 	 * the parent class
207 	 */
208 	GDBusProxyClass parentClass;
209 	void*[8] padding;
210 }
211 
212 struct SecretCollectionPrivate;
213 
214 struct SecretItem
215 {
216 	GDBusProxy parentInstance;
217 	SecretItemPrivate* pv;
218 }
219 
220 /**
221  * The class for #SecretItem.
222  */
223 struct SecretItemClass
224 {
225 	/**
226 	 * the parent class
227 	 */
228 	GDBusProxyClass parentClass;
229 	void*[4] padding;
230 }
231 
232 struct SecretItemPrivate;
233 
234 struct SecretPrompt
235 {
236 	GDBusProxy parentInstance;
237 	SecretPromptPrivate* pv;
238 }
239 
240 /**
241  * The class for #SecretPrompt.
242  */
243 struct SecretPromptClass
244 {
245 	/**
246 	 * the parent class
247 	 */
248 	GDBusProxyClass parentClass;
249 	void*[8] padding;
250 }
251 
252 struct SecretPromptPrivate;
253 
254 struct SecretSchema
255 {
256 	/**
257 	 * the dotted name of the schema
258 	 */
259 	const(char)* name;
260 	/**
261 	 * flags for the schema
262 	 */
263 	SecretSchemaFlags flags;
264 	/**
265 	 * the attribute names and types of those attributes
266 	 */
267 	SecretSchemaAttribute[32] attributes;
268 	int reserved;
269 	void* reserved1;
270 	void* reserved2;
271 	void* reserved3;
272 	void* reserved4;
273 	void* reserved5;
274 	void* reserved6;
275 	void* reserved7;
276 }
277 
278 /**
279  * An attribute in a #SecretSchema.
280  */
281 struct SecretSchemaAttribute
282 {
283 	/**
284 	 * name of the attribute
285 	 */
286 	const(char)* name;
287 	/**
288 	 * the type of the attribute
289 	 */
290 	SecretSchemaAttributeType type;
291 }
292 
293 struct SecretService
294 {
295 	GDBusProxy parent;
296 	SecretServicePrivate* pv;
297 }
298 
299 /**
300  * The class for #SecretService.
301  */
302 struct SecretServiceClass
303 {
304 	/**
305 	 * the parent class
306 	 */
307 	GDBusProxyClass parentClass;
308 	/**
309 	 * the #GType of the #SecretCollection objects instantiated
310 	 * by the #SecretService proxy
311 	 */
312 	GType collectionGtype;
313 	/**
314 	 * the #GType of the #SecretItem objects instantiated by the
315 	 * #SecretService proxy
316 	 */
317 	GType itemGtype;
318 	/**
319 	 *
320 	 * Params:
321 	 *     self = the secret service
322 	 *     prompt = the prompt
323 	 *     cancellable = optional cancellation object
324 	 *     returnType = the variant type of the prompt result
325 	 * Returns: %NULL if the prompt was dismissed or an error occurred,
326 	 *     a variant result if the prompt was successful
327 	 *
328 	 * Throws: GException on failure.
329 	 */
330 	extern(C) GVariant* function(SecretService* self, SecretPrompt* prompt, GCancellable* cancellable, GVariantType* returnType, GError** err) promptSync;
331 	/** */
332 	extern(C) void function(SecretService* self, SecretPrompt* prompt, GVariantType* returnType, GCancellable* cancellable, GAsyncReadyCallback callback, void* userData) promptAsync;
333 	/**
334 	 *
335 	 * Params:
336 	 *     self = the secret service
337 	 *     result = the asynchronous result passed to the callback
338 	 * Returns: %NULL if the prompt was dismissed or an error occurred,
339 	 *     a variant result if the prompt was successful
340 	 *
341 	 * Throws: GException on failure.
342 	 */
343 	extern(C) GVariant* function(SecretService* self, GAsyncResult* result, GError** err) promptFinish;
344 	/**
345 	 *
346 	 * Params:
347 	 *     self = the secret service
348 	 * Returns: the gobject type for collections
349 	 */
350 	extern(C) GType function(SecretService* self) getCollectionGtype;
351 	/**
352 	 *
353 	 * Params:
354 	 *     self = the service
355 	 * Returns: the gobject type for items
356 	 */
357 	extern(C) GType function(SecretService* self) getItemGtype;
358 	void*[14] padding;
359 }
360 
361 struct SecretServicePrivate;
362 
363 struct SecretValue;
364 
365 /**
366  * An alias to the default collection. This can be passed to secret_password_store()
367  * secret_collection_for_alias().
368  */
369 enum COLLECTION_DEFAULT = "default";
370 alias SECRET_COLLECTION_DEFAULT = COLLECTION_DEFAULT;
371 
372 /**
373  * An alias to the session collection, which will be cleared when the user ends
374  * the session. This can be passed to secret_password_store(),
375  * secret_collection_for_alias() or similar functions.
376  */
377 enum COLLECTION_SESSION = "session";
378 alias SECRET_COLLECTION_SESSION = COLLECTION_SESSION;