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

/*
* Copyright 2021 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*/

#include "onlineaccounts.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <granite-7.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <adwaita.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_0_PROPERTY,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_DISPLAY_NAME_PROPERTY,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_EMAIL_PROPERTY,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_PASSWORD_PROPERTY,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_REAL_NAME_PROPERTY,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_BUTTON_PROPERTY,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NUM_PROPERTIES
};
static GParamSpec* online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_CANCEL_SIGNAL,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_SIGNAL,
	ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NUM_SIGNALS
};
static guint online_accounts_imap_login_page_signals[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NUM_SIGNALS] = {0};

struct _OnlineAccountsImapLoginPagePrivate {
	gchar* _display_name;
	gchar* _email;
	gchar* _password;
	gchar* _real_name;
	GraniteValidatedEntry* display_name_entry;
	GraniteValidatedEntry* email_entry;
	GraniteValidatedEntry* password_entry;
	GraniteValidatedEntry* real_name_entry;
	GtkButton* _next_button;
};

static gint OnlineAccountsImapLoginPage_private_offset;
static gpointer online_accounts_imap_login_page_parent_class = NULL;

static void online_accounts_imap_login_page_set_button_sensitivity (OnlineAccountsImapLoginPage* self);
static void online_accounts_imap_login_page_set_next_button (OnlineAccountsImapLoginPage* self,
                                                      GtkButton* value);
static GObject * online_accounts_imap_login_page_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void _online_accounts_imap_login_page___lambda22_ (OnlineAccountsImapLoginPage* self);
static void __online_accounts_imap_login_page___lambda22__gtk_editable_changed (GtkEditable* _sender,
                                                                         gpointer self);
static void _online_accounts_imap_login_page___lambda23_ (OnlineAccountsImapLoginPage* self);
static void __online_accounts_imap_login_page___lambda23__gtk_editable_changed (GtkEditable* _sender,
                                                                         gpointer self);
static void _online_accounts_imap_login_page___lambda24_ (OnlineAccountsImapLoginPage* self);
static void __online_accounts_imap_login_page___lambda24__gtk_editable_changed (GtkEditable* _sender,
                                                                         gpointer self);
static void _online_accounts_imap_login_page___lambda25_ (OnlineAccountsImapLoginPage* self);
static void __online_accounts_imap_login_page___lambda25__gtk_editable_changed (GtkEditable* _sender,
                                                                         gpointer self);
static void _online_accounts_imap_login_page___lambda26_ (OnlineAccountsImapLoginPage* self);
static void __online_accounts_imap_login_page___lambda26__gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void _online_accounts_imap_login_page___lambda27_ (OnlineAccountsImapLoginPage* self);
static void __online_accounts_imap_login_page___lambda27__gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void online_accounts_imap_login_page_finalize (GObject * obj);
static GType online_accounts_imap_login_page_get_type_once (void);
static void _vala_online_accounts_imap_login_page_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_online_accounts_imap_login_page_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);

static inline gpointer
online_accounts_imap_login_page_get_instance_private (OnlineAccountsImapLoginPage* self)
{
	return G_STRUCT_MEMBER_P (self, OnlineAccountsImapLoginPage_private_offset);
}

static void
online_accounts_imap_login_page_set_button_sensitivity (OnlineAccountsImapLoginPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	GraniteValidatedEntry* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkButton* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp3_ = self->priv->email_entry;
	_tmp4_ = granite_validated_entry_get_is_valid (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		GraniteValidatedEntry* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = self->priv->real_name_entry;
		_tmp7_ = granite_validated_entry_get_is_valid (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp2_ = _tmp8_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GraniteValidatedEntry* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->display_name_entry;
		_tmp10_ = granite_validated_entry_get_is_valid (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp1_ = _tmp11_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GraniteValidatedEntry* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->password_entry;
		_tmp13_ = granite_validated_entry_get_is_valid (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp0_ = _tmp14_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp15_ = self->priv->_next_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, _tmp0_);
}

OnlineAccountsImapLoginPage*
online_accounts_imap_login_page_construct (GType object_type)
{
	OnlineAccountsImapLoginPage * self = NULL;
	self = (OnlineAccountsImapLoginPage*) g_object_new (object_type, NULL);
	return self;
}

OnlineAccountsImapLoginPage*
online_accounts_imap_login_page_new (void)
{
	return online_accounts_imap_login_page_construct (ONLINE_ACCOUNTS_TYPE_IMAP_LOGIN_PAGE);
}

const gchar*
online_accounts_imap_login_page_get_display_name (OnlineAccountsImapLoginPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_name;
	result = _tmp0_;
	return result;
}

void
online_accounts_imap_login_page_set_display_name (OnlineAccountsImapLoginPage* self,
                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = online_accounts_imap_login_page_get_display_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_display_name);
		self->priv->_display_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_DISPLAY_NAME_PROPERTY]);
	}
}

