/* xmpp-capability.h - XMPP Entity Capability * Capability hash / Disco Features pair * * 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_CAPABILITY_H_ #define _XMPP_CAPABILITY_H_ #define G_DISABLE_CAST_CHECKS #include #include #include G_BEGIN_DECLS #define XMPP_CAPABILITY_HASH_SHA1 "sha-1" #define XMPP_TYPE_CAPABILITY (xmpp_capability_get_type()) #define XMPP_CAPABILITY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XMPP_TYPE_CAPABILITY, XmppCapability)) #define XMPP_CAPABILITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XMPP_TYPE_CAPABILITY, XmppCapabilityClass)) #define XMPP_IS_CAPABILITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XMPP_TYPE_CAPABILITY)) #define XMPP_IS_CAPABILITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), XMPP_TYPE_CAPABILITY)) #define XMPP_CAPABILITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XMPP_TYPE_CAPABILITY, XmppCapabilityClass)) typedef struct _XmppCapability XmppCapability; typedef struct _XmppCapabilityClass XmppCapabilityClass; struct _XmppCapability { GObject parent_object; }; struct _XmppCapabilityClass { GObjectClass parent_class; }; GType xmpp_capability_get_type(void) G_GNUC_CONST; XmppCapability *xmpp_capability_new(XmppDiscoinfo *info, const gchar *hash_func, const gchar *hash, GError **error); gchar *xmpp_capability_get_hash_func(XmppCapability *capability); gchar *xmpp_capability_get_hash(XmppCapability *capability); XmppDiscoinfo *xmpp_capability_get_disco(XmppCapability *capability); void xmpp_capability_set_discoinfo(XmppCapability *capability, XmppDiscoinfo *discoinfo); void xmpp_capability_set_hash(XmppCapability *capability, const char* hash_func, const char* hash); G_END_DECLS #endif /* _XMPP_CAPABILITY_H_ */