src/protocols/jabber/iq.h

branch
cpw.khc.msnp14
changeset 20472
6a6d2ef151e6
parent 13912
463b4fa9f067
parent 20469
b2836a24d81e
child 20473
91e1b3a49d10
equal deleted inserted replaced
13912:463b4fa9f067 20472:6a6d2ef151e6
1 /**
2 * @file iq.h JabberID handlers
3 *
4 * gaim
5 *
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22 #ifndef _GAIM_JABBER_IQ_H_
23 #define _GAIM_JABBER_IQ_H_
24
25 #include "jabber.h"
26
27 typedef struct _JabberIq JabberIq;
28
29 typedef enum {
30 JABBER_IQ_SET,
31 JABBER_IQ_GET,
32 JABBER_IQ_RESULT,
33 JABBER_IQ_ERROR,
34 JABBER_IQ_NONE
35 } JabberIqType;
36
37 typedef void (JabberIqCallback)(JabberStream *js, xmlnode *packet, gpointer data);
38
39 struct _JabberIq {
40 JabberIqType type;
41 char *id;
42 xmlnode *node;
43
44 JabberIqCallback *callback;
45 gpointer callback_data;
46
47 JabberStream *js;
48 };
49
50 JabberIq *jabber_iq_new(JabberStream *js, JabberIqType type);
51 JabberIq *jabber_iq_new_query(JabberStream *js, JabberIqType type,
52 const char *xmlns);
53
54 void jabber_iq_parse(JabberStream *js, xmlnode *packet);
55
56 void jabber_iq_remove_callback_by_id(JabberStream *js, const char *id);
57 void jabber_iq_set_callback(JabberIq *iq, JabberIqCallback *cb, gpointer data);
58 void jabber_iq_set_id(JabberIq *iq, const char *id);
59
60 void jabber_iq_send(JabberIq *iq);
61 void jabber_iq_free(JabberIq *iq);
62
63 #endif /* _GAIM_JABBER_IQ_H_ */

mercurial