/* note-details.c generated by valac 0.34.0.60-52f79, the Vala compiler
 * generated from note-details.vala, do not modify */

/*
 * Copyright (C) 2011 Collabora Ltd.
 * Copyright (C) 2011 Philip Withnall
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
 *       Philip Withnall <philip@tecnocode.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>


#define FOLKS_TYPE_ABSTRACT_FIELD_DETAILS (folks_abstract_field_details_get_type ())
#define FOLKS_ABSTRACT_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, FolksAbstractFieldDetails))
#define FOLKS_ABSTRACT_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, FolksAbstractFieldDetailsClass))
#define FOLKS_IS_ABSTRACT_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS))
#define FOLKS_IS_ABSTRACT_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS))
#define FOLKS_ABSTRACT_FIELD_DETAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, FolksAbstractFieldDetailsClass))

typedef struct _FolksAbstractFieldDetails FolksAbstractFieldDetails;
typedef struct _FolksAbstractFieldDetailsClass FolksAbstractFieldDetailsClass;
typedef struct _FolksAbstractFieldDetailsPrivate FolksAbstractFieldDetailsPrivate;

#define FOLKS_TYPE_NOTE_FIELD_DETAILS (folks_note_field_details_get_type ())
#define FOLKS_NOTE_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_TYPE_NOTE_FIELD_DETAILS, FolksNoteFieldDetails))
#define FOLKS_NOTE_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_TYPE_NOTE_FIELD_DETAILS, FolksNoteFieldDetailsClass))
#define FOLKS_IS_NOTE_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_TYPE_NOTE_FIELD_DETAILS))
#define FOLKS_IS_NOTE_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_TYPE_NOTE_FIELD_DETAILS))
#define FOLKS_NOTE_FIELD_DETAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_TYPE_NOTE_FIELD_DETAILS, FolksNoteFieldDetailsClass))

typedef struct _FolksNoteFieldDetails FolksNoteFieldDetails;
typedef struct _FolksNoteFieldDetailsClass FolksNoteFieldDetailsClass;
typedef struct _FolksNoteFieldDetailsPrivate FolksNoteFieldDetailsPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define FOLKS_TYPE_NOTE_DETAILS (folks_note_details_get_type ())
#define FOLKS_NOTE_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_TYPE_NOTE_DETAILS, FolksNoteDetails))
#define FOLKS_IS_NOTE_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_TYPE_NOTE_DETAILS))
#define FOLKS_NOTE_DETAILS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FOLKS_TYPE_NOTE_DETAILS, FolksNoteDetailsIface))

typedef struct _FolksNoteDetails FolksNoteDetails;
typedef struct _FolksNoteDetailsIface FolksNoteDetailsIface;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _FolksNoteDetailsChangeNotesData FolksNoteDetailsChangeNotesData;

struct _FolksAbstractFieldDetails {
	GObject parent_instance;
	FolksAbstractFieldDetailsPrivate * priv;
};

struct _FolksAbstractFieldDetailsClass {
	GObjectClass parent_class;
	gboolean (*equal) (FolksAbstractFieldDetails* self, FolksAbstractFieldDetails* that);
	gboolean (*parameters_equal) (FolksAbstractFieldDetails* self, FolksAbstractFieldDetails* that);
	gboolean (*values_equal) (FolksAbstractFieldDetails* self, FolksAbstractFieldDetails* that);
	guint (*hash) (FolksAbstractFieldDetails* self);
	gconstpointer (*get_value) (FolksAbstractFieldDetails* self);
	void (*set_value) (FolksAbstractFieldDetails* self, gconstpointer value);
	const gchar* (*get_id) (FolksAbstractFieldDetails* self);
	void (*set_id) (FolksAbstractFieldDetails* self, const gchar* value);
	GeeMultiMap* (*get_parameters) (FolksAbstractFieldDetails* self);
	void (*set_parameters) (FolksAbstractFieldDetails* self, GeeMultiMap* value);
};

struct _FolksNoteFieldDetails {
	FolksAbstractFieldDetails parent_instance;
	FolksNoteFieldDetailsPrivate * priv;
};

struct _FolksNoteFieldDetailsClass {
	FolksAbstractFieldDetailsClass parent_class;
};

struct _FolksNoteFieldDetailsPrivate {
	gchar* _id;
};

typedef enum  {
	FOLKS_PROPERTY_ERROR_NOT_WRITEABLE,
	FOLKS_PROPERTY_ERROR_INVALID_VALUE,
	FOLKS_PROPERTY_ERROR_UNKNOWN_ERROR,
	FOLKS_PROPERTY_ERROR_UNAVAILABLE
} FolksPropertyError;
#define FOLKS_PROPERTY_ERROR folks_property_error_quark ()
struct _FolksNoteDetailsIface {
	GTypeInterface parent_iface;
	void (*change_notes) (FolksNoteDetails* self, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*change_notes_finish) (FolksNoteDetails* self, GAsyncResult* _res_, GError** error);
	GeeSet* (*get_notes) (FolksNoteDetails* self);
	void (*set_notes) (FolksNoteDetails* self, GeeSet* value);
};

struct _FolksNoteDetailsChangeNotesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksNoteDetails* self;
	GeeSet* notes;
	const gchar* _tmp0_;
	GError* _tmp1_;
	GError * _inner_error_;
};


static gpointer folks_note_field_details_parent_class = NULL;

GType folks_abstract_field_details_get_type (void) G_GNUC_CONST;
GType folks_note_field_details_get_type (void) G_GNUC_CONST;
#define FOLKS_NOTE_FIELD_DETAILS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FOLKS_TYPE_NOTE_FIELD_DETAILS, FolksNoteFieldDetailsPrivate))
enum  {
	FOLKS_NOTE_FIELD_DETAILS_DUMMY_PROPERTY,
	FOLKS_NOTE_FIELD_DETAILS_ID,
	FOLKS_NOTE_FIELD_DETAILS_UID
};
FolksNoteFieldDetails* folks_note_field_details_new (const gchar* value, GeeMultiMap* parameters, const gchar* uid);
FolksNoteFieldDetails* folks_note_field_details_construct (GType object_type, const gchar* value, GeeMultiMap* parameters, const gchar* uid);
static gboolean folks_note_field_details_real_equal (FolksAbstractFieldDetails* base, FolksAbstractFieldDetails* that);
gboolean folks_abstract_field_details_equal (FolksAbstractFieldDetails* self, FolksAbstractFieldDetails* that);
static guint folks_note_field_details_real_hash (FolksAbstractFieldDetails* base);
gconstpointer folks_abstract_field_details_get_value (FolksAbstractFieldDetails* self);
const gchar* folks_abstract_field_details_get_id (FolksAbstractFieldDetails* self);
const gchar* folks_note_field_details_get_uid (FolksNoteFieldDetails* self) G_GNUC_DEPRECATED;
void folks_note_field_details_set_uid (FolksNoteFieldDetails* self, const gchar* value) G_GNUC_DEPRECATED;
void folks_abstract_field_details_set_id (FolksAbstractFieldDetails* self, const gchar* value);
static void folks_note_field_details_finalize (GObject* obj);
static void _vala_folks_note_field_details_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_folks_note_field_details_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GQuark folks_property_error_quark (void);
GType folks_note_details_get_type (void) G_GNUC_CONST;
static void folks_note_details_real_change_notes_data_free (gpointer _data);
static void folks_note_details_real_change_notes (FolksNoteDetails* self, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
void folks_note_details_change_notes (FolksNoteDetails* self, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
void folks_note_details_change_notes_finish (FolksNoteDetails* self, GAsyncResult* _res_, GError** error);
static gboolean folks_note_details_real_change_notes_co (FolksNoteDetailsChangeNotesData* _data_);
GeeSet* folks_note_details_get_notes (FolksNoteDetails* self);
void folks_note_details_set_notes (FolksNoteDetails* self, GeeSet* value);


/**
   * Create a new NoteFieldDetails.
   *
   * @param value the value of the field, which should be a non-empty free-form
   * UTF-8 string as entered by the user
   * @param parameters initial parameters. See
   * {@link AbstractFieldDetails.parameters}. A ``null`` value is equivalent to
   * a empty map of parameters.
   * @param uid UID for the note object itself, if known. A ``null`` value means
   * the note has no unique ID.
   *
   * @return a new NoteFieldDetails
   *
   * @since 0.6.0
   */
