63e4f6ffe5fce3e6469add12c42d0d0da13ecee0
[platform/upstream/libsecret.git] / library / gsecret-collection.h
1 /* GSecret - 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 of the licence or (at
8  * your option) any later version.
9  *
10  * See the included COPYING file for more information.
11  */
12
13 #ifndef __GSECRET_COLLECTION_H__
14 #define __GSECRET_COLLECTION_H__
15
16 #include <gio/gio.h>
17
18 #include "gsecret-types.h"
19
20 G_BEGIN_DECLS
21
22 #define GSECRET_TYPE_COLLECTION            (gsecret_collection_get_type ())
23 #define GSECRET_COLLECTION(inst)           (G_TYPE_CHECK_INSTANCE_CAST ((inst), GSECRET_TYPE_COLLECTION, GSecretCollection))
24 #define GSECRET_COLLECTION_CLASS(class)    (G_TYPE_CHECK_CLASS_CAST ((class), GSECRET_TYPE_COLLECTION, GSecretCollectionClass))
25 #define GSECRET_IS_COLLECTION(inst)        (G_TYPE_CHECK_INSTANCE_TYPE ((inst), GSECRET_TYPE_COLLECTION))
26 #define GSECRET_IS_COLLECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), GSECRET_TYPE_COLLECTION))
27 #define GSECRET_COLLECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GSECRET_TYPE_COLLECTION, GSecretCollectionClass))
28
29 typedef struct _GSecretCollectionClass   GSecretCollectionClass;
30 typedef struct _GSecretCollectionPrivate GSecretCollectionPrivate;
31
32 struct _GSecretCollection {
33         GDBusProxy parent;
34         GSecretCollectionPrivate *pv;
35 };
36
37 struct _GSecretCollectionClass {
38         GDBusProxyClass parent_class;
39         gpointer padding[8];
40 };
41
42 GType               gsecret_collection_get_type                 (void) G_GNUC_CONST;
43
44 void                gsecret_collection_new                      (GSecretService *service,
45                                                                  const gchar *collection_path,
46                                                                  GCancellable *cancellable,
47                                                                  GAsyncReadyCallback callback,
48                                                                  gpointer user_data);
49
50 GSecretCollection * gsecret_collection_new_finish               (GAsyncResult *result,
51                                                                  GError **error);
52
53 GSecretCollection * gsecret_collection_new_sync                 (GSecretService *service,
54                                                                  const gchar *collection_path,
55                                                                  GCancellable *cancellable,
56                                                                  GError **error);
57
58 void                gsecret_collection_refresh                  (GSecretCollection *self);
59
60 void                gsecret_collection_create                   (GSecretService *service,
61                                                                  const gchar *label,
62                                                                  const gchar *alias,
63                                                                  GCancellable *cancellable,
64                                                                  GAsyncReadyCallback callback,
65                                                                  gpointer user_data);
66
67 GSecretCollection * gsecret_collection_create_finish            (GAsyncResult *result,
68                                                                  GError **error);
69
70 GSecretCollection * gsecret_collection_create_sync              (GSecretService *service,
71                                                                  const gchar *label,
72                                                                  const gchar *alias,
73                                                                  GCancellable *cancellable,
74                                                                  GError **error);
75
76 void                gsecret_collection_delete                   (GSecretCollection *self,
77                                                                  GCancellable *cancellable,
78                                                                  GAsyncReadyCallback callback,
79                                                                  gpointer user_data);
80
81 gboolean            gsecret_collection_delete_finish            (GSecretCollection *self,
82                                                                  GAsyncResult *result,
83                                                                  GError **error);
84
85 gboolean            gsecret_collection_delete_sync              (GSecretCollection *self,
86                                                                  GCancellable *cancellable,
87                                                                  GError **error);
88
89 GList *             gsecret_collection_get_items                (GSecretCollection *self);
90
91 gchar *             gsecret_collection_get_label                (GSecretCollection *self);
92
93 void                gsecret_collection_set_label                (GSecretCollection *self,
94                                                                  const gchar *label,
95                                                                  GCancellable *cancellable,
96                                                                  GAsyncReadyCallback callback,
97                                                                  gpointer user_data);
98
99 gboolean            gsecret_collection_set_label_finish         (GSecretCollection *self,
100                                                                  GAsyncResult *result,
101                                                                  GError **error);
102
103 gboolean            gsecret_collection_set_label_sync           (GSecretCollection *self,
104                                                                  const gchar *label,
105                                                                  GCancellable *cancellable,
106                                                                  GError **error);
107
108 gboolean            gsecret_collection_get_locked               (GSecretCollection *self);
109
110 guint64             gsecret_collection_get_created              (GSecretCollection *self);
111
112 guint64             gsecret_collection_get_modified             (GSecretCollection *self);
113
114 G_END_DECLS
115
116 #endif /* __GSECRET_COLLECTION_H___ */