/* xmpp-discoinfo.h - Hold XMPP discovery info * * Copyright 2008 OpenMoko, Inc. * Authored by Daniel Willmann * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _XMPP_DISCOINFO_H_ #define _XMPP_DISCOINFO_H_ #define G_DISABLE_CAST_CHECKS #include #include G_BEGIN_DECLS struct XmppDiscoinfoIdentity { gchar *category; gchar *type; gchar *name; }; struct XmppDiscoinfoFeature { gchar *var; }; #define XMPP_TYPE_DISCOINFO (xmpp_discoinfo_get_type()) #define XMPP_DISCOINFO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XMPP_TYPE_DISCOINFO, XmppDiscoinfo)) #define XMPP_DISCOINFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XMPP_TYPE_DISCOINFO, XmppDiscoinfoClass)) #define XMPP_IS_DISCOINFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XMPP_TYPE_DISCOINFO)) #define XMPP_IS_DISCOINFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), XMPP_TYPE_DISCOINFO)) #define XMPP_DISCOINFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XMPP_TYPE_DISCOINFO, XmppDiscoinfoClass)) typedef struct _XmppDiscoinfo XmppDiscoinfo; typedef struct _XmppDiscoinfoClass XmppDiscoinfoClass; struct _XmppDiscoinfo { GObject parent_object; }; struct _XmppDiscoinfoClass { GObjectClass parent_class; }; GType xmpp_discoinfo_get_type(void) G_GNUC_CONST; XmppDiscoinfo *xmpp_discoinfo_new(GError **error); XmppDiscoinfo *xmpp_discoinfo_new_from_msg_node(LmMessageNode *node, GError **error); void xmpp_discoinfo_ident_to_node(struct XmppDiscoinfoIdentity *ident, LmMessageNode *node); void xmpp_discoinfo_feat_to_node(struct XmppDiscoinfoFeature *feat, LmMessageNode *node); void xmpp_discoinfo_add_identity(XmppDiscoinfo *discoinfo, const gchar *category, const gchar *type, const gchar *name); void xmpp_discoinfo_add_feature(XmppDiscoinfo *discoinfo, const gchar *var); GList *xmpp_discoinfo_get_identities(XmppDiscoinfo *discoinfo); GList *xmpp_discoinfo_get_features(XmppDiscoinfo *discoinfo); char *xmpp_discoinfo_get_hash(XmppDiscoinfo *discoinfo, const char *hash_func); G_END_DECLS #endif /* _XMPP_DISCOINFO_H_ */