FolksNoteFieldDetails* folks_note_field_details_construct (GType object_type, const gchar* value, GeeMultiMap* parameters, const gchar* uid) {
	FolksNoteFieldDetails * self = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GeeMultiMap* _tmp3_ = NULL;
#line 71 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_return_val_if_fail (value != NULL, NULL);
#line 75 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp0_ = value;
#line 75 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	if (g_strcmp0 (_tmp0_, "") == 0) {
#line 77 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_warning ("note-details.vala:77: Empty note passed to NoteFieldDetails.");
#line 192 "note-details.c"
	}
#line 80 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp1_ = value;
#line 80 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp2_ = uid;
#line 80 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp3_ = parameters;
#line 80 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self = (FolksNoteFieldDetails*) g_object_new (object_type, "t_type", G_TYPE_STRING, "t_dup_func", (GBoxedCopyFunc) g_strdup, "t_destroy_func", g_free, "value", _tmp1_, "id", _tmp2_, "parameters", _tmp3_, NULL);
#line 71 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return self;
#line 204 "note-details.c"
}


FolksNoteFieldDetails* folks_note_field_details_new (const gchar* value, GeeMultiMap* parameters, const gchar* uid) {
#line 71 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return folks_note_field_details_construct (FOLKS_TYPE_NOTE_FIELD_DETAILS, value, parameters, uid);
#line 211 "note-details.c"
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.0
   */
static gboolean folks_note_field_details_real_equal (FolksAbstractFieldDetails* base, FolksAbstractFieldDetails* that) {
	FolksNoteFieldDetails * self;
	gboolean result = FALSE;
	FolksAbstractFieldDetails* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 90 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self = (FolksNoteFieldDetails*) base;
#line 90 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_return_val_if_fail (that != NULL, FALSE);
#line 92 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp0_ = that;
#line 92 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp1_ = FOLKS_ABSTRACT_FIELD_DETAILS_CLASS (folks_note_field_details_parent_class)->equal (G_TYPE_CHECK_INSTANCE_CAST (self, FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, FolksAbstractFieldDetails), _tmp0_);
#line 92 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	result = _tmp1_;
#line 92 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return result;
#line 237 "note-details.c"
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.0
   */
static guint folks_note_field_details_real_hash (FolksAbstractFieldDetails* base) {
	FolksNoteFieldDetails * self;
	guint result = 0U;
	gconstpointer _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	guint _tmp5_ = 0U;
#line 100 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self = (FolksNoteFieldDetails*) base;
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp0_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) self);
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp1_ = _tmp0_;
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp2_ = g_str_hash ((const gchar*) _tmp1_);
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp3_ = folks_abstract_field_details_get_id ((FolksAbstractFieldDetails*) self);
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp4_ = _tmp3_;
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp5_ = g_str_hash (_tmp4_);
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	result = _tmp2_ + _tmp5_;
#line 102 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return result;
#line 273 "note-details.c"
}


