Modifying the code to retrieve a pointer rather than a non-const reference in ash...
[chromium-blink-merge.git] / third_party / libsecret / secret-collection.h
blob55530f6cd2af53c27b688c16f47144a2abf254d5
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."
17 #endif
19 #ifndef __SECRET_COLLECTION_H__
20 #define __SECRET_COLLECTION_H__
22 #include <gio/gio.h>
24 #include "secret-schema.h"
25 #include "secret-service.h"
26 #include "secret-types.h"
28 G_BEGIN_DECLS
30 typedef enum {
31 SECRET_COLLECTION_NONE = 0 << 0,
32 SECRET_COLLECTION_LOAD_ITEMS = 1 << 1,
33 } SecretCollectionFlags;
35 typedef enum {
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 {
51 GDBusProxy parent;
53 /*< private >*/
54 SecretCollectionPrivate *pv;
57 struct _SecretCollectionClass {
58 GDBusProxyClass parent_class;
60 /*< private >*/
61 gpointer padding[8];
64 GType secret_collection_get_type (void) G_GNUC_CONST;
66 void secret_collection_for_alias (SecretService *service,
67 const gchar *alias,
68 SecretCollectionFlags flags,
69 GCancellable *cancellable,
70 GAsyncReadyCallback callback,
71 gpointer user_data);
73 SecretCollection * secret_collection_for_alias_finish (GAsyncResult *result,
74 GError **error);
76 SecretCollection * secret_collection_for_alias_sync (SecretService *service,
77 const gchar *alias,
78 SecretCollectionFlags flags,
79 GCancellable *cancellable,
80 GError **error);
82 void secret_collection_load_items (SecretCollection *self,
83 GCancellable *cancellable,
84 GAsyncReadyCallback callback,
85 gpointer user_data);
87 gboolean secret_collection_load_items_finish (SecretCollection *self,
88 GAsyncResult *result,
89 GError **error);
91 gboolean secret_collection_load_items_sync (SecretCollection *self,
92 GCancellable *cancellable,
93 GError **error);
95 void secret_collection_refresh (SecretCollection *self);
97 void secret_collection_create (SecretService *service,
98 const gchar *label,
99 const gchar *alias,
100 SecretCollectionCreateFlags flags,
101 GCancellable *cancellable,
102 GAsyncReadyCallback callback,
103 gpointer user_data);
105 SecretCollection * secret_collection_create_finish (GAsyncResult *result,
106 GError **error);
108 SecretCollection * secret_collection_create_sync (SecretService *service,
109 const gchar *label,
110 const gchar *alias,
111 SecretCollectionCreateFlags flags,
112 GCancellable *cancellable,
113 GError **error);
115 void secret_collection_search (SecretCollection *self,
116 const SecretSchema *schema,
117 GHashTable *attributes,
118 SecretSearchFlags flags,
119 GCancellable *cancellable,
120 GAsyncReadyCallback callback,
121 gpointer user_data);
123 GList * secret_collection_search_finish (SecretCollection *self,
124 GAsyncResult *result,
125 GError **error);
127 GList * secret_collection_search_sync (SecretCollection *self,
128 const SecretSchema *schema,
129 GHashTable *attributes,
130 SecretSearchFlags flags,
131 GCancellable *cancellable,
132 GError **error);
134 void secret_collection_delete (SecretCollection *self,
135 GCancellable *cancellable,
136 GAsyncReadyCallback callback,
137 gpointer user_data);
139 gboolean secret_collection_delete_finish (SecretCollection *self,
140 GAsyncResult *result,
141 GError **error);
143 gboolean secret_collection_delete_sync (SecretCollection *self,
144 GCancellable *cancellable,
145 GError **error);
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,
156 const gchar *label,
157 GCancellable *cancellable,
158 GAsyncReadyCallback callback,
159 gpointer user_data);
161 gboolean secret_collection_set_label_finish (SecretCollection *self,
162 GAsyncResult *result,
163 GError **error);
165 gboolean secret_collection_set_label_sync (SecretCollection *self,
166 const gchar *label,
167 GCancellable *cancellable,
168 GError **error);
170 gboolean secret_collection_get_locked (SecretCollection *self);
172 guint64 secret_collection_get_created (SecretCollection *self);
174 guint64 secret_collection_get_modified (SecretCollection *self);
176 G_END_DECLS
178 #endif /* __SECRET_COLLECTION_H___ */