const gchar*
online_accounts_imap_login_page_get_email (OnlineAccountsImapLoginPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_email;
	result = _tmp0_;
	return result;
}

void
online_accounts_imap_login_page_set_email (OnlineAccountsImapLoginPage* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = online_accounts_imap_login_page_get_email (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_email);
		self->priv->_email = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_EMAIL_PROPERTY]);
	}
}

const gchar*
online_accounts_imap_login_page_get_password (OnlineAccountsImapLoginPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_password;
	result = _tmp0_;
	return result;
}

void
online_accounts_imap_login_page_set_password (OnlineAccountsImapLoginPage* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = online_accounts_imap_login_page_get_password (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_password);
		self->priv->_password = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_PASSWORD_PROPERTY]);
	}
}

const gchar*
online_accounts_imap_login_page_get_real_name (OnlineAccountsImapLoginPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_real_name;
	result = _tmp0_;
	return result;
}

void
online_accounts_imap_login_page_set_real_name (OnlineAccountsImapLoginPage* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = online_accounts_imap_login_page_get_real_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_real_name);
		self->priv->_real_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_REAL_NAME_PROPERTY]);
	}
}

GtkButton*
online_accounts_imap_login_page_get_next_button (OnlineAccountsImapLoginPage* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_next_button;
	result = _tmp0_;
	return result;
}

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

static void
online_accounts_imap_login_page_set_next_button (OnlineAccountsImapLoginPage* self,
                                                 GtkButton* value)
{
	GtkButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = online_accounts_imap_login_page_get_next_button (self);
	if (old_value != value) {
		GtkButton* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_next_button);
		self->priv->_next_button = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_BUTTON_PROPERTY]);
	}
}

static void
_online_accounts_imap_login_page___lambda22_ (OnlineAccountsImapLoginPage* self)
{
	GraniteValidatedEntry* _tmp0_;
	GraniteValidatedEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	_tmp0_ = self->priv->display_name_entry;
	_tmp1_ = self->priv->email_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_editable_set_text ((GtkEditable*) _tmp0_, _tmp3_);
	online_accounts_imap_login_page_set_button_sensitivity (self);
}

static void
__online_accounts_imap_login_page___lambda22__gtk_editable_changed (GtkEditable* _sender,
                                                                    gpointer self)
{
	_online_accounts_imap_login_page___lambda22_ ((OnlineAccountsImapLoginPage*) self);
}

static void
_online_accounts_imap_login_page___lambda23_ (OnlineAccountsImapLoginPage* self)
{
	GraniteValidatedEntry* _tmp0_;
	GraniteValidatedEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	_tmp0_ = self->priv->real_name_entry;
	_tmp1_ = self->priv->real_name_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	granite_validated_entry_set_is_valid (_tmp0_, _tmp5_ > 0);
	online_accounts_imap_login_page_set_button_sensitivity (self);
}

static void
__online_accounts_imap_login_page___lambda23__gtk_editable_changed (GtkEditable* _sender,
                                                                    gpointer self)
{
	_online_accounts_imap_login_page___lambda23_ ((OnlineAccountsImapLoginPage*) self);
}

static void
_online_accounts_imap_login_page___lambda24_ (OnlineAccountsImapLoginPage* self)
{
	GraniteValidatedEntry* _tmp0_;
	GraniteValidatedEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	_tmp0_ = self->priv->display_name_entry;
	_tmp1_ = self->priv->display_name_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	granite_validated_entry_set_is_valid (_tmp0_, _tmp5_ > 0);
	online_accounts_imap_login_page_set_button_sensitivity (self);
}

