]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-dispatcher.h
empathy-dispatcher.[ch]: Several misc. code style fixes.
[empathy.git] / libempathy / empathy-dispatcher.h
index 4c47df65166f7256efef96374db93d8745f7ed11..231a2c10633c1f4e53cdc02a89c12b3a2330de44 100644 (file)
 #define __EMPATHY_DISPATCHER_H__
 
 #include <glib.h>
+#include <gio/gio.h>
 
 #include <telepathy-glib/channel.h>
 
 #include "empathy-contact.h"
-#include "empathy-tp-file.h"
+#include "empathy-dispatch-operation.h"
 
 G_BEGIN_DECLS
 
@@ -42,39 +43,53 @@ typedef struct _EmpathyDispatcher      EmpathyDispatcher;
 typedef struct _EmpathyDispatcherClass EmpathyDispatcherClass;
 
 struct _EmpathyDispatcher {
-       GObject parent;
-       gpointer priv;
+  GObject parent;
+  gpointer priv;
 };
 
 struct _EmpathyDispatcherClass {
      GObjectClass parent_class;
+ 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,
+  McAccount *account, GHashTable *request,
+  EmpathyDispatcherRequestCb *callback, gpointer user_data);
+
+/* Requesting 1 to 1 stream media channels */
+void empathy_dispatcher_call_with_contact (EmpathyContact *contact,
+  EmpathyDispatcherRequestCb *callback, gpointer user_data);
+
+/* Requesting 1 to 1 text channels */
+void empathy_dispatcher_chat_with_contact_id (McAccount *account,
+  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 (McAccount *account,
+  const gchar *roomname, EmpathyDispatcherRequestCb *callback,
+  gpointer user_data);
+
+GStrv empathy_dispatcher_find_channel_class (EmpathyDispatcher *dispatcher,
+  McAccount *account, const gchar *channel_type, guint handle_type);
+
+/* Get the dispatcher singleton */
+EmpathyDispatcher *    empathy_dispatcher_dup_singleton (void);
 
 G_END_DECLS