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 << 0,
32 SECRET_COLLECTION_LOAD_ITEMS
= 1 << 1,
33 } SecretCollectionFlags
;
36 SECRET_COLLECTION_CREATE_NONE
= 0 << 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 _SecretCollectionClass SecretCollectionClass
;
48 typedef struct _SecretCollectionPrivate SecretCollectionPrivate
;
50 struct _SecretCollection
{
54 SecretCollectionPrivate
*pv
;
57 struct _SecretCollectionClass
{
58 GDBusProxyClass parent_class
;
64 GType
secret_collection_get_type (void) G_GNUC_CONST
;
66 void secret_collection_for_alias (SecretService
*service
,
68 SecretCollectionFlags flags
,
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 SecretCollectionFlags flags
,
79 GCancellable
*cancellable
,
82 void secret_collection_load_items (SecretCollection
*self
,
83 GCancellable
*cancellable
,
84 GAsyncReadyCallback callback
,
87 gboolean
secret_collection_load_items_finish (SecretCollection
*self
,
91 gboolean
secret_collection_load_items_sync (SecretCollection
*self
,
92 GCancellable
*cancellable
,
95 void secret_collection_refresh (SecretCollection
*self
);
97 void secret_collection_create (SecretService
*service
,
100 SecretCollectionCreateFlags flags
,
101 GCancellable
*cancellable
,
102 GAsyncReadyCallback callback
,
105 SecretCollection
* secret_collection_create_finish (GAsyncResult
*result
,
108 SecretCollection
* secret_collection_create_sync (SecretService
*service
,
111 SecretCollectionCreateFlags flags
,
112 GCancellable
*cancellable
,
115 void secret_collection_search (SecretCollection
*self
,
116 const SecretSchema
*schema
,
117 GHashTable
*attributes
,
118 SecretSearchFlags flags
,
119 GCancellable
*cancellable
,
120 GAsyncReadyCallback callback
,
123 GList
* secret_collection_search_finish (SecretCollection
*self
,
124 GAsyncResult
*result
,
127 GList
* secret_collection_search_sync (SecretCollection
*self
,
128 const SecretSchema
*schema
,
129 GHashTable
*attributes
,
130 SecretSearchFlags flags
,
131 GCancellable
*cancellable
,
134 void secret_collection_delete (SecretCollection
*self
,
135 GCancellable
*cancellable
,
136 GAsyncReadyCallback callback
,
139 gboolean
secret_collection_delete_finish (SecretCollection
*self
,
140 GAsyncResult
*result
,
143 gboolean
secret_collection_delete_sync (SecretCollection
*self
,
144 GCancellable
*cancellable
,
147 SecretService
* secret_collection_get_service (SecretCollection
*self
);
149 SecretCollectionFlags
secret_collection_get_flags (SecretCollection
*self
);
151 GList
* secret_collection_get_items (SecretCollection
*self
);
153 gchar
* secret_collection_get_label (SecretCollection
*self
);
155 void secret_collection_set_label (SecretCollection
*self
,
157 GCancellable
*cancellable
,
158 GAsyncReadyCallback callback
,
161 gboolean
secret_collection_set_label_finish (SecretCollection
*self
,
162 GAsyncResult
*result
,
165 gboolean
secret_collection_set_label_sync (SecretCollection
*self
,
167 GCancellable
*cancellable
,
170 gboolean
secret_collection_get_locked (SecretCollection
*self
);
172 guint64
secret_collection_get_created (SecretCollection
*self
);
174 guint64
secret_collection_get_modified (SecretCollection
*self
);
178 #endif /* __SECRET_COLLECTION_H___ */