X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-protocol-info.h;h=dc1d2c0ebdab54c02d95b9d74df5b5f051fcbc61;hp=6683536b40394c8c01132c3d7bc2cc981673ff5a;hb=74e08db4fa22d92bdd87f31bde34b076248ece1e;hpb=4cb4c045267ce527e256baedd0f4c304f54cbdda diff --git a/src/modest-protocol-info.h b/src/modest-protocol-info.h index 6683536..dc1d2c0 100644 --- a/src/modest-protocol-info.h +++ b/src/modest-protocol-info.h @@ -35,7 +35,9 @@ G_BEGIN_DECLS +/** Transport and Store protocols. */ typedef enum { + MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN, MODEST_PROTOCOL_TRANSPORT_SENDMAIL, MODEST_PROTOCOL_TRANSPORT_SMTP, @@ -44,7 +46,8 @@ typedef enum { MODEST_PROTOCOL_STORE_MAILDIR, MODEST_PROTOCOL_STORE_MBOX } ModestTransportStoreProtocol; - + +/** Secure connection methods. */ typedef enum { MODEST_PROTOCOL_CONNECTION_NORMAL, MODEST_PROTOCOL_CONNECTION_SSL, @@ -52,26 +55,48 @@ typedef enum { MODEST_PROTOCOL_CONNECTION_TLS_OP } ModestConnectionProtocol; +/** Secure authentication methods. */ typedef enum { MODEST_PROTOCOL_AUTH_NONE, MODEST_PROTOCOL_AUTH_PASSWORD, MODEST_PROTOCOL_AUTH_CRAMMD5 } ModestAuthProtocol; -typedef enum { - MODEST_TRANSPORT_STORE_PROTOCOL, - MODEST_CONNECTION_PROTOCOL, - MODEST_AUTH_PROTOCOL -} ModestProtocolType; -typedef guint ModestProtocol; -#define MODEST_PROTOCOL_UNKNOWN 666 +/** + * modest_protocol_info_get_transport_store_protocol_pair_list: + * + * return the list of -tupels of protocols. + * The elements of the returned list are ModestPairs + * This is a convenience function for use with ModestComboBox + * + * Returns: a list of protocols. After use, it should be freed + * with modest_pair_list_free + */ +ModestPairList* +modest_protocol_info_get_transport_store_protocol_pair_list (); + +/** + * modest_protocol_info_get_supported_store_protocol_pair_list: + * + * return the list of -tuples of + * store protocols. + * The elements of the returned list are ModestPairs + * This is a convenience function for use with ModestComboBox + * + * In this case it only returns the UI exposed protocols for + * storage (IMAP, POP3). + * + * Returns: a list of protocols. After use, it should be freed + * with modest_pair_list_free + */ +ModestPairList* +modest_protocol_info_get_supported_store_protocol_pair_list (); /** - * modest_protocol_info_get_protocol_pair_list: - * @proto_type: the type of protocol you want to have + * modest_protocol_info_get_auth_protocol_pair_list: * * return the list of -tupels of protocols. * The elements of the returned list are ModestPairs @@ -80,44 +105,92 @@ typedef guint ModestProtocol; * Returns: a list of protocols. After use, it should be freed * with modest_pair_list_free */ -ModestPairList* modest_protocol_info_get_protocol_pair_list (ModestProtocolType proto_type); +ModestPairList* modest_protocol_info_get_auth_protocol_pair_list (void); + +/** + * modest_protocol_info_get_connection_protocol_pair_list: + * + * return the list of -tupels of protocols. + * The elements of the returned list are ModestPairs + * This is a convenience function for use with ModestComboBox + * + * Returns: a list of protocols. After use, it should be freed + * with modest_pair_list_free + */ +ModestPairList* modest_protocol_info_get_connection_protocol_pair_list (void); + + /** - * modest_protocol_info_get_protocol_type: - * @name: the name of the ModestProtocol - * @proto_type: the type of protocol you want to have + * modest_protocol_info_get_transport_store_protocol: + * @name: the name of the #ModestTransportStoreProtocol * * return the id of the protocol with the given name * - * Returns: the id of the protocol or MODEST_PROTOCOL_UNKNOWN + * Returns: the id of the protocol or MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN */ -ModestProtocol modest_protocol_info_get_protocol (const gchar* name, ModestProtocolType proto_type); +ModestTransportStoreProtocol modest_protocol_info_get_transport_store_protocol (const gchar* name); /** - * modest_protocol_info_get_protocol_name: + * modest_protocol_info_get_auth_protocol: + * @name: The name of the #ModestAuthProtocol + * + * Returns the ID of the protocol with the given name + * + * Returns: The ID of the protocol or MODEST_PROTOCOL_AUTH_NONE + */ +ModestAuthProtocol modest_protocol_info_get_auth_protocol (const gchar* name); + +/** + * modest_protocol_info_get_connection_protocol: + * @name: The name of the #ModestConnectionProtocol + * + * Returns the ID of the protocol with the given name + * + * Returns: The ID of the protocol or MODEST_CONNECTION_PROTOCOL_NORMAL + */ +ModestConnectionProtocol modest_protocol_info_get_connection_protocol (const gchar* name); + +/** + * modest_protocol_info_get_transport_store_protocol_name: * @proto: the protocol you are looking for - * @proto_type: the type of protocol you want to have * - * return the string id of the proto (such as "imap", or "tls") + * return the string id of the proto (such as "imap", or "smtp") * * Returns: string id of the proto as a constant string, that should NOT be modified or freed */ -const gchar* modest_protocol_info_get_protocol_name (ModestProtocol proto, - ModestProtocolType proto_type); +const gchar* modest_protocol_info_get_transport_store_protocol_name (ModestTransportStoreProtocol proto); /** - * modest_protocol_info_get_protocol_display_name: + * modest_protocol_info_get_auth_protocol_name: * @proto: the protocol you are looking for - * @proto_type: the type of protocol you want to have - * - * return the string id of the proto (such as "imap", or "tls") + * + * return the string id of the proto (such as "password", or "cram-md5") * * Returns: string id of the proto as a constant string, that should NOT be modified or freed + */ +const gchar* modest_protocol_info_get_auth_protocol_name (ModestAuthProtocol proto); + +/* + * modest_protocol_get_auth_protocol_pair_list: + * + * Get the list of support authentication methods supported by modest including + * the display names of those. * + * Returns: List of method/display name pairs */ -const gchar* modest_protocol_info_get_protocol_display_name (ModestProtocol proto, - ModestProtocolType proto_type); +ModestPairList* modest_protocol_info_get_auth_protocol_pair_list (void); +/** + * modest_protocol_info_get_auth_protocol_name: + * @proto: the protocol you are looking for + * + * return the string id of the proto (such as "ssl", or "tls") + * + * Returns: string id of the proto as a constant string, that should NOT be modified or freed + */ +const gchar* +modest_protocol_info_get_connection_protocol_name (ModestAuthProtocol proto); /** @@ -144,6 +217,29 @@ gboolean modest_protocol_info_protocol_is_store (ModestTransportStoreProtocol pr gboolean modest_protocol_info_protocol_is_local_store (ModestTransportStoreProtocol proto); +/** + * modest_protocol_info_is_secure: + * @protocol + * + * is the protocol connection secure (e.g encrypted)? + * + * Returns: TRUE if it is secure, FALSE otherwise + * + */ +gboolean modest_protocol_info_is_secure(ModestConnectionProtocol protocol); + +/** + * modest_protocol_info_auth_is_secure: + * @protocol + * + * is the protocol authentication secure (e.g encrypted)? + * + * Returns: TRUE if it is secure, FALSE otherwise + * + */ +gboolean modest_protocol_info_auth_is_secure(ModestAuthProtocol protocol); + + G_END_DECLS #endif /* __MODEST_PROTOCOL_INFO_H__ */