annotate libpurple/protocols/jabber/data.h @ 28047:8c991e09efcb

Update various header copyrights thanks to licensecheck.
author Paul Aurich <paul@darkrain42.org>
date Sat, 22 Aug 2009 02:40:01 +0000
parents 5767b7698c73
children 7921a53b94b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
1 /*
28047
8c991e09efcb Update various header copyrights thanks to licensecheck.
Paul Aurich <paul@darkrain42.org>
parents: 26481
diff changeset
2 * Purple is the legal property of its developers, whose names are too numerous
8c991e09efcb Update various header copyrights thanks to licensecheck.
Paul Aurich <paul@darkrain42.org>
parents: 26481
diff changeset
3 * to list here. Please refer to the COPYRIGHT file distributed with this
8c991e09efcb Update various header copyrights thanks to licensecheck.
Paul Aurich <paul@darkrain42.org>
parents: 26481
diff changeset
4 * source distribution.
8c991e09efcb Update various header copyrights thanks to licensecheck.
Paul Aurich <paul@darkrain42.org>
parents: 26481
diff changeset
5 *
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
9 * (at your option) any later version.
25952
5f9a24d1c25e Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24179
diff changeset
10 *
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
14 * GNU Library General Public License for more details.
25952
5f9a24d1c25e Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24179
diff changeset
15 *
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
19 */
25952
5f9a24d1c25e Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24179
diff changeset
20
26481
5767b7698c73 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <paul@darkrain42.org>
parents: 25979
diff changeset
21 #ifndef PURPLE_JABBER_DATA_H
5767b7698c73 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <paul@darkrain42.org>
parents: 25979
diff changeset
22 #define PURPLE_JABBER_DATA_H
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
23
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
24 #include "xmlnode.h"
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
25 #include "jabber.h"
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
26
24058
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
27 #define XEP_0231_NAMESPACE "urn:xmpp:bob"
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
28
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
29 #include <glib.h>
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
30
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
31 typedef struct {
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
32 char *cid;
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
33 char *type;
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
34 gsize size;
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
35 gpointer data;
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
36 } JabberData;
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
37
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
38 /* creates a JabberData instance from raw data */
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
39 JabberData *jabber_data_create_from_data(gconstpointer data, gsize size,
24058
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
40 const char *type, JabberStream *js);
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
41
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
42 /* create a JabberData instance from an XML "data" element (as defined by
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
43 XEP 0231 */
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
44 JabberData *jabber_data_create_from_xml(xmlnode *tag);
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
45
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
46 const char *jabber_data_get_cid(const JabberData *data);
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
47 const char *jabber_data_get_type(const JabberData *data);
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
48
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
49 gsize jabber_data_get_size(const JabberData *data);
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
50 gpointer jabber_data_get_data(const JabberData *data);
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
51
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
52 /* returns the XML definition for the data element */
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
53 xmlnode *jabber_data_get_xml_definition(const JabberData *data);
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
54
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
55 /* returns an XHTML-IM "img" tag given a data instance */
24058
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
56 xmlnode *jabber_data_get_xhtml_im(const JabberData *data, const gchar *alt);
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
57
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
58 /* returns a data request element (to be included in an iq stanza) for requesting
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
59 data */
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
60 xmlnode *jabber_data_get_xml_request(const gchar *cid);
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
61
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
62 /* lookup functions */
24058
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
63 const JabberData *jabber_data_find_local_by_alt(const gchar *alt);
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
64 const JabberData *jabber_data_find_local_by_cid(const gchar *cid);
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
65 const JabberData *jabber_data_find_remote_by_cid(const gchar *cid);
24179
2c6c9d72f54f A couple of compile warning fixes, a couple of memory leak plugs.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 24059
diff changeset
66
24058
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
67 /* store data objects */
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
68 void jabber_data_associate_local(JabberData *data, const gchar *alt);
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
69 void jabber_data_associate_remote(JabberData *data);
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
70
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
71 /* handles iq requests */
25648
050052891c55 Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents: 25433
diff changeset
72 void jabber_data_parse(JabberStream *js, const char *who, JabberIqType type,
050052891c55 Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents: 25433
diff changeset
73 const char *id, xmlnode *data_node);
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
74
24058
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
75 void jabber_data_init(void);
305fac6af8f9 Updated to use latest spec. in XEP-0231
Marcus Lundblad <ml@update.uu.se>
parents: 23780
diff changeset
76 void jabber_data_uninit(void);
23780
9d83ae2c1a4f New files used for custom smileys.
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
77
26481
5767b7698c73 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <paul@darkrain42.org>
parents: 25979
diff changeset
78 #endif /* PURPLE_JABBER_DATA_H */