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

#include <glib-object.h>
#include "libdino.h"
#include <glib.h>
#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS (dino_ui_view_model_account_details_get_type ())
#define DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetails))
#define DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetailsClass))
#define DINO_UI_VIEW_MODEL_IS_ACCOUNT_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS))
#define DINO_UI_VIEW_MODEL_IS_ACCOUNT_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS))
#define DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetailsClass))

typedef struct _DinoUiViewModelAccountDetails DinoUiViewModelAccountDetails;
typedef struct _DinoUiViewModelAccountDetailsClass DinoUiViewModelAccountDetailsClass;
typedef struct _DinoUiViewModelAccountDetailsPrivate DinoUiViewModelAccountDetailsPrivate;

#define DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL (dino_ui_view_model_avatar_picture_model_get_type ())
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModel))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModelClass))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModelClass))

typedef struct _DinoUiViewModelAvatarPictureModel DinoUiViewModelAvatarPictureModel;
typedef struct _DinoUiViewModelAvatarPictureModelClass DinoUiViewModelAvatarPictureModelClass;

#define DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL (dino_ui_view_model_compat_avatar_picture_model_get_type ())
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel))
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModelClass))
#define DINO_UI_VIEW_MODEL_IS_COMPAT_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_COMPAT_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModelClass))

