/* contacts-full-name-chunk.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from contacts-full-name-chunk.vala, do not modify */

/*
 * Copyright (C) 2022 Niels De Graef <nielsdegraef@gmail.com>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#include "contactscore.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <folks/folks.h>
#include <glib/gi18n-lib.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  {
	CONTACTS_FULL_NAME_CHUNK_0_PROPERTY,
	CONTACTS_FULL_NAME_CHUNK_FULL_NAME_PROPERTY,
	CONTACTS_FULL_NAME_CHUNK_PROPERTY_NAME_PROPERTY,
	CONTACTS_FULL_NAME_CHUNK_DISPLAY_NAME_PROPERTY,
	CONTACTS_FULL_NAME_CHUNK_ICON_NAME_PROPERTY,
	CONTACTS_FULL_NAME_CHUNK_IS_EMPTY_PROPERTY,
	CONTACTS_FULL_NAME_CHUNK_DIRTY_PROPERTY,
	CONTACTS_FULL_NAME_CHUNK_NUM_PROPERTIES
};
static GParamSpec* contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ContactsFullNameChunkSaveToPersonaData ContactsFullNameChunkSaveToPersonaData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _ContactsFullNameChunkPrivate {
	gchar* original_full_name;
	gchar* _full_name;
};

struct _ContactsFullNameChunkSaveToPersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ContactsFullNameChunk* self;
	FolksPersona* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	FolksPersona* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	GError* _inner_error0_;
};

static gint ContactsFullNameChunk_private_offset;
static gpointer contacts_full_name_chunk_parent_class = NULL;

static GValue* contacts_full_name_chunk_real_to_value (ContactsChunk* base);
static void contacts_full_name_chunk_real_save_to_persona_data_free (gpointer _data);
static void contacts_full_name_chunk_real_save_to_persona (ContactsChunk* base,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static gboolean contacts_full_name_chunk_real_save_to_persona_co (ContactsFullNameChunkSaveToPersonaData* _data_);
static void contacts_full_name_chunk_save_to_persona_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static GVariant* contacts_full_name_chunk_real_to_gvariant (ContactsChunk* base);
static void contacts_full_name_chunk_real_apply_gvariant (ContactsChunk* base,
                                                   GVariant* variant,
                                                   gboolean mark_dirty);
static GObject * contacts_full_name_chunk_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
static void contacts_full_name_chunk_finalize (GObject * obj);
static GType contacts_full_name_chunk_get_type_once (void);
static void _vala_contacts_full_name_chunk_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_contacts_full_name_chunk_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);

static inline gpointer
contacts_full_name_chunk_get_instance_private (ContactsFullNameChunk* self)
{
	return G_STRUCT_MEMBER_P (self, ContactsFullNameChunk_private_offset);
}

ContactsFullNameChunk*
contacts_full_name_chunk_construct_from_gvariant (GType object_type,
                                                  GVariant* variant)
{
	ContactsFullNameChunk * self = NULL;
	const gchar* fn = NULL;
	const gchar* _tmp0_;
	g_return_val_if_fail (variant != NULL, NULL);
	_tmp0_ = g_variant_get_string (variant, NULL);
	fn = _tmp0_;
	self = (ContactsFullNameChunk*) g_object_new (object_type, "persona", NULL, "full-name", fn, NULL);
	return self;
}

ContactsFullNameChunk*
contacts_full_name_chunk_new_from_gvariant (GVariant* variant)
{
	return contacts_full_name_chunk_construct_from_gvariant (CONTACTS_TYPE_FULL_NAME_CHUNK, variant);
}

static GValue*
contacts_full_name_chunk_real_to_value (ContactsChunk* base)
{
	ContactsFullNameChunk * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GValue* _tmp2_ = NULL;
	GValue* result;
	self = (ContactsFullNameChunk*) base;
	_tmp0_ = contacts_full_name_chunk_get_full_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_new0 (GValue, 1);
	g_value_init (_tmp2_, G_TYPE_STRING);
	g_value_set_string (_tmp2_, _tmp1_);
	result = _tmp2_;
	return result;
}

static void
contacts_full_name_chunk_real_save_to_persona_data_free (gpointer _data)
{
	ContactsFullNameChunkSaveToPersonaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ContactsFullNameChunkSaveToPersonaData, _data_);
}

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

static void
contacts_full_name_chunk_real_save_to_persona (ContactsChunk* base,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	ContactsFullNameChunk * self;
	ContactsFullNameChunkSaveToPersonaData* _data_;
	ContactsFullNameChunk* _tmp0_;
	self = (ContactsFullNameChunk*) base;
	_data_ = g_slice_new0 (ContactsFullNameChunkSaveToPersonaData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, contacts_full_name_chunk_real_save_to_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	contacts_full_name_chunk_real_save_to_persona_co (_data_);
}

static void
contacts_full_name_chunk_save_to_persona_finish (ContactsChunk* base,
                                                 GAsyncResult* _res_,
                                                 GError** error)
{
	ContactsFullNameChunkSaveToPersonaData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
contacts_full_name_chunk_save_to_persona_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	ContactsFullNameChunkSaveToPersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_full_name_chunk_real_save_to_persona_co (_data_);
}

static gboolean
contacts_full_name_chunk_real_save_to_persona_co (ContactsFullNameChunkSaveToPersonaData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = contacts_chunk_get_persona ((ContactsChunk*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_vala_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp1_, FOLKS_TYPE_NAME_DETAILS), "this.persona is NameDetails", FALSE);
	_data_->_tmp2_ = contacts_chunk_get_persona ((ContactsChunk*) _data_->self);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = contacts_full_name_chunk_get_full_name (_data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	folks_name_details_change_full_name (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp3_, FOLKS_TYPE_NAME_DETAILS, FolksNameDetails), _data_->_tmp5_, contacts_full_name_chunk_save_to_persona_ready, _data_);
	return FALSE;
	_state_1:
	folks_name_details_change_full_name_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp3_, FOLKS_TYPE_NAME_DETAILS, FolksNameDetails), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = contacts_full_name_chunk_get_full_name (_data_->self);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
	_g_free0 (_data_->self->priv->original_full_name);
	_data_->self->priv->original_full_name = _data_->_tmp8_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static GVariant*
contacts_full_name_chunk_real_to_gvariant (ContactsChunk* base)
{
	ContactsFullNameChunk * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GVariant* _tmp4_;
	GVariant* result;
	self = (ContactsFullNameChunk*) base;
	_tmp0_ = contacts_full_name_chunk_get_full_name (self);
	_tmp1_ = _tmp0_;
	if (g_strcmp0 (_tmp1_, "") == 0) {
		result = NULL;
		return result;
	}
	_tmp2_ = contacts_full_name_chunk_get_full_name (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_variant_new_string (_tmp3_);
	g_variant_ref_sink (_tmp4_);
	result = _tmp4_;
	return result;
}

static void
contacts_full_name_chunk_real_apply_gvariant (ContactsChunk* base,
                                              GVariant* variant,
                                              gboolean mark_dirty)
{
	ContactsFullNameChunk * self;
	const GVariantType* _tmp0_;
	const GVariantType* _tmp1_;
	const gchar* full_name = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp5_;
	self = (ContactsFullNameChunk*) base;
	g_return_if_fail (variant != NULL);
	_tmp0_ = g_variant_get_type (variant);
	_tmp1_ = G_VARIANT_TYPE_STRING;
	_vala_return_if_fail (g_variant_type_equal (_tmp0_, _tmp1_), "variant.get_type ().equal (VariantType.STRING)");
	_tmp2_ = g_variant_get_string (variant, NULL);
	full_name = _tmp2_;
	if (!mark_dirty) {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = full_name;
		_tmp4_ = g_strdup (_tmp3_);
		_g_free0 (self->priv->original_full_name);
		self->priv->original_full_name = _tmp4_;
	}
	_tmp5_ = full_name;
	contacts_full_name_chunk_set_full_name (self, _tmp5_);
}

ContactsFullNameChunk*
contacts_full_name_chunk_construct (GType object_type)
{
	ContactsFullNameChunk * self = NULL;
	self = (ContactsFullNameChunk*) contacts_chunk_construct (object_type);
	return self;
}

ContactsFullNameChunk*
contacts_full_name_chunk_new (void)
{
	return contacts_full_name_chunk_construct (CONTACTS_TYPE_FULL_NAME_CHUNK);
}

const gchar*
contacts_full_name_chunk_get_full_name (ContactsFullNameChunk* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_name;
	result = _tmp0_;
	return result;
}

void
contacts_full_name_chunk_set_full_name (ContactsFullNameChunk* self,
                                        const gchar* value)
{
	const gchar* _tmp0_;
	gboolean was_empty = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean was_dirty = FALSE;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_full_name;
	if (g_strcmp0 (_tmp0_, value) == 0) {
		return;
	}
	_tmp1_ = contacts_chunk_get_is_empty ((ContactsChunk*) self);
	_tmp2_ = _tmp1_;
	was_empty = _tmp2_;
	_tmp3_ = contacts_chunk_get_dirty ((ContactsChunk*) self);
	_tmp4_ = _tmp3_;
	was_dirty = _tmp4_;
	_tmp5_ = g_strdup (value);
	_g_free0 (self->priv->_full_name);
	self->priv->_full_name = _tmp5_;
	g_object_notify ((GObject*) self, "full-name");
	_tmp6_ = contacts_chunk_get_is_empty ((ContactsChunk*) self);
	_tmp7_ = _tmp6_;
	if (_tmp7_ != was_empty) {
		g_object_notify ((GObject*) self, "is-empty");
	}
	_tmp8_ = contacts_chunk_get_dirty ((ContactsChunk*) self);
	_tmp9_ = _tmp8_;
	if (was_dirty != _tmp9_) {
		g_object_notify ((GObject*) self, "dirty");
	}
	g_object_notify_by_pspec ((GObject *) self, contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_FULL_NAME_PROPERTY]);
}

static const gchar*
contacts_full_name_chunk_real_get_property_name (ContactsChunk* base)
{
	const gchar* result;
	ContactsFullNameChunk* self;
	self = (ContactsFullNameChunk*) base;
	result = "full-name";
	return result;
}

static const gchar*
contacts_full_name_chunk_real_get_display_name (ContactsChunk* base)
{
	const gchar* result;
	ContactsFullNameChunk* self;
	self = (ContactsFullNameChunk*) base;
	result = _ ("Full name");
	return result;
}

static const gchar*
contacts_full_name_chunk_real_get_icon_name (ContactsChunk* base)
{
	const gchar* result;
	ContactsFullNameChunk* self;
	self = (ContactsFullNameChunk*) base;
	result = NULL;
	return result;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gboolean
contacts_full_name_chunk_real_get_is_empty (ContactsChunk* base)
{
	gboolean result;
	ContactsFullNameChunk* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	self = (ContactsFullNameChunk*) base;
	_tmp0_ = self->priv->_full_name;
	_tmp1_ = string_strip (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strcmp0 (_tmp2_, "") == 0;
	_g_free0 (_tmp2_);
	result = _tmp3_;
	return result;
}

static gboolean
contacts_full_name_chunk_real_get_dirty (ContactsChunk* base)
{
	gboolean result;
	ContactsFullNameChunk* self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	self = (ContactsFullNameChunk*) base;
	_tmp0_ = contacts_full_name_chunk_get_full_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_strip (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->original_full_name;
	_tmp5_ = string_strip (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strcmp0 (_tmp3_, _tmp6_) != 0;
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	result = _tmp7_;
	return result;
}

static GObject *
contacts_full_name_chunk_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ContactsFullNameChunk * self;
	FolksPersona* _tmp0_;
	FolksPersona* _tmp1_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	parent_class = G_OBJECT_CLASS (contacts_full_name_chunk_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_FULL_NAME_CHUNK, ContactsFullNameChunk);
	_tmp0_ = contacts_chunk_get_persona ((ContactsChunk*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		FolksPersona* _tmp2_;
		FolksPersona* _tmp3_;
		FolksPersona* _tmp4_;
		FolksPersona* _tmp5_;
		FolksPersona* _tmp6_;
		FolksPersona* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp2_ = contacts_chunk_get_persona ((ContactsChunk*) self);
		_tmp3_ = _tmp2_;
		_vala_assert (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, FOLKS_TYPE_NAME_DETAILS), "persona is NameDetails");
		_tmp4_ = contacts_chunk_get_persona ((ContactsChunk*) self);
		_tmp5_ = _tmp4_;
		g_object_bind_property_with_closures ((GObject*) _tmp5_, "full-name", (GObject*) self, "full-name", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp6_ = contacts_chunk_get_persona ((ContactsChunk*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = folks_name_details_get_full_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, FOLKS_TYPE_NAME_DETAILS, FolksNameDetails));
		_tmp9_ = _tmp8_;
		_tmp10_ = g_strdup (_tmp9_);
		_g_free0 (self->priv->_full_name);
		self->priv->_full_name = _tmp10_;
	}
	_tmp11_ = contacts_full_name_chunk_get_full_name (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup (_tmp12_);
	_g_free0 (self->priv->original_full_name);
	self->priv->original_full_name = _tmp13_;
	return obj;
}

static void
contacts_full_name_chunk_class_init (ContactsFullNameChunkClass * klass,
                                     gpointer klass_data)
{
	contacts_full_name_chunk_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ContactsFullNameChunk_private_offset);
	((ContactsChunkClass *) klass)->to_value = (GValue* (*) (ContactsChunk*)) contacts_full_name_chunk_real_to_value;
	((ContactsChunkClass *) klass)->save_to_persona = (void (*) (ContactsChunk*, GAsyncReadyCallback, gpointer)) contacts_full_name_chunk_real_save_to_persona;
	((ContactsChunkClass *) klass)->save_to_persona_finish = (void (*) (ContactsChunk*, GAsyncResult*, GError**)) contacts_full_name_chunk_save_to_persona_finish;
	((ContactsChunkClass *) klass)->to_gvariant = (GVariant* (*) (ContactsChunk*)) contacts_full_name_chunk_real_to_gvariant;
	((ContactsChunkClass *) klass)->apply_gvariant = (void (*) (ContactsChunk*, GVariant*, gboolean)) contacts_full_name_chunk_real_apply_gvariant;
	CONTACTS_CHUNK_CLASS (klass)->get_property_name = (const gchar* (*) (ContactsChunk*)) contacts_full_name_chunk_real_get_property_name;
	CONTACTS_CHUNK_CLASS (klass)->get_display_name = (const gchar* (*) (ContactsChunk*)) contacts_full_name_chunk_real_get_display_name;
	CONTACTS_CHUNK_CLASS (klass)->get_icon_name = (const gchar* (*) (ContactsChunk*)) contacts_full_name_chunk_real_get_icon_name;
	CONTACTS_CHUNK_CLASS (klass)->get_is_empty = (gboolean (*) (ContactsChunk*)) contacts_full_name_chunk_real_get_is_empty;
	CONTACTS_CHUNK_CLASS (klass)->get_dirty = (gboolean (*) (ContactsChunk*)) contacts_full_name_chunk_real_get_dirty;
	G_OBJECT_CLASS (klass)->get_property = _vala_contacts_full_name_chunk_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_contacts_full_name_chunk_set_property;
	G_OBJECT_CLASS (klass)->constructor = contacts_full_name_chunk_constructor;
	G_OBJECT_CLASS (klass)->finalize = contacts_full_name_chunk_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FULL_NAME_CHUNK_FULL_NAME_PROPERTY, contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_FULL_NAME_PROPERTY] = g_param_spec_string ("full-name", "full-name", "full-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FULL_NAME_CHUNK_PROPERTY_NAME_PROPERTY, contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_PROPERTY_NAME_PROPERTY] = g_param_spec_string ("property-name", "property-name", "property-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FULL_NAME_CHUNK_DISPLAY_NAME_PROPERTY, contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FULL_NAME_CHUNK_ICON_NAME_PROPERTY, contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FULL_NAME_CHUNK_IS_EMPTY_PROPERTY, contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_IS_EMPTY_PROPERTY] = g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FULL_NAME_CHUNK_DIRTY_PROPERTY, contacts_full_name_chunk_properties[CONTACTS_FULL_NAME_CHUNK_DIRTY_PROPERTY] = g_param_spec_boolean ("dirty", "dirty", "dirty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
contacts_full_name_chunk_instance_init (ContactsFullNameChunk * self,
                                        gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = contacts_full_name_chunk_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->original_full_name = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_full_name = _tmp1_;
}

static void
contacts_full_name_chunk_finalize (GObject * obj)
{
	ContactsFullNameChunk * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_FULL_NAME_CHUNK, ContactsFullNameChunk);
	_g_free0 (self->priv->original_full_name);
	_g_free0 (self->priv->_full_name);
	G_OBJECT_CLASS (contacts_full_name_chunk_parent_class)->finalize (obj);
}

/**
 * A {@link Chunk} that represents the full name of a contact as a single
 * string (contrary to the structured name, where the name is split up in the
 * several constituent parts}.
 */
 G_GNUC_NO_INLINE static GType