static const gchar* folks_note_field_details_real_get_id (FolksAbstractFieldDetails* base) {
	const gchar* result;
	FolksNoteFieldDetails* self;
	const gchar* _tmp0_ = NULL;
#line 42 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self = (FolksNoteFieldDetails*) base;
#line 42 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp0_ = self->priv->_id;
#line 42 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	result = _tmp0_;
#line 42 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return result;
#line 289 "note-details.c"
}


static void folks_note_field_details_real_set_id (FolksAbstractFieldDetails* base, const gchar* value) {
	FolksNoteFieldDetails* self;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp3_ = NULL;
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self = (FolksNoteFieldDetails*) base;
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp1_ = value;
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	if (_tmp1_ != NULL) {
#line 304 "note-details.c"
		const gchar* _tmp2_ = NULL;
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		_tmp2_ = value;
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		_tmp0_ = _tmp2_;
#line 310 "note-details.c"
	} else {
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		_tmp0_ = "";
#line 314 "note-details.c"
	}
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp3_ = g_strdup (_tmp0_);
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_g_free0 (self->priv->_id);
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self->priv->_id = _tmp3_;
#line 43 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_object_notify ((GObject *) self, "id");
#line 324 "note-details.c"
}


const gchar* folks_note_field_details_get_uid (FolksNoteFieldDetails* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
#line 52 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 52 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp0_ = folks_abstract_field_details_get_id ((FolksAbstractFieldDetails*) self);
#line 52 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp1_ = _tmp0_;
#line 52 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	result = _tmp1_;
#line 52 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return result;
#line 342 "note-details.c"
}


void folks_note_field_details_set_uid (FolksNoteFieldDetails* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
#line 53 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_return_if_fail (self != NULL);
#line 53 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp0_ = value;
#line 53 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	folks_abstract_field_details_set_id ((FolksAbstractFieldDetails*) self, _tmp0_);
#line 53 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_object_notify ((GObject *) self, "uid");
#line 356 "note-details.c"
}


