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

/*
 * Copyright © 2024 Alain M. (https://github.com/alainm23/planify)
 *
 * 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 3 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., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <json-glib/json-glib.h>
#include <gee.h>
#include <glib-object.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  {
	OBJECTS_OBJECT_EVENT_0_PROPERTY,
	OBJECTS_OBJECT_EVENT_ID_PROPERTY,
	OBJECTS_OBJECT_EVENT_EVENT_TYPE_PROPERTY,
	OBJECTS_OBJECT_EVENT_EVENT_DATE_PROPERTY,
	OBJECTS_OBJECT_EVENT_OBJECT_ID_PROPERTY,
	OBJECTS_OBJECT_EVENT_OBJECT_TYPE_PROPERTY,
	OBJECTS_OBJECT_EVENT_OBJECT_KEY_PROPERTY,
	OBJECTS_OBJECT_EVENT_OBJECT_OLD_VALUE_PROPERTY,
	OBJECTS_OBJECT_EVENT_OBJECT_NEW_VALUE_PROPERTY,
	OBJECTS_OBJECT_EVENT_PARENT_ITEM_ID_PROPERTY,
	OBJECTS_OBJECT_EVENT_PARENT_PROJECT_ID_PROPERTY,
	OBJECTS_OBJECT_EVENT_ICON_NAME_PROPERTY,
	OBJECTS_OBJECT_EVENT_DATETIME_PROPERTY,
	OBJECTS_OBJECT_EVENT_DATE_PROPERTY,
	OBJECTS_OBJECT_EVENT_TIME_PROPERTY,
	OBJECTS_OBJECT_EVENT_NUM_PROPERTIES
};
static GParamSpec* objects_object_event_properties[OBJECTS_OBJECT_EVENT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ObjectsObjectEventPrivate {
	gint64 _id;
	ObjectEventType _event_type;
	gchar* _event_date;
	gchar* _object_id;
	gchar* _object_type;
	ObjectEventKeyType _object_key;
	gchar* _object_old_value;
	gchar* _object_new_value;
	gchar* _parent_item_id;
	gchar* _parent_project_id;
	GDateTime* _datetime;
	GDateTime* _date;
	gchar* _time;
};

static gint ObjectsObjectEvent_private_offset;
static gpointer objects_object_event_parent_class = NULL;

static void objects_object_event_finalize (GObject * obj);
static GType objects_object_event_get_type_once (void);
static void _vala_objects_object_event_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_objects_object_event_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
objects_object_event_get_instance_private (ObjectsObjectEvent* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsObjectEvent_private_offset);
}

ObjectsDueDate*
objects_object_event_get_due_value (ObjectsObjectEvent* self,
                                    const gchar* value)
{
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	ObjectsDueDate* due = NULL;
	ObjectsDueDate* _tmp6_;
	ObjectsDueDate* _tmp7_;
	JsonParser* _tmp8_;
	JsonNode* _tmp9_;
	JsonObject* _tmp10_;
	GError* _inner_error0_ = NULL;
	ObjectsDueDate* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = json_parser_new ();
	parser = _tmp0_;
	{
		JsonParser* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = parser;
		_tmp2_ = strlen (value);
		_tmp3_ = _tmp2_;
		json_parser_load_from_data (_tmp1_, value, (gssize) _tmp3_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("ObjectEvent.vala:96: %s", _tmp5_);
		result = NULL;
		_g_error_free0 (e);
		_g_object_unref0 (parser);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (parser);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp6_ = objects_due_date_new ();
	due = _tmp6_;
	_tmp7_ = due;
	_tmp8_ = parser;
	_tmp9_ = json_parser_get_root (_tmp8_);
	_tmp10_ = json_node_get_object (_tmp9_);
	objects_due_date_update_from_json (_tmp7_, _tmp10_);
	result = due;
	_g_object_unref0 (parser);
	return result;
}

gchar*
objects_object_event_get_labels_value (ObjectsObjectEvent* self,
                                       const gchar* value)
{
	gchar* return_value = NULL;
	gchar* _tmp0_;
	GeeArrayList* labels = NULL;
	ServicesStore* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = g_strdup ("");
	return_value = _tmp0_;
	_tmp1_ = services_store_instance ();
	_tmp2_ = services_store_get_labels_by_item_labels (_tmp1_, value);
	labels = _tmp2_;
	_tmp3_ = labels;
	_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ > 0) {
		{
			gint index = 0;
			index = 0;
			{
				gboolean _tmp6_ = FALSE;
				_tmp6_ = TRUE;
				while (TRUE) {
					GeeArrayList* _tmp8_;
					gint _tmp9_;
					gint _tmp10_;
					GeeArrayList* _tmp11_;
					gint _tmp12_;
					gint _tmp13_;
					if (!_tmp6_) {
						gint _tmp7_;
						_tmp7_ = index;
						index = _tmp7_ + 1;
					}
					_tmp6_ = FALSE;
					_tmp8_ = labels;
					_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
					_tmp10_ = _tmp9_;
					if (!(index < _tmp10_)) {
						break;
					}
					_tmp11_ = labels;
					_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
					_tmp13_ = _tmp12_;
					if (index < (_tmp13_ - 1)) {
						const gchar* _tmp14_;
						GeeArrayList* _tmp15_;
						gpointer _tmp16_;
						ObjectsLabel* _tmp17_;
						const gchar* _tmp18_;
						const gchar* _tmp19_;
						gchar* _tmp20_;
						gchar* _tmp21_;
						gchar* _tmp22_;
						_tmp14_ = return_value;
						_tmp15_ = labels;
						_tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, index);
						_tmp17_ = (ObjectsLabel*) _tmp16_;
						_tmp18_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp17_);
						_tmp19_ = _tmp18_;
						_tmp20_ = g_strconcat (_tmp19_, ", ", NULL);
						_tmp21_ = _tmp20_;
						_tmp22_ = g_strconcat (_tmp14_, _tmp21_, NULL);
						_g_free0 (return_value);
						return_value = _tmp22_;
						_g_free0 (_tmp21_);
						_g_object_unref0 (_tmp17_);
					} else {
						const gchar* _tmp23_;
						GeeArrayList* _tmp24_;
						gpointer _tmp25_;
						ObjectsLabel* _tmp26_;
						const gchar* _tmp27_;
						const gchar* _tmp28_;
						gchar* _tmp29_;
						_tmp23_ = return_value;
						_tmp24_ = labels;
						_tmp25_ = gee_abstract_list_get ((GeeAbstractList*) _tmp24_, index);
						_tmp26_ = (ObjectsLabel*) _tmp25_;
						_tmp27_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp26_);
						_tmp28_ = _tmp27_;
						_tmp29_ = g_strconcat (_tmp23_, _tmp28_, NULL);
						_g_free0 (return_value);
						return_value = _tmp29_;
						_g_object_unref0 (_tmp26_);
					}
				}
			}
		}
	}
	result = return_value;
	_g_object_unref0 (labels);
	return result;
}

ObjectsObjectEvent*
objects_object_event_construct (GType object_type)
{
	ObjectsObjectEvent * self = NULL;
	self = (ObjectsObjectEvent*) g_object_new (object_type, NULL);
	return self;
}

ObjectsObjectEvent*
objects_object_event_new (void)
{
	return objects_object_event_construct (OBJECTS_TYPE_OBJECT_EVENT);
}

gint64
objects_object_event_get_id (ObjectsObjectEvent* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_id;
	return result;
}

void
objects_object_event_set_id (ObjectsObjectEvent* self,
                             gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_ID_PROPERTY]);
	}
}

ObjectEventType
objects_object_event_get_event_type (ObjectsObjectEvent* self)
{
	ObjectEventType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_event_type;
	return result;
}

void
objects_object_event_set_event_type (ObjectsObjectEvent* self,
                                     ObjectEventType value)
{
	ObjectEventType old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_event_type (self);
	if (old_value != value) {
		self->priv->_event_type = value;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_EVENT_TYPE_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_event_date (ObjectsObjectEvent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_event_date;
	result = _tmp0_;
	return result;
}

void
objects_object_event_set_event_date (ObjectsObjectEvent* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_event_date (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_event_date);
		self->priv->_event_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_EVENT_DATE_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_object_id (ObjectsObjectEvent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_object_id;
	result = _tmp0_;
	return result;
}

void
objects_object_event_set_object_id (ObjectsObjectEvent* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_object_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_object_id);
		self->priv->_object_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_ID_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_object_type (ObjectsObjectEvent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_object_type;
	result = _tmp0_;
	return result;
}

void
objects_object_event_set_object_type (ObjectsObjectEvent* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_object_type (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_object_type);
		self->priv->_object_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_TYPE_PROPERTY]);
	}
}

ObjectEventKeyType
objects_object_event_get_object_key (ObjectsObjectEvent* self)
{
	ObjectEventKeyType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_object_key;
	return result;
}

void
objects_object_event_set_object_key (ObjectsObjectEvent* self,
                                     ObjectEventKeyType value)
{
	ObjectEventKeyType old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_object_key (self);
	if (old_value != value) {
		self->priv->_object_key = value;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_KEY_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_object_old_value (ObjectsObjectEvent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_object_old_value;
	result = _tmp0_;
	return result;
}

void
objects_object_event_set_object_old_value (ObjectsObjectEvent* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_object_old_value (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_object_old_value);
		self->priv->_object_old_value = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_OLD_VALUE_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_object_new_value (ObjectsObjectEvent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_object_new_value;
	result = _tmp0_;
	return result;
}

void
objects_object_event_set_object_new_value (ObjectsObjectEvent* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_object_new_value (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_object_new_value);
		self->priv->_object_new_value = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_NEW_VALUE_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_parent_item_id (ObjectsObjectEvent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent_item_id;
	result = _tmp0_;
	return result;
}

void
objects_object_event_set_parent_item_id (ObjectsObjectEvent* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_parent_item_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_parent_item_id);
		self->priv->_parent_item_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_PARENT_ITEM_ID_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_parent_project_id (ObjectsObjectEvent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent_project_id;
	result = _tmp0_;
	return result;
}

void
objects_object_event_set_parent_project_id (ObjectsObjectEvent* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_object_event_get_parent_project_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_parent_project_id);
		self->priv->_parent_project_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_object_event_properties[OBJECTS_OBJECT_EVENT_PARENT_PROJECT_ID_PROPERTY]);
	}
}

const gchar*
objects_object_event_get_icon_name (ObjectsObjectEvent* self)
{
	const gchar* result;
	ObjectEventType _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_event_type;
	if (_tmp0_ == OBJECT_EVENT_TYPE_INSERT) {
		result = "plus-large-symbolic";
		return result;
	} else {
		ObjectEventType _tmp1_;
		_tmp1_ = self->priv->_event_type;
		if (_tmp1_ == OBJECT_EVENT_TYPE_UPDATE) {
			ObjectEventKeyType _tmp2_;
			_tmp2_ = self->priv->_object_key;
			if (_tmp2_ == OBJECT_EVENT_KEY_TYPE_CONTENT) {
				result = "edit-symbolic";
				return result;
			} else {
				ObjectEventKeyType _tmp3_;
				_tmp3_ = self->priv->_object_key;
				if (_tmp3_ == OBJECT_EVENT_KEY_TYPE_DESCRIPTION) {
					result = "paper-symbolic";
					return result;
				} else {
					ObjectEventKeyType _tmp4_;
					_tmp4_ = self->priv->_object_key;
					if (_tmp4_ == OBJECT_EVENT_KEY_TYPE_DUE) {
						result = "month-symbolic";
						return result;
					} else {
						ObjectEventKeyType _tmp5_;
						_tmp5_ = self->priv->_object_key;
						if (_tmp5_ == OBJECT_EVENT_KEY_TYPE_PRIORITY) {
							result = "flag-outline-thick-symbolic";
							return result;
						} else {
							ObjectEventKeyType _tmp6_;
							_tmp6_ = self->priv->_object_key;
							if (_tmp6_ == OBJECT_EVENT_KEY_TYPE_LABELS) {
								result = "tag-outline-symbolic";
								return result;
							} else {
								ObjectEventKeyType _tmp7_;
								_tmp7_ = self->priv->_object_key;
								if (_tmp7_ == OBJECT_EVENT_KEY_TYPE_PINNED) {
									result = "pin-symbolic";
									return result;
								} else {
									ObjectEventKeyType _tmp8_;
									_tmp8_ = self->priv->_object_key;
									if (_tmp8_ == OBJECT_EVENT_KEY_TYPE_CHECKED) {
										result = "check-round-outline-symbolic";
										return result;
									} else {
										gboolean _tmp9_ = FALSE;
										ObjectEventKeyType _tmp10_;
										_tmp10_ = self->priv->_object_key;
										if (_tmp10_ == OBJECT_EVENT_KEY_TYPE_SECTION) {
											_tmp9_ = TRUE;
										} else {
											ObjectEventKeyType _tmp11_;
											_tmp11_ = self->priv->_object_key;
											_tmp9_ = _tmp11_ == OBJECT_EVENT_KEY_TYPE_PROJECT;
										}
										if (_tmp9_) {
											result = "arrow3-right-symbolic";
											return result;
										} else {
											ObjectEventKeyType _tmp12_;
											_tmp12_ = self->priv->_object_key;
											if (_tmp12_ == OBJECT_EVENT_KEY_TYPE_DEADLINE) {
												result = "delay-long-small-symbolic";
												return result;
											} else {
												ObjectEventKeyType _tmp13_;
												_tmp13_ = self->priv->_object_key;
												if (_tmp13_ == OBJECT_EVENT_KEY_TYPE_PARENT) {
													result = "arrow3-right-symbolic";
													return result;
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	result = "plus-large-symbolic";
	return result;
}

GDateTime*
objects_object_event_get_datetime (ObjectsObjectEvent* self)
{
	GDateTime* result;
	const gchar* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_event_date;
	_tmp1_ = utils_datetime_get_date_from_string (_tmp0_);
	_g_date_time_unref0 (self->priv->_datetime);
	self->priv->_datetime = _tmp1_;
	_tmp2_ = self->priv->_datetime;
	result = _tmp2_;
	return result;
}

GDateTime*
objects_object_event_get_date (ObjectsObjectEvent* self)
{
	GDateTime* result;
	const gchar* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_event_date;
	_tmp1_ = utils_datetime_get_date_from_string (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = utils_datetime_format_date (_tmp2_);
	_g_date_time_unref0 (self->priv->_date);
	self->priv->_date = _tmp3_;
	_g_date_time_unref0 (_tmp2_);
	_tmp4_ = self->priv->_date;
	result = _tmp4_;
	return result;
}

const gchar*
objects_object_event_get_time (ObjectsObjectEvent* self)
{
	const gchar* result;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = objects_object_event_get_datetime (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = utils_datetime_get_default_time_format (utils_datetime_is_clock_format_12h (), FALSE);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_date_time_format (_tmp1_, _tmp3_);
	_g_free0 (self->priv->_time);
	self->priv->_time = _tmp4_;
	_g_free0 (_tmp3_);
	_tmp5_ = self->priv->_time;
	result = _tmp5_;
	return result;
}

static void
objects_object_event_class_init (ObjectsObjectEventClass * klass,
                                 gpointer klass_data)
{
	objects_object_event_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsObjectEvent_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_object_event_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_objects_object_event_set_property;
	G_OBJECT_CLASS (klass)->finalize = objects_object_event_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_ID_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_ID_PROPERTY] = g_param_spec_int64 ("id", "id", "id", G_MININT64, G_MAXINT64, (gint64) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_EVENT_TYPE_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_EVENT_TYPE_PROPERTY] = g_param_spec_enum ("event-type", "event-type", "event-type", TYPE_OBJECT_EVENT_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_EVENT_DATE_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_EVENT_DATE_PROPERTY] = g_param_spec_string ("event-date", "event-date", "event-date", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_OBJECT_ID_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_ID_PROPERTY] = g_param_spec_string ("object-id", "object-id", "object-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_OBJECT_TYPE_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_TYPE_PROPERTY] = g_param_spec_string ("object-type", "object-type", "object-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_OBJECT_KEY_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_KEY_PROPERTY] = g_param_spec_enum ("object-key", "object-key", "object-key", TYPE_OBJECT_EVENT_KEY_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_OBJECT_OLD_VALUE_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_OLD_VALUE_PROPERTY] = g_param_spec_string ("object-old-value", "object-old-value", "object-old-value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_OBJECT_NEW_VALUE_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_OBJECT_NEW_VALUE_PROPERTY] = g_param_spec_string ("object-new-value", "object-new-value", "object-new-value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_PARENT_ITEM_ID_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_PARENT_ITEM_ID_PROPERTY] = g_param_spec_string ("parent-item-id", "parent-item-id", "parent-item-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_PARENT_PROJECT_ID_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_PARENT_PROJECT_ID_PROPERTY] = g_param_spec_string ("parent-project-id", "parent-project-id", "parent-project-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_ICON_NAME_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_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), OBJECTS_OBJECT_EVENT_DATETIME_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_DATETIME_PROPERTY] = g_param_spec_boxed ("datetime", "datetime", "datetime", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_DATE_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_DATE_PROPERTY] = g_param_spec_boxed ("date", "date", "date", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_OBJECT_EVENT_TIME_PROPERTY, objects_object_event_properties[OBJECTS_OBJECT_EVENT_TIME_PROPERTY] = g_param_spec_string ("time", "time", "time", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
objects_object_event_instance_init (ObjectsObjectEvent * self,
                                    gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self->priv = objects_object_event_get_instance_private (self);
	self->priv->_id = (gint64) 0;
	_tmp0_ = g_strdup ("");
	self->priv->_event_date = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_object_id = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_object_type = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_object_old_value = _tmp3_;
	_tmp4_ = g_strdup ("");
	self->priv->_object_new_value = _tmp4_;
	_tmp5_ = g_strdup ("");
	self->priv->_parent_item_id = _tmp5_;
	_tmp6_ = g_strdup ("");
	self->priv->_parent_project_id = _tmp6_;
}

static void
objects_object_event_finalize (GObject * obj)
{
	ObjectsObjectEvent * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_OBJECT_EVENT, ObjectsObjectEvent);
	_g_free0 (self->priv->_event_date);
	_g_free0 (self->priv->_object_id);
	_g_free0 (self->priv->_object_type);
	_g_free0 (self->priv->_object_old_value);
	_g_free0 (self->priv->_object_new_value);
	_g_free0 (self->priv->_parent_item_id);
	_g_free0 (self->priv->_parent_project_id);
	_g_date_time_unref0 (self->priv->_datetime);
	_g_date_time_unref0 (self->priv->_date);
	_g_free0 (self->priv->_time);
	G_OBJECT_CLASS (objects_object_event_parent_class)->finalize (obj);
}

static GType
objects_object_event_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsObjectEventClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_object_event_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsObjectEvent), 0, (GInstanceInitFunc) objects_object_event_instance_init, NULL };
	GType objects_object_event_type_id;
	objects_object_event_type_id = g_type_register_static (G_TYPE_OBJECT, "ObjectsObjectEvent", &g_define_type_info, 0);
	ObjectsObjectEvent_private_offset = g_type_add_instance_private (objects_object_event_type_id, sizeof (ObjectsObjectEventPrivate));
	return objects_object_event_type_id;
}

GType
objects_object_event_get_type (void)
{
	static volatile gsize objects_object_event_type_id__once = 0;
	if (g_once_init_enter (&objects_object_event_type_id__once)) {
		GType objects_object_event_type_id;
		objects_object_event_type_id = objects_object_event_get_type_once ();
		g_once_init_leave (&objects_object_event_type_id__once, objects_object_event_type_id);
	}
	return objects_object_event_type_id__once;
}

static void
_vala_objects_object_event_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	ObjectsObjectEvent * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_OBJECT_EVENT, ObjectsObjectEvent);
	switch (property_id) {
		case OBJECTS_OBJECT_EVENT_ID_PROPERTY:
		g_value_set_int64 (value, objects_object_event_get_id (self));
		break;
		case OBJECTS_OBJECT_EVENT_EVENT_TYPE_PROPERTY:
		g_value_set_enum (value, objects_object_event_get_event_type (self));
		break;
		case OBJECTS_OBJECT_EVENT_EVENT_DATE_PROPERTY:
		g_value_set_string (value, objects_object_event_get_event_date (self));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_ID_PROPERTY:
		g_value_set_string (value, objects_object_event_get_object_id (self));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_TYPE_PROPERTY:
		g_value_set_string (value, objects_object_event_get_object_type (self));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_KEY_PROPERTY:
		g_value_set_enum (value, objects_object_event_get_object_key (self));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_OLD_VALUE_PROPERTY:
		g_value_set_string (value, objects_object_event_get_object_old_value (self));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_NEW_VALUE_PROPERTY:
		g_value_set_string (value, objects_object_event_get_object_new_value (self));
		break;
		case OBJECTS_OBJECT_EVENT_PARENT_ITEM_ID_PROPERTY:
		g_value_set_string (value, objects_object_event_get_parent_item_id (self));
		break;
		case OBJECTS_OBJECT_EVENT_PARENT_PROJECT_ID_PROPERTY:
		g_value_set_string (value, objects_object_event_get_parent_project_id (self));
		break;
		case OBJECTS_OBJECT_EVENT_ICON_NAME_PROPERTY:
		g_value_set_string (value, objects_object_event_get_icon_name (self));
		break;
		case OBJECTS_OBJECT_EVENT_DATETIME_PROPERTY:
		g_value_set_boxed (value, objects_object_event_get_datetime (self));
		break;
		case OBJECTS_OBJECT_EVENT_DATE_PROPERTY:
		g_value_set_boxed (value, objects_object_event_get_date (self));
		break;
		case OBJECTS_OBJECT_EVENT_TIME_PROPERTY:
		g_value_set_string (value, objects_object_event_get_time (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_objects_object_event_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	ObjectsObjectEvent * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_OBJECT_EVENT, ObjectsObjectEvent);
	switch (property_id) {
		case OBJECTS_OBJECT_EVENT_ID_PROPERTY:
		objects_object_event_set_id (self, g_value_get_int64 (value));
		break;
		case OBJECTS_OBJECT_EVENT_EVENT_TYPE_PROPERTY:
		objects_object_event_set_event_type (self, g_value_get_enum (value));
		break;
		case OBJECTS_OBJECT_EVENT_EVENT_DATE_PROPERTY:
		objects_object_event_set_event_date (self, g_value_get_string (value));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_ID_PROPERTY:
		objects_object_event_set_object_id (self, g_value_get_string (value));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_TYPE_PROPERTY:
		objects_object_event_set_object_type (self, g_value_get_string (value));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_KEY_PROPERTY:
		objects_object_event_set_object_key (self, g_value_get_enum (value));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_OLD_VALUE_PROPERTY:
		objects_object_event_set_object_old_value (self, g_value_get_string (value));
		break;
		case OBJECTS_OBJECT_EVENT_OBJECT_NEW_VALUE_PROPERTY:
		objects_object_event_set_object_new_value (self, g_value_get_string (value));
		break;
		case OBJECTS_OBJECT_EVENT_PARENT_ITEM_ID_PROPERTY:
		objects_object_event_set_parent_item_id (self, g_value_get_string (value));
		break;
		case OBJECTS_OBJECT_EVENT_PARENT_PROJECT_ID_PROPERTY:
		objects_object_event_set_parent_project_id (self, g_value_get_string (value));
		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;
}

