/* contacts-contact-sheet.c generated by valac 0.30.0, the Vala compiler
 * generated from contacts-contact-sheet.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * 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 2 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, see <http://www.gnu.org/licenses/>.
 */

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


#define CONTACTS_TYPE_CONTACT_SHEET (contacts_contact_sheet_get_type ())
#define CONTACTS_CONTACT_SHEET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheet))
#define CONTACTS_CONTACT_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheetClass))
#define CONTACTS_IS_CONTACT_SHEET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_SHEET))
#define CONTACTS_IS_CONTACT_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_SHEET))
#define CONTACTS_CONTACT_SHEET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheetClass))

typedef struct _ContactsContactSheet ContactsContactSheet;
typedef struct _ContactsContactSheetClass ContactsContactSheetClass;
typedef struct _ContactsContactSheetPrivate ContactsContactSheetPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define CONTACTS_TYPE_CONTACT (contacts_contact_get_type ())
#define CONTACTS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT, ContactsContact))
#define CONTACTS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT, ContactsContactClass))
#define CONTACTS_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT))
#define CONTACTS_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT))
#define CONTACTS_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT, ContactsContactClass))

typedef struct _ContactsContact ContactsContact;
typedef struct _ContactsContactClass ContactsContactClass;
typedef struct _Block16Data Block16Data;

#define CONTACTS_TYPE_CONTACT_FRAME (contacts_contact_frame_get_type ())
#define CONTACTS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrame))
#define CONTACTS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
#define CONTACTS_IS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_IS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_CONTACT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))

typedef struct _ContactsContactFrame ContactsContactFrame;
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
typedef struct _ContactsContactPrivate ContactsContactPrivate;

#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
#define CONTACTS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_STORE, ContactsStore))
#define CONTACTS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_STORE, ContactsStoreClass))
#define CONTACTS_IS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_STORE))
#define CONTACTS_IS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_STORE))
#define CONTACTS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_STORE, ContactsStoreClass))

typedef struct _ContactsStore ContactsStore;
typedef struct _ContactsStoreClass ContactsStoreClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block17Data Block17Data;

#define CONTACTS_TYPE_TYPESET (contacts_typeset_get_type ())
#define CONTACTS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSet))
#define CONTACTS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))
#define CONTACTS_IS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_TYPESET))
#define CONTACTS_IS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_TYPESET))
#define CONTACTS_TYPESET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))

typedef struct _ContactsTypeSet ContactsTypeSet;
typedef struct _ContactsTypeSetClass ContactsTypeSetClass;
typedef struct _Block18Data Block18Data;

#define CONTACTS_TYPE_APP (contacts_app_get_type ())
#define CONTACTS_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_APP, ContactsApp))
#define CONTACTS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_APP, ContactsAppClass))
#define CONTACTS_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_APP))
#define CONTACTS_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_APP))
#define CONTACTS_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_APP, ContactsAppClass))

typedef struct _ContactsApp ContactsApp;
typedef struct _ContactsAppClass ContactsAppClass;
typedef struct _ContactsAppPrivate ContactsAppPrivate;

#define CONTACTS_TYPE_WINDOW (contacts_window_get_type ())
#define CONTACTS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_WINDOW, ContactsWindow))
#define CONTACTS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_WINDOW, ContactsWindowClass))
#define CONTACTS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_WINDOW))
#define CONTACTS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_WINDOW))
#define CONTACTS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_WINDOW, ContactsWindowClass))

typedef struct _ContactsWindow ContactsWindow;
typedef struct _ContactsWindowClass ContactsWindowClass;
typedef struct _ContactsStorePrivate ContactsStorePrivate;
typedef struct _Block19Data Block19Data;
typedef struct _Block20Data Block20Data;

#define CONTACTS_CONTACT_TYPE_IM_DISPLAY (contacts_contact_im_display_get_type ())
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

#define CONTACTS_TYPE_ADDRESS_MAP (contacts_address_map_get_type ())
#define CONTACTS_ADDRESS_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_ADDRESS_MAP, ContactsAddressMap))
#define CONTACTS_ADDRESS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_ADDRESS_MAP, ContactsAddressMapClass))
#define CONTACTS_IS_ADDRESS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_ADDRESS_MAP))
#define CONTACTS_IS_ADDRESS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_ADDRESS_MAP))
#define CONTACTS_ADDRESS_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_ADDRESS_MAP, ContactsAddressMapClass))

typedef struct _ContactsAddressMap ContactsAddressMap;
typedef struct _ContactsAddressMapClass ContactsAddressMapClass;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

struct _ContactsContactSheet {
	GtkGrid parent_instance;
	ContactsContactSheetPrivate * priv;
};

struct _ContactsContactSheetClass {
	GtkGridClass parent_class;
};

struct _Block16Data {
	int _ref_count_;
	ContactsContactSheet* self;
	ContactsContact* c;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksPresenceType presence_type;
	gchar* presence_message;
	gboolean is_phone;
	FolksIndividual* individual;
	FolksPersona* fake_persona;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};

struct _Block17Data {
	int _ref_count_;
	Block16Data * _data16_;
	FolksEmailFieldDetails* email;
};

struct _Block18Data {
	int _ref_count_;
	Block16Data * _data16_;
	FolksPhoneFieldDetails* phone;
};

struct _ContactsApp {
	GtkApplication parent_instance;
	ContactsAppPrivate * priv;
	GSettings* settings;
	ContactsStore* contacts_store;
	ContactsWindow* window;
};

struct _ContactsAppClass {
	GtkApplicationClass parent_class;
};

struct _ContactsStore {
	GObject parent_instance;
	ContactsStorePrivate * priv;
	GeeHashMap* calling_accounts;
	GeeHashMultiMap* dont_suggest_link;
};

struct _ContactsStoreClass {
	GObjectClass parent_class;
};

struct _Block19Data {
	int _ref_count_;
	Block16Data * _data16_;
	gchar* protocol;
};

struct _Block20Data {
	int _ref_count_;
	Block19Data * _data19_;
	FolksImFieldDetails* id;
};

typedef enum  {
	CONTACTS_CONTACT_IM_DISPLAY_DEFAULT,
	CONTACTS_CONTACT_IM_DISPLAY_ALIAS_SERVICE
} ContactsContactImDisplay;


static gpointer contacts_contact_sheet_parent_class = NULL;
extern ContactsApp* contacts_app_app;

