1 /* Copyright (c) 2007, 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.
31 /* modest-server-account-settings.h */
33 #ifndef __MODEST_SERVER_ACCOUNT_SETTINGS_H__
34 #define __MODEST_SERVER_ACCOUNT_SETTINGS_H__
36 #include <glib-object.h>
37 #include <modest-protocol.h>
41 /* convenience macros */
42 #define MODEST_TYPE_SERVER_ACCOUNT_SETTINGS (modest_server_account_settings_get_type())
43 #define MODEST_SERVER_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS,ModestServerAccountSettings))
44 #define MODEST_SERVER_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS,ModestServerAccountSettingsClass))
45 #define MODEST_IS_SERVER_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS))
46 #define MODEST_IS_SERVER_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS))
47 #define MODEST_SERVER_ACCOUNT_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS,ModestServerAccountSettingsClass))
49 typedef struct _ModestServerAccountSettings ModestServerAccountSettings;
50 typedef struct _ModestServerAccountSettingsClass ModestServerAccountSettingsClass;
52 struct _ModestServerAccountSettings {
56 struct _ModestServerAccountSettingsClass {
57 GObjectClass parent_class;
62 * modest_server_account_settings_get_type:
64 * Returns: GType of the account store
66 GType modest_server_account_settings_get_type (void) G_GNUC_CONST;
69 * modest_server_account_settings_new:
71 * creates a new instance of #ModestServerAccountSettings
73 * Returns: a #ModestServerAccountSettings
75 ModestServerAccountSettings* modest_server_account_settings_new (void);
78 * modest_server_account_settings_get_hostname:
79 * @settings: a #ModestServerAccountSettings
81 * get the server hostname.
85 const gchar* modest_server_account_settings_get_hostname (ModestServerAccountSettings *settings);
88 * modest_server_account_settings_set_hostname:
89 * @settings: a #ModestServerAccountSettings
90 * @hostname: a string.
92 * set @hostname as the server hostname.
94 void modest_server_account_settings_set_hostname (ModestServerAccountSettings *settings,
95 const gchar *hostname);
98 * modest_server_account_settings_get_protocol:
99 * @settings: a #ModestServerAccountSettings
101 * get the server protocol.
103 * Returns: a #ModestProtocolType
105 ModestProtocolType modest_server_account_settings_get_protocol (ModestServerAccountSettings *settings);
108 * modest_server_account_settings_set_protocol:
109 * @settings: a #ModestServerAccountSettings
110 * @protocol: a #ModestProtocolType
114 void modest_server_account_settings_set_protocol (ModestServerAccountSettings *settings,
115 ModestProtocolType protocol_type);
119 * modest_server_account_settings_get_uri:
120 * @settings: a #ModestServerAccountSettings
122 * get the uri, if any. If this is set, then all the other fields are invalid. It's only valid if protocol is %NULL.
126 const gchar *modest_server_account_settings_get_uri (ModestServerAccountSettings *settings);
129 * modest_server_account_settings_set_uri:
130 * @settings: a #ModestServerAccountSettings
133 * set @uri. When you set an @uri, then the protocol is set to %MODEST_PROTOCOL_REGISTRY_TYPE_INVALID. This is used for setting maildir or mbox
136 void modest_server_account_settings_set_uri (ModestServerAccountSettings *settings,
140 * modest_server_account_settings_get_port:
141 * @settings: a #ModestServerAccountSettings
143 * get the server port.
147 guint modest_server_account_settings_get_port (ModestServerAccountSettings *settings);
150 * modest_server_account_settings_set_port:
151 * @settings: a #ModestServerAccountSettings
156 void modest_server_account_settings_set_port (ModestServerAccountSettings *settings,
160 * modest_server_account_settings_get_username:
161 * @settings: a #ModestServerAccountSettings
167 const gchar *modest_server_account_settings_get_username (ModestServerAccountSettings *settings);
170 * modest_server_account_settings_set_username:
171 * @settings: a #ModestServerAccountSettings
172 * @username: a string
176 void modest_server_account_settings_set_username (ModestServerAccountSettings *settings,
177 const gchar *username);
180 * modest_server_account_settings_get_password:
181 * @settings: a #ModestServerAccountSettings
187 const gchar *modest_server_account_settings_get_password (ModestServerAccountSettings *settings);
190 * modest_server_account_settings_set_password:
191 * @settings: a #ModestServerAccountSettings
192 * @password: a string
196 void modest_server_account_settings_set_password (ModestServerAccountSettings *settings,
197 const gchar *password);
201 * modest_server_account_settings_get_security_protocol:
202 * @settings: a #ModestServerAccountSettings
204 * get the secure connection type, if any.
206 * Returns: a #ModestProtocolType
208 ModestProtocolType modest_server_account_settings_get_security_protocol (ModestServerAccountSettings *settings);
211 * modest_server_account_settings_set_security_protocol:
212 * @settings: a #ModestServerAccountSettings
213 * @security: a #ModestProtocolType
215 * set the current security connection protocol to @security.
217 void modest_server_account_settings_set_security_protocol (ModestServerAccountSettings *settings,
218 ModestProtocolType security_protocol);
222 * modest_server_account_settings_get_auth_protocol:
223 * @settings: a #ModestServerAccountSettings
225 * get the authentication protocol
227 * Returns: a #ModestProtocolType
229 ModestProtocolType modest_server_account_settings_get_auth_protocol (ModestServerAccountSettings *settings);
232 * modest_server_account_settings_set_auth_protocol:
233 * @settings: a #ModestServerAccountSettings
234 * @auth_protocol: a #ModestProtocolType
236 * set the current authentication protocol to @auth_protocol.
238 void modest_server_account_settings_set_auth_protocol (ModestServerAccountSettings *settings,
239 ModestProtocolType auth_protocol);
242 * modest_server_account_settings_get_account_name:
243 * @settings: a #ModestServerAccountSettings
245 * get the #ModestAccountMgr account name for these settings, or
246 * %NULL if it's not in the manager.
248 * Returns: a string, or %NULL
250 const gchar *modest_server_account_settings_get_account_name (ModestServerAccountSettings *settings);
253 * modest_server_account_settings_set_account_name:
254 * @settings: a #ModestServerAccountSettings
255 * @account_name: a string
257 * sets the account name that will be used to store the account settings. This should
258 * only be called from #ModestAccountMgr and #ModestAccountSettings.
260 void modest_server_account_settings_set_account_name (ModestServerAccountSettings *settings,
261 const gchar *account_name);
266 #endif /* __MODEST_SERVER_ACCOUNT_SETTINGS_H__ */