1 /* Copyright (c) 2006, Nokia Corporation
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Nokia Corporation nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 \ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef __MODEST_PROTOCOL_INFO_H__
31 #define __MODEST_PROTOCOL_INFO_H__
33 #include <modest-pair.h>
38 /** Transport and Store protocols. */
40 MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN,
41 MODEST_PROTOCOL_TRANSPORT_SENDMAIL,
42 MODEST_PROTOCOL_TRANSPORT_SMTP,
44 MODEST_PROTOCOL_STORE_POP,
45 MODEST_PROTOCOL_STORE_IMAP,
46 MODEST_PROTOCOL_STORE_MAILDIR,
47 MODEST_PROTOCOL_STORE_MBOX
48 } ModestTransportStoreProtocol;
50 /** Secure connection methods. */
52 MODEST_PROTOCOL_CONNECTION_NORMAL,
53 MODEST_PROTOCOL_CONNECTION_SSL,
54 MODEST_PROTOCOL_CONNECTION_TLS,
55 MODEST_PROTOCOL_CONNECTION_TLS_OP
56 } ModestConnectionProtocol;
58 /** Secure authentication methods. */
60 MODEST_PROTOCOL_AUTH_NONE,
61 MODEST_PROTOCOL_AUTH_PASSWORD,
62 MODEST_PROTOCOL_AUTH_CRAMMD5
69 * modest_protocol_info_get_transport_store_protocol_pair_list:
71 * return the list of <protocol,display-name>-tupels of protocols.
72 * The elements of the returned list are ModestPairs
73 * This is a convenience function for use with ModestComboBox
75 * Returns: a list of protocols. After use, it should be freed
76 * with modest_pair_list_free
79 modest_protocol_info_get_transport_store_protocol_pair_list ();
82 * modest_protocol_info_get_auth_protocol_pair_list:
84 * return the list of <protocol,display-name>-tupels of protocols.
85 * The elements of the returned list are ModestPairs
86 * This is a convenience function for use with ModestComboBox
88 * Returns: a list of protocols. After use, it should be freed
89 * with modest_pair_list_free
92 modest_protocol_info_get_auth_protocol_pair_list ();
96 * modest_protocol_info_get_connection_protocol_pair_list:
98 * return the list of <protocol,display-name>-tupels of protocols.
99 * The elements of the returned list are ModestPairs
100 * This is a convenience function for use with ModestComboBox
102 * Returns: a list of protocols. After use, it should be freed
103 * with modest_pair_list_free
106 modest_protocol_info_get_connection_protocol_pair_list ();
110 * modest_protocol_info_get_transport_store_protocol:
111 * @name: the name of the ModestTransportStoreProtocol
112 * @proto_type: the type of protocol you want to have
114 * return the id of the protocol with the given name
116 * Returns: the id of the protocol or MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN
118 ModestTransportStoreProtocol
119 modest_protocol_info_get_transport_store_protocol (const gchar* name);
122 * modest_protocol_info_get_transport_store_protocol_name:
123 * @proto: the protocol you are looking for
125 * return the string id of the proto (such as "imap", or "smtp")
127 * Returns: string id of the proto as a constant string, that should NOT be modified or freed
130 modest_protocol_info_get_transport_store_protocol_name (ModestTransportStoreProtocol proto);
133 * modest_protocol_info_get_auth_protocol_name:
134 * @proto: the protocol you are looking for
136 * return the string id of the proto (such as "password", or "cram-md5")
138 * Returns: string id of the proto as a constant string, that should NOT be modified or freed
141 modest_protocol_info_get_auth_protocol_name (ModestAuthProtocol proto);
144 * modest_protocol_get_auth_protocol_pair_list:
146 * Get the list of support authentication methods supported by modest including
147 * the display names of those.
149 * Returns: List of method/display name pairs
153 modest_protocol_info_get_auth_protocol_pair_list ();
156 * modest_protocol_info_get_auth_protocol_name:
157 * @proto: the protocol you are looking for
159 * return the string id of the proto (such as "ssl", or "tls")
161 * Returns: string id of the proto as a constant string, that should NOT be modified or freed
164 modest_protocol_info_get_connection_protocol_name (ModestAuthProtocol proto);
168 * modest_protocol_info_protocol_is_local_store:
169 * @proto: the protocol
171 * is this protocol a store protocol?
173 * Returns: TRUE if it is a local store, FALSE otherwise
176 gboolean modest_protocol_info_protocol_is_store (ModestTransportStoreProtocol proto);
180 * modest_protocol_info_protocol_is_local_store:
181 * @proto: the protocol
183 * is this protocol a local store protocol?
185 * Returns: TRUE if it is a local store, FALSE otherwise
188 gboolean modest_protocol_info_protocol_is_local_store (ModestTransportStoreProtocol proto);
192 * modest_protocol_info_is_secure:
195 * is the protocol connection secure (e.g encrypted)?
197 * Returns: TRUE if it is secure, FALSE otherwise
200 gboolean modest_protocol_info_is_secure(ModestConnectionProtocol protocol);
203 * modest_protocol_info_auth_is_secure:
206 * is the protocol authentication secure (e.g encrypted)?
208 * Returns: TRUE if it is secure, FALSE otherwise
211 gboolean modest_protocol_info_auth_is_secure(ModestAuthProtocol protocol);
215 #endif /* __MODEST_PROTOCOL_INFO_H__ */