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>
39 MODEST_PROTOCOL_TRANSPORT_SENDMAIL,
40 MODEST_PROTOCOL_TRANSPORT_SMTP,
42 MODEST_PROTOCOL_STORE_POP,
43 MODEST_PROTOCOL_STORE_IMAP,
44 MODEST_PROTOCOL_STORE_MAILDIR,
45 MODEST_PROTOCOL_STORE_MBOX
46 } ModestTransportStoreProtocol;
49 MODEST_PROTOCOL_CONNECTION_NORMAL,
50 MODEST_PROTOCOL_CONNECTION_SSL,
51 MODEST_PROTOCOL_CONNECTION_TLS,
52 MODEST_PROTOCOL_CONNECTION_TLS_OP
53 } ModestConnectionProtocol;
56 MODEST_PROTOCOL_AUTH_NONE,
57 MODEST_PROTOCOL_AUTH_PASSWORD,
58 MODEST_PROTOCOL_AUTH_CRAMMD5
62 MODEST_TRANSPORT_STORE_PROTOCOL,
63 MODEST_CONNECTION_PROTOCOL,
68 typedef guint ModestProtocol;
70 #define MODEST_PROTOCOL_UNKNOWN 666
73 * modest_protocol_info_get_protocol_pair_list:
74 * @proto_type: the type of protocol you want to have
76 * return the list of <protocol,display-name>-tupels of protocols.
77 * The elements of the returned list are ModestPairs
78 * This is a convenience function for use with ModestComboBox
80 * Returns: a list of protocols. After use, it should be freed
81 * with modest_pair_list_free
83 ModestPairList* modest_protocol_info_get_protocol_pair_list (ModestProtocolType proto_type);
86 * modest_protocol_info_get_protocol_type:
87 * @name: the name of the ModestProtocol
88 * @proto_type: the type of protocol you want to have
90 * return the id of the protocol with the given name
92 * Returns: the id of the protocol or MODEST_PROTOCOL_UNKNOWN
94 ModestProtocol modest_protocol_info_get_protocol (const gchar* name, ModestProtocolType proto_type);
97 * modest_protocol_info_get_protocol_name:
98 * @proto: the protocol you are looking for
99 * @proto_type: the type of protocol you want to have
101 * return the string id of the proto (such as "imap", or "tls")
103 * Returns: string id of the proto as a constant string, that should NOT be modified or freed
105 const gchar* modest_protocol_info_get_protocol_name (ModestProtocol proto,
106 ModestProtocolType proto_type);
109 * modest_protocol_info_get_protocol_display_name:
110 * @proto: the protocol you are looking for
111 * @proto_type: the type of protocol you want to have
113 * return the string id of the proto (such as "imap", or "tls")
115 * Returns: string id of the proto as a constant string, that should NOT be modified or freed
118 const gchar* modest_protocol_info_get_protocol_display_name (ModestProtocol proto,
119 ModestProtocolType proto_type);
124 * modest_protocol_info_protocol_is_local_store:
125 * @proto: the protocol
127 * is this protocol a store protocol?
129 * Returns: TRUE if it is a local store, FALSE otherwise
132 gboolean modest_protocol_info_protocol_is_store (ModestTransportStoreProtocol proto);
136 * modest_protocol_info_protocol_is_local_store:
137 * @proto: the protocol
139 * is this protocol a local store protocol?
141 * Returns: TRUE if it is a local store, FALSE otherwise
144 gboolean modest_protocol_info_protocol_is_local_store (ModestTransportStoreProtocol proto);
148 #endif /* __MODEST_PROTOCOL_INFO_H__ */