typedef struct _DinoUiViewModelCompatAvatarPictureModel DinoUiViewModelCompatAvatarPictureModel;
typedef struct _DinoUiViewModelCompatAvatarPictureModelClass DinoUiViewModelCompatAvatarPictureModelClass;
enum  {
	DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_0_PROPERTY,
	DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_ACCOUNT_PROPERTY,
	DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_BARE_JID_PROPERTY,
	DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_AVATAR_MODEL_PROPERTY,
	DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_STATE_PROPERTY,
	DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_ERROR_PROPERTY,
	DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_NUM_PROPERTIES
};
static GParamSpec* dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _dino_connection_manager_connection_error_unref0(var) ((var == NULL) ? NULL : (var = (dino_connection_manager_connection_error_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))

struct _DinoUiViewModelAccountDetails {
	GObject parent_instance;
	DinoUiViewModelAccountDetailsPrivate * priv;
};

struct _DinoUiViewModelAccountDetailsClass {
	GObjectClass parent_class;
};

struct _DinoUiViewModelAccountDetailsPrivate {
	DinoEntitiesAccount* _account;
	DinoUiViewModelCompatAvatarPictureModel* _avatar_model;
	DinoConnectionManagerConnectionState _connection_state;
	DinoConnectionManagerConnectionError* _connection_error;
};

static gint DinoUiViewModelAccountDetails_private_offset;
static gpointer dino_ui_view_model_account_details_parent_class = NULL;

VALA_EXTERN GType dino_ui_view_model_account_details_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelAccountDetails, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelAvatarPictureModel, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_compat_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelCompatAvatarPictureModel, g_object_unref)
VALA_EXTERN DinoUiViewModelAccountDetails* dino_ui_view_model_account_details_new (DinoEntitiesAccount* account,
                                                                       DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelAccountDetails* dino_ui_view_model_account_details_construct (GType object_type,
                                                                             DinoEntitiesAccount* account,
                                                                             DinoStreamInteractor* stream_interactor);
VALA_EXTERN void dino_ui_view_model_account_details_set_account (DinoUiViewModelAccountDetails* self,
                                                     DinoEntitiesAccount* value);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_construct (GType object_type,
                                                                                                   DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_set_conversation (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                                          DinoEntitiesConversation* conversation);
VALA_EXTERN void dino_ui_view_model_account_details_set_avatar_model (DinoUiViewModelAccountDetails* self,
                                                          DinoUiViewModelCompatAvatarPictureModel* value);
VALA_EXTERN void dino_ui_view_model_account_details_set_connection_state (DinoUiViewModelAccountDetails* self,
                                                              DinoConnectionManagerConnectionState value);
VALA_EXTERN void dino_ui_view_model_account_details_set_connection_error (DinoUiViewModelAccountDetails* self,
                                                              DinoConnectionManagerConnectionError* value);
VALA_EXTERN DinoEntitiesAccount* dino_ui_view_model_account_details_get_account (DinoUiViewModelAccountDetails* self);
VALA_EXTERN gchar* dino_ui_view_model_account_details_get_bare_jid (DinoUiViewModelAccountDetails* self);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_account_details_get_avatar_model (DinoUiViewModelAccountDetails* self);
VALA_EXTERN DinoConnectionManagerConnectionState dino_ui_view_model_account_details_get_connection_state (DinoUiViewModelAccountDetails* self);
VALA_EXTERN DinoConnectionManagerConnectionError* dino_ui_view_model_account_details_get_connection_error (DinoUiViewModelAccountDetails* self);
static void dino_ui_view_model_account_details_finalize (GObject * obj);
static GType dino_ui_view_model_account_details_get_type_once (void);
static void _vala_dino_ui_view_model_account_details_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_dino_ui_view_model_account_details_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_view_model_account_details_get_instance_private (DinoUiViewModelAccountDetails* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiViewModelAccountDetails_private_offset);
}

DinoUiViewModelAccountDetails*
dino_ui_view_model_account_details_construct (GType object_type,
                                              DinoEntitiesAccount* account,
                                              DinoStreamInteractor* stream_interactor)
{
	DinoUiViewModelAccountDetails * self = NULL;
	DinoEntitiesConversation* account_conv = NULL;
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	DinoEntitiesConversation* _tmp4_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp5_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp6_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp7_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp8_;
	DinoConnectionManager* _tmp9_;
	DinoConnectionManager* _tmp10_;
	DinoConnectionManagerConnectionError* _tmp11_;
	DinoConnectionManagerConnectionError* _tmp12_;
	g_return_val_if_fail (account != NULL, NULL);
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoUiViewModelAccountDetails*) g_object_new (object_type, NULL);
	_tmp0_ = dino_entities_account_get_bare_jid (account);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = dino_entities_conversation_new (_tmp2_, account, DINO_ENTITIES_CONVERSATION_TYPE_CHAT);
	_tmp4_ = _tmp3_;
	_xmpp_jid_unref0 (_tmp2_);
	account_conv = _tmp4_;
	dino_ui_view_model_account_details_set_account (self, account);
	_tmp5_ = dino_ui_view_model_compat_avatar_picture_model_new (stream_interactor);
	_tmp6_ = _tmp5_;
	_tmp7_ = dino_ui_view_model_compat_avatar_picture_model_set_conversation (_tmp6_, account_conv);
	_tmp8_ = _tmp7_;
	dino_ui_view_model_account_details_set_avatar_model (self, _tmp8_);
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (_tmp6_);
	_tmp9_ = stream_interactor->connection_manager;
	dino_ui_view_model_account_details_set_connection_state (self, dino_connection_manager_get_state (_tmp9_, account));
	_tmp10_ = stream_interactor->connection_manager;
	_tmp11_ = dino_connection_manager_get_error (_tmp10_, account);
	_tmp12_ = _tmp11_;
	dino_ui_view_model_account_details_set_connection_error (self, _tmp12_);
	_dino_connection_manager_connection_error_unref0 (_tmp12_);
	_g_object_unref0 (account_conv);
	return self;
}

DinoUiViewModelAccountDetails*
dino_ui_view_model_account_details_new (DinoEntitiesAccount* account,
                                        DinoStreamInteractor* stream_interactor)
{
	return dino_ui_view_model_account_details_construct (DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, account, stream_interactor);
}

