gpointer userdata);
static void update_branding (ModestMsgViewWindow *self);
static void sync_flags (ModestMsgViewWindow *self);
+static gboolean on_handle_calendar (ModestMsgView *msgview, TnyMimePart *calendar_part,
+ GtkContainer *container, ModestMsgViewWindow *self);
static gboolean on_realize (GtkWidget *widget,
gpointer userdata);
G_CALLBACK (modest_ui_actions_on_msg_link_contextual), obj);
g_signal_connect (G_OBJECT(priv->msg_view), "limit_error",
G_CALLBACK (modest_ui_actions_on_limit_error), obj);
+ g_signal_connect (G_OBJECT(priv->msg_view), "handle_calendar",
+ G_CALLBACK (on_handle_calendar), obj);
g_signal_connect (G_OBJECT (priv->msg_view), "fetch_image",
G_CALLBACK (on_fetch_image), obj);
return FALSE;
}
+
+static gboolean
+on_handle_calendar (ModestMsgView *msgview, TnyMimePart *calendar_part, GtkContainer *container, ModestMsgViewWindow *self)
+{
+ const gchar *account_name;
+ ModestProtocolType proto_type;
+ ModestProtocol *protocol;
+ gboolean retval = FALSE;
+
+ account_name = modest_window_get_active_account (MODEST_WINDOW (self));
+
+ /* Get proto */
+ proto_type = modest_account_mgr_get_store_protocol (modest_runtime_get_account_mgr (),
+ account_name);
+ protocol =
+ modest_protocol_registry_get_protocol_by_type (modest_runtime_get_protocol_registry (),
+ proto_type);
+
+ if (MODEST_IS_ACCOUNT_PROTOCOL (protocol)) {
+ retval = modest_account_protocol_handle_calendar (MODEST_ACCOUNT_PROTOCOL (protocol), MODEST_WINDOW (self),
+ calendar_part, container);
+ }
+ return retval;
+}
TnyMsg *old_msg,
ModestAccountProtocolSaveRemoteDraftCallback callback,
gpointer userdata);
+static gboolean
+modest_account_protocol_handle_calendar_default (ModestAccountProtocol *self,
+ ModestWindow *window,
+ TnyMimePart *calendar_part,
+ GtkContainer *container);
/* globals */
static GObjectClass *parent_class = NULL;
modest_account_protocol_get_service_icon_default;
account_class->save_remote_draft =
modest_account_protocol_save_remote_draft_default;
+ account_class->handle_calendar =
+ modest_account_protocol_handle_calendar_default;
}
}
}
+gboolean
+modest_account_protocol_handle_calendar (ModestAccountProtocol *self,
+ ModestWindow *window,
+ TnyMimePart *calendar_part,
+ GtkContainer *container)
+{
+ return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->handle_calendar (self, window,
+ calendar_part, container);
+}
+
+static gboolean
+modest_account_protocol_handle_calendar_default (ModestAccountProtocol *self,
+ ModestWindow *window,
+ TnyMimePart *calendar_part,
+ GtkContainer *container)
+{
+ return FALSE;
+}
#include "widgets/modest-account-settings-dialog.h"
#include "modest-protocol.h"
+#include "widgets/modest-window.h"
#include "widgets/modest-wizard-dialog.h"
#include "modest-pair.h"
#include <tny-account.h>
TnyStatusCallback status_callback,
gpointer user_data);
+ gboolean (*handle_calendar) (ModestAccountProtocol *protocol,
+ ModestWindow *window,
+ TnyMimePart *calendar_part,
+ GtkContainer *container);
+
/* Padding for future expansions */
- void (*_reserved8) (void);
void (*_reserved9) (void);
void (*_reserved10) (void);
void (*_reserved11) (void);
TnyStatusCallback status_callback,
gpointer user_data);
+/**
+ * modest_account_protocol_handle_calendar:
+ * @self: a #ModestAccountProtocol
+ * @window: the #ModestWindow requesting to handle calendar
+ * @calendar_part: a #TnyMimePart
+ * @container: a #GtkContainer (a #GtkVBox now)
+ *
+ * Instruct the account protocol to handle a calendar mime part. The account protocol
+ * will fill @container with the controls to handle the @calendar invitation.
+ *
+ * Returns: %TRUE if account protocol handles the calendar request, %FALSE otherwise
+ */
+gboolean modest_account_protocol_handle_calendar (ModestAccountProtocol *self,
+ ModestWindow *window,
+ TnyMimePart *calendar_part,
+ GtkContainer *container);
+
G_END_DECLS