/* content_description.c generated by valac 0.56.19, the Vala compiler
 * generated from content_description.vala, do not modify */

#include "xmpp-vala.h"
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

static GType xmpp_xep_jingle_content_type_get_type_once (void);
static GType xmpp_xep_jingle_content_parameters_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

XmppXepJingleContentParameters*
xmpp_xep_jingle_content_type_parse_content_parameters (XmppXepJingleContentType* self,
                                                       XmppStanzaNode* description,
                                                       GError** error)
{
	XmppXepJingleContentTypeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_TYPE_GET_INTERFACE (self);
	if (_iface_->parse_content_parameters) {
		return _iface_->parse_content_parameters (self, description, error);
	}
	return NULL;
}

const gchar*
xmpp_xep_jingle_content_type_get_ns_uri (XmppXepJingleContentType* self)
{
	XmppXepJingleContentTypeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_TYPE_GET_INTERFACE (self);
	if (_iface_->get_ns_uri) {
		return _iface_->get_ns_uri (self);
	}
	return NULL;
}

XmppXepJingleTransportType
xmpp_xep_jingle_content_type_get_required_transport_type (XmppXepJingleContentType* self)
{
	XmppXepJingleContentTypeIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_TYPE_GET_INTERFACE (self);
	if (_iface_->get_required_transport_type) {
		return _iface_->get_required_transport_type (self);
	}
	return 0;
}

guint8
xmpp_xep_jingle_content_type_get_required_components (XmppXepJingleContentType* self)
{
	XmppXepJingleContentTypeIface* _iface_;
	g_return_val_if_fail (self != NULL, 0U);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_TYPE_GET_INTERFACE (self);
	if (_iface_->get_required_components) {
		return _iface_->get_required_components (self);
	}
	return 0U;
}

static void
xmpp_xep_jingle_content_type_default_init (XmppXepJingleContentTypeIface * iface,
                                           gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_string ("ns-uri", "ns-uri", "ns-uri", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_enum ("required-transport-type", "required-transport-type", "required-transport-type", XMPP_XEP_JINGLE_TYPE_TRANSPORT_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_uchar ("required-components", "required-components", "required-components", 0, G_MAXUINT8, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
xmpp_xep_jingle_content_type_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleContentTypeIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_content_type_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType xmpp_xep_jingle_content_type_type_id;
	xmpp_xep_jingle_content_type_type_id = g_type_register_static (G_TYPE_INTERFACE, "XmppXepJingleContentType", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (xmpp_xep_jingle_content_type_type_id, G_TYPE_OBJECT);
	return xmpp_xep_jingle_content_type_type_id;
}

GType
xmpp_xep_jingle_content_type_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_content_type_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_content_type_type_id__once)) {
		GType xmpp_xep_jingle_content_type_type_id;
		xmpp_xep_jingle_content_type_type_id = xmpp_xep_jingle_content_type_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_content_type_type_id__once, xmpp_xep_jingle_content_type_type_id);
	}
	return xmpp_xep_jingle_content_type_type_id__once;
}

void
xmpp_xep_jingle_content_parameters_handle_proposed_content (XmppXepJingleContentParameters* self,
                                                            XmppXmppStream* stream,
                                                            XmppXepJingleSession* session,
                                                            XmppXepJingleContent* content,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_)
{
	XmppXepJingleContentParametersIface* _iface_;
	_iface_ = XMPP_XEP_JINGLE_CONTENT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->handle_proposed_content) {
		_iface_->handle_proposed_content (self, stream, session, content, _callback_, _user_data_);
	}
}

void
xmpp_xep_jingle_content_parameters_handle_proposed_content_finish (XmppXepJingleContentParameters* self,
                                                                   GAsyncResult* _res_)
{
	XmppXepJingleContentParametersIface* _iface_;
	_iface_ = XMPP_XEP_JINGLE_CONTENT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->handle_proposed_content_finish) {
		_iface_->handle_proposed_content_finish (self, _res_);
	}
}

/** Called when we accept the content that was proposed by the counterpart */
void
xmpp_xep_jingle_content_parameters_accept (XmppXepJingleContentParameters* self,
                                           XmppXmppStream* stream,
                                           XmppXepJingleSession* session,
                                           XmppXepJingleContent* content)
{
	XmppXepJingleContentParametersIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->accept) {
		_iface_->accept (self, stream, session, content);
	}
}

/** Called when the counterpart accepts the content that was proposed by us*/
void
xmpp_xep_jingle_content_parameters_handle_accept (XmppXepJingleContentParameters* self,
                                                  XmppXmppStream* stream,
                                                  XmppXepJingleSession* session,
                                                  XmppXepJingleContent* content,
                                                  XmppStanzaNode* description_node)
{
	XmppXepJingleContentParametersIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->handle_accept) {
		_iface_->handle_accept (self, stream, session, content, description_node);
	}
}

void
xmpp_xep_jingle_content_parameters_terminate (XmppXepJingleContentParameters* self,
                                              gboolean we_terminated,
                                              const gchar* reason_name,
                                              const gchar* reason_text)
{
	XmppXepJingleContentParametersIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->terminate) {
		_iface_->terminate (self, we_terminated, reason_name, reason_text);
	}
}

XmppStanzaNode*
xmpp_xep_jingle_content_parameters_get_description_node (XmppXepJingleContentParameters* self)
{
	XmppXepJingleContentParametersIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_CONTENT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->get_description_node) {
		return _iface_->get_description_node (self);
	}
	return NULL;
}

static void
xmpp_xep_jingle_content_parameters_default_init (XmppXepJingleContentParametersIface * iface,
                                                 gpointer iface_data)
{
}

static GType
xmpp_xep_jingle_content_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleContentParametersIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_content_parameters_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType xmpp_xep_jingle_content_parameters_type_id;
	xmpp_xep_jingle_content_parameters_type_id = g_type_register_static (G_TYPE_INTERFACE, "XmppXepJingleContentParameters", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (xmpp_xep_jingle_content_parameters_type_id, G_TYPE_OBJECT);
	return xmpp_xep_jingle_content_parameters_type_id;
}

GType
xmpp_xep_jingle_content_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_content_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_content_parameters_type_id__once)) {
		GType xmpp_xep_jingle_content_parameters_type_id;
		xmpp_xep_jingle_content_parameters_type_id = xmpp_xep_jingle_content_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_content_parameters_type_id__once, xmpp_xep_jingle_content_parameters_type_id);
	}
	return xmpp_xep_jingle_content_parameters_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

