Mercurial > pidgin
comparison libpurple/protocols/jabber/jingle/transport.h @ 24938:bd598b606ca4
Restructure Jingle code to more easily support multiple application types.
Actually negotiate a rawudp transport rather than pretending to use iceudp.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Sun, 19 Oct 2008 04:37:23 +0000 |
parents | |
children | 7252e3d0c627 |
comparison
equal
deleted
inserted
replaced
24937:5a774d0817d8 | 24938:bd598b606ca4 |
---|---|
1 /** | |
2 * @file transport.h | |
3 * | |
4 * purple | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
19 */ | |
20 | |
21 #ifndef JINGLE_TRANSPORT_H | |
22 #define JINGLE_TRANSPORT_H | |
23 | |
24 #include <glib.h> | |
25 #include <glib-object.h> | |
26 | |
27 #include "jingle.h" | |
28 #include "xmlnode.h" | |
29 | |
30 G_BEGIN_DECLS | |
31 | |
32 #define JINGLE_TYPE_TRANSPORT (jingle_transport_get_type()) | |
33 #define JINGLE_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), JINGLE_TYPE_TRANSPORT, JingleTransport)) | |
34 #define JINGLE_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), JINGLE_TYPE_TRANSPORT, JingleTransportClass)) | |
35 #define JINGLE_IS_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), JINGLE_TYPE_TRANSPORT)) | |
36 #define JINGLE_IS_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), JINGLE_TYPE_TRANSPORT)) | |
37 #define JINGLE_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), JINGLE_TYPE_TRANSPORT, JingleTransportClass)) | |
38 | |
39 /** @copydoc _JingleTransport */ | |
40 typedef struct _JingleTransport JingleTransport; | |
41 /** @copydoc _JingleTransportClass */ | |
42 typedef struct _JingleTransportClass JingleTransportClass; | |
43 /** @copydoc _JingleTransportPrivate */ | |
44 typedef struct _JingleTransportPrivate JingleTransportPrivate; | |
45 | |
46 /** The transport class */ | |
47 struct _JingleTransportClass | |
48 { | |
49 GObjectClass parent_class; /**< The parent class. */ | |
50 | |
51 const gchar *transport_type; | |
52 xmlnode *(*to_xml) (JingleTransport *transport, xmlnode *content, JingleActionType action); | |
53 JingleTransport *(*parse) (xmlnode *transport); | |
54 }; | |
55 | |
56 /** The transport class's private data */ | |
57 struct _JingleTransport | |
58 { | |
59 GObject parent; /**< The parent of this object. */ | |
60 JingleTransportPrivate *priv; /**< The private data of this object. */ | |
61 }; | |
62 | |
63 #ifdef __cplusplus | |
64 extern "C" { | |
65 #endif | |
66 | |
67 /** | |
68 * Gets the transport class's GType | |
69 * | |
70 * @return The transport class's GType. | |
71 */ | |
72 GType jingle_transport_get_type(void); | |
73 | |
74 JingleTransport *jingle_transport_create(const gchar *type); | |
75 const gchar *jingle_transport_get_transport_type(JingleTransport *transport); | |
76 void jingle_transport_add_candidate(); | |
77 | |
78 #define jingle_transport_create_transport_accept(session) \ | |
79 jingle_session_to_packet(session, JINGLE_TRANSPORT_ACCEPT) | |
80 #define jingle_transport_create_transport_info(session) \ | |
81 jingle_session_to_packet(session, JINGLE_TRANSPORT_INFO) | |
82 #define jingle_transport_create_transport_replace(session) \ | |
83 jingle_session_to_packet(session, JINGLE_TRANSPORT_REPLACE) | |
84 | |
85 JingleTransport *jingle_transport_parse(xmlnode *transport); | |
86 xmlnode *jingle_transport_to_xml(JingleTransport *transport, xmlnode *content, JingleActionType action); | |
87 | |
88 #ifdef __cplusplus | |
89 } | |
90 #endif | |
91 | |
92 G_END_DECLS | |
93 | |
94 #endif /* JINGLE_TRANSPORT_H */ | |
95 |