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

#include "omemo.h"
#include <glib-object.h>
#include <glib.h>
#include "libdino.h"
#include "xmpp-vala.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

enum  {
	DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_0_PROPERTY,
	DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_ID_PROPERTY,
	DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_TAB_PROPERTY,
	DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_contact_details_provider_properties[DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _DinoPluginsOmemoContactDetailsProviderPrivate {
	DinoPluginsOmemoPlugin* plugin;
};

static gint DinoPluginsOmemoContactDetailsProvider_private_offset;
static gpointer dino_plugins_omemo_contact_details_provider_parent_class = NULL;
static DinoPluginsContactDetailsProviderIface * dino_plugins_omemo_contact_details_provider_dino_plugins_contact_details_provider_parent_iface = NULL;

static void dino_plugins_omemo_contact_details_provider_real_populate (DinoPluginsContactDetailsProvider* base,
                                                                DinoEntitiesConversation* conversation,
                                                                DinoPluginsContactDetails* contact_details,
                                                                DinoPluginsWidgetType type);
static GObject* dino_plugins_omemo_contact_details_provider_real_get_widget (DinoPluginsContactDetailsProvider* base,
                                                                      DinoEntitiesConversation* conversation);
static void dino_plugins_omemo_contact_details_provider_finalize (GObject * obj);
static GType dino_plugins_omemo_contact_details_provider_get_type_once (void);
static void _vala_dino_plugins_omemo_contact_details_provider_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_plugins_omemo_contact_details_provider_get_instance_private (DinoPluginsOmemoContactDetailsProvider* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoContactDetailsProvider_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

DinoPluginsOmemoContactDetailsProvider*
dino_plugins_omemo_contact_details_provider_construct (GType object_type,
                                                       DinoPluginsOmemoPlugin* plugin)
{
	DinoPluginsOmemoContactDetailsProvider * self = NULL;
	DinoPluginsOmemoPlugin* _tmp0_;
	g_return_val_if_fail (plugin != NULL, NULL);
	self = (DinoPluginsOmemoContactDetailsProvider*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (plugin);
	_g_object_unref0 (self->priv->plugin);
	self->priv->plugin = _tmp0_;
	return self;
}

DinoPluginsOmemoContactDetailsProvider*
dino_plugins_omemo_contact_details_provider_new (DinoPluginsOmemoPlugin* plugin)
{
	return dino_plugins_omemo_contact_details_provider_construct (DINO_PLUGINS_OMEMO_TYPE_CONTACT_DETAILS_PROVIDER, plugin);
}

static void
dino_plugins_omemo_contact_details_provider_real_populate (DinoPluginsContactDetailsProvider* base,
                                                           DinoEntitiesConversation* conversation,
                                                           DinoPluginsContactDetails* contact_details,
                                                           DinoPluginsWidgetType type)
{
	DinoPluginsOmemoContactDetailsProvider * self;
	self = (DinoPluginsOmemoContactDetailsProvider*) base;
	g_return_if_fail (conversation != NULL);
	g_return_if_fail (contact_details != NULL);
}

static GObject*
dino_plugins_omemo_contact_details_provider_real_get_widget (DinoPluginsContactDetailsProvider* base,
                                                             DinoEntitiesConversation* conversation)
{
	DinoPluginsOmemoContactDetailsProvider * self;
	DinoEntitiesConversationType _tmp0_;
	DinoEntitiesConversationType _tmp1_;
	DinoPluginsOmemoOmemoPreferencesWidget* widget = NULL;
	DinoPluginsOmemoPlugin* _tmp2_;
	DinoPluginsOmemoOmemoPreferencesWidget* _tmp3_;
	DinoPluginsOmemoOmemoPreferencesWidget* _tmp4_;
	DinoEntitiesAccount* _tmp5_;
	DinoEntitiesAccount* _tmp6_;
	XmppJid* _tmp7_;
	XmppJid* _tmp8_;
	GObject* result;
	self = (DinoPluginsOmemoContactDetailsProvider*) base;
	g_return_val_if_fail (conversation != NULL, NULL);
	_tmp0_ = dino_entities_conversation_get_type_ (conversation);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != DINO_ENTITIES_CONVERSATION_TYPE_CHAT) {
		result = NULL;
		return result;
	}
	_tmp2_ = self->priv->plugin;
	_tmp3_ = dino_plugins_omemo_omemo_preferences_widget_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	widget = _tmp3_;
	_tmp4_ = widget;
	_tmp5_ = dino_entities_conversation_get_account (conversation);
	_tmp6_ = _tmp5_;
	_tmp7_ = dino_entities_conversation_get_counterpart (conversation);
	_tmp8_ = _tmp7_;
	dino_plugins_omemo_omemo_preferences_widget_set_jid (_tmp4_, _tmp6_, _tmp8_);
	result = (GObject*) widget;
	return result;
}

static const gchar*
dino_plugins_omemo_contact_details_provider_real_get_id (DinoPluginsContactDetailsProvider* base)
{
	const gchar* result;
	DinoPluginsOmemoContactDetailsProvider* self;
	self = (DinoPluginsOmemoContactDetailsProvider*) base;
	result = "omemo_info";
	return result;
}

static const gchar*
dino_plugins_omemo_contact_details_provider_real_get_tab (DinoPluginsContactDetailsProvider* base)
{
	const gchar* result;
	DinoPluginsOmemoContactDetailsProvider* self;
	self = (DinoPluginsOmemoContactDetailsProvider*) base;
	result = "encryption";
	return result;
}

static void
dino_plugins_omemo_contact_details_provider_class_init (DinoPluginsOmemoContactDetailsProviderClass * klass,
                                                        gpointer klass_data)
{
	dino_plugins_omemo_contact_details_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoContactDetailsProvider_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_plugins_omemo_contact_details_provider_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_contact_details_provider_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_ID_PROPERTY, dino_plugins_omemo_contact_details_provider_properties[DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_TAB_PROPERTY, dino_plugins_omemo_contact_details_provider_properties[DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_TAB_PROPERTY] = g_param_spec_string ("tab", "tab", "tab", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_plugins_omemo_contact_details_provider_dino_plugins_contact_details_provider_interface_init (DinoPluginsContactDetailsProviderIface * iface,
                                                                                                  gpointer iface_data)
{
	dino_plugins_omemo_contact_details_provider_dino_plugins_contact_details_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->populate = (void (*) (DinoPluginsContactDetailsProvider*, DinoEntitiesConversation*, DinoPluginsContactDetails*, DinoPluginsWidgetType)) dino_plugins_omemo_contact_details_provider_real_populate;
	iface->get_widget = (GObject* (*) (DinoPluginsContactDetailsProvider*, DinoEntitiesConversation*)) dino_plugins_omemo_contact_details_provider_real_get_widget;
	iface->get_id = dino_plugins_omemo_contact_details_provider_real_get_id;
	iface->get_tab = dino_plugins_omemo_contact_details_provider_real_get_tab;
}

static void
dino_plugins_omemo_contact_details_provider_instance_init (DinoPluginsOmemoContactDetailsProvider * self,
                                                           gpointer klass)
{
	self->priv = dino_plugins_omemo_contact_details_provider_get_instance_private (self);
}

static void
dino_plugins_omemo_contact_details_provider_finalize (GObject * obj)
{
	DinoPluginsOmemoContactDetailsProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_TYPE_CONTACT_DETAILS_PROVIDER, DinoPluginsOmemoContactDetailsProvider);
	_g_object_unref0 (self->priv->plugin);
	G_OBJECT_CLASS (dino_plugins_omemo_contact_details_provider_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_contact_details_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoContactDetailsProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_contact_details_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoContactDetailsProvider), 0, (GInstanceInitFunc) dino_plugins_omemo_contact_details_provider_instance_init, NULL };
	static const GInterfaceInfo dino_plugins_contact_details_provider_info = { (GInterfaceInitFunc) dino_plugins_omemo_contact_details_provider_dino_plugins_contact_details_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_plugins_omemo_contact_details_provider_type_id;
	dino_plugins_omemo_contact_details_provider_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoPluginsOmemoContactDetailsProvider", &g_define_type_info, 0);
	g_type_add_interface_static (dino_plugins_omemo_contact_details_provider_type_id, DINO_PLUGINS_TYPE_CONTACT_DETAILS_PROVIDER, &dino_plugins_contact_details_provider_info);
	DinoPluginsOmemoContactDetailsProvider_private_offset = g_type_add_instance_private (dino_plugins_omemo_contact_details_provider_type_id, sizeof (DinoPluginsOmemoContactDetailsProviderPrivate));
	return dino_plugins_omemo_contact_details_provider_type_id;
}

GType
dino_plugins_omemo_contact_details_provider_get_type (void)
{
	static volatile gsize dino_plugins_omemo_contact_details_provider_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_contact_details_provider_type_id__once)) {
		GType dino_plugins_omemo_contact_details_provider_type_id;
		dino_plugins_omemo_contact_details_provider_type_id = dino_plugins_omemo_contact_details_provider_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_contact_details_provider_type_id__once, dino_plugins_omemo_contact_details_provider_type_id);
	}
	return dino_plugins_omemo_contact_details_provider_type_id__once;
}

static void
_vala_dino_plugins_omemo_contact_details_provider_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec)
{
	DinoPluginsOmemoContactDetailsProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_OMEMO_TYPE_CONTACT_DETAILS_PROVIDER, DinoPluginsOmemoContactDetailsProvider);
	switch (property_id) {
		case DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_ID_PROPERTY:
		g_value_set_string (value, dino_plugins_contact_details_provider_get_id ((DinoPluginsContactDetailsProvider*) self));
		break;
		case DINO_PLUGINS_OMEMO_CONTACT_DETAILS_PROVIDER_TAB_PROPERTY:
		g_value_set_string (value, dino_plugins_contact_details_provider_get_tab ((DinoPluginsContactDetailsProvider*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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;
}

