Add capability to account protocol to override wizard response
authorJose Dapena Paz <jdapena@igalia.com>
Wed, 18 Feb 2009 15:43:19 +0000 (15:43 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Wed, 18 Feb 2009 15:43:19 +0000 (15:43 +0000)
pmo-trunk-r7557

src/modest-account-protocol.c
src/modest-account-protocol.h

index 9256c02..01781e6 100644 (file)
@@ -82,6 +82,9 @@ static void modest_account_protocol_save_wizard_settings_default (ModestAccountP
                                                                  GList *wizard_pages,
                                                                  ModestAccountSettings *settings);
 
+static ModestWizardDialogResponseOverrideFunc 
+modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self);
+
 /* globals */
 static GObjectClass *parent_class = NULL;
 
@@ -162,6 +165,8 @@ modest_account_protocol_class_init (ModestAccountProtocolClass *klass)
                modest_account_protocol_save_wizard_settings_default;
        account_class->create_account =
                modest_account_protocol_create_account_default;
+       account_class->get_wizard_response_override =
+               modest_account_protocol_get_wizard_response_override_default;
 }
 
 static void
@@ -553,3 +558,20 @@ modest_account_protocol_save_wizard_settings_default (ModestAccountProtocol *sel
 
        g_warning ("You must implement save_wizard_settings");
 }
+
+static ModestWizardDialogResponseOverrideFunc
+modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self)
+{
+       g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
+
+       return NULL;
+}
+
+ModestWizardDialogResponseOverrideFunc
+modest_account_protocol_get_wizard_response_override (ModestAccountProtocol *self)
+{
+       g_return_val_if_fail (MODEST_IS_ACCOUNT_PROTOCOL (self), NULL);
+
+       return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_wizard_response_override (self);   
+}
+
index eca9b0f..cc056f0 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "widgets/modest-account-settings-dialog.h"
 #include "modest-protocol.h"
+#include "widgets/modest-wizard-dialog.h"
 #include "modest-pair.h"
 #include <tny-account.h>
 #include <tny-list.h>
@@ -64,6 +65,7 @@ struct _ModestAccountProtocolClass {
        TnyAccount * (*create_account) (ModestAccountProtocol *self);
        ModestAccountSettingsDialog* (*create_account_settings_dialog) (ModestAccountProtocol* self);
        ModestPairList* (*get_easysetupwizard_tabs) (ModestAccountProtocol* self);
+       ModestWizardDialogResponseOverrideFunc (*get_wizard_response_override) (ModestAccountProtocol *self);
        void (*save_settings) (ModestAccountProtocol *self, ModestAccountSettingsDialog *dialog, ModestAccountSettings *settings);
        void (*save_wizard_settings) (ModestAccountProtocol *self, GList *wizard_pages, ModestAccountSettings *settings);
 };
@@ -272,6 +274,18 @@ void modest_account_protocol_save_wizard_settings (ModestAccountProtocol *self,
                                                   GList *wizard_pages,
                                                   ModestAccountSettings *settings);
 
+/**
+ * modest_account_protocol_get_wizard_response_override:
+ * @self: a #ModestAccountProtocol
+ *
+ * obtains the method that should be used to override wizard response behavior when the
+ * wizard is setting up this account type.
+ *
+ * Returns: a #ModestWizardDialogResponseOverrideFunc
+ */
+ModestWizardDialogResponseOverrideFunc modest_account_protocol_get_wizard_response_override (ModestAccountProtocol *self);
+
+
 G_END_DECLS
 
 #endif /* __MODEST_ACCOUNT_PROTOCOL_H__ */