X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-account-protocol.h;h=8a513c352dbc805f400217ae9335a324eec93214;hp=ef7ac2756d39f7c9b14c4a1294f60921a74273ab;hb=c712ba618d30859f259b2b4286023fcbeb7e32ed;hpb=8882009413d13c0c3e807c9dc256a3e44750e32d diff --git a/src/modest-account-protocol.h b/src/modest-account-protocol.h index ef7ac27..8a513c3 100644 --- a/src/modest-account-protocol.h +++ b/src/modest-account-protocol.h @@ -53,6 +53,9 @@ G_BEGIN_DECLS typedef struct _ModestAccountProtocol ModestAccountProtocol; typedef struct _ModestAccountProtocolClass ModestAccountProtocolClass; +typedef void (*ModestAccountProtocolCheckSupportFunc) (ModestAccountProtocol *self, + gboolean supported, gpointer userdata); + struct _ModestAccountProtocol { ModestProtocol parent; @@ -69,6 +72,10 @@ struct _ModestAccountProtocolClass { void (*save_settings) (ModestAccountProtocol *self, ModestAccountSettingsDialog *dialog, ModestAccountSettings *settings); void (*save_wizard_settings) (ModestAccountProtocol *self, GList *wizard_pages, ModestAccountSettings *settings); gboolean (*is_supported) (ModestAccountProtocol *self); + void (*check_support) (ModestAccountProtocol *self, ModestAccountProtocolCheckSupportFunc func, gpointer userdata); + gchar * (*get_from) (ModestAccountProtocol *self, const gchar *account_id, const gchar *mailbox); + ModestPairList * (*get_from_list) (ModestAccountProtocol *self, const gchar *account_id); + gchar * (*get_signature) (ModestAccountProtocol *self, const gchar *account_id, const gchar *mailbox, gboolean *has_signature); }; /** @@ -286,6 +293,23 @@ void modest_account_protocol_save_wizard_settings (ModestAccountProtocol *self, */ ModestWizardDialogResponseOverrideFunc modest_account_protocol_get_wizard_response_override (ModestAccountProtocol *self); + +/** + * modest_account_protocol_check_support: + * @self: a #ModestAccountProtocol + * @func: a #ModestAccountProtocolCheckSupportFunc + * @userdata: a gpointer + * + * This method checks asynchronously if the account protocol @self is + * supported. Once checked, @func will be called with the result in the + * mainloop. + * + * modest_account_protocol_is_supported() should return the cached response + * from this method. + */ +void modest_account_protocol_check_support (ModestAccountProtocol *self, + ModestAccountProtocolCheckSupportFunc func, + gpointer userdata); /** * modest_account_protocol_is_supported: * @self: a #ModestAccountProtocol @@ -296,6 +320,49 @@ ModestWizardDialogResponseOverrideFunc modest_account_protocol_get_wizard_respon */ gboolean modest_account_protocol_is_supported (ModestAccountProtocol *self); +/** + * modest_account_protocol_get_from: + * @self: a #ModestAccountProtocol + * @account_id: a transport account name + * @mailbox: a mailbox + * + * Obtain the From: string for the account and mailbox. Should be used only + * with transports with multi mailbox support. + * + * Returns: a newly allocated string + */ +gchar *modest_account_protocol_get_from (ModestAccountProtocol *self, + const gchar *account_id, + const gchar *mailbox); + +/** + * modest_account_protocol_get_from_list: + * @self: a #ModestAccountProtocol + * @account_id: a transport account name + * + * Obtain a list of pairs (mailbox - From: string) for filling the From picker. + * + * Returns: a ModestPairList + */ +ModestPairList *modest_account_protocol_get_from_list (ModestAccountProtocol *self, + const gchar *account_id); + +/** + * modest_account_protocol_get_signature: + * @self: a #ModestAccountProtocol + * @account_id: a transport account name + * @mailbox: a mailbox + * + * Obtain the signature string for the account and mailbox. Should be used only + * with transports with multi mailbox support. + * + * Returns: a newly allocated string + */ +gchar *modest_account_protocol_get_signature (ModestAccountProtocol *self, + const gchar *account_id, + const gchar *mailbox, + gboolean *has_signature); + G_END_DECLS #endif /* __MODEST_ACCOUNT_PROTOCOL_H__ */