[evolution-data-server/email-factory-3-4: 12/12] Completes most of the integration. Now Evolution compiles without any regression of features.



commit bb98ac04d71ffc65fa472688106deb97b3955a7a
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Thu Oct 13 12:40:36 2011 +0530

    Completes most of the integration. Now Evolution compiles without any
    regression of features.

 mail/daemon/Makefile.am                    |    2 -
 mail/daemon/e-dbus-manager.c               |  173 ++++++++++++++++++++++++++++
 mail/daemon/e-dbus-manager.h               |   46 ++++++++
 mail/daemon/utils.c                        |   47 ++++++++
 mail/daemon/utils.h                        |   22 ++++
 mail/libegdbus/Makefile.am                 |    1 -
 mail/libemail-engine/Makefile.am           |   19 +++-
 mail/libemail-engine/e-mail-session.c      |   38 ++++++
 mail/libemail-engine/e-mail-store.c        |   16 +--
 mail/libemail-engine/libemail-engine.pc.in |    2 +-
 mail/libemail-utils/Makefile.am            |    3 +-
 mail/libemail-utils/mail-mt.c              |   54 +++++++++-
 mail/libemail-utils/mail-mt.h              |   14 +++
 13 files changed, 416 insertions(+), 21 deletions(-)
---
diff --git a/mail/daemon/Makefile.am b/mail/daemon/Makefile.am
index 53c7376..436f34c 100644
--- a/mail/daemon/Makefile.am
+++ b/mail/daemon/Makefile.am
@@ -24,7 +24,6 @@ test_email_client_LDADD = \
 		$(top_builddir)/mail/libemail-utils/libemail-utils.la	\
 		$(top_builddir)/mail/libegdbus/libegdbus-mail.la	\
 		$(top_builddir)/camel/libcamel-1.2.la			\
-		$(top_builddir)/camel/libcamel-provider-1.2.la		\
 		$(top_builddir)/libedataserver/libedataserver-1.2.la	\
 		$(top_builddir)/libedataserverui/libedataserverui-3.0.la	\
 		$(GNOME_PLATFORM_LIBS)	\
@@ -45,7 +44,6 @@ evolution_mail_factory_LDADD = \
 		$(CAMEL_LIBS)		\
 		$(GNOME_PLATFORM_LIBS)	\
 		$(top_builddir)/camel/libcamel-1.2.la			\
-		$(top_builddir)/camel/libcamel-provider-1.2.la		\
 		$(top_builddir)/libedataserver/libedataserver-1.2.la	\
 		$(top_builddir)/libedataserverui/libedataserverui-3.0.la	\
 		$(top_builddir)/mail/libemail-utils/libemail-utils.la	\
