1 /*
2  * tube-dbus.h - Header for GabbleTubeDBus
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 __GABBLE_TUBE_DBUS_H__
21 #define __GABBLE_TUBE_DBUS_H__
22 
23 #include <glib-object.h>
24 
25 #include <telepathy-glib/telepathy-glib.h>
26 #include <telepathy-glib/telepathy-glib-dbus.h>
27 
28 #include "connection.h"
29 #include "bytestream-iface.h"
30 #include "extensions/extensions.h"
31 #include "muc-channel.h"
32 
33 G_BEGIN_DECLS
34 
35 typedef struct _GabbleTubeDBus GabbleTubeDBus;
36 typedef struct _GabbleTubeDBusClass GabbleTubeDBusClass;
37 typedef struct _GabbleTubeDBusPrivate GabbleTubeDBusPrivate;
38 
39 struct _GabbleTubeDBusClass {
40   TpBaseChannelClass parent_class;
41 
42   TpDBusPropertiesMixinClass dbus_props_class;
43   TpGroupMixinClass group_class;
44 };
45 
46 struct _GabbleTubeDBus {
47   TpBaseChannel parent;
48   TpGroupMixin group;
49 
50   GabbleTubeDBusPrivate *priv;
51 };
52 
53 GType gabble_tube_dbus_get_type (void);
54 
55 /* TYPE MACROS */
56 #define GABBLE_TYPE_TUBE_DBUS \
57   (gabble_tube_dbus_get_type ())
58 #define GABBLE_TUBE_DBUS(obj) \
59   (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_TUBE_DBUS, GabbleTubeDBus))
60 #define GABBLE_TUBE_DBUS_CLASS(klass) \
61   (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_TUBE_DBUS,\
62                            GabbleTubeDBusClass))
63 #define GABBLE_IS_TUBE_DBUS(obj) \
64   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_TUBE_DBUS))
65 #define GABBLE_IS_TUBE_DBUS_CLASS(klass) \
66   (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_TUBE_DBUS))
67 #define GABBLE_TUBE_DBUS_GET_CLASS(obj) \
68   (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_TUBE_DBUS,\
69                               GabbleTubeDBusClass))
70 
71 GabbleTubeDBus *gabble_tube_dbus_new (GabbleConnection *conn, TpHandle handle,
72     TpHandleType handle_type, TpHandle self_handle, TpHandle initiator,
73     const gchar *service, GHashTable *parameters, const gchar *stream_id,
74     guint64 id, GabbleBytestreamIface *bytestream, GabbleMucChannel *muc,
75     gboolean requested);
76 
77 gboolean gabble_tube_dbus_add_name (GabbleTubeDBus *tube, TpHandle handle,
78     const gchar *name);
79 
80 gboolean gabble_tube_dbus_remove_name (GabbleTubeDBus *tube, TpHandle handle);
81 
82 gboolean gabble_tube_dbus_handle_in_names (GabbleTubeDBus *tube,
83     TpHandle handle);
84 
85 gboolean gabble_tube_dbus_offer (GabbleTubeDBus *tube, GError **error);
86 
87 const gchar * const * gabble_tube_dbus_channel_get_allowed_properties (void);
88 
89 /* Only extern for the benefit of tests/test-dtube-unique-names.c */
90 gchar *_gabble_generate_dbus_unique_name (const gchar *nick);
91 
92 G_END_DECLS
93 
94 #endif /* #ifndef __GABBLE_TUBE_DBUS_H__ */
95