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

#include "xmpp-vala.h"
#include <gio/gio.h>
#include <glib.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_transport_get_type_once (void);
static GType xmpp_xep_jingle_transport_parameters_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
xmpp_xep_jingle_transport_is_transport_available (XmppXepJingleTransport* self,
                                                  XmppXmppStream* stream,
                                                  guint8 components,
                                                  XmppJid* full_jid,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_)
{
	XmppXepJingleTransportIface* _iface_;
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_GET_INTERFACE (self);
	if (_iface_->is_transport_available) {
		_iface_->is_transport_available (self, stream, components, full_jid, _callback_, _user_data_);
	}
}

gboolean
xmpp_xep_jingle_transport_is_transport_available_finish (XmppXepJingleTransport* self,
                                                         GAsyncResult* _res_)
{
	XmppXepJingleTransportIface* _iface_;
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_GET_INTERFACE (self);
	if (_iface_->is_transport_available_finish) {
		return _iface_->is_transport_available_finish (self, _res_);
	}
	return FALSE;
}

XmppXepJingleTransportParameters*
xmpp_xep_jingle_transport_create_transport_parameters (XmppXepJingleTransport* self,
                                                       XmppXmppStream* stream,
                                                       guint8 components,
                                                       XmppJid* local_full_jid,
                                                       XmppJid* peer_full_jid,
                                                       GError** error)
{
	XmppXepJingleTransportIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_GET_INTERFACE (self);
	if (_iface_->create_transport_parameters) {
		return _iface_->create_transport_parameters (self, stream, components, local_full_jid, peer_full_jid, error);
	}
	return NULL;
}

XmppXepJingleTransportParameters*
xmpp_xep_jingle_transport_parse_transport_parameters (XmppXepJingleTransport* self,
                                                      XmppXmppStream* stream,
                                                      guint8 components,
                                                      XmppJid* local_full_jid,
                                                      XmppJid* peer_full_jid,
                                                      XmppStanzaNode* transport,
                                                      GError** error)
{
	XmppXepJingleTransportIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_GET_INTERFACE (self);
	if (_iface_->parse_transport_parameters) {
		return _iface_->parse_transport_parameters (self, stream, components, local_full_jid, peer_full_jid, transport, error);
	}
	return NULL;
}

const gchar*
xmpp_xep_jingle_transport_get_ns_uri (XmppXepJingleTransport* self)
{
	XmppXepJingleTransportIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_GET_INTERFACE (self);
	if (_iface_->get_ns_uri) {
		return _iface_->get_ns_uri (self);
	}
	return NULL;
}

XmppXepJingleTransportType
xmpp_xep_jingle_transport_get_type_ (XmppXepJingleTransport* self)
{
	XmppXepJingleTransportIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_GET_INTERFACE (self);
	if (_iface_->get_type_) {
		return _iface_->get_type_ (self);
	}
	return 0;
}

gint
xmpp_xep_jingle_transport_get_priority (XmppXepJingleTransport* self)
{
	XmppXepJingleTransportIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_GET_INTERFACE (self);
	if (_iface_->get_priority) {
		return _iface_->get_priority (self);
	}
	return -1;
}

static void
xmpp_xep_jingle_transport_default_init (XmppXepJingleTransportIface * 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 ("type-", "type-", "type-", XMPP_XEP_JINGLE_TYPE_TRANSPORT_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_int ("priority", "priority", "priority", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
xmpp_xep_jingle_transport_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleTransportIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_transport_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType xmpp_xep_jingle_transport_type_id;
	xmpp_xep_jingle_transport_type_id = g_type_register_static (G_TYPE_INTERFACE, "XmppXepJingleTransport", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (xmpp_xep_jingle_transport_type_id, G_TYPE_OBJECT);
	return xmpp_xep_jingle_transport_type_id;
}

GType
xmpp_xep_jingle_transport_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_transport_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_transport_type_id__once)) {
		GType xmpp_xep_jingle_transport_type_id;
		xmpp_xep_jingle_transport_type_id = xmpp_xep_jingle_transport_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_transport_type_id__once, xmpp_xep_jingle_transport_type_id);
	}
	return xmpp_xep_jingle_transport_type_id__once;
}