diff --git a/mail/daemon/e-dbus-manager.c b/mail/daemon/e-dbus-manager.c
new file mode 100644
index 0000000..186e353
--- /dev/null
+++ b/mail/daemon/e-dbus-manager.c
@@ -0,0 +1,173 @@
+/* e-dbus-manager.c */
+
+#include "e-dbus-manager.h"
+#include "e-mail-data-session.h"
+#include <gio/gio.h>
+
+#define E_MAIL_DATA_FACTORY_SERVICE_NAME \
+	"org.gnome.evolution.dataserver.Mail"
+
+
+G_DEFINE_TYPE (EDBusManager, e_dbus_manager, G_TYPE_OBJECT)
+
+#define MANAGER_PRIVATE(o) \
+  (G_TYPE_INSTANCE_GET_PRIVATE ((o), EDBUS_TYPE_MANAGER, EDBusManagerPrivate))
+
+typedef struct _EDBusManagerPrivate EDBusManagerPrivate;
+
+/* This needs to be global ala the CamelSession*/
+EMailDataSession *data_session;
+
+struct _EDBusManagerPrivate
+{
+	guint owner_id;	
+
+	GMutex *books_lock;
+	/* A hash of object paths for book URIs to EDataBooks */
+	GHashTable *books;
+
+	GMutex *connections_lock;
+	/* This is a hash of client addresses to GList* of EDataBooks */
+	GHashTable *connections;
+
+	guint exit_timeout;	
+};
+
+/* Convenience function to print an error and exit */
+G_GNUC_NORETURN static void
+die (const gchar *prefix, GError *error)
+{
+	g_error("%s: %s", prefix, error->message);
+	g_error_free (error);
+	exit(1);
+}
+
+static void
+e_dbus_manager_get_property (GObject *object, guint property_id,
+                              GValue *value, GParamSpec *pspec)
+{
+  switch (property_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+e_dbus_manager_set_property (GObject *object, guint property_id,
+                              const GValue *value, GParamSpec *pspec)
+{
+  switch (property_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+e_dbus_manager_dispose (GObject *object)
+{
+  G_OBJECT_CLASS (e_dbus_manager_parent_class)->dispose (object);
+}
+
+static void
+e_dbus_manager_finalize (GObject *object)
+{
+  G_OBJECT_CLASS (e_dbus_manager_parent_class)->finalize (object);
+}
+
+static void
+e_dbus_manager_class_init (EDBusManagerClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  g_type_class_add_private (klass, sizeof (EDBusManagerPrivate));
+
+  object_class->get_property = e_dbus_manager_get_property;
+  object_class->set_property = e_dbus_manager_set_property;
+  object_class->dispose = e_dbus_manager_dispose;
+  object_class->finalize = e_dbus_manager_finalize;
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+                 const gchar     *name,
+                 gpointer         user_data)
+{
+	EDBusManager *manager = user_data;
+	EDBusManagerPrivate *priv = MANAGER_PRIVATE(manager);
+	guint registration_id;
+	GError *error = NULL;
+
+	registration_id = e_mail_data_session_register_gdbus_object (
+		data_session,
+		connection,
+		"/org/gnome/evolution/dataserver/Mail/Session",
+		&error);
+
+	if (error)
+		die ("Failed to register a Mail Session object", error);
+
+	g_assert (registration_id > 0);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+              const gchar     *name,
+              gpointer         user_data)
+{
+	EDBusManager *manager = user_data;
+	EDBusManagerPrivate *priv = MANAGER_PRIVATE(manager);
+
+	e_mail_data_session_release (data_session, connection, name);
+#if 0
+	g_mutex_lock (factory->priv->connections_lock);
+	while (g_hash_table_lookup_extended (
+		factory->priv->connections, name,
+		(gpointer) &key, (gpointer) &list)) {
+		GList *copy = g_list_copy (list);
+
+		/* this should trigger the book's weak ref notify
+		 * function, which will remove it from the list before
+		 * it's freed, and will remove the connection from
+		 * priv->connections once they're all gone */
+		g_list_foreach (copy, remove_data_book_cb, NULL);
+		g_list_free (copy);
+	}
+
+	g_mutex_unlock (factory->priv->connections_lock);
+#endif	
+}
+
+static void
+e_dbus_manager_init (EDBusManager *self)
+{
+	EDBusManagerPrivate *priv = MANAGER_PRIVATE(self);
+
+	data_session = e_mail_data_session_new ();
+
+	priv->owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+				E_MAIL_DATA_FACTORY_SERVICE_NAME,
+				G_BUS_NAME_OWNER_FLAGS_NONE,
+				on_bus_acquired,
+				on_name_acquired,
+				on_name_lost,
+				self,
+				NULL);
+			
+}
+
+EDBusManager*
+e_dbus_manager_new (void)
+{
+  return g_object_new (EDBUS_TYPE_MANAGER, NULL);
+}
+
+
diff --git a/mail/daemon/e-dbus-manager.h b/mail/daemon/e-dbus-manager.h
new file mode 100644
index 0000000..4c64a94
--- /dev/null
+++ b/mail/daemon/e-dbus-manager.h
@@ -0,0 +1,46 @@
+/* e-dbus-manager.h */
+
+#ifndef _E_DBUS_MANAGER_H
+#define _E_DBUS_MANAGER_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define EDBUS_TYPE_MANAGER e_dbus_manager_get_type()
+
+#define EDBUS_MANAGER(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+  EDBUS_TYPE_MANAGER, EDBusManager))
+
+#define EDBUS_MANAGER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), \
+  EDBUS_TYPE_MANAGER, EDBusManagerClass))
+
+#define EDBUS_IS_MANAGER(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+  EDBUS_TYPE_MANAGER))
+
+#define EDBUS_IS_MANAGER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+  EDBUS_TYPE_MANAGER))
+
+#define EDBUS_MANAGER_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+  EDBUS_TYPE_MANAGER, EDBusManagerClass))
+
+typedef struct {
+  GObject parent;
+} EDBusManager;
+
+typedef struct {
+  GObjectClass parent_class;
+} EDBusManagerClass;
+
+GType e_dbus_manager_get_type (void);
+
+EDBusManager* e_dbus_manager_new (void);
+
+G_END_DECLS
+
+#endif /* _E_DBUS_MANAGER_H */
diff --git a/mail/daemon/utils.c b/mail/daemon/utils.c
new file mode 100644
index 0000000..a1fcaea
--- /dev/null
+++ b/mail/daemon/utils.c
@@ -0,0 +1,47 @@
+
+#include <string.h>
+#include <glib.h>
+#include "utils.h"
+
+/* 
+ * EDS_MAIL_DEBUG should be a CSV
+ * export EDS_MAIL_DEBUG=folder,store,session,micro,ipc
+ * */
+
+static int mail_debug_flag = 0;
+
+void
+mail_debug_init ()
+{
+	const char *log = g_getenv ("EDS_MAIL_DEBUG");
+	char **tokens;
+
+	if (log && *log) {
+		int i=0;
+		tokens = g_strsplit (log, ",", 0);
+		
+		while (tokens[i]) {
+			if (strcmp (tokens[i], "folder") == 0)
+				mail_debug_flag |= EMAIL_DEBUG_FOLDER;
+			else if (strcmp (tokens[i], "store") == 0)
+				mail_debug_flag |= EMAIL_DEBUG_STORE;
+			else if (strcmp (tokens[i], "session") == 0)
+				mail_debug_flag |= EMAIL_DEBUG_SESSION;
+			else if (strcmp (tokens[i], "micro") == 0)
+				mail_debug_flag |= EMAIL_DEBUG_MICRO;		
+			else if (strcmp (tokens[i], "ipc") == 0)
+				mail_debug_flag |= EMAIL_DEBUG_IPC;						
+			else if (strcmp(tokens[i], "all") == 0)
+				mail_debug_flag |= EMAIL_DEBUG_SESSION|EMAIL_DEBUG_STORE|EMAIL_DEBUG_STORE|EMAIL_DEBUG_MICRO|EMAIL_DEBUG_IPC;
+			i++;
+		}
+
+		g_strfreev (tokens);
+	}
+}
+
+gboolean
+mail_debug_log (EMailDebugFlag flag)
+{
+	return (mail_debug_flag & flag) != 0;
+}
diff --git a/mail/daemon/utils.h b/mail/daemon/utils.h
new file mode 100644
index 0000000..bdd2387
--- /dev/null
+++ b/mail/daemon/utils.h
@@ -0,0 +1,22 @@
+
+
+#ifndef UTILS_H
+#define UTILS_H
+
+G_BEGIN_DECLS
+
+typedef enum {
+	EMAIL_DEBUG_FOLDER=1,
+	EMAIL_DEBUG_STORE=2,
+	EMAIL_DEBUG_SESSION=3,
+	EMAIL_DEBUG_IPC=4,
+	EMAIL_DEBUG_MICRO=5
+} EMailDebugFlag;
+
+void mail_debug_init (void);
+gboolean mail_debug_log (EMailDebugFlag flag);
+
+G_END_DECLS
+
+#endif /* UTILS_H */
+
diff --git a/mail/libegdbus/Makefile.am b/mail/libegdbus/Makefile.am
index 9f6d030..4e310e0 100644
--- a/mail/libegdbus/Makefile.am
+++ b/mail/libegdbus/Makefile.am
@@ -10,7 +10,6 @@ libegdbus_mail_la_SOURCES =
 
 libegdbus_mail_la_LIBADD =			\
 	$(top_builddir)/camel/libcamel-1.2.la			\
-	$(top_builddir)/camel/libcamel-provider-1.2.la			\
 	$(top_builddir)/libedataserver/libedataserver-1.2.la
 	
 
diff --git a/mail/libemail-engine/Makefile.am b/mail/libemail-engine/Makefile.am
index c7d24c5..0e363f9 100644
--- a/mail/libemail-engine/Makefile.am
+++ b/mail/libemail-engine/Makefile.am
@@ -16,7 +16,6 @@ libemail_engine_la_LIBADD = 	\
 		$(EMAIL_ENGINE_LIBS)	\
 		$(GNOME_PLATFORM_LIBS)	\
 		$(top_builddir)/camel/libcamel-1.2.la			\
-		$(top_builddir)/camel/libcamel-provider-1.2.la			\
 		$(top_builddir)/libebackend/libebackend-1.2.la		\
 		$(top_builddir)/libedataserver/libedataserver-1.2.la		\
 		$(top_builddir)/libedataserverui/libedataserverui-3.0.la		\
@@ -39,10 +38,22 @@ libemail_engine_la_SOURCES = 	\
 		e-mail-session.c	\
 		e-mail-store.c
 
-libmailengineincludedir = $(includedir)/libemail-engine
+libmailengineincludedir = $(privincludedir)/libemail-engine
 libmailengineinclude_HEADERS = 	\
-		e-mail-session.h		\
-		mail-folder-cache.h		
+		e-mail-session.h	\
+		e-mail-enums.h		\
+		mail-folder-cache.h	\
+		e-mail-local.h		\
+		e-mail-folder-utils.h	\
+		e-mail-store-utils.h	\
+		mail-tools.h		\
+		e-mail-utils.h		\
+		mail-config.h		\
+		e-mail-session-utils.h	\
+		mail-ops.h		\
+		e-mail-junk-filter.h	\
+		e-mail-store.h
+
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libemail-engine.pc
diff --git a/mail/libemail-engine/e-mail-session.c b/mail/libemail-engine/e-mail-session.c
index b139278..b8a9c37 100644
--- a/mail/libemail-engine/e-mail-session.c
+++ b/mail/libemail-engine/e-mail-session.c
@@ -97,6 +97,8 @@ enum {
 
 enum {
 	FLUSH_OUTBOX,
+	STORE_ADDED,
+	STORE_REMOVED,
 	LAST_SIGNAL
 };
 
@@ -1033,6 +1035,42 @@ e_mail_session_class_init (EMailSessionClass *class)
 		g_cclosure_marshal_VOID__VOID,
 		G_TYPE_NONE, 0);
 
+	/**
+	 * EMailSession::store-added
+	 * @session: the email session
+	 * @store: the CamelStore
+	 *
+	 * Emitted when a store is added
+	 **/
+	signals[STORE_ADDED] = g_signal_new (
+		"store-added",
+		G_OBJECT_CLASS_TYPE (object_class),
+		G_SIGNAL_RUN_FIRST,
+		0, /* struct offset */
+		NULL, NULL, /* accumulator */
+		g_cclosure_marshal_VOID__OBJECT,
+		G_TYPE_NONE, 1,
+		CAMEL_TYPE_STORE);
+
+
+	/**
+	 * EMailSession::store-removed
+	 * @session: the email session
+	 * @store: the CamelStore
+	 *
+	 * Emitted when a store is removed 
+	 **/
+	signals[STORE_REMOVED] = g_signal_new (
+		"store-removed",
+		G_OBJECT_CLASS_TYPE (object_class),
+		G_SIGNAL_RUN_FIRST,
+		0, /* struct offset */
+		NULL, NULL, /* accumulator */
+		g_cclosure_marshal_VOID__OBJECT,
+		G_TYPE_NONE, 1,
+		CAMEL_TYPE_STORE);
+
+
 }
 
 static void