contacts_full_name_chunk_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ContactsFullNameChunkClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_full_name_chunk_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsFullNameChunk), 0, (GInstanceInitFunc) contacts_full_name_chunk_instance_init, NULL };
	GType contacts_full_name_chunk_type_id;
	contacts_full_name_chunk_type_id = g_type_register_static (CONTACTS_TYPE_CHUNK, "ContactsFullNameChunk", &g_define_type_info, 0);
	ContactsFullNameChunk_private_offset = g_type_add_instance_private (contacts_full_name_chunk_type_id, sizeof (ContactsFullNameChunkPrivate));
	return contacts_full_name_chunk_type_id;
}

GType
contacts_full_name_chunk_get_type (void)
{
	static volatile gsize contacts_full_name_chunk_type_id__once = 0;
	if (g_once_init_enter (&contacts_full_name_chunk_type_id__once)) {
		GType contacts_full_name_chunk_type_id;
		contacts_full_name_chunk_type_id = contacts_full_name_chunk_get_type_once ();
		g_once_init_leave (&contacts_full_name_chunk_type_id__once, contacts_full_name_chunk_type_id);
	}
	return contacts_full_name_chunk_type_id__once;
}

static void
_vala_contacts_full_name_chunk_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	ContactsFullNameChunk * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_FULL_NAME_CHUNK, ContactsFullNameChunk);
	switch (property_id) {
		case CONTACTS_FULL_NAME_CHUNK_FULL_NAME_PROPERTY:
		g_value_set_string (value, contacts_full_name_chunk_get_full_name (self));
		break;
		case CONTACTS_FULL_NAME_CHUNK_PROPERTY_NAME_PROPERTY:
		g_value_set_string (value, contacts_chunk_get_property_name ((ContactsChunk*) self));
		break;
		case CONTACTS_FULL_NAME_CHUNK_DISPLAY_NAME_PROPERTY:
		g_value_set_string (value, contacts_chunk_get_display_name ((ContactsChunk*) self));
		break;
		case CONTACTS_FULL_NAME_CHUNK_ICON_NAME_PROPERTY:
		g_value_set_string (value, contacts_chunk_get_icon_name ((ContactsChunk*) self));
		break;
		case CONTACTS_FULL_NAME_CHUNK_IS_EMPTY_PROPERTY:
		g_value_set_boolean (value, contacts_chunk_get_is_empty ((ContactsChunk*) self));
		break;
		case CONTACTS_FULL_NAME_CHUNK_DIRTY_PROPERTY:
		g_value_set_boolean (value, contacts_chunk_get_dirty ((ContactsChunk*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_contacts_full_name_chunk_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	ContactsFullNameChunk * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_FULL_NAME_CHUNK, ContactsFullNameChunk);
	switch (property_id) {
		case CONTACTS_FULL_NAME_CHUNK_FULL_NAME_PROPERTY:
		contacts_full_name_chunk_set_full_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