GType contacts_contact_sheet_get_type (void) G_GNUC_CONST;
enum  {
	CONTACTS_CONTACT_SHEET_DUMMY_PROPERTY
};
static GtkButton* contacts_contact_sheet_add_row_with_button (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value);
static void contacts_contact_sheet_add_row_with_link_button (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value);
static void contacts_contact_sheet_add_row_with_label (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value);
ContactsContactSheet* contacts_contact_sheet_new (void);
ContactsContactSheet* contacts_contact_sheet_construct (GType object_type);
GType contacts_contact_get_type (void) G_GNUC_CONST;
void contacts_contact_sheet_update (ContactsContactSheet* self, ContactsContact* c);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
GType contacts_contact_frame_get_type (void) G_GNUC_CONST;
#define PROFILE_SIZE 96
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static void __lambda29_ (Block16Data* _data16_, GtkWidget* w);
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
GType contacts_store_get_type (void) G_GNUC_CONST;
static void ___lambda29__gtk_callback (GtkWidget* widget, gpointer self);
static void __lambda30_ (Block16Data* _data16_, GtkWidget* w);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
static void ___lambda30__gtk_callback (GtkWidget* widget, gpointer self);
GeeList* contacts_contact_get_personas_for_display (ContactsContact* self);
gchar* contacts_contact_format_persona_store_name_for_contact (FolksPersona* persona);
GeeArrayList* contacts_contact_sort_fields (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GeeCollection* fields);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
GType contacts_typeset_get_type (void) G_GNUC_CONST;
ContactsTypeSet* contacts_typeset_get_email (void);
gchar* contacts_typeset_format_type (ContactsTypeSet* self, FolksAbstractFieldDetails* detail);
static void _______lambda31_ (Block17Data* _data17_);
void contacts_utils_compose_mail (const gchar* email);
static void ________lambda31__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
GType contacts_app_get_type (void) G_GNUC_CONST;
GType contacts_window_get_type (void) G_GNUC_CONST;
gboolean contacts_store_get_can_call (ContactsStore* self);
ContactsTypeSet* contacts_typeset_get_phone (void);
static void ________lambda32_ (Block18Data* _data18_);
void contacts_utils_start_call (const gchar* contact_id, GeeHashMap* accounts);
static void _________lambda32__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
GType contacts_contact_im_display_get_type (void) G_GNUC_CONST;
gchar* contacts_contact_format_im_service (const gchar* service, ContactsContactImDisplay* display);
static void __________lambda33_ (Block20Data* _data20_);
TpfPersona* contacts_contact_find_im_persona (ContactsContact* self, const gchar* protocol, const gchar* im_address);
void contacts_utils_start_chat (ContactsContact* contact, const gchar* protocol, const gchar* id);
static void ___________lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self);
gboolean contacts_is_set (const gchar* str);
gchar** contacts_contact_format_address (FolksPostalAddress* addr, int* result_length1);
ContactsTypeSet* contacts_typeset_get_general (void);
GType contacts_address_map_get_type (void) G_GNUC_CONST;
ContactsAddressMap* contacts_address_map_new (ContactsContact* c, GeeSet* postal_addresses);
ContactsAddressMap* contacts_address_map_construct (GType object_type, ContactsContact* c, GeeSet* postal_addresses);
void contacts_address_map_load (ContactsAddressMap* self);
void contacts_contact_sheet_clear (ContactsContactSheet* self);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static GtkButton* contacts_contact_sheet_add_row_with_button (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value) {
	GtkButton* result = NULL;
	GtkLabel* type_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkStyleContext* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GtkButton* value_button = NULL;
	const gchar* _tmp4_ = NULL;
	GtkButton* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	GtkWidget* _tmp8_ = NULL;
	GtkWidget* _tmp9_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (label_value != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = label_value;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	type_label = _tmp1_;
	gtk_label_set_xalign (type_label, 1.0f);
	gtk_widget_set_halign ((GtkWidget*) type_label, GTK_ALIGN_END);
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) type_label);
	gtk_style_context_add_class (_tmp2_, "dim-label");
	_tmp3_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) type_label, 0, _tmp3_, 1, 1);
	_tmp4_ = value;
	_tmp5_ = (GtkButton*) gtk_button_new_with_label (_tmp4_);
	g_object_ref_sink (_tmp5_);
	value_button = _tmp5_;
	gtk_button_set_focus_on_click (value_button, FALSE);
	gtk_button_set_relief (value_button, GTK_RELIEF_NONE);
	g_object_set (value_button, "xalign", 0.0f, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) value_button, TRUE);
	_tmp6_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) value_button, 1, _tmp6_, 1, 1);
	_tmp7_ = *row;
	*row = _tmp7_ + 1;
	_tmp8_ = gtk_bin_get_child ((GtkBin*) value_button);
	gtk_label_set_ellipsize (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp8_) : NULL, PANGO_ELLIPSIZE_END);
	_tmp9_ = gtk_bin_get_child ((GtkBin*) value_button);
	g_object_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp9_) : NULL, "wrap-mode", PANGO_WRAP_CHAR, NULL);
	result = value_button;
	_g_object_unref0 (type_label);
	return result;
}


static void contacts_contact_sheet_add_row_with_link_button (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value) {
	GtkLabel* type_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkStyleContext* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GtkLinkButton* value_button = NULL;
	const gchar* _tmp4_ = NULL;
	GtkLinkButton* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	GtkWidget* _tmp8_ = NULL;
	GtkWidget* _tmp9_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label_value != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = label_value;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	type_label = _tmp1_;
	gtk_label_set_xalign (type_label, 1.0f);
	gtk_widget_set_halign ((GtkWidget*) type_label, GTK_ALIGN_END);
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) type_label);
	gtk_style_context_add_class (_tmp2_, "dim-label");
	_tmp3_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) type_label, 0, _tmp3_, 1, 1);
	_tmp4_ = value;
	_tmp5_ = (GtkLinkButton*) gtk_link_button_new (_tmp4_);
	g_object_ref_sink (_tmp5_);
	value_button = _tmp5_;
	gtk_button_set_focus_on_click ((GtkButton*) value_button, FALSE);
	gtk_button_set_relief ((GtkButton*) value_button, GTK_RELIEF_NONE);
	g_object_set ((GtkButton*) value_button, "xalign", 0.0f, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) value_button, TRUE);
	_tmp6_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) value_button, 1, _tmp6_, 1, 1);
	_tmp7_ = *row;
	*row = _tmp7_ + 1;
	_tmp8_ = gtk_bin_get_child ((GtkBin*) value_button);
	gtk_label_set_ellipsize (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp8_) : NULL, PANGO_ELLIPSIZE_END);
	_tmp9_ = gtk_bin_get_child ((GtkBin*) value_button);
	g_object_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp9_) : NULL, "wrap-mode", PANGO_WRAP_CHAR, NULL);
	_g_object_unref0 (value_button);
	_g_object_unref0 (type_label);
}


static void contacts_contact_sheet_add_row_with_label (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value) {
	GtkLabel* type_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkStyleContext* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GtkLabel* value_label = NULL;
	const gchar* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label_value != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = label_value;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	type_label = _tmp1_;
	gtk_label_set_xalign (type_label, 1.0f);
	gtk_widget_set_halign ((GtkWidget*) type_label, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) type_label, GTK_ALIGN_START);
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) type_label);
	gtk_style_context_add_class (_tmp2_, "dim-label");
	_tmp3_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) type_label, 0, _tmp3_, 1, 1);
	_tmp4_ = value;
	_tmp5_ = (GtkLabel*) gtk_label_new (_tmp4_);
	g_object_ref_sink (_tmp5_);
	value_label = _tmp5_;
	gtk_label_set_line_wrap (value_label, TRUE);
	gtk_label_set_xalign (value_label, 0.0f);
	gtk_widget_set_halign ((GtkWidget*) value_label, GTK_ALIGN_START);
	gtk_label_set_ellipsize (value_label, PANGO_ELLIPSIZE_END);
	g_object_set (value_label, "wrap-mode", PANGO_WRAP_CHAR, NULL);
	gtk_widget_set_margin_top ((GtkWidget*) type_label, 3);
	gtk_widget_set_margin_start ((GtkWidget*) value_label, 6);
	gtk_widget_set_margin_top ((GtkWidget*) value_label, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) value_label, 3);
	_tmp6_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) value_label, 1, _tmp6_, 1, 1);
	_tmp7_ = *row;
	*row = _tmp7_ + 1;
	_g_object_unref0 (value_label);
	_g_object_unref0 (type_label);
}


ContactsContactSheet* contacts_contact_sheet_construct (GType object_type) {
	ContactsContactSheet * self = NULL;
	self = (ContactsContactSheet*) g_object_new (object_type, NULL);
	gtk_grid_set_row_spacing ((GtkGrid*) self, (guint) 12);
	gtk_grid_set_column_spacing ((GtkGrid*) self, (guint) 16);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	return self;
}


ContactsContactSheet* contacts_contact_sheet_new (void) {
	return contacts_contact_sheet_construct (CONTACTS_TYPE_CONTACT_SHEET);
}


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


static Block16Data* block16_data_ref (Block16Data* _data16_) {
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}


static void block16_data_unref (void * _userdata_) {
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		ContactsContactSheet* self;
		self = _data16_->self;
		_g_object_unref0 (_data16_->c);
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}