diff --git a/mail/libemail-engine/e-mail-store.c b/mail/libemail-engine/e-mail-store.c
index d8d4029..db5b94e 100644
--- a/mail/libemail-engine/e-mail-store.c
+++ b/mail/libemail-engine/e-mail-store.c
@@ -197,11 +197,10 @@ mail_store_add (EMailSession *session,
 
 	g_hash_table_insert (store_table, store, store_info);
 
-	// FIXME: Launch a signal to indicate if we have to launch this
-
-	if (special_mail_store_is_enabled (store)) {}
-	/*	em_folder_tree_model_add_store (default_model, store);
-	*/
+	if (special_mail_store_is_enabled (store)) {
+		/* Listen to this in evolution and add to the folder tree model. */
+		g_signal_emit_by_name (session, "store-added", store);
+	}
 
 	mail_folder_cache_note_store (
 		folder_cache, CAMEL_SESSION (session), store, NULL,
@@ -409,11 +408,8 @@ e_mail_store_remove (EMailSession *session,
 	folder_cache = e_mail_session_get_folder_cache (session);
 	mail_folder_cache_note_store_remove (folder_cache, store);
 
-	//FIXME: Launch a signal to remove this from the folder tree model
-	/*
-	default_model = em_folder_tree_model_get_default ();
-	em_folder_tree_model_remove_store (default_model, store);
-	*/
+	g_signal_emit_by_name (session, "store-removed", store);
+
 	mail_disconnect_store (store);
 
 	g_object_unref (store);
diff --git a/mail/libemail-engine/libemail-engine.pc.in b/mail/libemail-engine/libemail-engine.pc.in
index 384147b..006a9ce 100644
--- a/mail/libemail-engine/libemail-engine.pc.in
+++ b/mail/libemail-engine/libemail-engine.pc.in
@@ -11,5 +11,5 @@ Name: libemail-utils
 Description: Client library for evolution mail
 Version: @VERSION@
 Requires: camel-1.2 libedataserver-1.2 gio-2.0
-Libs: -L${libdir} -lemail-utils
+Libs: -L${libdir} -lemail-engine
 Cflags: -I${privincludedir}
diff --git a/mail/libemail-utils/Makefile.am b/mail/libemail-utils/Makefile.am
index d39d328..5d5184a 100644
--- a/mail/libemail-utils/Makefile.am
+++ b/mail/libemail-utils/Makefile.am
@@ -18,7 +18,6 @@ libemail_utils_la_LIBADD = 	\
 		$(CAMEL_LIBS)		\
 		$(GNOME_PLATFORM_LIBS)	\
 		$(top_builddir)/camel/libcamel-1.2.la			\
-		$(top_builddir)/camel/libcamel-provider-1.2.la			\
 		$(top_builddir)/libedataserver/libedataserver-1.2.la
 
 libemail_utils_la_LDFLAGS = 
@@ -33,7 +32,7 @@ libemail_utils_la_SOURCES = 	\
 		gconf-bridge.c
 
 
-libmailutilsincludedir = $(includedir)/libemail-utils
+libmailutilsincludedir = $(privincludedir)/libemail-utils
 libmailutilsinclude_HEADERS = 	\
 		e-marshal.h	\
 		e-account-utils.h	\
diff --git a/mail/libemail-utils/mail-mt.c b/mail/libemail-utils/mail-mt.c
index b93ea82..4c3ee34 100644
--- a/mail/libemail-utils/mail-mt.c
+++ b/mail/libemail-utils/mail-mt.c
@@ -44,6 +44,29 @@ static GHashTable *mail_msg_active_table;
 static GMutex *mail_msg_lock;
 static GCond *mail_msg_cond;
 
+static MailMsgCreateActivityFunc create_activity = NULL;
+static MailMsgSubmitActivityFunc submit_acitivity = NULL;
+static MailMsgFreeActivityFunc free_activity = NULL;
+static MailMsgCompleteActivityFunc complete_activity = NULL;
+static MailMsgAlertErrorFunc alert_error = NULL;
+static MailMsgCancelActivityFunc cancel_activity = NULL;
+
+void mail_msg_register_activities (MailMsgCreateActivityFunc acreate,
+				   MailMsgSubmitActivityFunc asubmit,
+				   MailMsgFreeActivityFunc freeact,
+				   MailMsgCompleteActivityFunc comp_act,
+				   MailMsgCancelActivityFunc cancel_act,
+				   MailMsgAlertErrorFunc ealert)
+{
+	/* This is a utter hack to keep EActivity out of EDS and still let Evolution do EActivity */
+	create_activity = acreate;
+	submit_acitivity = asubmit;
+	free_activity = freeact;
+	complete_activity = comp_act;
+	cancel_activity = cancel_act;
+	alert_error = ealert;
+}
+
 static void
 mail_msg_cancelled (CamelOperation *operation,
                     gpointer user_data)
@@ -55,8 +78,9 @@ mail_msg_cancelled (CamelOperation *operation,
 static gboolean
 mail_msg_submit (CamelOperation *cancellable)
 {
-	/* FIXME: Add a way to pass this object to the clients for tracking*/
 
+	if (submit_acitivity)
+		submit_acitivity ((GCancellable *)cancellable);
 	return FALSE;
 }
 
@@ -73,6 +97,9 @@ mail_msg_new (MailMsgInfo *info)
 	msg->seq = mail_msg_seq++;
 
 	msg->cancellable = camel_operation_new ();
+	
+	if (create_activity)
+		create_activity (msg->cancellable);
 
 	g_signal_connect (
 		msg->cancellable, "cancelled",
@@ -118,6 +145,9 @@ mail_msg_free (MailMsg *mail_msg)
 {
 	/* This is an idle callback. */
 
+	if (free_activity)
+		free_activity (mail_msg->cancellable);
+
 	if (mail_msg->cancellable != NULL)
 		g_object_unref (mail_msg->cancellable);
 
@@ -191,7 +221,12 @@ mail_msg_check_error (gpointer msg)
 	if (m->error == NULL)
 		return;
 
+	if (complete_activity)
+		complete_activity (m->cancellable);
+
 	if (g_error_matches (m->error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+		if (cancel_activity)
+			cancel_activity (m->cancellable);
 		return;
 	}	
 
@@ -203,6 +238,15 @@ mail_msg_check_error (gpointer msg)
 		return;
 
 	/* FIXME: Submit an error on the dbus */
+	if (alert_error) {
+		char *what;
+
+		if (m->info->desc && (what = m->info->desc (m))) {
+			alert_error (what, m->error->message);
+			g_free (what);
+		} else
+			alert_error (NULL, m->error->message);
+	}
 }	
 
 void
@@ -530,6 +574,14 @@ do_call (struct _call_msg *m,
 		break;
 	}
 
+	if (g_cancellable_is_cancelled (cancellable)) {
+		if (cancel_activity)
+			cancel_activity (cancellable);
+	} else {
+		if (complete_activity)
+			complete_activity (cancellable);
+	}
+
 	if (m->done != NULL)
 		e_flag_set (m->done);
 }
diff --git a/mail/libemail-utils/mail-mt.h b/mail/libemail-utils/mail-mt.h
index 0d0c470..edae135 100644
--- a/mail/libemail-utils/mail-mt.h
+++ b/mail/libemail-utils/mail-mt.h
@@ -36,6 +36,14 @@ typedef void	(*MailMsgDoneFunc)		(MailMsg *msg);
 typedef void	(*MailMsgFreeFunc)		(MailMsg *msg);
 typedef void	(*MailMsgDispatchFunc)		(gpointer msg);
 
+
+typedef void    (*MailMsgCreateActivityFunc)	(GCancellable *cancellable);
+typedef void    (*MailMsgSubmitActivityFunc)	(GCancellable *cancellable);
+typedef void    (*MailMsgFreeActivityFunc)	(GCancellable *cancellable);
+typedef void    (*MailMsgCompleteActivityFunc)	(GCancellable *cancellable);
+typedef void    (*MailMsgCancelActivityFunc)	(GCancellable *cancellable);
+typedef void    (*MailMsgAlertErrorFunc)	(const char *what, const char *message);
+
 struct _MailMsg {
 	MailMsgInfo *info;
 	volatile gint ref_count;
@@ -55,6 +63,12 @@ struct _MailMsgInfo {
 
 /* setup ports */
 void mail_msg_init (void);
+void mail_msg_register_activities (MailMsgCreateActivityFunc,
+				   MailMsgSubmitActivityFunc,
+				   MailMsgFreeActivityFunc,
+				   MailMsgCompleteActivityFunc,
+				   MailMsgCancelActivityFunc,				   
+				   MailMsgAlertErrorFunc);
 
 gboolean mail_in_main_thread (void);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]