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> or <libsecret/secret-unstable.h> can be included directly."
19 #ifndef __SECRET_COLLECTION_H__
20 #define __SECRET_COLLECTION_H__
24 #include "secret-schema.h"
25 #include "secret-types.h"
30 SECRET_COLLECTION_NONE = 0,
31 SECRET_COLLECTION_LOAD_ITEMS = 1 << 1,
32 } SecretCollectionFlags;
35 SECRET_COLLECTION_CREATE_NONE = 0,
36 } SecretCollectionCreateFlags;
38 #define SECRET_TYPE_COLLECTION (secret_collection_get_type ())
39 #define SECRET_COLLECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), SECRET_TYPE_COLLECTION, SecretCollection))
40 #define SECRET_COLLECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), SECRET_TYPE_COLLECTION, SecretCollectionClass))
41 #define SECRET_IS_COLLECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), SECRET_TYPE_COLLECTION))
42 #define SECRET_IS_COLLECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), SECRET_TYPE_COLLECTION))
43 #define SECRET_COLLECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), SECRET_TYPE_COLLECTION, SecretCollectionClass))
45 typedef struct _SecretCollectionClass SecretCollectionClass;
46 typedef struct _SecretCollectionPrivate SecretCollectionPrivate;
48 struct _SecretCollection {
52 SecretCollectionPrivate *pv;
55 struct _SecretCollectionClass {
56 GDBusProxyClass parent_class;
62 GType secret_collection_get_type (void) G_GNUC_CONST;
64 void secret_collection_for_alias (SecretService *service,
66 GCancellable *cancellable,
67 GAsyncReadyCallback callback,
70 SecretCollection * secret_collection_for_alias_finish (GAsyncResult *result,
73 SecretCollection * secret_collection_for_alias_sync (SecretService *service,
75 GCancellable *cancellable,
78 void secret_collection_load_items (SecretCollection *self,
79 GCancellable *cancellable,
80 GAsyncReadyCallback callback,
83 gboolean secret_collection_load_items_finish (SecretCollection *self,
87 gboolean secret_collection_load_items_sync (SecretCollection *self,
88 GCancellable *cancellable,
91 void secret_collection_refresh (SecretCollection *self);
93 void secret_collection_create (SecretService *service,
96 SecretCollectionCreateFlags flags,
97 GCancellable *cancellable,
98 GAsyncReadyCallback callback,
101 SecretCollection * secret_collection_create_finish (GAsyncResult *result,
104 SecretCollection * secret_collection_create_sync (SecretService *service,
107 SecretCollectionCreateFlags flags,
108 GCancellable *cancellable,
111 void secret_collection_search (SecretCollection *self,
112 const SecretSchema *schema,
113 GHashTable *attributes,
114 SecretSearchFlags flags,
115 GCancellable *cancellable,
116 GAsyncReadyCallback callback,
119 GList * secret_collection_search_finish (SecretCollection *self,
120 GAsyncResult *result,
123 GList * secret_collection_search_sync (SecretCollection *self,
124 const SecretSchema *schema,
125 GHashTable *attributes,
126 SecretSearchFlags flags,
127 GCancellable *cancellable,
130 void secret_collection_delete (SecretCollection *self,
131 GCancellable *cancellable,
132 GAsyncReadyCallback callback,
135 gboolean secret_collection_delete_finish (SecretCollection *self,
136 GAsyncResult *result,
139 gboolean secret_collection_delete_sync (SecretCollection *self,
140 GCancellable *cancellable,
143 SecretService * secret_collection_get_service (SecretCollection *self);
145 SecretCollectionFlags secret_collection_get_flags (SecretCollection *self);
147 GList * secret_collection_get_items (SecretCollection *self);
149 gchar * secret_collection_get_label (SecretCollection *self);
151 void secret_collection_set_label (SecretCollection *self,
153 GCancellable *cancellable,
154 GAsyncReadyCallback callback,
157 gboolean secret_collection_set_label_finish (SecretCollection *self,
158 GAsyncResult *result,
161 gboolean secret_collection_set_label_sync (SecretCollection *self,
163 GCancellable *cancellable,
166 gboolean secret_collection_get_locked (SecretCollection *self);
168 guint64 secret_collection_get_created (SecretCollection *self);
170 guint64 secret_collection_get_modified (SecretCollection *self);
174 #endif /* __SECRET_COLLECTION_H___ */