vala
[moonshot-ui.git] / src / moonshot-idcard-store.c
1 /* moonshot-idcard-store.c generated by valac 0.26.1, the Vala compiler
2  * generated from moonshot-idcard-store.vala, do not modify */
3
4 /*
5  * Copyright (c) 2011-2014, JANET(UK)
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of JANET(UK) nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34 */
35
36 #include <glib.h>
37 #include <glib-object.h>
38 #include <gee.h>
39
40
41 #define TYPE_IIDENTITY_CARD_STORE (iidentity_card_store_get_type ())
42 #define IIDENTITY_CARD_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IIDENTITY_CARD_STORE, IIdentityCardStore))
43 #define IS_IIDENTITY_CARD_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IIDENTITY_CARD_STORE))
44 #define IIDENTITY_CARD_STORE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_IIDENTITY_CARD_STORE, IIdentityCardStoreIface))
45
46 typedef struct _IIdentityCardStore IIdentityCardStore;
47 typedef struct _IIdentityCardStoreIface IIdentityCardStoreIface;
48
49 #define TYPE_ID_CARD (id_card_get_type ())
50 #define ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ID_CARD, IdCard))
51 #define ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ID_CARD, IdCardClass))
52 #define IS_ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ID_CARD))
53 #define IS_ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ID_CARD))
54 #define ID_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ID_CARD, IdCardClass))
55
56 typedef struct _IdCard IdCard;
57 typedef struct _IdCardClass IdCardClass;
58
59 #define IIDENTITY_CARD_STORE_TYPE_STORE_TYPE (iidentity_card_store_store_type_get_type ())
60
61 typedef enum  {
62         IIDENTITY_CARD_STORE_STORE_TYPE_FLAT_FILE,
63         IIDENTITY_CARD_STORE_STORE_TYPE_KEYRING
64 } IIdentityCardStoreStoreType;
65
66 struct _IIdentityCardStoreIface {
67         GTypeInterface parent_iface;
68         void (*add_card) (IIdentityCardStore* self, IdCard* card);
69         gboolean (*remove_card) (IIdentityCardStore* self, IdCard* card);
70         IdCard* (*update_card) (IIdentityCardStore* self, IdCard* card);
71         IIdentityCardStoreStoreType (*get_store_type) (IIdentityCardStore* self);
72         GeeLinkedList* (*get_card_list) (IIdentityCardStore* self);
73 };
74
75
76
77 GType id_card_get_type (void) G_GNUC_CONST;
78 GType iidentity_card_store_store_type_get_type (void) G_GNUC_CONST;
79 GType iidentity_card_store_get_type (void) G_GNUC_CONST;
80 void iidentity_card_store_add_card (IIdentityCardStore* self, IdCard* card);
81 gboolean iidentity_card_store_remove_card (IIdentityCardStore* self, IdCard* card);
82 IdCard* iidentity_card_store_update_card (IIdentityCardStore* self, IdCard* card);
83 IIdentityCardStoreStoreType iidentity_card_store_get_store_type (IIdentityCardStore* self);
84 GeeLinkedList* iidentity_card_store_get_card_list (IIdentityCardStore* self);
85
86
87 GType iidentity_card_store_store_type_get_type (void) {
88         static volatile gsize iidentity_card_store_store_type_type_id__volatile = 0;
89         if (g_once_init_enter (&iidentity_card_store_store_type_type_id__volatile)) {
90                 static const GEnumValue values[] = {{IIDENTITY_CARD_STORE_STORE_TYPE_FLAT_FILE, "IIDENTITY_CARD_STORE_STORE_TYPE_FLAT_FILE", "flat-file"}, {IIDENTITY_CARD_STORE_STORE_TYPE_KEYRING, "IIDENTITY_CARD_STORE_STORE_TYPE_KEYRING", "keyring"}, {0, NULL, NULL}};
91                 GType iidentity_card_store_store_type_type_id;
92                 iidentity_card_store_store_type_type_id = g_enum_register_static ("IIdentityCardStoreStoreType", values);
93                 g_once_init_leave (&iidentity_card_store_store_type_type_id__volatile, iidentity_card_store_store_type_type_id);
94         }
95         return iidentity_card_store_store_type_type_id__volatile;
96 }
97
98
99 void iidentity_card_store_add_card (IIdentityCardStore* self, IdCard* card) {
100 #line 40 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
101         g_return_if_fail (self != NULL);
102 #line 40 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
103         IIDENTITY_CARD_STORE_GET_INTERFACE (self)->add_card (self, card);
104 #line 105 "moonshot-idcard-store.c"
105 }
106
107
108 gboolean iidentity_card_store_remove_card (IIdentityCardStore* self, IdCard* card) {
109 #line 41 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
110         g_return_val_if_fail (self != NULL, FALSE);
111 #line 41 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
112         return IIDENTITY_CARD_STORE_GET_INTERFACE (self)->remove_card (self, card);
113 #line 114 "moonshot-idcard-store.c"
114 }
115
116
117 IdCard* iidentity_card_store_update_card (IIdentityCardStore* self, IdCard* card) {
118 #line 42 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
119         g_return_val_if_fail (self != NULL, NULL);
120 #line 42 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
121         return IIDENTITY_CARD_STORE_GET_INTERFACE (self)->update_card (self, card);
122 #line 123 "moonshot-idcard-store.c"
123 }
124
125
126 IIdentityCardStoreStoreType iidentity_card_store_get_store_type (IIdentityCardStore* self) {
127 #line 43 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
128         g_return_val_if_fail (self != NULL, 0);
129 #line 43 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
130         return IIDENTITY_CARD_STORE_GET_INTERFACE (self)->get_store_type (self);
131 #line 132 "moonshot-idcard-store.c"
132 }
133
134
135 GeeLinkedList* iidentity_card_store_get_card_list (IIdentityCardStore* self) {
136 #line 44 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
137         g_return_val_if_fail (self != NULL, NULL);
138 #line 44 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
139         return IIDENTITY_CARD_STORE_GET_INTERFACE (self)->get_card_list (self);
140 #line 141 "moonshot-idcard-store.c"
141 }
142
143
144 static void iidentity_card_store_base_init (IIdentityCardStoreIface * iface) {
145 #line 33 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
146         static gboolean initialized = FALSE;
147 #line 33 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
148         if (!initialized) {
149 #line 33 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-idcard-store.vala"
150                 initialized = TRUE;
151 #line 152 "moonshot-idcard-store.c"
152         }
153 }
154
155
156 GType iidentity_card_store_get_type (void) {
157         static volatile gsize iidentity_card_store_type_id__volatile = 0;
158         if (g_once_init_enter (&iidentity_card_store_type_id__volatile)) {
159                 static const GTypeInfo g_define_type_info = { sizeof (IIdentityCardStoreIface), (GBaseInitFunc) iidentity_card_store_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
160                 GType iidentity_card_store_type_id;
161                 iidentity_card_store_type_id = g_type_register_static (G_TYPE_INTERFACE, "IIdentityCardStore", &g_define_type_info, 0);
162                 g_type_interface_add_prerequisite (iidentity_card_store_type_id, G_TYPE_OBJECT);
163                 g_once_init_leave (&iidentity_card_store_type_id__volatile, iidentity_card_store_type_id);
164         }
165         return iidentity_card_store_type_id__volatile;
166 }
167
168
169