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);
115 static GObjectClass *parent_class = NULL;
118 modest_account_protocol_get_type (void)
120 static GType my_type = 0;
123 static const GTypeInfo my_info = {
124 sizeof(ModestAccountProtocolClass),
125 NULL, /* base init */
126 NULL, /* base finalize */
127 (GClassInitFunc) modest_account_protocol_class_init,
128 NULL, /* class finalize */
129 NULL, /* class data */
130 sizeof(ModestAccountProtocol),
132 (GInstanceInitFunc) modest_account_protocol_instance_init,
136 my_type = g_type_register_static (MODEST_TYPE_PROTOCOL,
137 "ModestAccountProtocol",
144 modest_account_protocol_class_init (ModestAccountProtocolClass *klass)
146 GObjectClass *object_class;
147 ModestAccountProtocolClass *account_class;
149 object_class = (GObjectClass *) klass;
150 account_class = MODEST_ACCOUNT_PROTOCOL_CLASS (klass);
151 parent_class = g_type_class_peek_parent (klass);
152 object_class->finalize = modest_account_protocol_finalize;
153 object_class->set_property = modest_account_protocol_set_property;
154 object_class->get_property = modest_account_protocol_get_property;
156 g_object_class_install_property (object_class,
158 g_param_spec_uint ("port",
160 _("The standard port for the protocol"),
162 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
164 g_object_class_install_property (object_class,
166 g_param_spec_uint ("alternate-port",
168 _("The alternate port for the protocol (usually used in SSL)"),
170 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
172 g_object_class_install_property (object_class,
174 g_param_spec_gtype ("account-g-type",
175 _("Account factory GType"),
176 _("Account factory GType used for creating new instances."),
178 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
180 g_type_class_add_private (object_class,
181 sizeof(ModestAccountProtocolPrivate));
183 /* Virtual methods */
184 account_class->create_account_settings_dialog =
185 modest_account_protocol_create_account_settings_dialog_default;
186 account_class->get_easysetupwizard_tabs =
187 modest_account_protocol_get_easysetupwizard_tabs_default;
188 account_class->save_settings =
189 modest_account_protocol_save_settings_default;
190 account_class->save_wizard_settings =
191 modest_account_protocol_save_wizard_settings_default;
192 account_class->create_account =
193 modest_account_protocol_create_account_default;
194 account_class->get_wizard_response_override =
195 modest_account_protocol_get_wizard_response_override_default;
196 account_class->is_supported =
197 modest_account_protocol_is_supported_default;
198 account_class->check_support =
199 modest_account_protocol_check_support_default;
200 account_class->get_from =
201 modest_account_protocol_get_from_default;
202 account_class->get_from_list =
203 modest_account_protocol_get_from_list_default;
204 account_class->get_signature =
205 modest_account_protocol_get_signature_default;
206 account_class->get_icon =
207 modest_account_protocol_get_icon_default;
208 account_class->get_service_name =
209 modest_account_protocol_get_service_name_default;
210 account_class->get_service_icon =
211 modest_account_protocol_get_service_icon_default;
215 modest_account_protocol_instance_init (ModestAccountProtocol *obj)
217 ModestAccountProtocolPrivate *priv;
219 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (obj);
222 priv->alternate_port = 0;
223 priv->account_g_type = 0;
224 priv->account_options = tny_simple_list_new ();
225 priv->custom_auth_mechs = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
227 priv->account_dialogs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
231 remove_account (const gchar *account_name, GObject *account, GObject *account_to_remove)
233 return (account == account_to_remove);
237 account_dialog_weak_handler (ModestAccountProtocol *self, GObject *where_the_object_was)
239 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
241 g_hash_table_foreach_remove (priv->account_dialogs, (GHRFunc) remove_account, where_the_object_was);
245 dialogs_remove (const gchar *account_name, GObject *account_dialog, ModestAccountProtocol *self)
247 g_object_weak_unref (account_dialog, (GWeakNotify) account_dialog_weak_handler, self);
253 modest_account_protocol_finalize (GObject *obj)
255 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
256 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (protocol);
258 if (priv->account_dialogs) {
259 g_hash_table_foreach_remove (priv->account_dialogs, (GHRFunc) dialogs_remove, obj);
260 g_hash_table_destroy (priv->account_dialogs);
263 if (priv->account_options)
264 g_object_unref (priv->account_options);
265 priv->account_options = NULL;
267 if (priv->custom_auth_mechs)
268 g_hash_table_destroy (priv->custom_auth_mechs);
269 priv->custom_auth_mechs = NULL;
271 G_OBJECT_CLASS (parent_class)->finalize (obj);
275 modest_account_protocol_get_property (GObject *obj,
280 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
281 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (protocol);
283 switch (property_id) {
285 g_value_set_uint (value, priv->port);
287 case PROP_ALTERNATE_PORT:
288 g_value_set_uint (value, priv->alternate_port);
290 case PROP_ACCOUNT_G_TYPE:
291 g_value_set_gtype (value, priv->account_g_type);
294 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
300 modest_account_protocol_set_property (GObject *obj,
305 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
307 switch (property_id) {
309 modest_account_protocol_set_port (protocol, g_value_get_uint (value));
311 case PROP_ALTERNATE_PORT:
312 modest_account_protocol_set_alternate_port (protocol, g_value_get_uint (value));
314 case PROP_ACCOUNT_G_TYPE:
315 modest_account_protocol_set_account_g_type (protocol, g_value_get_gtype (value));
318 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
325 modest_account_protocol_new (const gchar *name, const gchar *display_name,
326 guint port, guint alternate_port,
327 GType account_g_type)
329 return g_object_new (MODEST_TYPE_ACCOUNT_PROTOCOL,
330 "display-name", display_name, "name", name,
331 "port", port, "alternate-port", alternate_port,
332 "account-g-type", account_g_type,
337 modest_account_protocol_get_port (ModestAccountProtocol *self)
339 ModestAccountProtocolPrivate *priv;
341 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
343 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
348 modest_account_protocol_set_port (ModestAccountProtocol *self,
351 ModestAccountProtocolPrivate *priv;
353 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
355 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
361 modest_account_protocol_get_alternate_port (ModestAccountProtocol *self)
363 ModestAccountProtocolPrivate *priv;
365 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
367 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
368 return priv->alternate_port;
372 modest_account_protocol_set_alternate_port (ModestAccountProtocol *self,
373 guint alternate_port)
375 ModestAccountProtocolPrivate *priv;
377 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
379 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
380 priv->alternate_port = alternate_port;
384 modest_account_protocol_get_account_g_type (ModestAccountProtocol *self)
386 ModestAccountProtocolPrivate *priv;
388 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
390 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
391 return priv->account_g_type;
395 modest_account_protocol_get_account_options (ModestAccountProtocol *self)
398 ModestAccountProtocolPrivate *priv;
400 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
401 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
403 result = tny_list_copy (priv->account_options);
409 modest_account_protocol_set_account_options (ModestAccountProtocol *self,
412 ModestAccountProtocolPrivate *priv;
414 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
415 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
417 if (priv->account_options) {
418 g_object_unref (priv->account_options);
419 priv->account_options = NULL;
421 priv->account_options = tny_list_copy (list);
425 modest_account_protocol_has_custom_secure_auth_mech (ModestAccountProtocol *self,
426 ModestProtocolType auth_protocol_type)
428 ModestAccountProtocolPrivate *priv;
430 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), FALSE);
431 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
433 return g_hash_table_lookup_extended (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type), NULL, NULL);
437 modest_account_protocol_get_custom_secure_auth_mech (ModestAccountProtocol *self,
438 ModestProtocolType auth_protocol_type)
440 ModestAccountProtocolPrivate *priv;
442 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
443 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
445 return (const gchar *) g_hash_table_lookup (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type));
449 modest_account_protocol_set_custom_secure_auth_mech (ModestAccountProtocol *self, ModestProtocolType auth_protocol_type, const gchar *secure_auth_mech)
451 ModestAccountProtocolPrivate *priv;
453 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
454 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
456 g_hash_table_replace (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type), g_strdup (secure_auth_mech));
460 modest_account_protocol_unset_custom_secure_auth_mech (ModestAccountProtocol *self, ModestProtocolType auth_protocol_type)
462 ModestAccountProtocolPrivate *priv;
464 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
465 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
467 g_hash_table_remove (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type));
472 modest_account_protocol_set_account_g_type (ModestAccountProtocol *self,
473 GType account_g_type)
475 ModestAccountProtocolPrivate *priv;
477 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
479 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
480 priv->account_g_type = account_g_type;
484 modest_account_protocol_create_account_default (ModestAccountProtocol *self)
486 ModestAccountProtocolPrivate *priv;
488 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
490 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
491 if (priv->account_g_type > 0) {
492 return g_object_new (priv->account_g_type, NULL);
499 modest_account_protocol_create_account (ModestAccountProtocol *self)
501 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
503 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->create_account (self);
506 /* This is a template method for getting the account settings
507 dialog. It calls create_account_settings that must be implemented
508 by subclasses and then perform several common operations with the
510 ModestAccountSettingsDialog *
511 modest_account_protocol_get_account_settings_dialog (ModestAccountProtocol *self,
512 const gchar *account_name)
514 ModestAccountSettingsDialog *dialog;
515 ModestAccountSettings *settings;
516 ModestAccountProtocolPrivate *priv;
518 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
519 dialog = g_hash_table_lookup (priv->account_dialogs, account_name);
521 if (dialog == NULL) {
523 dialog = MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->create_account_settings_dialog (self);
526 settings = modest_account_mgr_load_account_settings (modest_runtime_get_account_mgr (),
528 modest_account_settings_dialog_load_settings (dialog, settings);
530 /* Close dialog on response */
531 g_signal_connect_swapped (dialog,
533 G_CALLBACK (gtk_widget_destroy),
536 g_hash_table_insert (priv->account_dialogs, g_strdup (account_name), dialog);
537 g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) account_dialog_weak_handler, self);
544 modest_account_protocol_get_easysetupwizard_tabs (ModestAccountProtocol *self)
546 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_easysetupwizard_tabs (self);
551 modest_account_protocol_save_settings (ModestAccountProtocol *self,
552 ModestAccountSettingsDialog *dialog,
553 ModestAccountSettings *settings)
555 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->save_settings (self, dialog, settings);
559 modest_account_protocol_save_wizard_settings (ModestAccountProtocol *self,
561 ModestAccountSettings *settings)
563 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->save_wizard_settings (self, wizard_pages, settings);
566 /* Default implementations */
567 static ModestAccountSettingsDialog *
568 modest_account_protocol_create_account_settings_dialog_default (ModestAccountProtocol *self)
570 return modest_default_account_settings_dialog_new ();
573 static ModestPairList*
574 modest_account_protocol_get_easysetupwizard_tabs_default (ModestAccountProtocol *self)
576 g_warning ("You must implement get_easysetupwizard_tabs");
581 modest_account_protocol_save_settings_default (ModestAccountProtocol *self,
582 ModestAccountSettingsDialog *dialog,
583 ModestAccountSettings *settings)
585 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
586 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS_DIALOG (dialog));
587 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS (settings));
589 g_warning ("You must implement save_settings");
593 modest_account_protocol_save_wizard_settings_default (ModestAccountProtocol *self,
595 ModestAccountSettings *settings)
597 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
598 g_return_if_fail (wizard_pages);
599 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS (settings));
601 g_warning ("You must implement save_wizard_settings");
604 static ModestWizardDialogResponseOverrideFunc
605 modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self)
607 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
612 ModestWizardDialogResponseOverrideFunc
613 modest_account_protocol_get_wizard_response_override (ModestAccountProtocol *self)
615 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
617 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_wizard_response_override (self);
621 modest_account_protocol_is_supported_default (ModestAccountProtocol *self)
627 modest_account_protocol_is_supported (ModestAccountProtocol *self)
629 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->is_supported (self);
633 modest_account_protocol_check_support_default (ModestAccountProtocol *self,
634 ModestAccountProtocolCheckSupportFunc func,
638 func (self, TRUE, userdata);
642 modest_account_protocol_check_support (ModestAccountProtocol *self,
643 ModestAccountProtocolCheckSupportFunc func,
646 MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->check_support (self, func, userdata);
650 modest_account_protocol_get_from (ModestAccountProtocol *self,
651 const gchar *account_id,
652 const gchar *mailbox)
654 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_from (self, account_id, mailbox);
657 modest_account_protocol_get_from_default (ModestAccountProtocol *self,
658 const gchar *account_id,
659 const gchar *mailbox)
661 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
667 modest_account_protocol_get_from_list (ModestAccountProtocol *self,
668 const gchar *account_id)
670 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_from_list (self, account_id);
672 static ModestPairList *
673 modest_account_protocol_get_from_list_default (ModestAccountProtocol *self,
674 const gchar *account_id)
676 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
682 modest_account_protocol_get_signature (ModestAccountProtocol *self,
683 const gchar *account_id,
684 const gchar *mailbox,
685 gboolean *has_signature)
687 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_signature (self, account_id, mailbox, has_signature);
691 modest_account_protocol_get_signature_default (ModestAccountProtocol *self,
692 const gchar *account_id,
693 const gchar *mailbox,
694 gboolean *has_signature)
696 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
698 *has_signature = FALSE;
704 modest_account_protocol_get_icon (ModestAccountProtocol *self,
705 ModestAccountProtocolIconType icon_type,
709 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_icon (self, icon_type, object, icon_size);
712 static const GdkPixbuf *
713 modest_account_protocol_get_icon_default (ModestAccountProtocol *self, ModestAccountProtocolIconType icon_type,
714 GObject *object, guint icon_size)
716 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
722 modest_account_protocol_get_service_name (ModestAccountProtocol *self,
723 const gchar *account_id,
724 const gchar *mailbox)
726 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_name (self, account_id, mailbox);
730 modest_account_protocol_get_service_name_default (ModestAccountProtocol *self,
731 const gchar *account_id,
732 const gchar *mailbox)
734 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
740 modest_account_protocol_get_service_icon (ModestAccountProtocol *self,
741 const gchar *account_id,
742 const gchar *mailbox)
744 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_icon (self, account_id, mailbox);
747 static const GdkPixbuf *
748 modest_account_protocol_get_service_icon_default (ModestAccountProtocol *self,
749 const gchar *account_id,
750 const gchar *mailbox)
752 g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);