2007-05-15 Murray Cumming <murrayc@murrayc.com>
[modest] / src / modest-protocol-info.h
index 6683536..52e9737 100644 (file)
@@ -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,31 @@ 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 <protocol,display-name>-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_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 <protocol,display-name>-tupels of protocols.
  * The elements of the returned list are ModestPairs
@@ -80,44 +88,68 @@ 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 ();
+
 
 /**
- * modest_protocol_info_get_protocol_type:
- * @name: the name of the  ModestProtocol
+ * modest_protocol_info_get_connection_protocol_pair_list:
+ * 
+ * return the list of <protocol,display-name>-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 ();
+       
+       
+/**
+ * modest_protocol_info_get_transport_store_protocol:
+ * @name: the name of the  ModestTransportStoreProtocol
  * @proto_type: the type of protocol you want to have
  *
  * 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_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_protocol_display_name (ModestProtocol proto,
-                                                            ModestProtocolType proto_type);
+const gchar*
+modest_protocol_info_get_auth_protocol_name (ModestAuthProtocol proto);
 
+/**
+ * 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);
 
 
 /**