static void __lambda29_ (Block16Data* _data16_, GtkWidget* w) {
	ContactsContactSheet* self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	self = _data16_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data16_->c;
	_tmp2_ = _tmp1_->individual;
	_tmp3_ = _data16_->c;
	contacts_contact_frame_set_image (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp0_) : NULL, (FolksAvatarDetails*) _tmp2_, _tmp3_);
}


static void ___lambda29__gtk_callback (GtkWidget* widget, gpointer self) {
	__lambda29_ (self, widget);
}


static void __lambda30_ (Block16Data* _data16_, GtkWidget* w) {
	ContactsContactSheet* self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	self = _data16_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data16_->c;
	_tmp2_ = contacts_contact_get_display_name (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_markup_printf_escaped ("<span font='16'>%s</span>", _tmp3_);
	_tmp5_ = _tmp4_;
	gtk_label_set_markup (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp0_) : NULL, _tmp5_);
	_g_free0 (_tmp5_);
}


static void ___lambda30__gtk_callback (GtkWidget* widget, gpointer self) {
	__lambda30_ (self, widget);
}


static Block17Data* block17_data_ref (Block17Data* _data17_) {
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}


static void block17_data_unref (void * _userdata_) {
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		ContactsContactSheet* self;
		self = _data17_->_data16_->self;
		_g_object_unref0 (_data17_->email);
		block16_data_unref (_data17_->_data16_);
		_data17_->_data16_ = NULL;
		g_slice_free (Block17Data, _data17_);
	}
}


static void _______lambda31_ (Block17Data* _data17_) {
	Block16Data* _data16_;
	ContactsContactSheet* self;
	ContactsContact* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	FolksEmailFieldDetails* _tmp3_ = NULL;
	gconstpointer _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	_data16_ = _data17_->_data16_;
	self = _data16_->self;
	_tmp0_ = _data16_->c;
	_tmp1_ = contacts_contact_get_display_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _data17_->email;
	_tmp4_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup_printf ("%s <%s>", _tmp2_, (const gchar*) _tmp5_);
	_tmp7_ = _tmp6_;
	contacts_utils_compose_mail (_tmp7_);
	_g_free0 (_tmp7_);
}


static void ________lambda31__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_______lambda31_ (self);
}


static Block18Data* block18_data_ref (Block18Data* _data18_) {
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}


static void block18_data_unref (void * _userdata_) {
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		ContactsContactSheet* self;
		self = _data18_->_data16_->self;
		_g_object_unref0 (_data18_->phone);
		block16_data_unref (_data18_->_data16_);
		_data18_->_data16_ = NULL;
		g_slice_free (Block18Data, _data18_);
	}
}


static void ________lambda32_ (Block18Data* _data18_) {
	Block16Data* _data16_;
	ContactsContactSheet* self;
	FolksPhoneFieldDetails* _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	ContactsApp* _tmp3_ = NULL;
	ContactsStore* _tmp4_ = NULL;
	GeeHashMap* _tmp5_ = NULL;
	_data16_ = _data18_->_data16_;
	self = _data16_->self;
	_tmp0_ = _data18_->phone;
	_tmp1_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = contacts_app_app;
	_tmp4_ = _tmp3_->contacts_store;
	_tmp5_ = _tmp4_->calling_accounts;
	contacts_utils_start_call ((const gchar*) _tmp2_, _tmp5_);
}


static void _________lambda32__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	________lambda32_ (self);
}


static Block19Data* block19_data_ref (Block19Data* _data19_) {
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}


static void block19_data_unref (void * _userdata_) {
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		ContactsContactSheet* self;
		self = _data19_->_data16_->self;
		_g_free0 (_data19_->protocol);
		block16_data_unref (_data19_->_data16_);
		_data19_->_data16_ = NULL;
		g_slice_free (Block19Data, _data19_);
	}
}


static Block20Data* block20_data_ref (Block20Data* _data20_) {
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}


static void block20_data_unref (void * _userdata_) {
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		ContactsContactSheet* self;
		self = _data20_->_data19_->_data16_->self;
		_g_object_unref0 (_data20_->id);
		block19_data_unref (_data20_->_data19_);
		_data20_->_data19_ = NULL;
		g_slice_free (Block20Data, _data20_);
	}
}


static void __________lambda33_ (Block20Data* _data20_) {
	Block19Data* _data19_;
	Block16Data* _data16_;
	ContactsContactSheet* self;
	TpfPersona* im_persona = NULL;
	ContactsContact* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	FolksImFieldDetails* _tmp2_ = NULL;
	gconstpointer _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	TpfPersona* _tmp5_ = NULL;
	TpfPersona* _tmp6_ = NULL;
	_data19_ = _data20_->_data19_;
	_data16_ = _data19_->_data16_;
	self = _data16_->self;
	_tmp0_ = _data16_->c;
	_tmp1_ = _data19_->protocol;
	_tmp2_ = _data20_->id;
	_tmp3_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = contacts_contact_find_im_persona (_tmp0_, _tmp1_, (const gchar*) _tmp4_);
	im_persona = _tmp5_;
	_tmp6_ = im_persona;
	if (_tmp6_ != NULL) {
		FolksPresenceType type = 0;
		TpfPersona* _tmp7_ = NULL;
		FolksPresenceType _tmp8_ = 0;
		FolksPresenceType _tmp9_ = 0;
		gboolean _tmp10_ = FALSE;
		gboolean _tmp11_ = FALSE;
		gboolean _tmp12_ = FALSE;
		FolksPresenceType _tmp13_ = 0;
		_tmp7_ = im_persona;
		_tmp8_ = folks_presence_details_get_presence_type ((FolksPresenceDetails*) _tmp7_);
		_tmp9_ = _tmp8_;
		type = _tmp9_;
		_tmp13_ = type;
		if (_tmp13_ != FOLKS_PRESENCE_TYPE_UNSET) {
			FolksPresenceType _tmp14_ = 0;
			_tmp14_ = type;
			_tmp12_ = _tmp14_ != FOLKS_PRESENCE_TYPE_ERROR;
		} else {
			_tmp12_ = FALSE;
		}
		if (_tmp12_) {
			FolksPresenceType _tmp15_ = 0;
			_tmp15_ = type;
			_tmp11_ = _tmp15_ != FOLKS_PRESENCE_TYPE_OFFLINE;
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			FolksPresenceType _tmp16_ = 0;
			_tmp16_ = type;
			_tmp10_ = _tmp16_ != FOLKS_PRESENCE_TYPE_UNKNOWN;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			ContactsContact* _tmp17_ = NULL;
			const gchar* _tmp18_ = NULL;
			FolksImFieldDetails* _tmp19_ = NULL;
			gconstpointer _tmp20_ = NULL;
			const gchar* _tmp21_ = NULL;
			_tmp17_ = _data16_->c;
			_tmp18_ = _data19_->protocol;
			_tmp19_ = _data20_->id;
			_tmp20_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp19_);
			_tmp21_ = _tmp20_;
			contacts_utils_start_chat (_tmp17_, _tmp18_, (const gchar*) _tmp21_);
		}
	}
	_g_object_unref0 (im_persona);
}


static void ___________lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__________lambda33_ (self);
}


