X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-account-mgr-helpers.h;h=10402099a613e1d0a9b4cb4215dd7e232189b147;hb=9e52d4854215f97da297634959cc1e9212150c5b;hp=8d63aba317c3415565156bc41cee152d30ad7136;hpb=6ad0c7e0fbf8462c0a41c0a42bf34adbb127fe4e;p=modest diff --git a/src/modest-account-mgr-helpers.h b/src/modest-account-mgr-helpers.h index 8d63aba..1040209 100644 --- a/src/modest-account-mgr-helpers.h +++ b/src/modest-account-mgr-helpers.h @@ -32,27 +32,38 @@ #define __MODEST_ACCOUNT_MGR_HELPERS_H__ #include +#include + +#include +#include +#include G_BEGIN_DECLS typedef struct { - gchar *account_name; - gchar *hostname; - gchar *username; - ModestProtocol proto; - gchar *password; + gchar *account_name; + gchar *hostname; + gchar *username; + gchar *uri; + ModestProtocol proto; /*< The store or transport. Not ORed. */ + gchar *password; + time_t last_updated; + GSList *options; } ModestServerAccountData; typedef struct { - gchar *account_name; - gchar *display_name; - gchar *fullname; - gchar *email; - gboolean enabled; + gchar *account_name; + gchar *display_name; + gchar *fullname; + gchar *email; + gboolean is_enabled; + gboolean is_default; ModestServerAccountData *transport_account; ModestServerAccountData *store_account; } ModestAccountData; + + /** * modest_account_mgr_get_account_data: * @self: a ModestAccountMgr instance @@ -101,10 +112,8 @@ gboolean modest_account_mgr_set_default_account (ModestAccountMgr *self, void modest_account_mgr_free_account_data (ModestAccountMgr *self, ModestAccountData *data); - - /** - * modest_account_mgr_account_set_enabled + * modest_account_mgr_set_enabled * @self: a ModestAccountMgr instance * @name: the account name * @enabled: if TRUE, the account will be enabled, if FALSE, it will be disabled @@ -113,12 +122,11 @@ void modest_account_mgr_free_account_data (ModestAccountMgr *self, * * Returns: TRUE if it worked, FALSE otherwise */ -gboolean modest_account_mgr_account_set_enabled (ModestAccountMgr *self, const gchar* name, - gboolean enabled); - +gboolean modest_account_mgr_set_enabled (ModestAccountMgr *self, const gchar* name, + gboolean enabled); /** - * modest_account_mgr_account_get_enabled: + * modest_account_mgr_get_enabled: * @self: a ModestAccountMgr instance * @name: the account name to check * @@ -126,12 +134,47 @@ gboolean modest_account_mgr_account_set_enabled (ModestAccountMgr *self, const g * * Returns: TRUE if it is enabled, FALSE otherwise */ -gboolean modest_account_mgr_account_get_enabled (ModestAccountMgr *self, const gchar* name); +gboolean modest_account_mgr_get_enabled (ModestAccountMgr *self, const gchar* name); +/** + * modest_account_mgr_get_account_option: + * @self: a ModestAccountMgr instance + * @account_name: the account name to check + * @account_name: the option name to check + * + * Returns: The account option value. This must be freed with g_free(). + */ +gchar* modest_account_mgr_get_server_account_option (ModestAccountMgr *self, const gchar* account_name, const gchar* option_name); +/** + * modest_server_account_data_get_option_value: + * @self: a ModestServerAccountData instance + * @account_name: the option name to check + * + * Returns: The account option value. This must be freed with g_free(). + */ +gchar* modest_server_account_data_get_option_value (GSList* options_list, const gchar* option_name); +/** + * modest_server_account_data_get_option_bool: + * @self: a ModestServerAccountData instance + * @account_name: the option name to check + * + * Returns: Whether the account option is present. + */ +gboolean modest_server_account_data_get_option_bool (GSList* options_list, const gchar* option_name); +/** + * modest_account_mgr_get_from_string + * @self: a #ModestAccountMgr instance + * @name: the account name + * + * get the From: string for some account; ie. "Foo Bar" " + * + * Returns: the newly allocated from-string, or NULL in case of error + */ +gchar * modest_account_mgr_get_from_string (ModestAccountMgr *self, const gchar* name); G_END_DECLS