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-defs.h>
38 #include <modest-protocol-info.h>
42 /* convenience macros */
43 #define MODEST_TYPE_SERVER_ACCOUNT_SETTINGS (modest_server_account_settings_get_type())
44 #define MODEST_SERVER_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS,ModestServerAccountSettings))
45 #define MODEST_SERVER_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS,ModestServerAccountSettingsClass))
46 #define MODEST_IS_SERVER_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS))
47 #define MODEST_IS_SERVER_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS))
48 #define MODEST_SERVER_ACCOUNT_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_SERVER_ACCOUNT_SETTINGS,ModestServerAccountSettingsClass))
50 typedef struct _ModestServerAccountSettings ModestServerAccountSettings;
51 typedef struct _ModestServerAccountSettingsClass ModestServerAccountSettingsClass;
53 struct _ModestServerAccountSettings {
57 struct _ModestServerAccountSettingsClass {
58 GObjectClass parent_class;
63 * modest_server_account_settings_get_type:
65 * Returns: GType of the account store
67 GType modest_server_account_settings_get_type (void) G_GNUC_CONST;
70 * modest_server_account_settings_new:
72 * creates a new instance of #ModestServerAccountSettings
74 * Returns: a #ModestServerAccountSettings
76 ModestServerAccountSettings* modest_server_account_settings_new (void);
79 * modest_server_account_settings_get_hostname:
80 * @settings: a #ModestServerAccountSettings
82 * get the server hostname.
86 const gchar* modest_server_account_settings_get_hostname (ModestServerAccountSettings *settings);
89 * modest_server_account_settings_set_hostname:
90 * @settings: a #ModestServerAccountSettings
91 * @hostname: a string.
93 * set @hostname as the server hostname.
95 void modest_server_account_settings_set_hostname (ModestServerAccountSettings *settings,
96 const gchar *hostname);
99 * modest_server_account_settings_get_protocol:
100 * @settings: a #ModestServerAccountSettings
102 * get the server protocol.
104 * Returns: a #ModestTransportStoreProtocol
106 ModestTransportStoreProtocol modest_server_account_settings_get_protocol (ModestServerAccountSettings *settings);
109 * modest_server_account_settings_set_protocol:
110 * @settings: a #ModestServerAccountSettings
111 * @protocol: a #ModestTransportStoreProtocol.
115 void modest_server_account_settings_set_protocol (ModestServerAccountSettings *settings,
116 ModestTransportStoreProtocol protocol);
120 * modest_server_account_settings_get_uri:
121 * @settings: a #ModestServerAccountSettings
123 * get the uri, if any. If this is set, then all the other fields are invalid. It's only valid if protocol is %NULL.
127 const gchar *modest_server_account_settings_get_uri (ModestServerAccountSettings *settings);
130 * modest_server_account_settings_set_uri:
131 * @settings: a #ModestServerAccountSettings
134 * set @uri. When you set an @uri, then the protocol is set to %NULL. This is used for setting maildir or mbox
137 void modest_server_account_settings_set_uri (ModestServerAccountSettings *settings,
141 * modest_server_account_settings_get_port:
142 * @settings: a #ModestServerAccountSettings
144 * get the server port.
148 guint modest_server_account_settings_get_port (ModestServerAccountSettings *settings);
151 * modest_server_account_settings_set_port:
152 * @settings: a #ModestServerAccountSettings
157 void modest_server_account_settings_set_port (ModestServerAccountSettings *settings,
161 * modest_server_account_settings_get_username:
162 * @settings: a #ModestServerAccountSettings
168 const gchar *modest_server_account_settings_get_username (ModestServerAccountSettings *settings);
171 * modest_server_account_settings_set_username:
172 * @settings: a #ModestServerAccountSettings
173 * @username: a string
177 void modest_server_account_settings_set_username (ModestServerAccountSettings *settings,
178 const gchar *username);
181 * modest_server_account_settings_get_password:
182 * @settings: a #ModestServerAccountSettings
188 const gchar *modest_server_account_settings_get_password (ModestServerAccountSettings *settings);
191 * modest_server_account_settings_set_password:
192 * @settings: a #ModestServerAccountSettings
193 * @password: a string
197 void modest_server_account_settings_set_password (ModestServerAccountSettings *settings,
198 const gchar *password);
202 * modest_server_account_settings_get_security:
203 * @settings: a #ModestServerAccountSettings
205 * get the secure connection type, if any.
207 * Returns: a #ModestConnectionProtocol
209 ModestConnectionProtocol modest_server_account_settings_get_security (ModestServerAccountSettings *settings);
212 * modest_server_account_settings_set_security:
213 * @settings: a #ModestServerAccountSettings
214 * @security: a #ModestConnectionProtocol
216 * set the current security connection protocol to @security.
218 void modest_server_account_settings_set_security (ModestServerAccountSettings *settings,
219 ModestConnectionProtocol security);
223 * modest_server_account_settings_get_auth_protocol:
224 * @settings: a #ModestServerAccountSettings
226 * get the authentication protocol
228 * Returns: a #ModestAuthProtocol
230 ModestAuthProtocol modest_server_account_settings_get_auth_protocol (ModestServerAccountSettings *settings);
233 * modest_server_account_settings_set_auth_protocol:
234 * @settings: a #ModestServerAccountSettings
235 * @auth_protocol: a #ModestAuthProtocol
237 * set the current authentication protocol to @auth_protocol.
239 void modest_server_account_settings_set_auth_protocol (ModestServerAccountSettings *settings,
240 ModestAuthProtocol auth_protocol);
243 * modest_server_account_settings_get_account_name:
244 * @settings: a #ModestServerAccountSettings
246 * get the #ModestAccountMgr account name for these settings, or
247 * %NULL if it's not in the manager.
249 * Returns: a string, or %NULL
251 const gchar *modest_server_account_settings_get_account_name (ModestServerAccountSettings *settings);
254 * modest_server_account_settings_set_account_name:
255 * @settings: a #ModestServerAccountSettings
256 * @account_name: a string
258 * sets the account name that will be used to store the account settings. This should
259 * only be called from #ModestAccountMgr and #ModestAccountSettings.
261 void modest_server_account_settings_set_account_name (ModestServerAccountSettings *settings,
262 const gchar *account_name);
267 #endif /* __MODEST_SERVER_ACCOUNT_SETTINGS_H__ */