static void folks_note_field_details_class_init (FolksNoteFieldDetailsClass * klass) {
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	folks_note_field_details_parent_class = g_type_class_peek_parent (klass);
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_type_class_add_private (klass, sizeof (FolksNoteFieldDetailsPrivate));
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	((FolksAbstractFieldDetailsClass *) klass)->equal = folks_note_field_details_real_equal;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	((FolksAbstractFieldDetailsClass *) klass)->hash = folks_note_field_details_real_hash;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	FOLKS_ABSTRACT_FIELD_DETAILS_CLASS (klass)->get_id = folks_note_field_details_real_get_id;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	FOLKS_ABSTRACT_FIELD_DETAILS_CLASS (klass)->set_id = folks_note_field_details_real_set_id;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_folks_note_field_details_get_property;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_folks_note_field_details_set_property;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	G_OBJECT_CLASS (klass)->finalize = folks_note_field_details_finalize;
#line 379 "note-details.c"
	/**
	   * {@inheritDoc}
	   */
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_NOTE_FIELD_DETAILS_ID, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 385 "note-details.c"
	/**
	   * The UID of the note (if any).
	   */
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_NOTE_FIELD_DETAILS_UID, g_param_spec_string ("uid", "uid", "uid", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_DEPRECATED));
#line 391 "note-details.c"
}


static void folks_note_field_details_instance_init (FolksNoteFieldDetails * self) {
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self->priv = FOLKS_NOTE_FIELD_DETAILS_GET_PRIVATE (self);
#line 398 "note-details.c"
}


static void folks_note_field_details_finalize (GObject* obj) {
	FolksNoteFieldDetails * self;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FOLKS_TYPE_NOTE_FIELD_DETAILS, FolksNoteFieldDetails);
#line 36 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_g_free0 (self->priv->_id);
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	G_OBJECT_CLASS (folks_note_field_details_parent_class)->finalize (obj);
#line 410 "note-details.c"
}


/**
 * Object representing a note that can have some parameters associated with it.
 *
 * See {@link Folks.AbstractFieldDetails} for details on common parameter names
 * and values.
 *
 * @since 0.6.0
 */
GType folks_note_field_details_get_type (void) {
	static volatile gsize folks_note_field_details_type_id__volatile = 0;
	if (g_once_init_enter (&folks_note_field_details_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksNoteFieldDetailsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_note_field_details_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksNoteFieldDetails), 0, (GInstanceInitFunc) folks_note_field_details_instance_init, NULL };
		GType folks_note_field_details_type_id;
		folks_note_field_details_type_id = g_type_register_static (FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, "FolksNoteFieldDetails", &g_define_type_info, 0);
		g_once_init_leave (&folks_note_field_details_type_id__volatile, folks_note_field_details_type_id);
	}
	return folks_note_field_details_type_id__volatile;
}


static void _vala_folks_note_field_details_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	FolksNoteFieldDetails * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FOLKS_TYPE_NOTE_FIELD_DETAILS, FolksNoteFieldDetails);
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	switch (property_id) {
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		case FOLKS_NOTE_FIELD_DETAILS_ID:
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_value_set_string (value, folks_abstract_field_details_get_id ((FolksAbstractFieldDetails*) self));
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		break;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		case FOLKS_NOTE_FIELD_DETAILS_UID:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS#line 447 "note-details.c"
		g_value_set_string (value, folks_note_field_details_get_uid (self));
G_GNUC_END_IGNORE_DEPRECATIONS
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		break;
#line 452 "note-details.c"
		default:
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		break;
#line 458 "note-details.c"
	}
}


static void _vala_folks_note_field_details_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	FolksNoteFieldDetails * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FOLKS_TYPE_NOTE_FIELD_DETAILS, FolksNoteFieldDetails);
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	switch (property_id) {
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		case FOLKS_NOTE_FIELD_DETAILS_ID:
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		folks_abstract_field_details_set_id ((FolksAbstractFieldDetails*) self, g_value_get_string (value));
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		break;
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		case FOLKS_NOTE_FIELD_DETAILS_UID:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS#line 476 "note-details.c"
		folks_note_field_details_set_uid (self, g_value_get_string (value));
G_GNUC_END_IGNORE_DEPRECATIONS
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		break;
#line 481 "note-details.c"
		default:
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		break;
#line 487 "note-details.c"
	}
}


static void folks_note_details_real_change_notes_data_free (gpointer _data) {
	FolksNoteDetailsChangeNotesData* _data_;
	_data_ = _data;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_g_object_unref0 (_data_->notes);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_g_object_unref0 (_data_->self);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_slice_free (FolksNoteDetailsChangeNotesData, _data_);
#line 501 "note-details.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return self ? g_object_ref (self) : NULL;
#line 508 "note-details.c"
}


