1 /* modest-account-presets.c */
3 /* insert (c)/licensing information) */
5 #include "modest-account-presets.h"
6 /* include other impl specific header files */
8 /* 'private'/'protected' functions */
9 static void modest_account_presets_class_init (ModestAccountPresetsClass *klass);
10 static void modest_account_presets_init (ModestAccountPresets *obj);
11 static void modest_account_presets_finalize (GObject *obj);
20 typedef struct _ModestAccountPresetsPrivate ModestAccountPresetsPrivate;
21 struct _ModestAccountPresetsPrivate {
22 /* my private members go here, eg. */
23 GKeyFile *preset_file;
26 #define MODEST_ACCOUNT_PRESETS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
27 MODEST_TYPE_ACCOUNT_PRESETS, \
28 ModestAccountPresetsPrivate))
30 static GObjectClass *parent_class = NULL;
32 /* uncomment the following if you have defined any signals */
33 /* static guint signals[LAST_SIGNAL] = {0}; */
36 modest_account_presets_get_type (void)
38 static GType my_type = 0;
40 static const GTypeInfo my_info = {
41 sizeof(ModestAccountPresetsClass),
43 NULL, /* base finalize */
44 (GClassInitFunc) modest_account_presets_class_init,
45 NULL, /* class finalize */
46 NULL, /* class data */
47 sizeof(ModestAccountPresets),
49 (GInstanceInitFunc) modest_account_presets_init,
51 my_type = g_type_register_static (G_TYPE_OBJECT,
52 "ModestAccountPresets",
59 modest_account_presets_class_init (ModestAccountPresetsClass *klass)
61 GObjectClass *gobject_class;
62 gobject_class = (GObjectClass*) klass;
64 parent_class = g_type_class_peek_parent (klass);
65 gobject_class->finalize = modest_account_presets_finalize;
67 g_type_class_add_private (gobject_class, sizeof(ModestAccountPresetsPrivate));
69 klass->get_list = modest_account_presets_get_list;
70 klass->get_names = modest_account_presets_get_names;
71 klass->get_by_name = modest_account_presets_get_by_name;
72 klass->load_file = modest_account_presets_load_file;
73 /* signal definitions go here, e.g.: */
74 /* signals[MY_SIGNAL_1] = */
75 /* g_signal_new ("my_signal_1",....); */
76 /* signals[MY_SIGNAL_2] = */
77 /* g_signal_new ("my_signal_2",....); */
82 modest_account_presets_init (ModestAccountPresets *obj)
84 ModestAccountPresetsPrivate *priv = MODEST_ACCOUNT_PRESETS_GET_PRIVATE(obj);
86 priv->preset_file = g_key_file_new ();
87 priv->preset_list = NULL;
92 modest_account_presets_finalize (GObject *obj)
94 ModestAccountPresetsPrivate *priv = MODEST_ACCOUNT_PRESETS_GET_PRIVATE(obj);
96 g_object_unref (priv->preset_file);
100 modest_account_presets_new (void)
102 return G_OBJECT(g_object_new(MODEST_TYPE_ACCOUNT_PRESETS, NULL));
105 /* method implementations */
108 modest_account_presets_get_list (ModestAccountPresets *self)
114 modest_account_presets_get_names (ModestAccountPresets *self)
119 modest_account_presets_get_by_name (ModestAccountPresets *self, const gchar *name)
125 modest_account_presets_load_file (ModestAccountPresets *self, const gchar *filename)