#include <telepathy-glib/channel.h>
#include "empathy-contact.h"
+#include "empathy-dispatch-operation.h"
G_BEGIN_DECLS
typedef struct _EmpathyDispatcher EmpathyDispatcher;
typedef struct _EmpathyDispatcherClass EmpathyDispatcherClass;
-struct _EmpathyDispatcher {
- GObject parent;
- gpointer priv;
+struct _EmpathyDispatcher
+{
+ GObject parent;
+ gpointer priv;
};
-struct _EmpathyDispatcherClass {
- GObjectClass parent_class;
+struct _EmpathyDispatcherClass
+{
+ GObjectClass parent_class;
};
-#define EMPATHY_TYPE_DISPATCHER_TUBE (empathy_dispatcher_tube_get_type ())
-typedef struct {
- EmpathyContact *initiator;
- TpChannel *channel;
- guint id;
- gboolean activatable;
-} EmpathyDispatcherTube;
-
-GType empathy_dispatcher_get_type (void) G_GNUC_CONST;
-EmpathyDispatcher * empathy_dispatcher_new (void);
-void empathy_dispatcher_channel_process (EmpathyDispatcher *dispatcher,
- TpChannel *channel);
-GType empathy_dispatcher_tube_get_type (void);
-EmpathyDispatcherTube *empathy_dispatcher_tube_ref (EmpathyDispatcherTube *tube);
-void empathy_dispatcher_tube_unref (EmpathyDispatcherTube *tube);
-void empathy_dispatcher_tube_process (EmpathyDispatcher *dispatcher,
- EmpathyDispatcherTube *tube);
-void empathy_dispatcher_call_with_contact (EmpathyContact *contact);
-void empathy_dispatcher_call_with_contact_id (McAccount *account,
- const gchar *contact_id);
-void empathy_dispatcher_chat_with_contact_id (McAccount *account,
- const gchar *contact_id);
-void empathy_dispatcher_chat_with_contact (EmpathyContact *contact);
-void empathy_dispatcher_send_file (EmpathyContact *contact,
- GFile *gfile);
+/* Will be called when the channel is ready for dispatching. The requestor
+ * handle the channel itself by calling empathy_dispatch_operation_handles */
+typedef void (EmpathyDispatcherRequestCb) (
+ EmpathyDispatchOperation *dispatch, const GError *error,
+ gpointer user_data);
+
+GType empathy_dispatcher_get_type (void) G_GNUC_CONST;
+
+void empathy_dispatcher_create_channel (EmpathyDispatcher *dispatcher,
+ TpConnection *connection, GHashTable *request,
+ EmpathyDispatcherRequestCb *callback, gpointer user_data);
+
+/* Requesting 1 to 1 text channels */
+void empathy_dispatcher_chat_with_contact_id (TpConnection *connection,
+ const gchar *contact_id, EmpathyDispatcherRequestCb *callback,
+ gpointer user_data);
+void empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
+ EmpathyDispatcherRequestCb *callback, gpointer user_data);
+
+/* Request a file channel to a specific contact */
+void empathy_dispatcher_send_file_to_contact (EmpathyContact *contact,
+ const gchar *filename, guint64 size, guint64 date,
+ const gchar *content_type, EmpathyDispatcherRequestCb *callback,
+ gpointer user_data);
+
+/* Request a muc channel */
+void empathy_dispatcher_join_muc (TpConnection *connection,
+ const gchar *roomname, EmpathyDispatcherRequestCb *callback,
+ gpointer user_data);
+
+GStrv empathy_dispatcher_find_channel_class (EmpathyDispatcher *dispatcher,
+ TpConnection *connection, const gchar *channel_type, guint handle_type);
+
+/* Get the dispatcher singleton */
+EmpathyDispatcher * empathy_dispatcher_dup_singleton (void);
G_END_DECLS