static void
__online_accounts_imap_login_page___lambda24__gtk_editable_changed (GtkEditable* _sender,
                                                                    gpointer self)
{
	_online_accounts_imap_login_page___lambda24_ ((OnlineAccountsImapLoginPage*) self);
}

static void
_online_accounts_imap_login_page___lambda25_ (OnlineAccountsImapLoginPage* self)
{
	GraniteValidatedEntry* _tmp0_;
	GraniteValidatedEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	_tmp0_ = self->priv->password_entry;
	_tmp1_ = self->priv->password_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	granite_validated_entry_set_is_valid (_tmp0_, _tmp5_ > 0);
	online_accounts_imap_login_page_set_button_sensitivity (self);
}

static void
__online_accounts_imap_login_page___lambda25__gtk_editable_changed (GtkEditable* _sender,
                                                                    gpointer self)
{
	_online_accounts_imap_login_page___lambda25_ ((OnlineAccountsImapLoginPage*) self);
}

static void
_online_accounts_imap_login_page___lambda26_ (OnlineAccountsImapLoginPage* self)
{
	g_signal_emit (self, online_accounts_imap_login_page_signals[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_CANCEL_SIGNAL], 0);
}

static void
__online_accounts_imap_login_page___lambda26__gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	_online_accounts_imap_login_page___lambda26_ ((OnlineAccountsImapLoginPage*) self);
}

static void
_online_accounts_imap_login_page___lambda27_ (OnlineAccountsImapLoginPage* self)
{
	g_signal_emit (self, online_accounts_imap_login_page_signals[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_SIGNAL], 0);
}

static void
__online_accounts_imap_login_page___lambda27__gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	_online_accounts_imap_login_page___lambda27_ ((OnlineAccountsImapLoginPage*) self);
}

