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"
35 #include "modest-marshal.h"
44 typedef struct _ModestAccountProtocolPrivate ModestAccountProtocolPrivate;
45 struct _ModestAccountProtocolPrivate {
48 TnyList *account_options;
49 GHashTable *custom_auth_mechs;
52 GHashTable *account_dialogs;
55 /* 'private'/'protected' functions */
56 static void modest_account_protocol_class_init (ModestAccountProtocolClass *klass);
57 static void modest_account_protocol_finalize (GObject *obj);
58 static void modest_account_protocol_get_property (GObject *obj,
62 static void modest_account_protocol_set_property (GObject *obj,
66 static void modest_account_protocol_instance_init (ModestAccountProtocol *obj);
68 #define MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
69 MODEST_TYPE_ACCOUNT_PROTOCOL, \
70 ModestAccountProtocolPrivate))
72 static TnyAccount *modest_account_protocol_create_account_default (ModestAccountProtocol *self);
74 static ModestAccountSettingsDialog *modest_account_protocol_create_account_settings_dialog_default (ModestAccountProtocol *self);
76 static ModestPairList* modest_account_protocol_get_easysetupwizard_tabs_default (ModestAccountProtocol *self);
78 static void modest_account_protocol_save_settings_default (ModestAccountProtocol *self,
79 ModestAccountSettingsDialog *dialog,
80 ModestAccountSettings *settings);
82 static void modest_account_protocol_save_wizard_settings_default (ModestAccountProtocol *self,
84 ModestAccountSettings *settings);
86 static ModestWizardDialogResponseOverrideFunc
87 modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self);
89 static void modest_account_protocol_check_support_default (ModestAccountProtocol *self,
90 ModestAccountProtocolCheckSupportFunc func,
92 static void modest_account_protocol_cancel_check_support_default (ModestAccountProtocol *self);
93 static void modest_account_protocol_wizard_finished_default (ModestAccountProtocol *self);
94 static gboolean modest_account_protocol_is_supported_default (ModestAccountProtocol *self);
95 static gchar *modest_account_protocol_get_from_default (ModestAccountProtocol *self,
96 const gchar *account_id,
97 const gchar *mailbox);
98 static ModestPairList *modest_account_protocol_get_from_list_default (ModestAccountProtocol *self,
99 const gchar *account_id);
100 static gchar *modest_account_protocol_get_signature_default (ModestAccountProtocol *self,
101 const gchar *account_id,
102 const gchar *mailbox,
103 gboolean *has_signature);
104 static const GdkPixbuf *modest_account_protocol_get_icon_default (ModestAccountProtocol *self,
105 ModestAccountProtocolIconType icon_type,
109 static gchar *modest_account_protocol_get_service_name_default (ModestAccountProtocol *self,
110 const gchar *account_id,
111 const gchar *mailbox);
113 static const GdkPixbuf *modest_account_protocol_get_service_icon_default (ModestAccountProtocol *self,
114 const gchar *account_id,
115 const gchar *mailbox,
117 static void modest_account_protocol_save_remote_draft_default (ModestAccountProtocol *self,
118 const gchar *account_id,
121 ModestAccountProtocolSaveRemoteDraftCallback callback,
125 static GObjectClass *parent_class = NULL;
128 modest_account_protocol_get_type (void)
130 static GType my_type = 0;
133 static const GTypeInfo my_info = {
134 sizeof(ModestAccountProtocolClass),
135 NULL, /* base init */
136 NULL, /* base finalize */
137 (GClassInitFunc) modest_account_protocol_class_init,
138 NULL, /* class finalize */
139 NULL, /* class data */
140 sizeof(ModestAccountProtocol),
142 (GInstanceInitFunc) modest_account_protocol_instance_init,
146 my_type = g_type_register_static (MODEST_TYPE_PROTOCOL,
147 "ModestAccountProtocol",
154 modest_account_protocol_class_init (ModestAccountProtocolClass *klass)
156 GObjectClass *object_class;
157 ModestAccountProtocolClass *account_class;
159 object_class = (GObjectClass *) klass;
160 account_class = MODEST_ACCOUNT_PROTOCOL_CLASS (klass);
161 parent_class = g_type_class_peek_parent (klass);
162 object_class->finalize = modest_account_protocol_finalize;
163 object_class->set_property = modest_account_protocol_set_property;
164 object_class->get_property = modest_account_protocol_get_property;
166 g_object_class_install_property (object_class,
168 g_param_spec_uint ("port",
170 _("The standard port for the protocol"),
172 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
174 g_object_class_install_property (object_class,
176 g_param_spec_uint ("alternate-port",
178 _("The alternate port for the protocol (usually used in SSL)"),
180 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
182 g_object_class_install_property (object_class,
184 g_param_spec_gtype ("account-g-type",
185 _("Account factory GType"),
186 _("Account factory GType used for creating new instances."),
188 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
190 g_type_class_add_private (object_class,
191 sizeof(ModestAccountProtocolPrivate));
193 /* Virtual methods */
194 account_class->create_account_settings_dialog =
195 modest_account_protocol_create_account_settings_dialog_default;
196 account_class->get_easysetupwizard_tabs =
197 modest_account_protocol_get_easysetupwizard_tabs_default;
198 account_class->save_settings =
199 modest_account_protocol_save_settings_default;
200 account_class->save_wizard_settings =
201 modest_account_protocol_save_wizard_settings_default;
202 account_class->create_account =
203 modest_account_protocol_create_account_default;
204 account_class->get_wizard_response_override =
205 modest_account_protocol_get_wizard_response_override_default;
206 account_class->is_supported =
207 modest_account_protocol_is_supported_default;
208 account_class->check_support =
209 modest_account_protocol_check_support_default;
210 account_class->cancel_check_support =
211 modest_account_protocol_cancel_check_support_default;
212 account_class->wizard_finished =
213 modest_account_protocol_wizard_finished_default;
214 account_class->get_from =
215 modest_account_protocol_get_from_default;
216 account_class->get_from_list =
217 modest_account_protocol_get_from_list_default;
218 account_class->get_signature =
219 modest_account_protocol_get_signature_default;
220 account_class->get_icon =
221 modest_account_protocol_get_icon_default;
222 account_class->get_service_name =
223 modest_account_protocol_get_service_name_default;
224 account_class->get_service_icon =
225 modest_account_protocol_get_service_icon_default;
226 account_class->save_remote_draft =
227 modest_account_protocol_save_remote_draft_default;
232 modest_account_protocol_instance_init (ModestAccountProtocol *obj)
234 ModestAccountProtocolPrivate *priv;
236 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (obj);
239 priv->alternate_port = 0;
240 priv->account_g_type = 0;
241 priv->account_options = tny_simple_list_new ();
242 priv->custom_auth_mechs = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
244 priv->account_dialogs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
248 remove_account (const gchar *account_name, GObject *account, GObject *account_to_remove)
250 return (account == account_to_remove);
254 account_dialog_weak_handler (ModestAccountProtocol *self, GObject *where_the_object_was)
256 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
258 g_hash_table_foreach_remove (priv->account_dialogs, (GHRFunc) remove_account, where_the_object_was);
262 dialogs_remove (const gchar *account_name, GObject *account_dialog, ModestAccountProtocol *self)
264 g_object_weak_unref (account_dialog, (GWeakNotify) account_dialog_weak_handler, self);
270 modest_account_protocol_finalize (GObject *obj)
272 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
273 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (protocol);
275 if (priv->account_dialogs) {
276 g_hash_table_foreach_remove (priv->account_dialogs, (GHRFunc) dialogs_remove, obj);
277 g_hash_table_destroy (priv->account_dialogs);
280 if (priv->account_options)
281 g_object_unref (priv->account_options);
282 priv->account_options = NULL;
284 if (priv->custom_auth_mechs)
285 g_hash_table_destroy (priv->custom_auth_mechs);
286 priv->custom_auth_mechs = NULL;
288 G_OBJECT_CLASS (parent_class)->finalize (obj);
292 modest_account_protocol_get_property (GObject *obj,
297 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
298 ModestAccountProtocolPrivate *priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (protocol);
300 switch (property_id) {
302 g_value_set_uint (value, priv->port);
304 case PROP_ALTERNATE_PORT:
305 g_value_set_uint (value, priv->alternate_port);
307 case PROP_ACCOUNT_G_TYPE:
308 g_value_set_gtype (value, priv->account_g_type);
311 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
317 modest_account_protocol_set_property (GObject *obj,
322 ModestAccountProtocol *protocol = MODEST_ACCOUNT_PROTOCOL (obj);
324 switch (property_id) {
326 modest_account_protocol_set_port (protocol, g_value_get_uint (value));
328 case PROP_ALTERNATE_PORT:
329 modest_account_protocol_set_alternate_port (protocol, g_value_get_uint (value));
331 case PROP_ACCOUNT_G_TYPE:
332 modest_account_protocol_set_account_g_type (protocol, g_value_get_gtype (value));
335 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
342 modest_account_protocol_new (const gchar *name, const gchar *display_name,
343 guint port, guint alternate_port,
344 GType account_g_type)
346 return g_object_new (MODEST_TYPE_ACCOUNT_PROTOCOL,
347 "display-name", display_name, "name", name,
348 "port", port, "alternate-port", alternate_port,
349 "account-g-type", account_g_type,
354 modest_account_protocol_get_port (ModestAccountProtocol *self)
356 ModestAccountProtocolPrivate *priv;
358 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
360 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
365 modest_account_protocol_set_port (ModestAccountProtocol *self,
368 ModestAccountProtocolPrivate *priv;
370 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
372 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
378 modest_account_protocol_get_alternate_port (ModestAccountProtocol *self)
380 ModestAccountProtocolPrivate *priv;
382 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
384 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
385 return priv->alternate_port;
389 modest_account_protocol_set_alternate_port (ModestAccountProtocol *self,
390 guint alternate_port)
392 ModestAccountProtocolPrivate *priv;
394 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
396 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
397 priv->alternate_port = alternate_port;
401 modest_account_protocol_get_account_g_type (ModestAccountProtocol *self)
403 ModestAccountProtocolPrivate *priv;
405 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), 0);
407 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
408 return priv->account_g_type;
412 modest_account_protocol_get_account_options (ModestAccountProtocol *self)
415 ModestAccountProtocolPrivate *priv;
417 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
418 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
420 result = tny_list_copy (priv->account_options);
426 modest_account_protocol_set_account_options (ModestAccountProtocol *self,
429 ModestAccountProtocolPrivate *priv;
431 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
432 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
434 if (priv->account_options) {
435 g_object_unref (priv->account_options);
436 priv->account_options = NULL;
438 priv->account_options = tny_list_copy (list);
442 modest_account_protocol_has_custom_secure_auth_mech (ModestAccountProtocol *self,
443 ModestProtocolType auth_protocol_type)
445 ModestAccountProtocolPrivate *priv;
447 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), FALSE);
448 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
450 return g_hash_table_lookup_extended (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type), NULL, NULL);
454 modest_account_protocol_get_custom_secure_auth_mech (ModestAccountProtocol *self,
455 ModestProtocolType auth_protocol_type)
457 ModestAccountProtocolPrivate *priv;
459 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
460 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
462 return (const gchar *) g_hash_table_lookup (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type));
466 modest_account_protocol_set_custom_secure_auth_mech (ModestAccountProtocol *self, ModestProtocolType auth_protocol_type, const gchar *secure_auth_mech)
468 ModestAccountProtocolPrivate *priv;
470 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
471 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
473 g_hash_table_replace (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type), g_strdup (secure_auth_mech));
477 modest_account_protocol_unset_custom_secure_auth_mech (ModestAccountProtocol *self, ModestProtocolType auth_protocol_type)
479 ModestAccountProtocolPrivate *priv;
481 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
482 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
484 g_hash_table_remove (priv->custom_auth_mechs, GINT_TO_POINTER (auth_protocol_type));
489 modest_account_protocol_set_account_g_type (ModestAccountProtocol *self,
490 GType account_g_type)
492 ModestAccountProtocolPrivate *priv;
494 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
496 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
497 priv->account_g_type = account_g_type;
501 modest_account_protocol_create_account_default (ModestAccountProtocol *self)
503 ModestAccountProtocolPrivate *priv;
505 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
507 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
508 if (priv->account_g_type > 0) {
509 return g_object_new (priv->account_g_type, NULL);
516 modest_account_protocol_create_account (ModestAccountProtocol *self)
518 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
520 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->create_account (self);
523 /* This is a template method for getting the account settings
524 dialog. It calls create_account_settings that must be implemented
525 by subclasses and then perform several common operations with the
527 ModestAccountSettingsDialog *
528 modest_account_protocol_get_account_settings_dialog (ModestAccountProtocol *self,
529 const gchar *account_name)
531 ModestAccountSettingsDialog *dialog;
532 ModestAccountSettings *settings;
533 ModestAccountProtocolPrivate *priv;
535 priv = MODEST_ACCOUNT_PROTOCOL_GET_PRIVATE (self);
536 dialog = g_hash_table_lookup (priv->account_dialogs, account_name);
538 if (dialog == NULL) {
540 dialog = MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->create_account_settings_dialog (self);
543 settings = modest_account_mgr_load_account_settings (modest_runtime_get_account_mgr (),
545 modest_account_settings_dialog_load_settings (dialog, settings);
547 /* Close dialog on response */
548 g_signal_connect_swapped (dialog,
550 G_CALLBACK (gtk_widget_destroy),
553 g_hash_table_insert (priv->account_dialogs, g_strdup (account_name), dialog);
554 g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) account_dialog_weak_handler, self);
561 modest_account_protocol_get_easysetupwizard_tabs (ModestAccountProtocol *self)
563 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_easysetupwizard_tabs (self);
568 modest_account_protocol_save_settings (ModestAccountProtocol *self,
569 ModestAccountSettingsDialog *dialog,
570 ModestAccountSettings *settings)
572 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->save_settings (self, dialog, settings);
576 modest_account_protocol_save_wizard_settings (ModestAccountProtocol *self,
578 ModestAccountSettings *settings)
580 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->save_wizard_settings (self, wizard_pages, settings);
583 /* Default implementations */
584 static ModestAccountSettingsDialog *
585 modest_account_protocol_create_account_settings_dialog_default (ModestAccountProtocol *self)
587 return modest_default_account_settings_dialog_new ();
590 static ModestPairList*
591 modest_account_protocol_get_easysetupwizard_tabs_default (ModestAccountProtocol *self)
593 g_warning ("You must implement get_easysetupwizard_tabs");
598 modest_account_protocol_save_settings_default (ModestAccountProtocol *self,
599 ModestAccountSettingsDialog *dialog,
600 ModestAccountSettings *settings)
602 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
603 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS_DIALOG (dialog));
604 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS (settings));
606 g_warning ("You must implement save_settings");
610 modest_account_protocol_save_wizard_settings_default (ModestAccountProtocol *self,
612 ModestAccountSettings *settings)
614 g_return_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self));
615 g_return_if_fail (wizard_pages);
616 g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS (settings));
618 g_warning ("You must implement save_wizard_settings");
621 static ModestWizardDialogResponseOverrideFunc
622 modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self)
624 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
629 ModestWizardDialogResponseOverrideFunc
630 modest_account_protocol_get_wizard_response_override (ModestAccountProtocol *self)
632 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
634 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_wizard_response_override (self);
638 modest_account_protocol_is_supported_default (ModestAccountProtocol *self)
644 modest_account_protocol_is_supported (ModestAccountProtocol *self)
646 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->is_supported (self);
650 modest_account_protocol_check_support_default (ModestAccountProtocol *self,
651 ModestAccountProtocolCheckSupportFunc func,
655 func (self, TRUE, userdata);
659 modest_account_protocol_check_support (ModestAccountProtocol *self,
660 ModestAccountProtocolCheckSupportFunc func,
663 MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->check_support (self, func, userdata);
667 modest_account_protocol_cancel_check_support_default (ModestAccountProtocol *self)
673 modest_account_protocol_cancel_check_support (ModestAccountProtocol *self)
675 MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->cancel_check_support (self);
679 modest_account_protocol_wizard_finished_default (ModestAccountProtocol *self)
685 modest_account_protocol_wizard_finished (ModestAccountProtocol *self)
687 MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->wizard_finished (self);
691 modest_account_protocol_get_from (ModestAccountProtocol *self,
692 const gchar *account_id,
693 const gchar *mailbox)
695 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_from (self, account_id, mailbox);
698 modest_account_protocol_get_from_default (ModestAccountProtocol *self,
699 const gchar *account_id,
700 const gchar *mailbox)
702 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
708 modest_account_protocol_get_from_list (ModestAccountProtocol *self,
709 const gchar *account_id)
711 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_from_list (self, account_id);
713 static ModestPairList *
714 modest_account_protocol_get_from_list_default (ModestAccountProtocol *self,
715 const gchar *account_id)
717 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
723 modest_account_protocol_get_signature (ModestAccountProtocol *self,
724 const gchar *account_id,
725 const gchar *mailbox,
726 gboolean *has_signature)
728 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_signature (self, account_id, mailbox, has_signature);
732 modest_account_protocol_get_signature_default (ModestAccountProtocol *self,
733 const gchar *account_id,
734 const gchar *mailbox,
735 gboolean *has_signature)
737 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
739 *has_signature = FALSE;
745 modest_account_protocol_get_icon (ModestAccountProtocol *self,
746 ModestAccountProtocolIconType icon_type,
750 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_icon (self, icon_type, object, icon_size);
753 static const GdkPixbuf *
754 modest_account_protocol_get_icon_default (ModestAccountProtocol *self, ModestAccountProtocolIconType icon_type,
755 GObject *object, guint icon_size)
757 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
763 modest_account_protocol_get_service_name (ModestAccountProtocol *self,
764 const gchar *account_id,
765 const gchar *mailbox)
767 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_name (self, account_id, mailbox);
771 modest_account_protocol_get_service_name_default (ModestAccountProtocol *self,
772 const gchar *account_id,
773 const gchar *mailbox)
775 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
781 modest_account_protocol_get_service_icon (ModestAccountProtocol *self,
782 const gchar *account_id,
783 const gchar *mailbox,
786 return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_icon (self, account_id, mailbox, icon_size);
789 static const GdkPixbuf *
790 modest_account_protocol_get_service_icon_default (ModestAccountProtocol *self,
791 const gchar *account_id,
792 const gchar *mailbox,
795 g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
801 modest_account_protocol_save_remote_draft (ModestAccountProtocol *self,
802 const gchar *account_id,
805 ModestAccountProtocolSaveRemoteDraftCallback callback,
808 MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->save_remote_draft (self, account_id,
814 modest_account_protocol_save_remote_draft_default (ModestAccountProtocol *self,
815 const gchar *account_id,
818 ModestAccountProtocolSaveRemoteDraftCallback callback,
822 callback (self, NULL, account_id, NULL, new_msg, old_msg, userdata);