Migrate certificates, icons, logs to XDG dirs
[pidgin-git.git] / libpurple / protocols / jabber / xdata.h
blob855b0460c6960211f13d15c3d9535f9223be9fe2
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
24 #ifndef PURPLE_JABBER_XDATA_H_
25 #define PURPLE_JABBER_XDATA_H_
27 #include "jabber.h"
28 #include "xmlnode.h"
30 typedef struct _JabberXDataAction {
31 char *name;
32 char *handle;
33 } JabberXDataAction;
35 typedef void (*jabber_x_data_cb)(JabberStream *js, PurpleXmlNode *result, gpointer user_data);
36 typedef void (*jabber_x_data_action_cb)(JabberStream *js, PurpleXmlNode *result, const char *actionhandle, gpointer user_data);
37 void *jabber_x_data_request(JabberStream *js, PurpleXmlNode *packet, jabber_x_data_cb cb, gpointer user_data);
38 void *jabber_x_data_request_with_actions(JabberStream *js, PurpleXmlNode *packet, GList *actions, int defaultaction, jabber_x_data_action_cb cb, gpointer user_data);
41 * Return the form type (the CDATA of the value child of the FORM_TYPE
42 * field entry.
43 * E.g., for the following, "http://jabber.org/protocol/muc#roominfo".
44 * <x xmlns='jabber:x:data' type='result'>
45 * <field var='FORM_TYPE' type='hidden'>
46 * <value>http://jabber.org/protocol/muc#roominfo</value>
47 * </field>
48 * </x>
50 * @param form The PurpleXmlNode for the form (the 'x' element)
51 * @returns The FORM_TYPE. Must be freed by caller.
53 gchar *jabber_x_data_get_formtype(const PurpleXmlNode *form);
55 #endif /* PURPLE_JABBER_XDATA_H_ */