]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-tp-tube.h
Merge branch 'master' into tp-tube
[empathy.git] / libempathy / empathy-tp-tube.h
index 22f6b8dc80af439eb9c6a9a266e21ece37efeb50..dd9ec4dcfc09533521500b70e4b1f3219e4b6d01 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <telepathy-glib/channel.h>
 
+#include "empathy-contact.h"
+
 G_BEGIN_DECLS
 
 #define EMPATHY_TYPE_TP_TUBE (empathy_tp_tube_get_type ())
@@ -43,8 +45,22 @@ G_BEGIN_DECLS
 typedef struct _EmpathyTpTube EmpathyTpTube;
 typedef struct _EmpathyTpTubeClass EmpathyTpTubeClass;
 
+typedef struct {
+  TpSocketAddressType type;
+  union {
+    struct socket_address_t {
+      GArray *path;
+    } socket;
+    struct inet_address_t {
+      gchar *hostname;
+      guint port;
+    } inet;
+  } a;
+} EmpathyTpTubeAddress;
+
 struct _EmpathyTpTube {
   GObject parent;
+  gpointer priv;
 };
 
 struct _EmpathyTpTubeClass {
@@ -52,12 +68,26 @@ struct _EmpathyTpTubeClass {
 };
 
 GType empathy_tp_tube_get_type (void) G_GNUC_CONST;
-EmpathyTpTube *empathy_tp_tube_new (TpChannel *channel, guint tube_id);
-void empathy_tp_tube_accept_ipv4_stream_tube (EmpathyTpTube *tube);
-void empathy_tp_tube_accept_unix_stream_tube (EmpathyTpTube *tube);
-void empathy_tp_tube_get_ipv4_socket (EmpathyTpTube *tube, gchar **hostname,
-    guint *port);
-gchar * empathy_tp_tube_get_unix_socket (EmpathyTpTube *tube);
+EmpathyTpTube *empathy_tp_tube_new (TpChannel *channel);
+EmpathyTpTube *empathy_tp_tube_new_stream_tube (EmpathyContact *contact,
+    TpSocketAddressType type, const gchar *hostname, guint port,
+    const gchar *service, GHashTable *parameters);
+
+typedef void (EmpatyTpTubeAcceptStreamTubeCb) (EmpathyTpTube *tube,
+  const EmpathyTpTubeAddress *address, const GError *error,
+  gpointer user_data);
+
+void empathy_tp_tube_accept_stream_tube (EmpathyTpTube *tube,
+  TpSocketAddressType type, EmpatyTpTubeAcceptStreamTubeCb *callback,
+  gpointer user_data);
+
+typedef void (EmpathyTpTubeReadyCb)
+  (EmpathyTpTube *tube, const GError *error, gpointer user_data,
+   GObject *weak_object);
+
+void empathy_tp_tube_call_when_ready (EmpathyTpTube *tube,
+  EmpathyTpTubeReadyCb *callback, gpointer user_data, GDestroyNotify destroy,
+  GObject *weak_object);
 
 G_END_DECLS