DinoEntitiesAccount*
dino_ui_view_model_account_details_get_account (DinoUiViewModelAccountDetails* self)
{
	DinoEntitiesAccount* result;
	DinoEntitiesAccount* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

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

void
dino_ui_view_model_account_details_set_account (DinoUiViewModelAccountDetails* self,
                                                DinoEntitiesAccount* value)
{
	DinoEntitiesAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_account_details_get_account (self);
	if (old_value != value) {
		DinoEntitiesAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_account);
		self->priv->_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_ACCOUNT_PROPERTY]);
	}
}

gchar*
dino_ui_view_model_account_details_get_bare_jid (DinoUiViewModelAccountDetails* self)
{
	gchar* result;
	DinoEntitiesAccount* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account;
	_tmp1_ = dino_entities_account_get_bare_jid (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = xmpp_jid_to_string (_tmp3_);
	_tmp5_ = _tmp4_;
	_xmpp_jid_unref0 (_tmp3_);
	result = _tmp5_;
	return result;
}

DinoUiViewModelCompatAvatarPictureModel*
dino_ui_view_model_account_details_get_avatar_model (DinoUiViewModelAccountDetails* self)
{
	DinoUiViewModelCompatAvatarPictureModel* result;
	DinoUiViewModelCompatAvatarPictureModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_avatar_model;
	result = _tmp0_;
	return result;
}

void
dino_ui_view_model_account_details_set_avatar_model (DinoUiViewModelAccountDetails* self,
                                                     DinoUiViewModelCompatAvatarPictureModel* value)
{
	DinoUiViewModelCompatAvatarPictureModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_account_details_get_avatar_model (self);
	if (old_value != value) {
		DinoUiViewModelCompatAvatarPictureModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_avatar_model);
		self->priv->_avatar_model = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_AVATAR_MODEL_PROPERTY]);
	}
}

DinoConnectionManagerConnectionState
dino_ui_view_model_account_details_get_connection_state (DinoUiViewModelAccountDetails* self)
{
	DinoConnectionManagerConnectionState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_connection_state;
	return result;
}

void
dino_ui_view_model_account_details_set_connection_state (DinoUiViewModelAccountDetails* self,
                                                         DinoConnectionManagerConnectionState value)
{
	DinoConnectionManagerConnectionState old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_account_details_get_connection_state (self);
	if (old_value != value) {
		self->priv->_connection_state = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_STATE_PROPERTY]);
	}
}

DinoConnectionManagerConnectionError*
dino_ui_view_model_account_details_get_connection_error (DinoUiViewModelAccountDetails* self)
{
	DinoConnectionManagerConnectionError* result;
	DinoConnectionManagerConnectionError* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_connection_error;
	result = _tmp0_;
	return result;
}

static gpointer
_dino_connection_manager_connection_error_ref0 (gpointer self)
{
	return self ? dino_connection_manager_connection_error_ref (self) : NULL;
}

void
dino_ui_view_model_account_details_set_connection_error (DinoUiViewModelAccountDetails* self,
                                                         DinoConnectionManagerConnectionError* value)
{
	DinoConnectionManagerConnectionError* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_account_details_get_connection_error (self);
	if (old_value != value) {
		DinoConnectionManagerConnectionError* _tmp0_;
		_tmp0_ = _dino_connection_manager_connection_error_ref0 (value);
		_dino_connection_manager_connection_error_unref0 (self->priv->_connection_error);
		self->priv->_connection_error = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_ERROR_PROPERTY]);
	}
}

