X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-account-mgr-helpers.h;h=e649d04e1304c7e4f88ab846150de5470b7f51da;hb=3fd0a78294445622ec284044bf465bed079c1c49;hp=d122dafb08e59a152e3970ba092ce78fc9a2d969;hpb=5024de84b7959b0b3373176d8c1f91a73427ff88;p=modest diff --git a/src/modest-account-mgr-helpers.h b/src/modest-account-mgr-helpers.h index d122daf..e649d04 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 @@ -68,38 +79,41 @@ typedef struct { ModestAccountData *modest_account_mgr_get_account_data (ModestAccountMgr *self, const gchar* name); - /** - * modest_account_mgr_free_account_data: + * modest_account_mgr_get_default_account: * @self: a ModestAccountMgr instance - * @data: a ModestAccountData instance * - * free the account data structure + * get the default account name, or NULL if none is found + * + * Returns: the default account name (as newly allocated string, which + * must be g_free'd), or NULL */ -void modest_account_mgr_free_account_data (ModestAccountMgr *self, - ModestAccountData *data); - +gchar* modest_account_mgr_get_default_account (ModestAccountMgr *self); /** - * modest_account_mgr_server_account_names: + * modest_account_mgr_get_default_account: * @self: a ModestAccountMgr instance - * @account_name: get only server accounts for @account_name, or NULL for any - * @type: get only server accounts from protocol type @type, or MODEST_PROTO_TYPE_ANY - * @proto: get only server account with protocol @proto, or NULL for any - * @only_enabled: get only enabled server accounts if TRUE + * @account: the name of an existing account * - * list all the server account names + * set the default account name (which must be valid account) * - * Returns: a newly allocated list of server account names, or NULL in case of - * error or if there are no server accounts. The caller must free the returned GSList + * Returns: TRUE if succeeded, FALSE otherwise + */ +gboolean modest_account_mgr_set_default_account (ModestAccountMgr *self, + const gchar* account); + +/** + * modest_account_mgr_free_account_data: + * @self: a ModestAccountMgr instance + * @data: a ModestAccountData instance + * + * free the account data structure */ -GSList* modest_account_mgr_search_server_accounts (ModestAccountMgr *self, - const gchar* account_name, - ModestProtocolType type, - ModestProtocol proto); +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 @@ -108,12 +122,11 @@ GSList* modest_account_mgr_search_server_accounts (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 * @@ -121,7 +134,19 @@ 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_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