void contacts_contact_sheet_update (ContactsContactSheet* self, ContactsContact* c) {
	Block16Data* _data16_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContactFrame* image_frame = NULL;
	ContactsContactFrame* _tmp2_ = NULL;
	ContactsContactFrame* _tmp3_ = NULL;
	GtkStyleContext* _tmp4_ = NULL;
	ContactsContactFrame* _tmp5_ = NULL;
	ContactsContactFrame* _tmp6_ = NULL;
	ContactsContactFrame* _tmp7_ = NULL;
	ContactsContact* _tmp8_ = NULL;
	ContactsContactFrame* _tmp9_ = NULL;
	ContactsContactFrame* _tmp10_ = NULL;
	GtkLabel* name_label = NULL;
	GtkLabel* _tmp11_ = NULL;
	GtkLabel* _tmp12_ = NULL;
	GtkLabel* _tmp13_ = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_ = NULL;
	GtkLabel* _tmp16_ = NULL;
	GtkLabel* _tmp17_ = NULL;
	ContactsContact* _tmp18_ = NULL;
	GtkLabel* _tmp19_ = NULL;
	GtkLabel* _tmp20_ = NULL;
	gint i = 0;
	gint last_store_position = 0;
	gboolean is_first_persona = FALSE;
	GeeList* personas = NULL;
	ContactsContact* _tmp21_ = NULL;
	GeeList* _tmp22_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (c != NULL);
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	_data16_->self = g_object_ref (self);
	_tmp0_ = c;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data16_->c);
	_data16_->c = _tmp1_;
	_tmp2_ = contacts_contact_frame_new (PROFILE_SIZE, FALSE);
	g_object_ref_sink (_tmp2_);
	image_frame = _tmp2_;
	_tmp3_ = image_frame;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	gtk_style_context_add_class (_tmp4_, "main-avatar-frame");
	_tmp5_ = image_frame;
	gtk_frame_set_shadow_type ((GtkFrame*) _tmp5_, GTK_SHADOW_IN);
	_tmp6_ = image_frame;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp6_, FALSE);
	_tmp7_ = image_frame;
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_START);
	_tmp8_ = _data16_->c;
	_tmp9_ = image_frame;
	contacts_contact_keep_widget_uptodate (_tmp8_, (GtkWidget*) _tmp9_, ___lambda29__gtk_callback, block16_data_ref (_data16_), block16_data_unref);
	_tmp10_ = image_frame;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp10_, 0, 0, 1, 3);
	_tmp11_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp11_);
	name_label = _tmp11_;
	_tmp12_ = name_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	_tmp13_ = name_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_START);
	_tmp14_ = name_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp14_, GTK_ALIGN_CENTER);
	_tmp15_ = name_label;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp15_, 6);
	_tmp16_ = name_label;
	gtk_label_set_ellipsize (_tmp16_, PANGO_ELLIPSIZE_END);
	_tmp17_ = name_label;
	gtk_label_set_xalign (_tmp17_, 0.0f);
	_tmp18_ = _data16_->c;
	_tmp19_ = name_label;
	contacts_contact_keep_widget_uptodate (_tmp18_, (GtkWidget*) _tmp19_, ___lambda30__gtk_callback, block16_data_ref (_data16_), block16_data_unref);
	_tmp20_ = name_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp20_, 1, 0, 1, 3);
	i = 3;
	last_store_position = 0;
	is_first_persona = TRUE;
	_tmp21_ = _data16_->c;
	_tmp22_ = contacts_contact_get_personas_for_display (_tmp21_);
	personas = _tmp22_;
	{
		GeeList* _p_list = NULL;
		GeeList* _tmp23_ = NULL;
		GeeList* _tmp24_ = NULL;
		gint _p_size = 0;
		GeeList* _tmp25_ = NULL;
		gint _tmp26_ = 0;
		gint _tmp27_ = 0;
		gint _p_index = 0;
		_tmp23_ = personas;
		_tmp24_ = _g_object_ref0 (_tmp23_);
		_p_list = _tmp24_;
		_tmp25_ = _p_list;
		_tmp26_ = gee_collection_get_size ((GeeCollection*) _tmp25_);
		_tmp27_ = _tmp26_;
		_p_size = _tmp27_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp28_ = 0;
			gint _tmp29_ = 0;
			gint _tmp30_ = 0;
			FolksPersona* p = NULL;
			GeeList* _tmp31_ = NULL;
			gint _tmp32_ = 0;
			gpointer _tmp33_ = NULL;
			gboolean _tmp34_ = FALSE;
			FolksEmailDetails* details = NULL;
			FolksPersona* _tmp49_ = NULL;
			FolksEmailDetails* _tmp50_ = NULL;
			FolksEmailDetails* _tmp51_ = NULL;
			FolksPhoneDetails* phone_details = NULL;
			FolksPersona* _tmp78_ = NULL;
			FolksPhoneDetails* _tmp79_ = NULL;
			FolksPhoneDetails* _tmp80_ = NULL;
			FolksImDetails* im_details = NULL;
			FolksPersona* _tmp119_ = NULL;
			FolksImDetails* _tmp120_ = NULL;
			FolksImDetails* _tmp121_ = NULL;
			FolksUrlDetails* url_details = NULL;
			FolksPersona* _tmp155_ = NULL;
			FolksUrlDetails* _tmp156_ = NULL;
			FolksUrlDetails* _tmp157_ = NULL;
			FolksNameDetails* name_details = NULL;
			FolksPersona* _tmp170_ = NULL;
			FolksNameDetails* _tmp171_ = NULL;
			FolksNameDetails* _tmp172_ = NULL;
			FolksBirthdayDetails* birthday_details = NULL;
			FolksPersona* _tmp181_ = NULL;
			FolksBirthdayDetails* _tmp182_ = NULL;
			FolksBirthdayDetails* _tmp183_ = NULL;
			FolksNoteDetails* note_details = NULL;
			FolksPersona* _tmp195_ = NULL;
			FolksNoteDetails* _tmp196_ = NULL;
			FolksNoteDetails* _tmp197_ = NULL;
			FolksPostalAddressDetails* addr_details = NULL;
			FolksPersona* _tmp210_ = NULL;
			FolksPostalAddressDetails* _tmp211_ = NULL;
			FolksPostalAddressDetails* _tmp212_ = NULL;
			gint _tmp254_ = 0;
			gint _tmp255_ = 0;
			gint _tmp256_ = 0;
			_tmp28_ = _p_index;
			_p_index = _tmp28_ + 1;
			_tmp29_ = _p_index;
			_tmp30_ = _p_size;
			if (!(_tmp29_ < _tmp30_)) {
				break;
			}
			_tmp31_ = _p_list;
			_tmp32_ = _p_index;
			_tmp33_ = gee_list_get (_tmp31_, _tmp32_);
			p = (FolksPersona*) _tmp33_;
			_tmp34_ = is_first_persona;
			if (!_tmp34_) {
				GtkLabel* store_name = NULL;
				GtkLabel* _tmp35_ = NULL;
				GtkLabel* _tmp36_ = NULL;
				FolksPersona* _tmp37_ = NULL;
				gchar* _tmp38_ = NULL;
				gchar* _tmp39_ = NULL;
				gchar* _tmp40_ = NULL;
				gchar* _tmp41_ = NULL;
				GtkLabel* _tmp42_ = NULL;
				GtkLabel* _tmp43_ = NULL;
				GtkLabel* _tmp44_ = NULL;
				GtkLabel* _tmp45_ = NULL;
				gint _tmp46_ = 0;
				gint _tmp47_ = 0;
				gint _tmp48_ = 0;
				_tmp35_ = (GtkLabel*) gtk_label_new ("");
				g_object_ref_sink (_tmp35_);
				store_name = _tmp35_;
				_tmp36_ = store_name;
				_tmp37_ = p;
				_tmp38_ = contacts_contact_format_persona_store_name_for_contact (_tmp37_);
				_tmp39_ = _tmp38_;
				_tmp40_ = g_markup_printf_escaped ("<span font='16px bold'>%s</span>", _tmp39_);
				_tmp41_ = _tmp40_;
				gtk_label_set_markup (_tmp36_, _tmp41_);
				_g_free0 (_tmp41_);
				_g_free0 (_tmp39_);
				_tmp42_ = store_name;
				gtk_widget_set_halign ((GtkWidget*) _tmp42_, GTK_ALIGN_START);
				_tmp43_ = store_name;
				gtk_label_set_xalign (_tmp43_, 0.0f);
				_tmp44_ = store_name;
				gtk_widget_set_margin_start ((GtkWidget*) _tmp44_, 6);
				_tmp45_ = store_name;
				_tmp46_ = i;
				gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp45_, 0, _tmp46_, 3, 1);
				_tmp47_ = i;
				i = _tmp47_ + 1;
				_tmp48_ = i;
				last_store_position = _tmp48_;
				_g_object_unref0 (store_name);
			}
			_tmp49_ = p;
			_tmp50_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp49_, FOLKS_TYPE_EMAIL_DETAILS) ? ((FolksEmailDetails*) _tmp49_) : NULL);
			details = _tmp50_;
			_tmp51_ = details;
			if (_tmp51_ != NULL) {
				GeeArrayList* emails = NULL;
				FolksEmailDetails* _tmp52_ = NULL;
				GeeSet* _tmp53_ = NULL;
				GeeSet* _tmp54_ = NULL;
				GeeArrayList* _tmp55_ = NULL;
				_tmp52_ = details;
				_tmp53_ = folks_email_details_get_email_addresses (_tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = contacts_contact_sort_fields (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp54_);
				emails = _tmp55_;
				{
					GeeArrayList* _email_list = NULL;
					GeeArrayList* _tmp56_ = NULL;
					GeeArrayList* _tmp57_ = NULL;
					gint _email_size = 0;
					GeeArrayList* _tmp58_ = NULL;
					gint _tmp59_ = 0;
					gint _tmp60_ = 0;
					gint _email_index = 0;
					_tmp56_ = emails;
					_tmp57_ = _g_object_ref0 (_tmp56_);
					_email_list = _tmp57_;
					_tmp58_ = _email_list;
					_tmp59_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp58_);
					_tmp60_ = _tmp59_;
					_email_size = _tmp60_;
					_email_index = -1;
					while (TRUE) {
						Block17Data* _data17_;
						gint _tmp61_ = 0;
						gint _tmp62_ = 0;
						gint _tmp63_ = 0;
						GeeArrayList* _tmp64_ = NULL;
						gint _tmp65_ = 0;
						gpointer _tmp66_ = NULL;
						GtkButton* button = NULL;
						ContactsTypeSet* _tmp67_ = NULL;
						ContactsTypeSet* _tmp68_ = NULL;
						FolksEmailFieldDetails* _tmp69_ = NULL;
						gchar* _tmp70_ = NULL;
						gchar* _tmp71_ = NULL;
						FolksEmailFieldDetails* _tmp72_ = NULL;
						gconstpointer _tmp73_ = NULL;
						const gchar* _tmp74_ = NULL;
						GtkButton* _tmp75_ = NULL;
						GtkButton* _tmp76_ = NULL;
						GtkButton* _tmp77_ = NULL;
						_data17_ = g_slice_new0 (Block17Data);
						_data17_->_ref_count_ = 1;
						_data17_->_data16_ = block16_data_ref (_data16_);
						_tmp61_ = _email_index;
						_email_index = _tmp61_ + 1;
						_tmp62_ = _email_index;
						_tmp63_ = _email_size;
						if (!(_tmp62_ < _tmp63_)) {
							block17_data_unref (_data17_);
							_data17_ = NULL;
							break;
						}
						_tmp64_ = _email_list;
						_tmp65_ = _email_index;
						_tmp66_ = gee_abstract_list_get ((GeeAbstractList*) _tmp64_, _tmp65_);
						_data17_->email = (FolksEmailFieldDetails*) _tmp66_;
						_tmp67_ = contacts_typeset_get_email ();
						_tmp68_ = _tmp67_;
						_tmp69_ = _data17_->email;
						_tmp70_ = contacts_typeset_format_type (_tmp68_, (FolksAbstractFieldDetails*) _tmp69_);
						_tmp71_ = _tmp70_;
						_tmp72_ = _data17_->email;
						_tmp73_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp72_);
						_tmp74_ = _tmp73_;
						_tmp75_ = contacts_contact_sheet_add_row_with_button (self, &i, _tmp71_, (const gchar*) _tmp74_);
						_tmp76_ = _tmp75_;
						_g_free0 (_tmp71_);
						button = _tmp76_;
						_tmp77_ = button;
						g_signal_connect_data (_tmp77_, "clicked", (GCallback) ________lambda31__gtk_button_clicked, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
						_g_object_unref0 (button);
						block17_data_unref (_data17_);
						_data17_ = NULL;
					}
					_g_object_unref0 (_email_list);
				}
				_g_object_unref0 (emails);
			}
			_tmp78_ = p;
			_tmp79_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp78_, FOLKS_TYPE_PHONE_DETAILS) ? ((FolksPhoneDetails*) _tmp78_) : NULL);
			phone_details = _tmp79_;
			_tmp80_ = phone_details;
			if (_tmp80_ != NULL) {
				GeeArrayList* phones = NULL;
				FolksPhoneDetails* _tmp81_ = NULL;
				GeeSet* _tmp82_ = NULL;
				GeeSet* _tmp83_ = NULL;
				GeeArrayList* _tmp84_ = NULL;
				_tmp81_ = phone_details;
				_tmp82_ = folks_phone_details_get_phone_numbers (_tmp81_);
				_tmp83_ = _tmp82_;
				_tmp84_ = contacts_contact_sort_fields (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp83_);
				phones = _tmp84_;
				{
					GeeArrayList* _phone_list = NULL;
					GeeArrayList* _tmp85_ = NULL;
					GeeArrayList* _tmp86_ = NULL;
					gint _phone_size = 0;
					GeeArrayList* _tmp87_ = NULL;
					gint _tmp88_ = 0;
					gint _tmp89_ = 0;
					gint _phone_index = 0;
					_tmp85_ = phones;
					_tmp86_ = _g_object_ref0 (_tmp85_);
					_phone_list = _tmp86_;
					_tmp87_ = _phone_list;
					_tmp88_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp87_);
					_tmp89_ = _tmp88_;
					_phone_size = _tmp89_;
					_phone_index = -1;
					while (TRUE) {
						Block18Data* _data18_;
						gint _tmp90_ = 0;
						gint _tmp91_ = 0;
						gint _tmp92_ = 0;
						GeeArrayList* _tmp93_ = NULL;
						gint _tmp94_ = 0;
						gpointer _tmp95_ = NULL;
						ContactsApp* _tmp96_ = NULL;
						ContactsStore* _tmp97_ = NULL;
						gboolean _tmp98_ = FALSE;
						gboolean _tmp99_ = FALSE;
						_data18_ = g_slice_new0 (Block18Data);
						_data18_->_ref_count_ = 1;
						_data18_->_data16_ = block16_data_ref (_data16_);
						_tmp90_ = _phone_index;
						_phone_index = _tmp90_ + 1;
						_tmp91_ = _phone_index;
						_tmp92_ = _phone_size;
						if (!(_tmp91_ < _tmp92_)) {
							block18_data_unref (_data18_);
							_data18_ = NULL;
							break;
						}
						_tmp93_ = _phone_list;
						_tmp94_ = _phone_index;
						_tmp95_ = gee_abstract_list_get ((GeeAbstractList*) _tmp93_, _tmp94_);
						_data18_->phone = (FolksPhoneFieldDetails*) _tmp95_;
						_tmp96_ = contacts_app_app;
						_tmp97_ = _tmp96_->contacts_store;
						_tmp98_ = contacts_store_get_can_call (_tmp97_);
						_tmp99_ = _tmp98_;
						if (_tmp99_) {
							GtkButton* button = NULL;
							ContactsTypeSet* _tmp100_ = NULL;
							ContactsTypeSet* _tmp101_ = NULL;
							FolksPhoneFieldDetails* _tmp102_ = NULL;
							gchar* _tmp103_ = NULL;
							gchar* _tmp104_ = NULL;
							FolksPhoneFieldDetails* _tmp105_ = NULL;
							gconstpointer _tmp106_ = NULL;
							const gchar* _tmp107_ = NULL;
							GtkButton* _tmp108_ = NULL;
							GtkButton* _tmp109_ = NULL;
							GtkButton* _tmp110_ = NULL;
							_tmp100_ = contacts_typeset_get_phone ();
							_tmp101_ = _tmp100_;
							_tmp102_ = _data18_->phone;
							_tmp103_ = contacts_typeset_format_type (_tmp101_, (FolksAbstractFieldDetails*) _tmp102_);
							_tmp104_ = _tmp103_;
							_tmp105_ = _data18_->phone;
							_tmp106_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp105_);
							_tmp107_ = _tmp106_;
							_tmp108_ = contacts_contact_sheet_add_row_with_button (self, &i, _tmp104_, (const gchar*) _tmp107_);
							_tmp109_ = _tmp108_;
							_g_free0 (_tmp104_);
							button = _tmp109_;
							_tmp110_ = button;
							g_signal_connect_data (_tmp110_, "clicked", (GCallback) _________lambda32__gtk_button_clicked, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
							_g_object_unref0 (button);
						} else {
							ContactsTypeSet* _tmp111_ = NULL;
							ContactsTypeSet* _tmp112_ = NULL;
							FolksPhoneFieldDetails* _tmp113_ = NULL;
							gchar* _tmp114_ = NULL;
							gchar* _tmp115_ = NULL;
							FolksPhoneFieldDetails* _tmp116_ = NULL;
							gconstpointer _tmp117_ = NULL;
							const gchar* _tmp118_ = NULL;
							_tmp111_ = contacts_typeset_get_phone ();
							_tmp112_ = _tmp111_;
							_tmp113_ = _data18_->phone;
							_tmp114_ = contacts_typeset_format_type (_tmp112_, (FolksAbstractFieldDetails*) _tmp113_);
							_tmp115_ = _tmp114_;
							_tmp116_ = _data18_->phone;
							_tmp117_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp116_);
							_tmp118_ = _tmp117_;
							contacts_contact_sheet_add_row_with_label (self, &i, _tmp115_, (const gchar*) _tmp118_);
							_g_free0 (_tmp115_);
						}
						block18_data_unref (_data18_);
						_data18_ = NULL;
					}
					_g_object_unref0 (_phone_list);
				}
				_g_object_unref0 (phones);
			}
			_tmp119_ = p;
			_tmp120_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp119_, FOLKS_TYPE_IM_DETAILS) ? ((FolksImDetails*) _tmp119_) : NULL);
			im_details = _tmp120_;
			_tmp121_ = im_details;
			if (_tmp121_ != NULL) {
				{
					GeeIterator* _protocol_it = NULL;
					FolksImDetails* _tmp122_ = NULL;
					GeeMultiMap* _tmp123_ = NULL;
					GeeMultiMap* _tmp124_ = NULL;
					GeeSet* _tmp125_ = NULL;
					GeeSet* _tmp126_ = NULL;
					GeeIterator* _tmp127_ = NULL;
					GeeIterator* _tmp128_ = NULL;
					_tmp122_ = im_details;
					_tmp123_ = folks_im_details_get_im_addresses (_tmp122_);
					_tmp124_ = _tmp123_;
					_tmp125_ = gee_multi_map_get_keys (_tmp124_);
					_tmp126_ = _tmp125_;
					_tmp127_ = gee_iterable_iterator ((GeeIterable*) _tmp126_);
					_tmp128_ = _tmp127_;
					_g_object_unref0 (_tmp126_);
					_protocol_it = _tmp128_;
					while (TRUE) {
						Block19Data* _data19_;
						GeeIterator* _tmp129_ = NULL;
						gboolean _tmp130_ = FALSE;
						GeeIterator* _tmp131_ = NULL;
						gpointer _tmp132_ = NULL;
						_data19_ = g_slice_new0 (Block19Data);
						_data19_->_ref_count_ = 1;
						_data19_->_data16_ = block16_data_ref (_data16_);
						_tmp129_ = _protocol_it;
						_tmp130_ = gee_iterator_next (_tmp129_);
						if (!_tmp130_) {
							block19_data_unref (_data19_);
							_data19_ = NULL;
							break;
						}
						_tmp131_ = _protocol_it;
						_tmp132_ = gee_iterator_get (_tmp131_);
						_data19_->protocol = (gchar*) _tmp132_;
						{
							GeeIterator* _id_it = NULL;
							FolksImDetails* _tmp133_ = NULL;
							GeeMultiMap* _tmp134_ = NULL;
							GeeMultiMap* _tmp135_ = NULL;
							const gchar* _tmp136_ = NULL;
							GeeCollection* _tmp137_ = NULL;
							GeeCollection* _tmp138_ = NULL;
							GeeIterator* _tmp139_ = NULL;
							GeeIterator* _tmp140_ = NULL;
							_tmp133_ = im_details;
							_tmp134_ = folks_im_details_get_im_addresses (_tmp133_);
							_tmp135_ = _tmp134_;
							_tmp136_ = _data19_->protocol;
							_tmp137_ = gee_multi_map_get (_tmp135_, _tmp136_);
							_tmp138_ = _tmp137_;
							_tmp139_ = gee_iterable_iterator ((GeeIterable*) _tmp138_);
							_tmp140_ = _tmp139_;
							_g_object_unref0 (_tmp138_);
							_id_it = _tmp140_;
							while (TRUE) {
								Block20Data* _data20_;
								GeeIterator* _tmp141_ = NULL;
								gboolean _tmp142_ = FALSE;
								GeeIterator* _tmp143_ = NULL;
								gpointer _tmp144_ = NULL;
								FolksPersona* _tmp145_ = NULL;
								_data20_ = g_slice_new0 (Block20Data);
								_data20_->_ref_count_ = 1;
								_data20_->_data19_ = block19_data_ref (_data19_);
								_tmp141_ = _id_it;
								_tmp142_ = gee_iterator_next (_tmp141_);
								if (!_tmp142_) {
									block20_data_unref (_data20_);
									_data20_ = NULL;
									break;
								}
								_tmp143_ = _id_it;
								_tmp144_ = gee_iterator_get (_tmp143_);
								_data20_->id = (FolksImFieldDetails*) _tmp144_;
								_tmp145_ = p;
								if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp145_, TPF_TYPE_PERSONA)) {
									GtkButton* button = NULL;
									const gchar* _tmp146_ = NULL;
									gchar* _tmp147_ = NULL;
									gchar* _tmp148_ = NULL;
									FolksImFieldDetails* _tmp149_ = NULL;
									gconstpointer _tmp150_ = NULL;
									const gchar* _tmp151_ = NULL;
									GtkButton* _tmp152_ = NULL;
									GtkButton* _tmp153_ = NULL;
									GtkButton* _tmp154_ = NULL;
									_tmp146_ = _data19_->protocol;
									_tmp147_ = contacts_contact_format_im_service (_tmp146_, NULL);
									_tmp148_ = _tmp147_;
									_tmp149_ = _data20_->id;
									_tmp150_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp149_);
									_tmp151_ = _tmp150_;
									_tmp152_ = contacts_contact_sheet_add_row_with_button (self, &i, _tmp148_, (const gchar*) _tmp151_);
									_tmp153_ = _tmp152_;
									_g_free0 (_tmp148_);
									button = _tmp153_;
									_tmp154_ = button;
									g_signal_connect_data (_tmp154_, "clicked", (GCallback) ___________lambda33__gtk_button_clicked, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
									_g_object_unref0 (button);
								}
								block20_data_unref (_data20_);
								_data20_ = NULL;
							}
							_g_object_unref0 (_id_it);
						}
						block19_data_unref (_data19_);
						_data19_ = NULL;
					}
					_g_object_unref0 (_protocol_it);
				}
			}
			_tmp155_ = p;
			_tmp156_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp155_, FOLKS_TYPE_URL_DETAILS) ? ((FolksUrlDetails*) _tmp155_) : NULL);
			url_details = _tmp156_;
			_tmp157_ = url_details;
			if (_tmp157_ != NULL) {
				{
					GeeIterator* _url_it = NULL;
					FolksUrlDetails* _tmp158_ = NULL;
					GeeSet* _tmp159_ = NULL;
					GeeSet* _tmp160_ = NULL;
					GeeIterator* _tmp161_ = NULL;
					_tmp158_ = url_details;
					_tmp159_ = folks_url_details_get_urls (_tmp158_);
					_tmp160_ = _tmp159_;
					_tmp161_ = gee_iterable_iterator ((GeeIterable*) _tmp160_);
					_url_it = _tmp161_;
					while (TRUE) {
						GeeIterator* _tmp162_ = NULL;
						gboolean _tmp163_ = FALSE;
						FolksUrlFieldDetails* url = NULL;
						GeeIterator* _tmp164_ = NULL;
						gpointer _tmp165_ = NULL;
						const gchar* _tmp166_ = NULL;
						FolksUrlFieldDetails* _tmp167_ = NULL;
						gconstpointer _tmp168_ = NULL;
						const gchar* _tmp169_ = NULL;
						_tmp162_ = _url_it;
						_tmp163_ = gee_iterator_next (_tmp162_);
						if (!_tmp163_) {
							break;
						}
						_tmp164_ = _url_it;
						_tmp165_ = gee_iterator_get (_tmp164_);
						url = (FolksUrlFieldDetails*) _tmp165_;
						_tmp166_ = _ ("Website");
						_tmp167_ = url;
						_tmp168_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp167_);
						_tmp169_ = _tmp168_;
						contacts_contact_sheet_add_row_with_link_button (self, &i, _tmp166_, (const gchar*) _tmp169_);
						_g_object_unref0 (url);
					}
					_g_object_unref0 (_url_it);
				}
			}
			_tmp170_ = p;
			_tmp171_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp170_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _tmp170_) : NULL);
			name_details = _tmp171_;
			_tmp172_ = name_details;
			if (_tmp172_ != NULL) {
				FolksNameDetails* _tmp173_ = NULL;
				const gchar* _tmp174_ = NULL;
				const gchar* _tmp175_ = NULL;
				gboolean _tmp176_ = FALSE;
				_tmp173_ = name_details;
				_tmp174_ = folks_name_details_get_nickname (_tmp173_);
				_tmp175_ = _tmp174_;
				_tmp176_ = contacts_is_set (_tmp175_);
				if (_tmp176_) {
					const gchar* _tmp177_ = NULL;
					FolksNameDetails* _tmp178_ = NULL;
					const gchar* _tmp179_ = NULL;
					const gchar* _tmp180_ = NULL;
					_tmp177_ = _ ("Nickname");
					_tmp178_ = name_details;
					_tmp179_ = folks_name_details_get_nickname (_tmp178_);
					_tmp180_ = _tmp179_;
					contacts_contact_sheet_add_row_with_label (self, &i, _tmp177_, _tmp180_);
				}
			}
			_tmp181_ = p;
			_tmp182_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp181_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _tmp181_) : NULL);
			birthday_details = _tmp182_;
			_tmp183_ = birthday_details;
			if (_tmp183_ != NULL) {
				FolksBirthdayDetails* _tmp184_ = NULL;
				GDateTime* _tmp185_ = NULL;
				GDateTime* _tmp186_ = NULL;
				_tmp184_ = birthday_details;
				_tmp185_ = folks_birthday_details_get_birthday (_tmp184_);
				_tmp186_ = _tmp185_;
				if (_tmp186_ != NULL) {
					const gchar* _tmp187_ = NULL;
					FolksBirthdayDetails* _tmp188_ = NULL;
					GDateTime* _tmp189_ = NULL;
					GDateTime* _tmp190_ = NULL;
					GDateTime* _tmp191_ = NULL;
					GDateTime* _tmp192_ = NULL;
					gchar* _tmp193_ = NULL;
					gchar* _tmp194_ = NULL;
					_tmp187_ = _ ("Birthday");
					_tmp188_ = birthday_details;
					_tmp189_ = folks_birthday_details_get_birthday (_tmp188_);
					_tmp190_ = _tmp189_;
					_tmp191_ = g_date_time_to_local (_tmp190_);
					_tmp192_ = _tmp191_;
					_tmp193_ = g_date_time_format (_tmp192_, "%x");
					_tmp194_ = _tmp193_;
					contacts_contact_sheet_add_row_with_label (self, &i, _tmp187_, _tmp194_);
					_g_free0 (_tmp194_);
					_g_date_time_unref0 (_tmp192_);
				}
			}
			_tmp195_ = p;
			_tmp196_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp195_, FOLKS_TYPE_NOTE_DETAILS) ? ((FolksNoteDetails*) _tmp195_) : NULL);
			note_details = _tmp196_;
			_tmp197_ = note_details;
			if (_tmp197_ != NULL) {
				{
					GeeIterator* _note_it = NULL;
					FolksNoteDetails* _tmp198_ = NULL;
					GeeSet* _tmp199_ = NULL;
					GeeSet* _tmp200_ = NULL;
					GeeIterator* _tmp201_ = NULL;
					_tmp198_ = note_details;
					_tmp199_ = folks_note_details_get_notes (_tmp198_);
					_tmp200_ = _tmp199_;
					_tmp201_ = gee_iterable_iterator ((GeeIterable*) _tmp200_);
					_note_it = _tmp201_;
					while (TRUE) {
						GeeIterator* _tmp202_ = NULL;
						gboolean _tmp203_ = FALSE;
						FolksNoteFieldDetails* note = NULL;
						GeeIterator* _tmp204_ = NULL;
						gpointer _tmp205_ = NULL;
						const gchar* _tmp206_ = NULL;
						FolksNoteFieldDetails* _tmp207_ = NULL;
						gconstpointer _tmp208_ = NULL;
						const gchar* _tmp209_ = NULL;
						_tmp202_ = _note_it;
						_tmp203_ = gee_iterator_next (_tmp202_);
						if (!_tmp203_) {
							break;
						}
						_tmp204_ = _note_it;
						_tmp205_ = gee_iterator_get (_tmp204_);
						note = (FolksNoteFieldDetails*) _tmp205_;
						_tmp206_ = _ ("Note");
						_tmp207_ = note;
						_tmp208_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp207_);
						_tmp209_ = _tmp208_;
						contacts_contact_sheet_add_row_with_label (self, &i, _tmp206_, (const gchar*) _tmp209_);
						_g_object_unref0 (note);
					}
					_g_object_unref0 (_note_it);
				}
			}
			_tmp210_ = p;
			_tmp211_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp210_, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS) ? ((FolksPostalAddressDetails*) _tmp210_) : NULL);
			addr_details = _tmp211_;
			_tmp212_ = addr_details;
			if (_tmp212_ != NULL) {
				FolksPostalAddressDetails* _tmp240_ = NULL;
				GeeSet* _tmp241_ = NULL;
				GeeSet* _tmp242_ = NULL;
				gint _tmp243_ = 0;
				gint _tmp244_ = 0;
				{
					GeeIterator* _addr_it = NULL;
					FolksPostalAddressDetails* _tmp213_ = NULL;
					GeeSet* _tmp214_ = NULL;
					GeeSet* _tmp215_ = NULL;
					GeeIterator* _tmp216_ = NULL;
					_tmp213_ = addr_details;
					_tmp214_ = folks_postal_address_details_get_postal_addresses (_tmp213_);
					_tmp215_ = _tmp214_;
					_tmp216_ = gee_iterable_iterator ((GeeIterable*) _tmp215_);
					_addr_it = _tmp216_;
					while (TRUE) {
						GeeIterator* _tmp217_ = NULL;
						gboolean _tmp218_ = FALSE;
						FolksPostalAddressFieldDetails* addr = NULL;
						GeeIterator* _tmp219_ = NULL;
						gpointer _tmp220_ = NULL;
						gchar** strs = NULL;
						FolksPostalAddressFieldDetails* _tmp221_ = NULL;
						gconstpointer _tmp222_ = NULL;
						FolksPostalAddress* _tmp223_ = NULL;
						gint _tmp224_ = 0;
						gchar** _tmp225_ = NULL;
						gint strs_length1 = 0;
						gint _strs_size_ = 0;
						gchar* all_strs = NULL;
						gchar* _tmp226_ = NULL;
						gchar** _tmp227_ = NULL;
						gint _tmp227__length1 = 0;
						ContactsTypeSet* _tmp234_ = NULL;
						ContactsTypeSet* _tmp235_ = NULL;
						FolksPostalAddressFieldDetails* _tmp236_ = NULL;
						gchar* _tmp237_ = NULL;
						gchar* _tmp238_ = NULL;
						const gchar* _tmp239_ = NULL;
						_tmp217_ = _addr_it;
						_tmp218_ = gee_iterator_next (_tmp217_);
						if (!_tmp218_) {
							break;
						}
						_tmp219_ = _addr_it;
						_tmp220_ = gee_iterator_get (_tmp219_);
						addr = (FolksPostalAddressFieldDetails*) _tmp220_;
						_tmp221_ = addr;
						_tmp222_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp221_);
						_tmp223_ = _tmp222_;
						_tmp225_ = contacts_contact_format_address ((FolksPostalAddress*) _tmp223_, &_tmp224_);
						strs = _tmp225_;
						strs_length1 = _tmp224_;
						_strs_size_ = strs_length1;
						_tmp226_ = g_strdup ("");
						all_strs = _tmp226_;
						_tmp227_ = strs;
						_tmp227__length1 = strs_length1;
						{
							gchar** s_collection = NULL;
							gint s_collection_length1 = 0;
							gint _s_collection_size_ = 0;
							gint s_it = 0;
							s_collection = _tmp227_;
							s_collection_length1 = _tmp227__length1;
							for (s_it = 0; s_it < _tmp227__length1; s_it = s_it + 1) {
								gchar* _tmp228_ = NULL;
								gchar* s = NULL;
								_tmp228_ = g_strdup (s_collection[s_it]);
								s = _tmp228_;
								{
									const gchar* _tmp229_ = NULL;
									const gchar* _tmp230_ = NULL;
									gchar* _tmp231_ = NULL;
									gchar* _tmp232_ = NULL;
									gchar* _tmp233_ = NULL;
									_tmp229_ = all_strs;
									_tmp230_ = s;
									_tmp231_ = g_strconcat (_tmp230_, "\n", NULL);
									_tmp232_ = _tmp231_;
									_tmp233_ = g_strconcat (_tmp229_, _tmp232_, NULL);
									_g_free0 (all_strs);
									all_strs = _tmp233_;
									_g_free0 (_tmp232_);
									_g_free0 (s);
								}
							}
						}
						_tmp234_ = contacts_typeset_get_general ();
						_tmp235_ = _tmp234_;
						_tmp236_ = addr;
						_tmp237_ = contacts_typeset_format_type (_tmp235_, (FolksAbstractFieldDetails*) _tmp236_);
						_tmp238_ = _tmp237_;
						_tmp239_ = all_strs;
						contacts_contact_sheet_add_row_with_label (self, &i, _tmp238_, _tmp239_);
						_g_free0 (_tmp238_);
						_g_free0 (all_strs);
						strs = (_vala_array_free (strs, strs_length1, (GDestroyNotify) g_free), NULL);
						_g_object_unref0 (addr);
					}
					_g_object_unref0 (_addr_it);
				}
				_tmp240_ = addr_details;
				_tmp241_ = folks_postal_address_details_get_postal_addresses (_tmp240_);
				_tmp242_ = _tmp241_;
				_tmp243_ = gee_collection_get_size ((GeeCollection*) _tmp242_);
				_tmp244_ = _tmp243_;
				if (_tmp244_ > 0) {
					ContactsAddressMap* map = NULL;
					ContactsContact* _tmp245_ = NULL;
					FolksPostalAddressDetails* _tmp246_ = NULL;
					GeeSet* _tmp247_ = NULL;
					GeeSet* _tmp248_ = NULL;
					ContactsAddressMap* _tmp249_ = NULL;
					ContactsAddressMap* _tmp250_ = NULL;
					ContactsAddressMap* _tmp251_ = NULL;
					gint _tmp252_ = 0;
					gint _tmp253_ = 0;
					_tmp245_ = _data16_->c;
					_tmp246_ = addr_details;
					_tmp247_ = folks_postal_address_details_get_postal_addresses (_tmp246_);
					_tmp248_ = _tmp247_;
					_tmp249_ = contacts_address_map_new (_tmp245_, _tmp248_);
					g_object_ref_sink (_tmp249_);
					map = _tmp249_;
					_tmp250_ = map;
					contacts_address_map_load (_tmp250_);
					_tmp251_ = map;
					_tmp252_ = i;
					gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp251_, 1, _tmp252_, 1, 1);
					_tmp253_ = i;
					i = _tmp253_ + 1;
					_g_object_unref0 (map);
				}
			}
			_tmp254_ = i;
			if (_tmp254_ != 3) {
				is_first_persona = FALSE;
			}
			_tmp255_ = i;
			_tmp256_ = last_store_position;
			if (_tmp255_ == _tmp256_) {
				gint _tmp257_ = 0;
				GtkWidget* _tmp258_ = NULL;
				_tmp257_ = i;
				_tmp258_ = gtk_grid_get_child_at ((GtkGrid*) self, 0, _tmp257_ - 1);
				gtk_widget_destroy (_tmp258_);
			}
			_g_object_unref0 (addr_details);
			_g_object_unref0 (note_details);
			_g_object_unref0 (birthday_details);
			_g_object_unref0 (name_details);
			_g_object_unref0 (url_details);
			_g_object_unref0 (im_details);
			_g_object_unref0 (phone_details);
			_g_object_unref0 (details);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_list);
	}
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (personas);
	_g_object_unref0 (name_label);
	_g_object_unref0 (image_frame);
	block16_data_unref (_data16_);
	_data16_ = NULL;
}


void contacts_contact_sheet_clear (ContactsContactSheet* self) {
	GList* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp0_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* w = NULL;
			w = (GtkWidget*) w_it->data;
			{
				GtkWidget* _tmp1_ = NULL;
				_tmp1_ = w;
				gtk_widget_destroy (_tmp1_);
			}
		}
		_g_list_free0 (w_collection);
	}
}


static void contacts_contact_sheet_class_init (ContactsContactSheetClass * klass) {
	contacts_contact_sheet_parent_class = g_type_class_peek_parent (klass);
}


static void contacts_contact_sheet_instance_init (ContactsContactSheet * self) {
}


GType contacts_contact_sheet_get_type (void) {
	static volatile gsize contacts_contact_sheet_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_sheet_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsContactSheetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_contact_sheet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsContactSheet), 0, (GInstanceInitFunc) contacts_contact_sheet_instance_init, NULL };
		GType contacts_contact_sheet_type_id;
		contacts_contact_sheet_type_id = g_type_register_static (gtk_grid_get_type (), "ContactsContactSheet", &g_define_type_info, 0);
		g_once_init_leave (&contacts_contact_sheet_type_id__volatile, contacts_contact_sheet_type_id);
	}
	return contacts_contact_sheet_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