static GType
xmpp_xep_jingle_transport_type_get_type_once (void)
{
	static const GEnumValue values[] = {{XMPP_XEP_JINGLE_TRANSPORT_TYPE_DATAGRAM, "XMPP_XEP_JINGLE_TRANSPORT_TYPE_DATAGRAM", "datagram"}, {XMPP_XEP_JINGLE_TRANSPORT_TYPE_STREAMING, "XMPP_XEP_JINGLE_TRANSPORT_TYPE_STREAMING", "streaming"}, {0, NULL, NULL}};
	GType xmpp_xep_jingle_transport_type_type_id;
	xmpp_xep_jingle_transport_type_type_id = g_enum_register_static ("XmppXepJingleTransportType", values);
	return xmpp_xep_jingle_transport_type_type_id;
}

GType
xmpp_xep_jingle_transport_type_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_transport_type_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_transport_type_type_id__once)) {
		GType xmpp_xep_jingle_transport_type_type_id;
		xmpp_xep_jingle_transport_type_type_id = xmpp_xep_jingle_transport_type_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_transport_type_type_id__once, xmpp_xep_jingle_transport_type_type_id);
	}
	return xmpp_xep_jingle_transport_type_type_id__once;
}

void
xmpp_xep_jingle_transport_parameters_set_content (XmppXepJingleTransportParameters* self,
                                                  XmppXepJingleContent* content)
{
	XmppXepJingleTransportParametersIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->set_content) {
		_iface_->set_content (self, content);
	}
}

XmppStanzaNode*
xmpp_xep_jingle_transport_parameters_to_transport_stanza_node (XmppXepJingleTransportParameters* self,
                                                               const gchar* action_type)
{
	XmppXepJingleTransportParametersIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->to_transport_stanza_node) {
		return _iface_->to_transport_stanza_node (self, action_type);
	}
	return NULL;
}

void
xmpp_xep_jingle_transport_parameters_handle_transport_accept (XmppXepJingleTransportParameters* self,
                                                              XmppStanzaNode* transport,
                                                              GError** error)
{
	XmppXepJingleTransportParametersIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->handle_transport_accept) {
		_iface_->handle_transport_accept (self, transport, error);
	}
}

void
xmpp_xep_jingle_transport_parameters_handle_transport_info (XmppXepJingleTransportParameters* self,
                                                            XmppStanzaNode* transport,
                                                            GError** error)
{
	XmppXepJingleTransportParametersIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->handle_transport_info) {
		_iface_->handle_transport_info (self, transport, error);
	}
}

void
xmpp_xep_jingle_transport_parameters_create_transport_connection (XmppXepJingleTransportParameters* self,
                                                                  XmppXmppStream* stream,
                                                                  XmppXepJingleContent* content)
{
	XmppXepJingleTransportParametersIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->create_transport_connection) {
		_iface_->create_transport_connection (self, stream, content);
	}
}

const gchar*
xmpp_xep_jingle_transport_parameters_get_ns_uri (XmppXepJingleTransportParameters* self)
{
	XmppXepJingleTransportParametersIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->get_ns_uri) {
		return _iface_->get_ns_uri (self);
	}
	return NULL;
}

guint8
xmpp_xep_jingle_transport_parameters_get_components (XmppXepJingleTransportParameters* self)
{
	XmppXepJingleTransportParametersIface* _iface_;
	g_return_val_if_fail (self != NULL, 0U);
	_iface_ = XMPP_XEP_JINGLE_TRANSPORT_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->get_components) {
		return _iface_->get_components (self);
	}
	return 0U;
}

static void
xmpp_xep_jingle_transport_parameters_default_init (XmppXepJingleTransportParametersIface * 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_uchar ("components", "components", "components", 0, G_MAXUINT8, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
xmpp_xep_jingle_transport_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleTransportParametersIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_transport_parameters_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType xmpp_xep_jingle_transport_parameters_type_id;
	xmpp_xep_jingle_transport_parameters_type_id = g_type_register_static (G_TYPE_INTERFACE, "XmppXepJingleTransportParameters", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (xmpp_xep_jingle_transport_parameters_type_id, G_TYPE_OBJECT);
	return xmpp_xep_jingle_transport_parameters_type_id;
}

GType
xmpp_xep_jingle_transport_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_transport_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_transport_parameters_type_id__once)) {
		GType xmpp_xep_jingle_transport_parameters_type_id;
		xmpp_xep_jingle_transport_parameters_type_id = xmpp_xep_jingle_transport_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_transport_parameters_type_id__once, xmpp_xep_jingle_transport_parameters_type_id);
	}
	return xmpp_xep_jingle_transport_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;
}

