~ubuntu-branches/ubuntu/precise/evolution/precise

« back to all changes in this revision

Viewing changes to mail/em-format-hook.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-09-08 09:38:57 UTC
  • mfrom: (1.1.84 upstream)
  • Revision ID: package-import@ubuntu.com-20110908093857-6lfl04ke2ns3kx2o
Tags: 3.1.91-0ubuntu1
* New upstream release. (LP: #843769)
* debian/control: bump e-d-s Build-Depends to 3.1.91. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
/* Mail formatter handler plugin */
40
40
 
41
41
/*
42
 
  <hook class="org.gnome.evolution.mail.format:1.0">
43
 
  <group id="EMFormatHTML">
44
 
     <item flags="inline,inline_disposition"
45
 
           mime_type="text/vcard"
46
 
           format="format_vcard"/>
47
 
  </group>
48
 
  </hook>
49
 
 
50
 
*/
 
42
 * <hook class="org.gnome.evolution.mail.format:1.0">
 
43
 * <group id="EMFormatHTML">
 
44
 *   <item flags="inline,inline_disposition"
 
45
 *         mime_type="text/vcard"
 
46
 *         format="format_vcard"/>
 
47
 * </group>
 
48
 * </hook>
 
49
 */
51
50
 
52
51
static gpointer emfh_parent_class;
53
52
#define emfh ((EMFormatHook *)eph)
103
102
}
104
103
 
105
104
static struct _EMFormatHookItem *
106
 
emfh_construct_item (EPluginHook *eph, EMFormatHookGroup *group, xmlNodePtr root)
 
105
emfh_construct_item (EPluginHook *eph,
 
106
                     EMFormatHookGroup *group,
 
107
                     xmlNodePtr root)
107
108
{
108
109
        struct _EMFormatHookItem *item;
109
110
 
130
131
}
131
132
 
132
133
static struct _EMFormatHookGroup *
133
 
emfh_construct_group (EPluginHook *eph, xmlNodePtr root)
 
134
emfh_construct_group (EPluginHook *eph,
 
135
                      xmlNodePtr root)
134
136
{
135
137
        struct _EMFormatHookGroup *group;
136
138
        xmlNodePtr node;
161
163
}
162
164
 
163
165
static gint
164
 
emfh_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root)
 
166
emfh_construct (EPluginHook *eph,
 
167
                EPlugin *ep,
 
168
                xmlNodePtr root)
165
169
{
166
170
        xmlNodePtr node;
167
171
 
183
187
                                    && (klass = g_hash_table_lookup (emfh_types, group->id))) {
184
188
                                        GSList *l = group->items;
185
189
 
186
 
                                        for (;l;l=g_slist_next (l)) {
 
190
                                        for (; l; l = g_slist_next (l)) {
187
191
                                                EMFormatHookItem *item = l->data;
188
192
                                                /* TODO: only add handlers if enabled? */
189
193
                                                /* Well, disabling is handled by the callback,
209
213
}
210
214
 
211
215
static void
212
 
emfh_enable (EPluginHook *eph, gint state)
 
216
emfh_enable (EPluginHook *eph,
 
217
             gint state)
213
218
{
214
219
        GSList *g, *l;
215
220
        EMFormatClass *klass;
218
223
        if (emfh_types == NULL)
219
224
                return;
220
225
 
221
 
        for (;g;g=g_slist_next (g)) {
 
226
        for (; g; g = g_slist_next (g)) {
222
227
                struct _EMFormatHookGroup *group = g->data;
223
228
 
224
229
                klass = g_hash_table_lookup (emfh_types, group->id);
225
 
                for (l=group->items;l;l=g_slist_next (l)) {
 
230
                for (l = group->items; l; l = g_slist_next (l)) {
226
231
                        EMFormatHookItem *item = l->data;
227
232
 
228
233
                        if (state)
234
239
}
235
240
 
236
241
static void
237
 
emfh_finalise (GObject *o)
 
242
emfh_finalize (GObject *o)
238
243
{
239
244
        EPluginHook *eph = (EPluginHook *) o;
240
245
 
247
252
static void
248
253
emfh_class_init (EPluginHookClass *klass)
249
254
{
250
 
        ((GObjectClass *) klass)->finalize = emfh_finalise;
 
255
        ((GObjectClass *) klass)->finalize = emfh_finalize;
251
256
        klass->construct = emfh_construct;
252
257
        klass->enable = emfh_enable;
253
258
        klass->id = "org.gnome.evolution.mail.format:1.0";