e3cc541d5412e2802cbc84d4c2c0bca2ef3b729f
[modest] / src / modest-tny-account-store.h
1 /* modest-tny-account-store.h */
2 /* insert (c)/licensing information) */
3
4 #ifndef __MODEST_TNY_ACCOUNT_STORE_H__
5 #define __MODEST_TNY_ACCOUNT_STORE_H__
6
7 #include <glib-object.h>
8 #include <tny-account-store.h>
9 #include <tny-session-camel.h>
10 #include <tny-shared.h>
11
12 /* other include files */
13
14 G_BEGIN_DECLS
15
16 /* convenience macros */
17 #define MODEST_TYPE_TNY_ACCOUNT_STORE             (modest_tny_account_store_get_type())
18 #define MODEST_TNY_ACCOUNT_STORE(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_ACCOUNT_STORE,ModestTnyAccountStore))
19 #define MODEST_TNY_ACCOUNT_STORE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_ACCOUNT_STORE,ModestTnyAccountStoreClass))
20 #define MODEST_IS_TNY_ACCOUNT_STORE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_ACCOUNT_STORE))
21 #define MODEST_IS_TNY_ACCOUNT_STORE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_ACCOUNT_STORE))
22 #define MODEST_TNY_ACCOUNT_STORE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_ACCOUNT_STORE,ModestTnyAccountStoreClass))
23
24 typedef struct _ModestTnyAccountStore      ModestTnyAccountStore;
25 typedef struct _ModestTnyAccountStoreClass ModestTnyAccountStoreClass;
26 typedef TnyGetPassFunc ModestTnyGetPassFunc;
27
28 struct _ModestTnyAccountStore {
29         GObject parent;
30 };
31
32 struct _ModestTnyAccountStoreClass {
33         GObjectClass parent_class;
34
35         void (*password_requested) (ModestTnyAccountStore *self,
36                                     const gchar *account_name,
37                                     gpointer user_data);
38 };
39
40 /* member functions */
41
42 /**
43  * modest_tny_account_store_get_type:
44  *
45  * Returns: GType of account store
46  */
47 GType        modest_tny_account_store_get_type    (void) G_GNUC_CONST;
48
49 /**
50  * modest_tny_account_store_new:
51  * @modest_acc_mgr: account manager to use for new account store
52  *
53  * creates new (tinymail) account store for account manager modest_acc_mgr
54  *
55  * Returns: GObject of newly created account store
56  */
57 GObject*    modest_tny_account_store_new         (ModestAccountMgr *modest_acc_mgr);
58
59 /**
60  * modest_tny_account_store_get_account_mgr:
61  * @self: a TnyAccountStore instance
62  *
63  * retrieve the account manager associated with this account store.
64  *
65  * Returns: the account manager for @self.
66  */
67 ModestAccountMgr *modest_tny_account_store_get_accout_mgr(ModestTnyAccountStore *self);
68
69 /**
70  * tny_account_store_get_session:
71  * @self: a TnyAccountStore instance
72  *
73  * retrieve current tinymail camel session
74  *
75  * Returns: current tinymail camel session
76  */
77 TnySessionCamel* tny_account_store_get_session (TnyAccountStore *self);
78
79 /**
80  * tny_account_store_set_get_pass_func:
81  * @self: a TnyAccountStore instance
82  * key: a key
83  * func: a function
84  *
85  * set the password function to function
86  */
87 void
88 modest_tny_account_store_set_get_pass_func (ModestTnyAccountStore *, ModestTnyGetPassFunc);
89
90 G_END_DECLS
91
92 #endif /* __MODEST_TNY_ACCOUNT_STORE_H__ */
93