File: content.h

package info (click to toggle)
pidgin 2.7.3-1%2Bsqueeze4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 61,844 kB
  • ctags: 31,772
  • sloc: ansic: 321,156; sh: 10,269; makefile: 3,515; python: 1,285; perl: 520; cs: 209; tcl: 96; xml: 10
file content (121 lines) | stat: -rw-r--r-- 4,669 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
 * @file content.h
 *
 * purple
 *
 * Purple is the legal property of its developers, whose names are too numerous
 * to list here.  Please refer to the COPYRIGHT file distributed with this
 * source distribution.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 */

#ifndef PURPLE_JABBER_JINGLE_CONTENT_H
#define PURPLE_JABBER_JINGLE_CONTENT_H


#include "jabber.h"
#include "jingle.h"
#include "session.h"
#include "transport.h"

#include <glib.h>
#include <glib-object.h>

G_BEGIN_DECLS

#define JINGLE_TYPE_CONTENT            (jingle_content_get_type())
#define JINGLE_CONTENT(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), JINGLE_TYPE_CONTENT, JingleContent))
#define JINGLE_CONTENT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), JINGLE_TYPE_CONTENT, JingleContentClass))
#define JINGLE_IS_CONTENT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), JINGLE_TYPE_CONTENT))
#define JINGLE_IS_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), JINGLE_TYPE_CONTENT))
#define JINGLE_CONTENT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), JINGLE_TYPE_CONTENT, JingleContentClass))

/** @copydoc _JingleContent */
typedef struct _JingleContent JingleContent;
/** @copydoc _JingleContentClass */
typedef struct _JingleContentClass JingleContentClass;
/** @copydoc _JingleContentPrivate */
typedef struct _JingleContentPrivate JingleContentPrivate;

/** The content class */
struct _JingleContentClass
{
	GObjectClass parent_class;     /**< The parent class. */

	xmlnode *(*to_xml) (JingleContent *content, xmlnode *jingle, JingleActionType action);
	JingleContent *(*parse) (xmlnode *content);
	void (*handle_action) (JingleContent *content, xmlnode *xmlcontent, JingleActionType action);
	const gchar *description_type;
};

/** The content class's private data */
struct _JingleContent
{
	GObject parent;                /**< The parent of this object. */
	JingleContentPrivate *priv;      /**< The private data of this object. */
};

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Gets the content class's GType
 *
 * @return The content class's GType.
 */
GType jingle_content_get_type(void);

JingleContent *jingle_content_create(const gchar *type, const gchar *creator,
		const gchar *disposition, const gchar *name,
		const gchar *senders, JingleTransport *transport);

JingleSession *jingle_content_get_session(JingleContent *content);
const gchar *jingle_content_get_description_type(JingleContent *content);
gchar *jingle_content_get_creator(JingleContent *content);
gchar *jingle_content_get_disposition(JingleContent *content);
gchar *jingle_content_get_name(JingleContent *content);
gchar *jingle_content_get_senders(JingleContent *content);
JingleTransport *jingle_content_get_transport(JingleContent *content);
JingleTransport *jingle_content_get_pending_transport(JingleContent *content);

void jingle_content_set_session(JingleContent *content, JingleSession *session);
void jingle_content_set_pending_transport(JingleContent *content, JingleTransport *transport);
void jingle_content_accept_transport(JingleContent *content);
void jingle_content_remove_pending_transport(JingleContent *content);
void jingle_content_modify(JingleContent *content, const gchar *senders);

#define jingle_content_create_content_accept(session) \
	jingle_session_to_packet(session, JINGLE_CONTENT_ACCEPT)
#define jingle_content_create_content_add(session) \
	jingle_session_to_packet(session, JINGLE_CONTENT_ADD)
#define jingle_content_create_content_modify(session) \
	jingle_session_to_packet(session, JINGLE_CONTENT_MODIFY)
#define jingle_content_create_content_remove(session) \
	jingle_session_to_packet(session, JINGLE_CONTENT_REMOVE)

JingleContent *jingle_content_parse(xmlnode *content);
xmlnode *jingle_content_to_xml(JingleContent *content, xmlnode *jingle, JingleActionType action);
void jingle_content_handle_action(JingleContent *content, xmlnode *xmlcontent, JingleActionType action);

#ifdef __cplusplus
}
#endif

G_END_DECLS

#endif /* PURPLE_JABBER_JINGLE_CONTENT_H */