annotate libpurple/protocols/jabber/jingle/content.h @ 28001:584e063285b7

Pull in changes from the im.pidgin.pidgin.2.6.2 branch and add "devel" back to configure.ac
author Mark Doliner <mark@kingant.net>
date Wed, 19 Aug 2009 00:18:54 +0000
parents 0c8d41f5caa0
children c585572e80dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24938
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
1 /**
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
2 * @file content.h
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
3 *
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
4 * purple
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
5 *
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
9 * (at your option) any later version.
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
10 *
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
14 * GNU General Public License for more details.
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
15 *
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
19 */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
20
26480
0c8d41f5caa0 Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <paul@darkrain42.org>
parents: 24949
diff changeset
21 #ifndef PURPLE_JABBER_JINGLE_CONTENT_H
0c8d41f5caa0 Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <paul@darkrain42.org>
parents: 24949
diff changeset
22 #define PURPLE_JABBER_JINGLE_CONTENT_H
24938
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
23
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
24
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
25 #include "jabber.h"
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
26 #include "jingle.h"
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
27 #include "session.h"
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
28 #include "transport.h"
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
29
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
30 #include <glib.h>
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
31 #include <glib-object.h>
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
32
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
33 G_BEGIN_DECLS
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
34
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
35 #define JINGLE_TYPE_CONTENT (jingle_content_get_type())
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
36 #define JINGLE_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), JINGLE_TYPE_CONTENT, JingleContent))
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
37 #define JINGLE_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), JINGLE_TYPE_CONTENT, JingleContentClass))
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
38 #define JINGLE_IS_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), JINGLE_TYPE_CONTENT))
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
39 #define JINGLE_IS_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), JINGLE_TYPE_CONTENT))
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
40 #define JINGLE_CONTENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), JINGLE_TYPE_CONTENT, JingleContentClass))
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
41
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
42 /** @copydoc _JingleContent */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
43 typedef struct _JingleContent JingleContent;
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
44 /** @copydoc _JingleContentClass */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
45 typedef struct _JingleContentClass JingleContentClass;
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
46 /** @copydoc _JingleContentPrivate */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
47 typedef struct _JingleContentPrivate JingleContentPrivate;
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
48
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
49 /** The content class */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
50 struct _JingleContentClass
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
51 {
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
52 GObjectClass parent_class; /**< The parent class. */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
53
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
54 xmlnode *(*to_xml) (JingleContent *content, xmlnode *jingle, JingleActionType action);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
55 JingleContent *(*parse) (xmlnode *content);
24949
1a2d446cb8a0 Fix support for audio and video (at the same time) sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 24938
diff changeset
56 void (*handle_action) (JingleContent *content, xmlnode *xmlcontent, JingleActionType action);
24938
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
57 const gchar *description_type;
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
58 };
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
59
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
60 /** The content class's private data */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
61 struct _JingleContent
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
62 {
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
63 GObject parent; /**< The parent of this object. */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
64 JingleContentPrivate *priv; /**< The private data of this object. */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
65 };
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
66
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
67 #ifdef __cplusplus
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
68 extern "C" {
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
69 #endif
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
70
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
71 /**
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
72 * Gets the content class's GType
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
73 *
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
74 * @return The content class's GType.
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
75 */
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
76 GType jingle_content_get_type(void);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
77
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
78 JingleContent *jingle_content_create(const gchar *type, const gchar *creator,
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
79 const gchar *disposition, const gchar *name,
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
80 const gchar *senders, JingleTransport *transport);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
81
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
82 JingleSession *jingle_content_get_session(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
83 const gchar *jingle_content_get_description_type(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
84 gchar *jingle_content_get_creator(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
85 gchar *jingle_content_get_disposition(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
86 gchar *jingle_content_get_name(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
87 gchar *jingle_content_get_senders(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
88 JingleTransport *jingle_content_get_transport(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
89 JingleTransport *jingle_content_get_pending_transport(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
90
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
91 void jingle_content_set_session(JingleContent *content, JingleSession *session);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
92 void jingle_content_set_pending_transport(JingleContent *content, JingleTransport *transport);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
93 void jingle_content_accept_transport(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
94 void jingle_content_remove_pending_transport(JingleContent *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
95 void jingle_content_modify(JingleContent *content, const gchar *senders);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
96
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
97 #define jingle_content_create_content_accept(session) \
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
98 jingle_session_to_packet(session, JINGLE_CONTENT_ACCEPT)
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
99 #define jingle_content_create_content_add(session) \
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
100 jingle_session_to_packet(session, JINGLE_CONTENT_ADD)
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
101 #define jingle_content_create_content_modify(session) \
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
102 jingle_session_to_packet(session, JINGLE_CONTENT_MODIFY)
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
103 #define jingle_content_create_content_remove(session) \
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
104 jingle_session_to_packet(session, JINGLE_CONTENT_REMOVE)
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
105
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
106 JingleContent *jingle_content_parse(xmlnode *content);
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
107 xmlnode *jingle_content_to_xml(JingleContent *content, xmlnode *jingle, JingleActionType action);
24949
1a2d446cb8a0 Fix support for audio and video (at the same time) sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 24938
diff changeset
108 void jingle_content_handle_action(JingleContent *content, xmlnode *xmlcontent, JingleActionType action);
24938
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
109
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
110 #ifdef __cplusplus
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
111 }
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
112 #endif
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
113
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
114 G_END_DECLS
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
115
26480
0c8d41f5caa0 Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <paul@darkrain42.org>
parents: 24949
diff changeset
116 #endif /* PURPLE_JABBER_JINGLE_CONTENT_H */
24938
bd598b606ca4 Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
117