Replace misused g_str_equal() with purple_strequal()
[pidgin-git.git] / libpurple / protocols / jabber / jingle / content.h
blob91dc4e86ca09da85e1bc20467945861a26a04808
1 /**
2 * @file content.h
4 * purple
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
8 * source distribution.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 #ifndef PURPLE_JABBER_JINGLE_CONTENT_H
26 #define PURPLE_JABBER_JINGLE_CONTENT_H
29 #include "jabber.h"
30 #include "jingle.h"
31 #include "session.h"
32 #include "transport.h"
34 #include <glib.h>
35 #include <glib-object.h>
37 G_BEGIN_DECLS
39 #define JINGLE_TYPE_CONTENT (jingle_content_get_type())
40 #define JINGLE_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), JINGLE_TYPE_CONTENT, JingleContent))
41 #define JINGLE_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), JINGLE_TYPE_CONTENT, JingleContentClass))
42 #define JINGLE_IS_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), JINGLE_TYPE_CONTENT))
43 #define JINGLE_IS_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), JINGLE_TYPE_CONTENT))
44 #define JINGLE_CONTENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), JINGLE_TYPE_CONTENT, JingleContentClass))
46 /** @copydoc _JingleContent */
47 typedef struct _JingleContent JingleContent;
48 /** @copydoc _JingleContentClass */
49 typedef struct _JingleContentClass JingleContentClass;
50 /** @copydoc _JingleContentPrivate */
51 typedef struct _JingleContentPrivate JingleContentPrivate;
53 /** The content class */
54 struct _JingleContentClass
56 GObjectClass parent_class; /**< The parent class. */
58 xmlnode *(*to_xml) (JingleContent *content, xmlnode *jingle, JingleActionType action);
59 JingleContent *(*parse) (xmlnode *content);
60 void (*handle_action) (JingleContent *content, xmlnode *xmlcontent, JingleActionType action);
61 const gchar *description_type;
64 /** The content class's private data */
65 struct _JingleContent
67 GObject parent; /**< The parent of this object. */
68 JingleContentPrivate *priv; /**< The private data of this object. */
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
75 /**
76 * Gets the content class's GType
78 * @return The content class's GType.
80 GType jingle_content_get_type(void);
82 JingleContent *jingle_content_create(const gchar *type, const gchar *creator,
83 const gchar *disposition, const gchar *name,
84 const gchar *senders, JingleTransport *transport);
86 JingleSession *jingle_content_get_session(JingleContent *content);
87 const gchar *jingle_content_get_description_type(JingleContent *content);
88 gchar *jingle_content_get_creator(JingleContent *content);
89 gchar *jingle_content_get_disposition(JingleContent *content);
90 gchar *jingle_content_get_name(JingleContent *content);
91 gchar *jingle_content_get_senders(JingleContent *content);
92 JingleTransport *jingle_content_get_transport(JingleContent *content);
93 JingleTransport *jingle_content_get_pending_transport(JingleContent *content);
95 void jingle_content_set_session(JingleContent *content, JingleSession *session);
96 void jingle_content_set_pending_transport(JingleContent *content, JingleTransport *transport);
97 void jingle_content_accept_transport(JingleContent *content);
98 void jingle_content_remove_pending_transport(JingleContent *content);
99 void jingle_content_modify(JingleContent *content, const gchar *senders);
101 #define jingle_content_create_content_accept(session) \
102 jingle_session_to_packet(session, JINGLE_CONTENT_ACCEPT)
103 #define jingle_content_create_content_add(session) \
104 jingle_session_to_packet(session, JINGLE_CONTENT_ADD)
105 #define jingle_content_create_content_modify(session) \
106 jingle_session_to_packet(session, JINGLE_CONTENT_MODIFY)
107 #define jingle_content_create_content_remove(session) \
108 jingle_session_to_packet(session, JINGLE_CONTENT_REMOVE)
110 JingleContent *jingle_content_parse(xmlnode *content);
111 xmlnode *jingle_content_to_xml(JingleContent *content, xmlnode *jingle, JingleActionType action);
112 void jingle_content_handle_action(JingleContent *content, xmlnode *xmlcontent, JingleActionType action);
114 #ifdef __cplusplus
116 #endif
118 G_END_DECLS
120 #endif /* PURPLE_JABBER_JINGLE_CONTENT_H */