| 1 |
/* |
| 2 |
* gnome-keyring |
| 3 |
* |
| 4 |
* Copyright (C) 2009 Stefan Walter |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU Lesser General Public License as |
| 8 |
* published by the Free Software Foundation; either version 2.1 of |
| 9 |
* the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, but |
| 12 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
* Lesser General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU Lesser General Public |
| 17 |
* License along with this program; if not, see |
| 18 |
* <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef __GKM_SECRET_COLLECTION_H__ |
| 22 |
#define __GKM_SECRET_COLLECTION_H__ |
| 23 |
|
| 24 |
#include <glib-object.h> |
| 25 |
|
| 26 |
#include "gkm-secret-object.h" |
| 27 |
|
| 28 |
#define GKM_FACTORY_SECRET_COLLECTION (gkm_secret_collection_get_factory ()) |
| 29 |
|
| 30 |
#define GKM_TYPE_SECRET_COLLECTION (gkm_secret_collection_get_type ()) |
| 31 |
#define GKM_SECRET_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKM_TYPE_SECRET_COLLECTION, GkmSecretCollection)) |
| 32 |
#define GKM_SECRET_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKM_TYPE_SECRET_COLLECTION, GkmSecretCollectionClass)) |
| 33 |
#define GKM_IS_SECRET_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKM_TYPE_SECRET_COLLECTION)) |
| 34 |
#define GKM_IS_SECRET_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKM_TYPE_SECRET_COLLECTION)) |
| 35 |
#define GKM_SECRET_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKM_TYPE_SECRET_COLLECTION, GkmSecretCollectionClass)) |
| 36 |
|
| 37 |
typedef struct _GkmSecretCollectionClass GkmSecretCollectionClass; |
| 38 |
|
| 39 |
struct _GkmSecretCollectionClass { |
| 40 |
GkmSecretObjectClass parent_class; |
| 41 |
GHashTable *identifiers; |
| 42 |
}; |
| 43 |
|
| 44 |
GType gkm_secret_collection_get_type (void); |
| 45 |
|
| 46 |
GkmFactory* gkm_secret_collection_get_factory (void) G_GNUC_CONST; |
| 47 |
|
| 48 |
GkmSecretCollection* gkm_secret_collection_find (GkmSession *session, |
| 49 |
CK_ATTRIBUTE_PTR attr, |
| 50 |
...) G_GNUC_NULL_TERMINATED; |
| 51 |
|
| 52 |
GkmDataResult gkm_secret_collection_load (GkmSecretCollection *self); |
| 53 |
|
| 54 |
void gkm_secret_collection_save (GkmSecretCollection *self, |
| 55 |
GkmTransaction *transaction); |
| 56 |
|
| 57 |
void gkm_secret_collection_destroy (GkmSecretCollection *self, |
| 58 |
GkmTransaction *transaction); |
| 59 |
|
| 60 |
const gchar* gkm_secret_collection_get_filename (GkmSecretCollection *self); |
| 61 |
|
| 62 |
void gkm_secret_collection_set_filename (GkmSecretCollection *self, |
| 63 |
const gchar *filename); |
| 64 |
|
| 65 |
GList* gkm_secret_collection_get_items (GkmSecretCollection *self); |
| 66 |
|
| 67 |
GkmSecretItem* gkm_secret_collection_get_item (GkmSecretCollection *self, |
| 68 |
const gchar *identifier); |
| 69 |
|
| 70 |
gboolean gkm_secret_collection_has_item (GkmSecretCollection *self, |
| 71 |
GkmSecretItem *item); |
| 72 |
|
| 73 |
GkmSecretItem* gkm_secret_collection_new_item (GkmSecretCollection *self, |
| 74 |
const gchar *identifier); |
| 75 |
|
| 76 |
void gkm_secret_collection_remove_item (GkmSecretCollection *self, |
| 77 |
GkmSecretItem *item); |
| 78 |
|
| 79 |
GkmSecretItem* gkm_secret_collection_create_item (GkmSecretCollection *self, |
| 80 |
GkmTransaction *transaction); |
| 81 |
|
| 82 |
void gkm_secret_collection_destroy_item (GkmSecretCollection *self, |
| 83 |
GkmTransaction *transaction, |
| 84 |
GkmSecretItem *item); |
| 85 |
|
| 86 |
void gkm_secret_collection_unlocked_clear (GkmSecretCollection *self); |
| 87 |
|
| 88 |
GkmSecretData* gkm_secret_collection_unlocked_use (GkmSecretCollection *self, |
| 89 |
GkmSession *session); |
| 90 |
|
| 91 |
gboolean gkm_secret_collection_unlocked_have (GkmSecretCollection *self, |
| 92 |
GkmSession *session); |
| 93 |
|
| 94 |
gint gkm_secret_collection_get_lock_idle (GkmSecretCollection *self); |
| 95 |
|
| 96 |
void gkm_secret_collection_set_lock_idle (GkmSecretCollection *self, |
| 97 |
gint lock_timeout); |
| 98 |
|
| 99 |
gint gkm_secret_collection_get_lock_after (GkmSecretCollection *self); |
| 100 |
|
| 101 |
void gkm_secret_collection_set_lock_after (GkmSecretCollection *self, |
| 102 |
gint lock_timeout); |
| 103 |
|
| 104 |
#endif /* __GKM_SECRET_COLLECTION_H__ */ |