rename accountopt.[ch] to purpleaccountoption.[ch]
[pidgin-git.git] / libpurple / protocols / jabber / xdata.h
blob65b4dfaf19ad216385a747bd609999a6456d4c7a
1 /**
2 * @file xdata.h utility functions
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_XDATA_H
26 #define PURPLE_JABBER_XDATA_H
28 #include "jabber.h"
29 #include "xmlnode.h"
31 typedef struct {
32 char *name;
33 char *handle;
34 } JabberXDataAction;
36 typedef void (*jabber_x_data_cb)(JabberStream *js, PurpleXmlNode *result, gpointer user_data);
37 typedef void (*jabber_x_data_action_cb)(JabberStream *js, PurpleXmlNode *result, const char *actionhandle, gpointer user_data);
38 void *jabber_x_data_request(JabberStream *js, PurpleXmlNode *packet, jabber_x_data_cb cb, gpointer user_data);
39 void *jabber_x_data_request_with_actions(JabberStream *js, PurpleXmlNode *packet, GList *actions, int defaultaction, jabber_x_data_action_cb cb, gpointer user_data);
42 * Return the form type (the CDATA of the value child of the FORM_TYPE
43 * field entry.
44 * E.g., for the following, "http://jabber.org/protocol/muc#roominfo".
45 * <x xmlns='jabber:x:data' type='result'>
46 * <field var='FORM_TYPE' type='hidden'>
47 * <value>http://jabber.org/protocol/muc#roominfo</value>
48 * </field>
49 * </x>
51 * @param form The PurpleXmlNode for the form (the 'x' element)
52 * @returns The FORM_TYPE. Must be freed by caller.
54 gchar *jabber_x_data_get_formtype(const PurpleXmlNode *form);
56 #endif /* PURPLE_JABBER_XDATA_H */