static GObject *
online_accounts_imap_login_page_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	OnlineAccountsImapLoginPage * self;
	GRegex* email_regex = NULL;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	GraniteValidatedEntry* _tmp7_ = NULL;
	GraniteValidatedEntry* _tmp8_;
	GraniteValidatedEntry* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	GraniteHeaderLabel* real_name_label = NULL;
	GraniteValidatedEntry* _tmp12_;
	GtkWidget* _tmp13_;
	GraniteHeaderLabel* _tmp14_ = NULL;
	GRegex* _tmp15_;
	GraniteValidatedEntry* _tmp16_ = NULL;
	GraniteValidatedEntry* _tmp17_;
	GraniteHeaderLabel* email_label = NULL;
	GraniteValidatedEntry* _tmp18_;
	GtkWidget* _tmp19_;
	GraniteHeaderLabel* _tmp20_ = NULL;
	GraniteValidatedEntry* _tmp21_ = NULL;
	GraniteValidatedEntry* _tmp22_;
	GraniteHeaderLabel* password_label = NULL;
	GraniteValidatedEntry* _tmp23_;
	GtkWidget* _tmp24_;
	GraniteHeaderLabel* _tmp25_ = NULL;
	GraniteValidatedEntry* _tmp26_ = NULL;
	GraniteValidatedEntry* _tmp27_;
	GraniteHeaderLabel* display_name_label = NULL;
	GraniteValidatedEntry* _tmp28_;
	GtkWidget* _tmp29_;
	gchar* _tmp30_;
	GraniteHeaderLabel* _tmp31_ = NULL;
	GtkButton* cancel_button = NULL;
	GtkButton* _tmp32_;
	GtkButton* _tmp33_ = NULL;
	GtkButton* _tmp34_;
	GtkButton* _tmp35_;
	GtkBox* action_area = NULL;
	GtkBox* _tmp36_ = NULL;
	GtkBox* _tmp37_;
	GtkBox* _tmp38_;
	GtkButton* _tmp39_;
	GtkBox* _tmp40_;
	GtkButton* _tmp41_;
	GtkBox* box = NULL;
	GtkBox* _tmp42_;
	GtkBox* _tmp43_;
	GraniteHeaderLabel* _tmp44_;
	GtkBox* _tmp45_;
	GraniteValidatedEntry* _tmp46_;
	GtkBox* _tmp47_;
	GraniteHeaderLabel* _tmp48_;
	GtkBox* _tmp49_;
	GraniteValidatedEntry* _tmp50_;
	GtkBox* _tmp51_;
	GraniteHeaderLabel* _tmp52_;
	GtkBox* _tmp53_;
	GraniteValidatedEntry* _tmp54_;
	GtkBox* _tmp55_;
	GraniteHeaderLabel* _tmp56_;
	GtkBox* _tmp57_;
	GraniteValidatedEntry* _tmp58_;
	GtkBox* _tmp59_;
	GtkBox* _tmp60_;
	GtkBox* _tmp61_;
	GraniteValidatedEntry* _tmp62_;
	GraniteValidatedEntry* _tmp63_;
	GraniteValidatedEntry* _tmp64_;
	GraniteValidatedEntry* _tmp65_;
	GraniteValidatedEntry* _tmp66_;
	GraniteValidatedEntry* _tmp67_;
	GraniteValidatedEntry* _tmp68_;
	GraniteValidatedEntry* _tmp69_;
	GtkButton* _tmp70_;
	GtkButton* _tmp71_;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (online_accounts_imap_login_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_IMAP_LOGIN_PAGE, OnlineAccountsImapLoginPage);
	email_regex = NULL;
	{
		GRegex* _tmp0_ = NULL;
		GRegex* _tmp1_;
		GRegex* _tmp2_;
		_tmp1_ = g_regex_new ("^[^\\s]+@[^\\s]+\\.[^\\s]+$", 0, 0, &_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_regex_unref0 (email_regex);
		email_regex = _tmp2_;
		_g_regex_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_critical ("ImapLoginPage.vala:42: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_regex_unref0 (email_regex);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	_tmp5_ = g_get_real_name ();
	_tmp6_ = g_strdup (_tmp5_);
	_tmp7_ = granite_validated_entry_new ();
	granite_validated_entry_set_is_valid (_tmp7_, TRUE);
	gtk_entry_set_input_purpose ((GtkEntry*) _tmp7_, GTK_INPUT_PURPOSE_NAME);
	gtk_editable_set_text ((GtkEditable*) _tmp7_, _tmp6_);
	_g_free0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->real_name_entry);
	self->priv->real_name_entry = _tmp7_;
	_tmp8_ = self->priv->real_name_entry;
	gtk_accessible_update_property ((GtkAccessible*) _tmp8_, GTK_ACCESSIBLE_PROPERTY_REQUIRED, TRUE, -1, -1);
	_tmp9_ = self->priv->real_name_entry;
	_tmp10_ = gtk_editable_get_text ((GtkEditable*) _tmp9_);
	_tmp11_ = _tmp10_;
	online_accounts_imap_login_page_set_real_name (self, _tmp11_);
	_tmp12_ = self->priv->real_name_entry;
	_tmp13_ = _g_object_ref0 ((GtkWidget*) _tmp12_);
	_tmp14_ = granite_header_label_new (_ ("Real Name"));
	granite_header_label_set_mnemonic_widget (_tmp14_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	g_object_ref_sink (_tmp14_);
	real_name_label = _tmp14_;
	_tmp15_ = email_regex;
	_tmp16_ = granite_validated_entry_new_from_regex (_tmp15_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp16_, TRUE);
	gtk_entry_set_input_purpose ((GtkEntry*) _tmp16_, GTK_INPUT_PURPOSE_EMAIL);
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->email_entry);
	self->priv->email_entry = _tmp16_;
	_tmp17_ = self->priv->email_entry;
	gtk_accessible_update_property ((GtkAccessible*) _tmp17_, GTK_ACCESSIBLE_PROPERTY_REQUIRED, TRUE, -1, -1);
	_tmp18_ = self->priv->email_entry;
	_tmp19_ = _g_object_ref0 ((GtkWidget*) _tmp18_);
	_tmp20_ = granite_header_label_new (_ ("Email"));
	granite_header_label_set_mnemonic_widget (_tmp20_, _tmp19_);
	_g_object_unref0 (_tmp19_);
	g_object_ref_sink (_tmp20_);
	email_label = _tmp20_;
	_tmp21_ = granite_validated_entry_new ();
	gtk_entry_set_input_purpose ((GtkEntry*) _tmp21_, GTK_INPUT_PURPOSE_PASSWORD);
	gtk_entry_set_visibility ((GtkEntry*) _tmp21_, FALSE);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->password_entry);
	self->priv->password_entry = _tmp21_;
	_tmp22_ = self->priv->password_entry;
	gtk_accessible_update_property ((GtkAccessible*) _tmp22_, GTK_ACCESSIBLE_PROPERTY_REQUIRED, TRUE, -1, -1);
	_tmp23_ = self->priv->password_entry;
	_tmp24_ = _g_object_ref0 ((GtkWidget*) _tmp23_);
	_tmp25_ = granite_header_label_new (_ ("Password"));
	granite_header_label_set_mnemonic_widget (_tmp25_, _tmp24_);
	_g_object_unref0 (_tmp24_);
	g_object_ref_sink (_tmp25_);
	password_label = _tmp25_;
	_tmp26_ = granite_validated_entry_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp26_, TRUE);
	g_object_ref_sink (_tmp26_);
	_g_object_unref0 (self->priv->display_name_entry);
	self->priv->display_name_entry = _tmp26_;
	_tmp27_ = self->priv->display_name_entry;
	gtk_accessible_update_property ((GtkAccessible*) _tmp27_, GTK_ACCESSIBLE_PROPERTY_REQUIRED, TRUE, -1, -1);
	_tmp28_ = self->priv->display_name_entry;
	_tmp29_ = _g_object_ref0 ((GtkWidget*) _tmp28_);
	_tmp30_ = g_strdup (_ ("Pick a name like “Work” or “Personal” for the account."));
	_tmp31_ = granite_header_label_new (_ ("Account Display Name"));
	granite_header_label_set_mnemonic_widget (_tmp31_, _tmp29_);
	_g_object_unref0 (_tmp29_);
	granite_header_label_set_secondary_text (_tmp31_, _tmp30_);
	_g_free0 (_tmp30_);
	g_object_ref_sink (_tmp31_);
	display_name_label = _tmp31_;
	_tmp32_ = (GtkButton*) gtk_button_new_with_label (_ ("Cancel"));
	g_object_ref_sink (_tmp32_);
	cancel_button = _tmp32_;
	_tmp33_ = (GtkButton*) gtk_button_new_with_label (_ ("Next"));
	gtk_widget_set_sensitive ((GtkWidget*) _tmp33_, FALSE);
	g_object_ref_sink (_tmp33_);
	_tmp34_ = _tmp33_;
	online_accounts_imap_login_page_set_next_button (self, _tmp34_);
	_g_object_unref0 (_tmp34_);
	_tmp35_ = self->priv->_next_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp35_, GRANITE_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp36_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp36_, 24);
	gtk_widget_set_valign ((GtkWidget*) _tmp36_, GTK_ALIGN_END);
	gtk_widget_set_halign ((GtkWidget*) _tmp36_, GTK_ALIGN_END);
	gtk_box_set_homogeneous (_tmp36_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp36_, TRUE);
	g_object_ref_sink (_tmp36_);
	action_area = _tmp36_;
	_tmp37_ = action_area;
	gtk_widget_add_css_class ((GtkWidget*) _tmp37_, "action-area");
	_tmp38_ = action_area;
	_tmp39_ = cancel_button;
	gtk_box_append (_tmp38_, (GtkWidget*) _tmp39_);
	_tmp40_ = action_area;
	_tmp41_ = self->priv->_next_button;
	gtk_box_append (_tmp40_, (GtkWidget*) _tmp41_);
	_tmp42_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	g_object_ref_sink (_tmp42_);
	box = _tmp42_;
	_tmp43_ = box;
	_tmp44_ = real_name_label;
	gtk_box_append (_tmp43_, (GtkWidget*) _tmp44_);
	_tmp45_ = box;
	_tmp46_ = self->priv->real_name_entry;
	gtk_box_append (_tmp45_, (GtkWidget*) _tmp46_);
	_tmp47_ = box;
	_tmp48_ = email_label;
	gtk_box_append (_tmp47_, (GtkWidget*) _tmp48_);
	_tmp49_ = box;
	_tmp50_ = self->priv->email_entry;
	gtk_box_append (_tmp49_, (GtkWidget*) _tmp50_);
	_tmp51_ = box;
	_tmp52_ = password_label;
	gtk_box_append (_tmp51_, (GtkWidget*) _tmp52_);
	_tmp53_ = box;
	_tmp54_ = self->priv->password_entry;
	gtk_box_append (_tmp53_, (GtkWidget*) _tmp54_);
	_tmp55_ = box;
	_tmp56_ = display_name_label;
	gtk_box_append (_tmp55_, (GtkWidget*) _tmp56_);
	_tmp57_ = box;
	_tmp58_ = self->priv->display_name_entry;
	gtk_box_append (_tmp57_, (GtkWidget*) _tmp58_);
	_tmp59_ = box;
	_tmp60_ = action_area;
	gtk_box_append (_tmp59_, (GtkWidget*) _tmp60_);
	_tmp61_ = box;
	adw_navigation_page_set_child ((AdwNavigationPage*) self, (GtkWidget*) _tmp61_);
	adw_navigation_page_set_title ((AdwNavigationPage*) self, _ ("Log In"));
	_tmp62_ = self->priv->email_entry;
	g_object_bind_property_with_closures ((GObject*) self, "email", (GObject*) _tmp62_, "text", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp63_ = self->priv->email_entry;
	g_signal_connect_object ((GtkEditable*) _tmp63_, "changed", (GCallback) __online_accounts_imap_login_page___lambda22__gtk_editable_changed, self, 0);
	_tmp64_ = self->priv->real_name_entry;
	g_object_bind_property_with_closures ((GObject*) self, "real-name", (GObject*) _tmp64_, "text", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp65_ = self->priv->real_name_entry;
	g_signal_connect_object ((GtkEditable*) _tmp65_, "changed", (GCallback) __online_accounts_imap_login_page___lambda23__gtk_editable_changed, self, 0);
	_tmp66_ = self->priv->display_name_entry;
	g_object_bind_property_with_closures ((GObject*) self, "display-name", (GObject*) _tmp66_, "text", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp67_ = self->priv->display_name_entry;
	g_signal_connect_object ((GtkEditable*) _tmp67_, "changed", (GCallback) __online_accounts_imap_login_page___lambda24__gtk_editable_changed, self, 0);
	_tmp68_ = self->priv->password_entry;
	g_object_bind_property_with_closures ((GObject*) self, "password", (GObject*) _tmp68_, "text", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp69_ = self->priv->password_entry;
	g_signal_connect_object ((GtkEditable*) _tmp69_, "changed", (GCallback) __online_accounts_imap_login_page___lambda25__gtk_editable_changed, self, 0);
	_tmp70_ = cancel_button;
	g_signal_connect_object (_tmp70_, "clicked", (GCallback) __online_accounts_imap_login_page___lambda26__gtk_button_clicked, self, 0);
	_tmp71_ = self->priv->_next_button;
	g_signal_connect_object (_tmp71_, "clicked", (GCallback) __online_accounts_imap_login_page___lambda27__gtk_button_clicked, self, 0);
	_g_object_unref0 (box);
	_g_object_unref0 (action_area);
	_g_object_unref0 (cancel_button);
	_g_object_unref0 (display_name_label);
	_g_object_unref0 (password_label);
	_g_object_unref0 (email_label);
	_g_object_unref0 (real_name_label);
	_g_regex_unref0 (email_regex);
	return obj;
}

static void
online_accounts_imap_login_page_class_init (OnlineAccountsImapLoginPageClass * klass,
                                            gpointer klass_data)
{
	online_accounts_imap_login_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &OnlineAccountsImapLoginPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_online_accounts_imap_login_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_online_accounts_imap_login_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = online_accounts_imap_login_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = online_accounts_imap_login_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_DISPLAY_NAME_PROPERTY, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_EMAIL_PROPERTY, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_EMAIL_PROPERTY] = g_param_spec_string ("email", "email", "email", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_PASSWORD_PROPERTY, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_PASSWORD_PROPERTY] = g_param_spec_string ("password", "password", "password", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_REAL_NAME_PROPERTY, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_REAL_NAME_PROPERTY] = g_param_spec_string ("real-name", "real-name", "real-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_BUTTON_PROPERTY, online_accounts_imap_login_page_properties[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_BUTTON_PROPERTY] = g_param_spec_object ("next-button", "next-button", "next-button", gtk_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	online_accounts_imap_login_page_signals[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_CANCEL_SIGNAL] = g_signal_new ("cancel", ONLINE_ACCOUNTS_TYPE_IMAP_LOGIN_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	online_accounts_imap_login_page_signals[ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_SIGNAL] = g_signal_new ("next", ONLINE_ACCOUNTS_TYPE_IMAP_LOGIN_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
online_accounts_imap_login_page_instance_init (OnlineAccountsImapLoginPage * self,
                                               gpointer klass)
{
	self->priv = online_accounts_imap_login_page_get_instance_private (self);
}

static void
online_accounts_imap_login_page_finalize (GObject * obj)
{
	OnlineAccountsImapLoginPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_IMAP_LOGIN_PAGE, OnlineAccountsImapLoginPage);
	_g_free0 (self->priv->_display_name);
	_g_free0 (self->priv->_email);
	_g_free0 (self->priv->_password);
	_g_free0 (self->priv->_real_name);
	_g_object_unref0 (self->priv->display_name_entry);
	_g_object_unref0 (self->priv->email_entry);
	_g_object_unref0 (self->priv->password_entry);
	_g_object_unref0 (self->priv->real_name_entry);
	_g_object_unref0 (self->priv->_next_button);
	G_OBJECT_CLASS (online_accounts_imap_login_page_parent_class)->finalize (obj);
}

static GType
online_accounts_imap_login_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (OnlineAccountsImapLoginPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) online_accounts_imap_login_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OnlineAccountsImapLoginPage), 0, (GInstanceInitFunc) online_accounts_imap_login_page_instance_init, NULL };
	GType online_accounts_imap_login_page_type_id;
	online_accounts_imap_login_page_type_id = g_type_register_static (adw_navigation_page_get_type (), "OnlineAccountsImapLoginPage", &g_define_type_info, 0);
	OnlineAccountsImapLoginPage_private_offset = g_type_add_instance_private (online_accounts_imap_login_page_type_id, sizeof (OnlineAccountsImapLoginPagePrivate));
	return online_accounts_imap_login_page_type_id;
}

