1 /*
2  * gnome-keyring
3  *
4  * Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __GCR_COLLECTION_H__
21 #define __GCR_COLLECTION_H__
22 
23 #include "gcr-types.h"
24 
25 #include <glib-object.h>
26 
27 G_BEGIN_DECLS
28 
29 #define GCR_TYPE_COLLECTION                 (gcr_collection_get_type())
30 #define GCR_COLLECTION(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_COLLECTION, GcrCollection))
31 #define GCR_IS_COLLECTION(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_COLLECTION))
32 #define GCR_COLLECTION_GET_INTERFACE(inst)  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GCR_TYPE_COLLECTION, GcrCollectionIface))
33 
34 typedef struct _GcrCollection      GcrCollection;
35 typedef struct _GcrCollectionIface GcrCollectionIface;
36 
37 struct _GcrCollectionIface {
38 	GTypeInterface parent;
39 
40 	/* signals */
41 	void (*added) (GcrCollection *self, GObject *object);
42 
43 	void (*removed) (GcrCollection *self, GObject *object);
44 
45 	/* virtual */
46 	guint    (*get_length)  (GcrCollection *self);
47 
48 	GList*   (*get_objects) (GcrCollection *self);
49 
50 	gboolean (*contains)    (GcrCollection *self,
51 	                         GObject *object);
52 
53 	/*< private >*/
54 	gpointer dummy1;
55 	gpointer dummy2;
56 	gpointer dummy3;
57 	gpointer dummy5;
58 	gpointer dummy6;
59 	gpointer dummy7;
60 	gpointer dummy8;
61 };
62 
63 GType               gcr_collection_get_type               (void);
64 
65 guint               gcr_collection_get_length             (GcrCollection *self);
66 
67 GList*              gcr_collection_get_objects            (GcrCollection *self);
68 
69 gboolean            gcr_collection_contains               (GcrCollection *self,
70                                                            GObject *object);
71 
72 void                gcr_collection_emit_added             (GcrCollection *self,
73                                                            GObject *object);
74 
75 void                gcr_collection_emit_removed           (GcrCollection *self,
76                                                            GObject *object);
77 
78 G_END_DECLS
79 
80 #endif /* __GCR_COLLECTION_H__ */
81