static void folks_note_details_real_change_notes (FolksNoteDetails* self, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FolksNoteDetailsChangeNotesData* _data_;
	FolksNoteDetails* _tmp0_ = NULL;
	GeeSet* _tmp1_ = NULL;
	GeeSet* _tmp2_ = NULL;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_ = g_slice_new0 (FolksNoteDetailsChangeNotesData);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, folks_note_details_real_change_notes);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, folks_note_details_real_change_notes_data_free);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->self = _tmp0_;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp1_ = notes;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_g_object_unref0 (_data_->notes);
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->notes = _tmp2_;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	folks_note_details_real_change_notes_co (_data_);
#line 537 "note-details.c"
}


static void folks_note_details_real_change_notes_finish (FolksNoteDetails* self, GAsyncResult* _res_, GError** error) {
	FolksNoteDetailsChangeNotesData* _data_;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		return;
#line 547 "note-details.c"
	}
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 551 "note-details.c"
}


/**
   * Change the contact's notes.
   *
   * It's preferred to call this rather than setting {@link NoteDetails.notes}
   * directly, as this method gives error notification and will only return once
   * the notes have been written to the relevant backing store (or the
   * operation's failed).
   *
   * @param notes the set of notes
   * @throws PropertyError if setting the notes failed
   * @since 0.6.2
   */
static gboolean folks_note_details_real_change_notes_co (FolksNoteDetailsChangeNotesData* _data_) {
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	switch (_data_->_state_) {
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		case 0:
#line 572 "note-details.c"
		goto _state_0;
		default:
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_assert_not_reached ();
#line 577 "note-details.c"
	}
	_state_0:
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->_tmp0_ = NULL;
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->_tmp0_ = _ ("Notes are not writeable on this contact.");
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->_tmp1_ = NULL;
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp0_);
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	_data_->_inner_error_ = _data_->_tmp1_;
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_error_free (_data_->_inner_error_);
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		if (_data_->_state_ == 0) {
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 600 "note-details.c"
		} else {
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 604 "note-details.c"
		}
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_object_unref (_data_->_async_result);
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		return FALSE;
#line 610 "note-details.c"
	} else {
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_clear_error (&_data_->_inner_error_);
#line 137 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		return FALSE;
#line 618 "note-details.c"
	}
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	if (_data_->_state_ == 0) {
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 624 "note-details.c"
	} else {
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 628 "note-details.c"
	}
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_object_unref (_data_->_async_result);
#line 133 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return FALSE;
#line 634 "note-details.c"
}


void folks_note_details_change_notes (FolksNoteDetails* self, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_) {
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	FOLKS_NOTE_DETAILS_GET_INTERFACE (self)->change_notes (self, notes, _callback_, _user_data_);
#line 641 "note-details.c"
}


void folks_note_details_change_notes_finish (FolksNoteDetails* self, GAsyncResult* _res_, GError** error) {
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	FOLKS_NOTE_DETAILS_GET_INTERFACE (self)->change_notes_finish (self, _res_, error);
#line 648 "note-details.c"
}


GeeSet* folks_note_details_get_notes (FolksNoteDetails* self) {
#line 119 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 119 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	return FOLKS_NOTE_DETAILS_GET_INTERFACE (self)->get_notes (self);
#line 657 "note-details.c"
}


void folks_note_details_set_notes (FolksNoteDetails* self, GeeSet* value) {
#line 119 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	g_return_if_fail (self != NULL);
#line 119 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	FOLKS_NOTE_DETAILS_GET_INTERFACE (self)->set_notes (self, value);
#line 666 "note-details.c"
}


static void folks_note_details_base_init (FolksNoteDetailsIface * iface) {
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	static gboolean initialized = FALSE;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
	if (!initialized) {
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		initialized = TRUE;
#line 677 "note-details.c"
		/**
		   * The notes about the contact.
		   *
		   * @since 0.5.1
		   */
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		g_object_interface_install_property (iface, g_param_spec_object ("notes", "notes", "notes", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		iface->change_notes = folks_note_details_real_change_notes;
#line 112 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala"
		iface->change_notes_finish = folks_note_details_real_change_notes_finish;
#line 689 "note-details.c"
	}
}


/**
 * This interface represents the list of notes associated
 * to a {@link Persona} and {@link Individual}.
 *
 * @since 0.4.0
 */
GType folks_note_details_get_type (void) {
	static volatile gsize folks_note_details_type_id__volatile = 0;
	if (g_once_init_enter (&folks_note_details_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksNoteDetailsIface), (GBaseInitFunc) folks_note_details_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType folks_note_details_type_id;
		folks_note_details_type_id = g_type_register_static (G_TYPE_INTERFACE, "FolksNoteDetails", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (folks_note_details_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&folks_note_details_type_id__volatile, folks_note_details_type_id);
	}
	return folks_note_details_type_id__volatile;
}



