1 /* Copyright (c) 2008, 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 #include <tny-simple-list.h>
31 #include "modest-account-protocol.h"
32 #include "modest-account-mgr-helpers.h"
33 #include "widgets/modest-default-account-settings-dialog.h"
34 #include "modest-runtime.h"
43 typedef struct _ModestAccountProtocolPrivate ModestAccountProtocolPrivate;
44 struct _ModestAccountProtocolPrivate {
47 TnyList *account_options;
48 GHashTable *custom_auth_mechs;
51 GHashTable *account_dialogs;
54 /* 'private'/'protected' functions */
55 static void modest_account_protocol_class_init (ModestAccountProtocolClass *klass);
56 static void modest_account_protocol_finalize (GObject *obj);
57 static void modest_account_protocol_get_property (GObject *obj,
61 static void modest_account_protocol_set_property (GObject *obj,
65 static void modest_account_protocol_instance_init (ModestAccountProtocol *obj);
67 #define MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
68 MODEST_TYPE_ACCOUNT_PROTOCOL, \
69 ModestAccountProtocolPrivate))
71 static TnyAccount *modest_account_protocol_create_account_default (ModestAccountProtocol *self);
73 static ModestAccountSettingsDialog *modest_account_protocol_create_account_settings_dialog_default (ModestAccountProtocol *self);
75 static ModestPairList* modest_account_protocol_get_easysetupwizard_tabs_default (ModestAccountProtocol *self);
77 static void modest_account_protocol_save_settings_default (ModestAccountProtocol *self,
78 ModestAccountSettingsDialog *dialog,
79 ModestAccountSettings *settings);
81 static void modest_account_protocol_save_wizard_settings_default (ModestAccountProtocol *self,
83 ModestAccountSettings *settings);
85 static ModestWizardDialogResponseOverrideFunc
86 modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self);
88 static void modest_account_protocol_check_support_default (ModestAccountProtocol *self,
89 ModestAccountProtocolCheckSupportFunc func,
91 static gboolean modest_account_protocol_is_supported_default (ModestAccountProtocol *self);
92 static gchar *modest_account_protocol_get_from_default (ModestAccountProtocol *self,
93 const gchar *account_id,
94 const gchar *mailbox);
95 static ModestPairList *modest_account_protocol_get_from_list_default (ModestAccountProtocol *self,
96 const gchar *account_id);
97 static gchar *modest_account_protocol_get_signature_default (ModestAccountProtocol *self,
98 const gchar *account_id,
100 gboolean *has_signature);
101 static const GdkPixbuf *modest_account_protocol_get_icon_default (ModestAccountProtocol *self,
102 ModestAccountProtocolIconType icon_type,
106 static gchar *modest_account_protocol_get_service_name_default (ModestAccountProtocol *self,
107 const gchar *account_id,
108 const gchar *mailbox);
110 static const GdkPixbuf *modest_account_protocol_get_service_icon_default (ModestAccountProtocol *self,
111 const gchar *account_id,
112 const gchar *mailbox,
116 static GObjectClass *parent_class = NULL;
119 modest_account_protocol_get_type (void)
121 static GType my_type = 0;
124 static const GTypeInfo my_info = {
125 sizeof(ModestAccountProtocolClass),
126 NULL, /* base init */
127 NULL, /* base finalize */
128 (GClassInitFunc) modest_account_protocol_class_init,
129 NULL, /* class finalize */
130 NULL, /* class data */
131 sizeof(ModestAccountProtocol),
133 (GInstanceInitFunc) modest_account_protocol_instance_init,
137 my_type = g_type_register_static (MODEST_TYPE_PROTOCOL,
138 "ModestAccountProtocol",
145 modest_account_protocol_class_init (ModestAccountProtocolClass *klass)
147 GObjectClass *object_class;
148 ModestAccountProtocolClass *account_class;
150 object_class = (GObjectClass *) klass;
151 account_class = MODEST_ACCOUNT_PROTOCOL_CLASS (klass);
152 parent_class = g_type_class_peek_parent (klass);
153 object_class->finalize = modest_account_protocol_finalize;
154 object_class->set_property = modest_account_protocol_set_property;
155 object_class->get_property = modest_account_protocol_get_property;
157 g_object_class_install_property (object_class,
159 g_param_spec_uint ("port",
161 _("The standard port for the protocol"),
163 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
165 g_object_class_install_property (object_class,
167 g_param_spec_uint ("alternate-port",
169 _("The alternate port for the protocol (usually used in SSL)"),
171 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
173 g_object_class_install_property (object_class,
175 g_param_spec_gtype ("account-g-type",
176 _("Account factory GType"),
177 _("Account factory GType used for creating new instances."),
179 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
181 g_type_class_add_private (object_class,
182 sizeof(ModestAccountProtocolPrivate));
184 /* Virtual methods */
185 account_class->create_account_settings_dialog =
186 modest_account_protocol_create_account_settings_dialog_default;
187 account_class->get_easysetupwizard_tabs =
188 modest_account_protocol_get_easysetupwizard_tabs_default;
189 account_class->save_settings =
190 modest_account_protocol_save_settings_default;
191 account_class->save_wizard_settings =
192 modest_account_protocol_save_wizard_settings_default;
193 account_class->create_account =
194 modest_account_protocol_create_account_default;
195 account_class->get_wizard_response_override =
196 modest_account_protocol_get_wizard_response_override_default;
197 account_class->is_supported =
198 modest_account_protocol_is_supported_default;
199 account_class->check_support =
200 modest_account_protocol_check_support_default;
201 account_class->get_from =
202 modest_account_protocol_get_from_default;
203 account_class->get_from_list =
204 modest_account_protocol_get_from_list_default;
205 account_class->get_signature =
206 modest_account_protocol_get_signature_default;
207 account_class->get_icon =
208 modest_account_protocol_get_icon_default;
209 account_class->get_service_name =
210 modest_account_protocol_get_service_name_default;
211 account_class->get_service_icon =
212 modest_account_protocol_get_service_icon_default;
216 modest_account_protocol_instance_init (ModestAccountProtocol *obj)
218 ModestAccountProtocolPrivate *priv;
220 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (obj);
223 priv->alternate_port = 0;
224 priv->account_g_type = 0;
225 priv->account_options = tny_simple_list_new ();
226 priv->custom_auth_mechs = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
228 priv->account_dialogs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
232 remove_account (const gchar *account_name, GObject *account, GObject *account_to_remove)
234 return (account == account_to_remove);
238 account_dialog_weak_handler (ModestAccountProtocol *self, GObject *where_the_object_was)
240 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
242 g_hash_table_foreach_remove (priv->account_dialogs, (GHRFunc) remove_account, where_the_object_was);
246 dialogs_remove (const gchar *account_name, GObject *account_dialog, ModestAccountProtocol *self)
248 g_object_weak_unref (account_dialog, (GWeakNotify) account_dialog_weak_handler, self);
254 modest_account_protocol_finalize (GObject *obj)
256 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
257 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (protocol);
259 if (priv->account_dialogs) {
260 g_hash_table_foreach_remove (priv->account_dialogs, (GHRFunc) dialogs_remove, obj);
261 g_hash_table_destroy (priv->account_dialogs);
264 if (priv->account_options)
265 g_object_unref (priv->account_options);
266 priv->account_options = NULL;
268 if (priv->custom_auth_mechs)
269 g_hash_table_destroy (priv->custom_auth_mechs);
270 priv->custom_auth_mechs = NULL;
272 G_OBJECT_CLASS (parent_class)->finalize (obj);
276 modest_account_protocol_get_property (GObject *obj,
281 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
282 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (protocol);
284 switch (property_id) {
286 g_value_set_uint (value, priv->port);
288 case PROP_ALTERNATE_PORT:
289 g_value_set_uint (value, priv->alternate_port);
291 case PROP_ACCOUNT_G_TYPE:
292 g_value_set_gtype (value, priv->account_g_type);
295 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
301 modest_account_protocol_set_property (GObject *obj,
306 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
308 switch (property_id) {
310 modest_account_protocol_set_port (protocol, g_value_get_uint (value));
312 case PROP_ALTERNATE_PORT:
313 modest_account_protocol_set_alternate_port (protocol, g_value_get_uint (value));
315 case PROP_ACCOUNT_G_TYPE:
316 modest_account_protocol_set_account_g_type (protocol, g_value_get_gtype (value));
319 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
326 modest_account_protocol_new (const gchar *name, const gchar *display_name,
327 guint port, guint alternate_port,
328 GType account_g_type)
330 return g_object_new (MODEST_TYPE_ACCOUNT_PROTOCOL,
331 "display-name", display_name, "name", name,
332 "port", port, "alternate-port", alternate_port,
333 "account-g-type", account_g_type,
338 modest_account_protocol_get_port (ModestAccountProtocol *self)
340 ModestAccountProtocolPrivate *priv;
342 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
344 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
349 modest_account_protocol_set_port (ModestAccountProtocol *self,
352 ModestAccountProtocolPrivate *priv;
354 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
356 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
362 modest_account_protocol_get_alternate_port (ModestAccountProtocol *self)
364 ModestAccountProtocolPrivate *priv;
366 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
368 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
369 return priv->alternate_port;
373 modest_account_protocol_set_alternate_port (ModestAccountProtocol *self,
374 guint alternate_port)
376 ModestAccountProtocolPrivate *priv;
378 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
380 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
381 priv->alternate_port = alternate_port;
385 modest_account_protocol_get_account_g_type (ModestAccountProtocol *self)
387 ModestAccountProtocolPrivate *priv;
389 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
391 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
392 return priv->account_g_type;
396 modest_account_protocol_get_account_options (ModestAccountProtocol *self)
399 ModestAccountProtocolPrivate *priv;
401 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
402 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
404 result = tny_list_copy (priv->account_options);
410 modest_account_protocol_set_account_options (ModestAccountProtocol *self,
413 ModestAccountProtocolPrivate *priv;
415 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
416 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
418 if (priv->account_options) {
419 g_object_unref (priv->account_options);
420 priv->account_options = NULL;
422 priv->account_options = tny_list_copy (list);
426 modest_account_protocol_has_custom_secure_auth_mech (ModestAccountProtocol *self,
427 ModestProtocolType auth_protocol_type)
429 ModestAccountProtocolPrivate *priv;
431 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), FALSE);
432 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
434 return g_hash_table_lookup_extended (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type), NULL, NULL);
438 modest_account_protocol_get_custom_secure_auth_mech (ModestAccountProtocol *self,
439 ModestProtocolType auth_protocol_type)
441 ModestAccountProtocolPrivate *priv;
443 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
444 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
446 return (const gchar *) g_hash_table_lookup (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type));
450 modest_account_protocol_set_custom_secure_auth_mech (ModestAccountProtocol *self, ModestProtocolType auth_protocol_type, const gchar *secure_auth_mech)
452 ModestAccountProtocolPrivate *priv;
454 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
455 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
457 g_hash_table_replace (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type), g_strdup (secure_auth_mech));
461 modest_account_protocol_unset_custom_secure_auth_mech (ModestAccountProtocol *self, ModestProtocolType auth_protocol_type)
463 ModestAccountProtocolPrivate *priv;
465 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
466 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
468 g_hash_table_remove (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type));
473 modest_account_protocol_set_account_g_type (ModestAccountProtocol *self,
474 GType account_g_type)
476 ModestAccountProtocolPrivate *priv;
478 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
480 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
481 priv->account_g_type = account_g_type;
485 modest_account_protocol_create_account_default (ModestAccountProtocol *self)
487 ModestAccountProtocolPrivate *priv;
489 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
491 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
492 if (priv->account_g_type > 0) {
493 return g_object_new (priv->account_g_type, NULL);
500 modest_account_protocol_create_account (ModestAccountProtocol *self)
502 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
504 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->create_account (self);
507 /* This is a template method for getting the account settings
508 dialog. It calls create_account_settings that must be implemented
509 by subclasses and then perform several common operations with the
511 ModestAccountSettingsDialog *
512 modest_account_protocol_get_account_settings_dialog (ModestAccountProtocol *self,
513 const gchar *account_name)
515 ModestAccountSettingsDialog *dialog;
516 ModestAccountSettings *settings;
517 ModestAccountProtocolPrivate *priv;
519 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
520 dialog = g_hash_table_lookup (priv->account_dialogs, account_name);
522 if (dialog == NULL) {
524 dialog = MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->create_account_settings_dialog (self);
527 settings = modest_account_mgr_load_account_settings (modest_runtime_get_account_mgr (),
529 modest_account_settings_dialog_load_settings (dialog, settings);
531 /* Close dialog on response */
532 g_signal_connect_swapped (dialog,
534 G_CALLBACK (gtk_widget_destroy),
537 g_hash_table_insert (priv->account_dialogs, g_strdup (account_name), dialog);
538 g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) account_dialog_weak_handler, self);
545 modest_account_protocol_get_easysetupwizard_tabs (ModestAccountProtocol *self)
547 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_easysetupwizard_tabs (self);
552 modest_account_protocol_save_settings (ModestAccountProtocol *self,
553 ModestAccountSettingsDialog *dialog,
554 ModestAccountSettings *settings)
556 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->save_settings (self, dialog, settings);
560 modest_account_protocol_save_wizard_settings (ModestAccountProtocol *self,
562 ModestAccountSettings *settings)
564 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->save_wizard_settings (self, wizard_pages, settings);
567 /* Default implementations */
568 static ModestAccountSettingsDialog *
569 modest_account_protocol_create_account_settings_dialog_default (ModestAccountProtocol *self)
571 return modest_default_account_settings_dialog_new ();
574 static ModestPairList*
575 modest_account_protocol_get_easysetupwizard_tabs_default (ModestAccountProtocol *self)
577 g_warning ("You must implement get_easysetupwizard_tabs");
582 modest_account_protocol_save_settings_default (ModestAccountProtocol *self,
583 ModestAccountSettingsDialog *dialog,
584 ModestAccountSettings *settings)
586 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
587 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS_DIALOG (dialog));
588 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS (settings));
590 g_warning ("You must implement save_settings");
594 modest_account_protocol_save_wizard_settings_default (ModestAccountProtocol *self,
596 ModestAccountSettings *settings)
598 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
599 g_return_if_fail (wizard_pages);
600 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS (settings));
602 g_warning ("You must implement save_wizard_settings");
605 static ModestWizardDialogResponseOverrideFunc
606 modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self)
608 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
613 ModestWizardDialogResponseOverrideFunc
614 modest_account_protocol_get_wizard_response_override (ModestAccountProtocol *self)
616 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
618 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_wizard_response_override (self);
622 modest_account_protocol_is_supported_default (ModestAccountProtocol *self)
628 modest_account_protocol_is_supported (ModestAccountProtocol *self)
630 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->is_supported (self);
634 modest_account_protocol_check_support_default (ModestAccountProtocol *self,
635 ModestAccountProtocolCheckSupportFunc func,
639 func (self, TRUE, userdata);
643 modest_account_protocol_check_support (ModestAccountProtocol *self,
644 ModestAccountProtocolCheckSupportFunc func,
647 MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->check_support (self, func, userdata);
651 modest_account_protocol_get_from (ModestAccountProtocol *self,
652 const gchar *account_id,
653 const gchar *mailbox)
655 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_from (self, account_id, mailbox);
658 modest_account_protocol_get_from_default (ModestAccountProtocol *self,
659 const gchar *account_id,
660 const gchar *mailbox)
662 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
668 modest_account_protocol_get_from_list (ModestAccountProtocol *self,
669 const gchar *account_id)
671 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_from_list (self, account_id);
673 static ModestPairList *
674 modest_account_protocol_get_from_list_default (ModestAccountProtocol *self,
675 const gchar *account_id)
677 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
683 modest_account_protocol_get_signature (ModestAccountProtocol *self,
684 const gchar *account_id,
685 const gchar *mailbox,
686 gboolean *has_signature)
688 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_signature (self, account_id, mailbox, has_signature);
692 modest_account_protocol_get_signature_default (ModestAccountProtocol *self,
693 const gchar *account_id,
694 const gchar *mailbox,
695 gboolean *has_signature)
697 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
699 *has_signature = FALSE;
705 modest_account_protocol_get_icon (ModestAccountProtocol *self,
706 ModestAccountProtocolIconType icon_type,
710 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_icon (self, icon_type, object, icon_size);
713 static const GdkPixbuf *
714 modest_account_protocol_get_icon_default (ModestAccountProtocol *self, ModestAccountProtocolIconType icon_type,
715 GObject *object, guint icon_size)
717 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
723 modest_account_protocol_get_service_name (ModestAccountProtocol *self,
724 const gchar *account_id,
725 const gchar *mailbox)
727 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_name (self, account_id, mailbox);
731 modest_account_protocol_get_service_name_default (ModestAccountProtocol *self,
732 const gchar *account_id,
733 const gchar *mailbox)
735 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
741 modest_account_protocol_get_service_icon (ModestAccountProtocol *self,
742 const gchar *account_id,
743 const gchar *mailbox,
746 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_icon (self, account_id, mailbox, icon_size);
749 static const GdkPixbuf *
750 modest_account_protocol_get_service_icon_default (ModestAccountProtocol *self,
751 const gchar *account_id,
752 const gchar *mailbox,
755 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);