1 /*
2  * private-tubes-factory.h - Header for GabblePrivateTubesFactory
3  * Copyright (C) 2007 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #ifndef __PRIVATE_TUBES_FACTORY_H__
21 #define __PRIVATE_TUBES_FACTORY_H__
22 
23 #include <glib-object.h>
24 
25 #include <telepathy-glib/telepathy-glib.h>
26 
27 #include "connection.h"
28 #include "bytestream-iface.h"
29 
30 G_BEGIN_DECLS
31 
32 typedef struct _GabblePrivateTubesFactoryClass GabblePrivateTubesFactoryClass;
33 typedef struct _GabblePrivateTubesFactoryPrivate
34     GabblePrivateTubesFactoryPrivate;
35 
36 struct _GabblePrivateTubesFactoryClass {
37   GObjectClass parent_class;
38 };
39 
40 struct _GabblePrivateTubesFactory {
41   GObject parent;
42 
43   GabblePrivateTubesFactoryPrivate *priv;
44 };
45 
46 GType gabble_private_tubes_factory_get_type (void);
47 
48 /* TYPE MACROS */
49 #define GABBLE_TYPE_PRIVATE_TUBES_FACTORY \
50   (gabble_private_tubes_factory_get_type ())
51 #define GABBLE_PRIVATE_TUBES_FACTORY(obj) \
52   (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_PRIVATE_TUBES_FACTORY,\
53                               GabblePrivateTubesFactory))
54 #define GABBLE_PRIVATE_TUBES_FACTORY_CLASS(klass) \
55   (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_PRIVATE_TUBES_FACTORY,\
56                            GabblePrivateTubesFactoryClass))
57 #define GABBLE_IS_PRIVATE_TUBES_FACTORY(obj) \
58   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_PRIVATE_TUBES_FACTORY))
59 #define GABBLE_IS_PRIVATE_TUBES_FACTORY_CLASS(klass) \
60   (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_PRIVATE_TUBES_FACTORY))
61 #define GABBLE_PRIVATE_TUBES_FACTORY_GET_CLASS(obj) \
62   (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_PRIVATE_TUBES_FACTORY,\
63                               GabblePrivateTubesFactoryClass))
64 
65 GabblePrivateTubesFactory * gabble_private_tubes_factory_new (
66     GabbleConnection *conn);
67 
68 /* New 1-1 D-Bus tube requested by the remote contact */
69 void gabble_private_tubes_factory_handle_si_tube_request (
70     GabblePrivateTubesFactory *fac, GabbleBytestreamIface *bytestream,
71     TpHandle handle, const gchar *stream_id, WockyStanza *msg);
72 
73 /* New connection requested in a existing 1-1 stream tube */
74 void gabble_private_tubes_factory_handle_si_stream_request (
75     GabblePrivateTubesFactory *fac, GabbleBytestreamIface *bytestream,
76     TpHandle handle, const gchar *stream_id, WockyStanza *msg);
77 
78 gboolean gabble_private_tubes_factory_extract_tube_information (
79     TpHandleRepoIface *contact_repo, WockyNode *tube_node,
80     TpTubeType *type, TpHandle *initiator_handle,
81     const gchar **service, GHashTable **parameters,
82     guint64 *tube_id);
83 
84 G_END_DECLS
85 
86 #endif /* #ifndef __PRIVATE_TUBES_FACTORY_H__ */
87 
88