Add account preset object draft.
[modest] / experimental / accountpresets / modest-account-presets.h
1 /* modest-account-presets.h */
2 /* insert (c)/licensing information) */
3
4 #ifndef __MODEST_ACCOUNT_PRESETS_H__
5 #define __MODEST_ACCOUNT_PRESETS_H__
6
7 #include <glib-object.h>
8 /* other include files */
9
10 G_BEGIN_DECLS
11
12 /* convenience macros */
13 #define MODEST_TYPE_ACCOUNT_PRESETS             (modest_account_presets_get_type())
14 #define MODEST_ACCOUNT_PRESETS(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_ACCOUNT_PRESETS,ModestAccountPresets))
15 #define MODEST_ACCOUNT_PRESETS_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_ACCOUNT_PRESETS,GObject))
16 #define MODEST_IS_ACCOUNT_PRESETS(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_ACCOUNT_PRESETS))
17 #define MODEST_IS_ACCOUNT_PRESETS_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_ACCOUNT_PRESETS))
18 #define MODEST_ACCOUNT_PRESETS_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_ACCOUNT_PRESETS,ModestAccountPresetsClass))
19
20 typedef struct _ModestAccountPresets      ModestAccountPresets;
21 typedef struct _ModestAccountPresetsClass ModestAccountPresetsClass;
22
23 typedef struct _ModestPreset      ModestPreset;
24
25 struct _ModestAccountPresets {
26         GObject parent;
27         /* public members */
28         gint count;     /* number of available presets */
29 };
30
31 struct _ModestAccountPresetsClass {
32         GObjectClass parent_class;
33         GList * (* get_list) (ModestAccountPresets *self);
34         GList * (* get_names) (ModestAccountPresets *self);
35         ModestPreset * (* get_by_name) (ModestAccountPresets *self, const gchar *name);
36         gboolean (* load_file) (ModestAccountPresets *self, const gchar *filename);
37 };
38
39 /* data type to hold an account preset dataset */
40 struct _ModestPreset {
41         gchar *name;
42         gchar *transport_server;
43         gchar *storage_server;
44         gint transport_port;
45         gint storage_port;
46         /* add security stuff */
47         gchar *note;
48 };
49
50 /* member functions */
51 GType        modest_account_presets_get_type    (void) G_GNUC_CONST;
52
53 /* typical parameter-less _new function */
54 GObject*    modest_account_presets_new         (void);
55
56 /* public methods */
57 GList *modest_account_presets_get_list (ModestAccountPresets *self);
58 GList *modest_account_presets_get_names (ModestAccountPresets *self);
59 ModestPreset *modest_account_presets_get_by_name (ModestAccountPresets *self, const gchar *name);
60 gboolean modest_account_presets_load_file (ModestAccountPresets *self, const gchar *filename);
61
62
63 G_END_DECLS
64
65 #endif /* __MODEST_ACCOUNT_PRESETS_H__ */