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>
37 /* NOTE: be careful to check modest-protocol-info.c
38 * if you make any changes here */
40 MODEST_PROTOCOL_UNKNOWN,
42 MODEST_PROTOCOL_TRANSPORT_SENDMAIL,
43 MODEST_PROTOCOL_TRANSPORT_SMTP,
45 MODEST_PROTOCOL_STORE_POP,
46 MODEST_PROTOCOL_STORE_IMAP,
47 MODEST_PROTOCOL_STORE_MAILDIR,
48 MODEST_PROTOCOL_STORE_MBOX,
50 MODEST_PROTOCOL_SECURITY_SSL,
51 MODEST_PROTOCOL_SECURITY_TLS,
53 MODEST_PROTOCOL_AUTH_NONE,
54 MODEST_PROTOCOL_AUTH_PASSWORD,
61 MODEST_PROTOCOL_TYPE_UNKNOWN,
62 MODEST_PROTOCOL_TYPE_TRANSPORT,
63 MODEST_PROTOCOL_TYPE_STORE,
64 MODEST_PROTOCOL_TYPE_SECURITY,
65 MODEST_PROTOCOL_TYPE_AUTH,
67 MODEST_PROTOCOL_TYPE_NUM
72 * modest_protocol_info_get_list:
73 * @type: the type of list you want, it should NOT be MODEST_PROTOCOL_TYPE_UNKNOWN
75 * return the list of protocols of the given @type.
76 * the elements of the returned list are ModestProtocols (use GPOINTER_TO_INT to get it)
78 * Returns: a list of protocols of the given @type; after use, it should be freed
79 * with g_slist_free. The elements should not be freed, as there is no memory allocated
82 GSList* modest_protocol_info_get_protocol_list (ModestProtocolType type);
86 * modest_protocol_info_get_list:
87 * @type: the type of list you want, it should NOT be MODEST_PROTOCOL_TYPE_UNKNOWN
89 * return the list of <protocol,display-name>-tupels of the given @type.
90 * the elements of the returned list are ModestPairs
91 * this is a convenience function for use with ModestComboBox
93 * Returns: a list of protocols of the given @type; after use, it should be freed
94 * with modest_pair_list_free
96 ModestPairList* modest_protocol_info_get_protocol_pair_list (ModestProtocolType type);
100 * modest_protocol_info_get_protocol_type:
101 * @proto: the ModestProtocol you'd like to query for its type
103 * return ModestProtocolType for the protocol
105 * Returns: the protocol type or MODEST_PROTOCOL_TYPE_UNKNOWN
107 ModestProtocolType modest_protocol_info_get_protocol_type (ModestProtocol proto);
111 * modest_protocol_info_get_protocol_type:
112 * @name: the name of the ModestProtocol
114 * return the id of the protocol with the given name
116 * Returns: the id of the protocol or MODEST_PROTOCOL_UNKNOWN
118 ModestProtocol modest_protocol_info_get_protocol (const gchar* name);
122 * modest_protocol_info_get_protocol_name:
123 * @proto: the protocol you are looking for
125 * return the string id of the proto (such as "imap", or "tls")
127 * Returns: string id of the proto as a constant string, that should NOT be modified or freed
129 const gchar* modest_protocol_info_get_protocol_name (ModestProtocol proto);
132 * modest_protocol_info_get_protocol_display_name:
133 * @proto: the protocol you are looking for
135 * return the string id of the proto (such as "imap", or "tls")
137 * Returns: string id of the proto as a constant string, that should NOT be modified or freed
140 const gchar* modest_protocol_info_get_protocol_display_name (ModestProtocol proto);
145 * modest_protocol_info_protocol_is_local_store:
146 * @proto: the protocol
148 * is this protocol a local store protocol?
150 * Returns: TRUE if it is a local store, FALSE otherwise
153 gboolean modest_protocol_info_protocol_is_local_store (ModestProtocol proto);
159 #endif /* __MODEST_PROTOCOL_INFO_H__ */