static void
dino_ui_view_model_account_details_class_init (DinoUiViewModelAccountDetailsClass * klass,
                                               gpointer klass_data)
{
	dino_ui_view_model_account_details_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiViewModelAccountDetails_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_view_model_account_details_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_view_model_account_details_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_view_model_account_details_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_ACCOUNT_PROPERTY, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", DINO_ENTITIES_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_BARE_JID_PROPERTY, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_BARE_JID_PROPERTY] = g_param_spec_string ("bare-jid", "bare-jid", "bare-jid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_AVATAR_MODEL_PROPERTY, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_AVATAR_MODEL_PROPERTY] = g_param_spec_object ("avatar-model", "avatar-model", "avatar-model", DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_STATE_PROPERTY, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_STATE_PROPERTY] = g_param_spec_enum ("connection-state", "connection-state", "connection-state", DINO_CONNECTION_MANAGER_TYPE_CONNECTION_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_ERROR_PROPERTY, dino_ui_view_model_account_details_properties[DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_ERROR_PROPERTY] = dino_connection_manager_param_spec_connection_error ("connection-error", "connection-error", "connection-error", DINO_CONNECTION_MANAGER_TYPE_CONNECTION_ERROR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_view_model_account_details_instance_init (DinoUiViewModelAccountDetails * self,
                                                  gpointer klass)
{
	self->priv = dino_ui_view_model_account_details_get_instance_private (self);
}

static void
dino_ui_view_model_account_details_finalize (GObject * obj)
{
	DinoUiViewModelAccountDetails * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetails);
	_g_object_unref0 (self->priv->_account);
	_g_object_unref0 (self->priv->_avatar_model);
	_dino_connection_manager_connection_error_unref0 (self->priv->_connection_error);
	G_OBJECT_CLASS (dino_ui_view_model_account_details_parent_class)->finalize (obj);
}

static GType
dino_ui_view_model_account_details_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiViewModelAccountDetailsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_view_model_account_details_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiViewModelAccountDetails), 0, (GInstanceInitFunc) dino_ui_view_model_account_details_instance_init, NULL };
	GType dino_ui_view_model_account_details_type_id;
	dino_ui_view_model_account_details_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiViewModelAccountDetails", &g_define_type_info, 0);
	DinoUiViewModelAccountDetails_private_offset = g_type_add_instance_private (dino_ui_view_model_account_details_type_id, sizeof (DinoUiViewModelAccountDetailsPrivate));
	return dino_ui_view_model_account_details_type_id;
}

GType
dino_ui_view_model_account_details_get_type (void)
{
	static volatile gsize dino_ui_view_model_account_details_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_view_model_account_details_type_id__once)) {
		GType dino_ui_view_model_account_details_type_id;
		dino_ui_view_model_account_details_type_id = dino_ui_view_model_account_details_get_type_once ();
		g_once_init_leave (&dino_ui_view_model_account_details_type_id__once, dino_ui_view_model_account_details_type_id);
	}
	return dino_ui_view_model_account_details_type_id__once;
}

static void
_vala_dino_ui_view_model_account_details_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	DinoUiViewModelAccountDetails * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetails);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_ACCOUNT_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_account_details_get_account (self));
		break;
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_BARE_JID_PROPERTY:
		g_value_take_string (value, dino_ui_view_model_account_details_get_bare_jid (self));
		break;
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_AVATAR_MODEL_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_account_details_get_avatar_model (self));
		break;
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_STATE_PROPERTY:
		g_value_set_enum (value, dino_ui_view_model_account_details_get_connection_state (self));
		break;
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_ERROR_PROPERTY:
		dino_connection_manager_value_set_connection_error (value, dino_ui_view_model_account_details_get_connection_error (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_view_model_account_details_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	DinoUiViewModelAccountDetails * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetails);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_ACCOUNT_PROPERTY:
		dino_ui_view_model_account_details_set_account (self, g_value_get_object (value));
		break;
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_AVATAR_MODEL_PROPERTY:
		dino_ui_view_model_account_details_set_avatar_model (self, g_value_get_object (value));
		break;
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_STATE_PROPERTY:
		dino_ui_view_model_account_details_set_connection_state (self, g_value_get_enum (value));
		break;
		case DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CONNECTION_ERROR_PROPERTY:
		dino_ui_view_model_account_details_set_connection_error (self, dino_connection_manager_value_get_connection_error (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