GType
online_accounts_imap_login_page_get_type (void)
{
	static volatile gsize online_accounts_imap_login_page_type_id__once = 0;
	if (g_once_init_enter (&online_accounts_imap_login_page_type_id__once)) {
		GType online_accounts_imap_login_page_type_id;
		online_accounts_imap_login_page_type_id = online_accounts_imap_login_page_get_type_once ();
		g_once_init_leave (&online_accounts_imap_login_page_type_id__once, online_accounts_imap_login_page_type_id);
	}
	return online_accounts_imap_login_page_type_id__once;
}

static void
_vala_online_accounts_imap_login_page_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	OnlineAccountsImapLoginPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ONLINE_ACCOUNTS_TYPE_IMAP_LOGIN_PAGE, OnlineAccountsImapLoginPage);
	switch (property_id) {
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_DISPLAY_NAME_PROPERTY:
		g_value_set_string (value, online_accounts_imap_login_page_get_display_name (self));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_EMAIL_PROPERTY:
		g_value_set_string (value, online_accounts_imap_login_page_get_email (self));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_PASSWORD_PROPERTY:
		g_value_set_string (value, online_accounts_imap_login_page_get_password (self));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_REAL_NAME_PROPERTY:
		g_value_set_string (value, online_accounts_imap_login_page_get_real_name (self));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_BUTTON_PROPERTY:
		g_value_set_object (value, online_accounts_imap_login_page_get_next_button (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_online_accounts_imap_login_page_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	OnlineAccountsImapLoginPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ONLINE_ACCOUNTS_TYPE_IMAP_LOGIN_PAGE, OnlineAccountsImapLoginPage);
	switch (property_id) {
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_DISPLAY_NAME_PROPERTY:
		online_accounts_imap_login_page_set_display_name (self, g_value_get_string (value));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_EMAIL_PROPERTY:
		online_accounts_imap_login_page_set_email (self, g_value_get_string (value));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_PASSWORD_PROPERTY:
		online_accounts_imap_login_page_set_password (self, g_value_get_string (value));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_REAL_NAME_PROPERTY:
		online_accounts_imap_login_page_set_real_name (self, g_value_get_string (value));
		break;
		case ONLINE_ACCOUNTS_IMAP_LOGIN_PAGE_NEXT_BUTTON_PROPERTY:
		online_accounts_imap_login_page_set_next_button (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

