rename accountopt.[ch] to purpleaccountoption.[ch]
[pidgin-git.git] / libpurple / protocols / jabber / jingle / session.h
blob65d9a7bd01086bee767abacb885a7750533b8103
1 /**
2 * @file session.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_SESSION_H
26 #define PURPLE_JABBER_JINGLE_SESSION_H
28 #include "iq.h"
29 #include "jabber.h"
31 #include <glib.h>
32 #include <glib-object.h>
34 G_BEGIN_DECLS
36 #define JINGLE_TYPE_SESSION jingle_session_get_type()
38 struct _JingleContent;
40 /**
41 * Gets the session class's GType
43 * @return The session class's GType.
45 G_MODULE_EXPORT
46 G_DECLARE_FINAL_TYPE(JingleSession, jingle_session, JINGLE, SESSION, GObject)
48 /**
49 * Registers the JingleSession type in the type system.
51 void jingle_session_register(PurplePlugin *plugin);
53 JingleSession *jingle_session_create(JabberStream *js, const gchar *sid,
54 const gchar *local_jid, const gchar *remote_jid,
55 gboolean is_initiator);
56 JabberStream *jingle_session_get_js(JingleSession *session);
57 gchar *jingle_session_get_sid(JingleSession *session);
58 gchar *jingle_session_get_local_jid(JingleSession *session);
59 gchar *jingle_session_get_remote_jid(JingleSession *session);
60 gboolean jingle_session_is_initiator(JingleSession *session);
61 gboolean jingle_session_get_state(JingleSession *session);
63 GList *jingle_session_get_contents(JingleSession *session);
64 GList *jingle_session_get_pending_contents(JingleSession *session);
66 JingleSession *jingle_session_find_by_sid(JabberStream *js, const gchar *sid);
67 JingleSession *jingle_session_find_by_jid(JabberStream *js, const gchar *jid);
69 JabberIq *jingle_session_create_ack(JingleSession *session, const PurpleXmlNode *jingle);
70 PurpleXmlNode *jingle_session_to_xml(JingleSession *session, PurpleXmlNode *parent, JingleActionType action);
71 JabberIq *jingle_session_to_packet(JingleSession *session, JingleActionType action);
73 void jingle_session_handle_action(JingleSession *session, PurpleXmlNode *jingle, JingleActionType action);
75 struct _JingleContent *jingle_session_find_content(JingleSession *session,
76 const gchar *name, const gchar *creator);
77 struct _JingleContent *jingle_session_find_pending_content(JingleSession *session,
78 const gchar *name, const gchar *creator);
80 void jingle_session_add_content(JingleSession *session, struct _JingleContent* content);
81 void jingle_session_remove_content(JingleSession *session, const gchar *name, const gchar *creator);
82 void jingle_session_add_pending_content(JingleSession *session, struct _JingleContent* content);
83 void jingle_session_remove_pending_content(JingleSession *session, const gchar *name, const gchar *creator);
84 void jingle_session_accept_content(JingleSession *session, const gchar *name, const gchar *creator);
85 void jingle_session_accept_session(JingleSession *session);
86 JabberIq *jingle_session_terminate_packet(JingleSession *session, const gchar *reason);
87 JabberIq *jingle_session_redirect_packet(JingleSession *session, const gchar *sid);
89 G_END_DECLS
91 #endif /* PURPLE_JABBER_JINGLE_SESSION_H */