/* geary-folder-properties.c generated by valac 0.56.3, the Vala compiler
 * generated from geary-folder-properties.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include "geary-engine.h"
#include <glib.h>

enum  {
	GEARY_FOLDER_PROPERTIES_0_PROPERTY,
	GEARY_FOLDER_PROPERTIES_EMAIL_TOTAL_PROPERTY,
	GEARY_FOLDER_PROPERTIES_EMAIL_UNREAD_PROPERTY,
	GEARY_FOLDER_PROPERTIES_HAS_CHILDREN_PROPERTY,
	GEARY_FOLDER_PROPERTIES_SUPPORTS_CHILDREN_PROPERTY,
	GEARY_FOLDER_PROPERTIES_IS_OPENABLE_PROPERTY,
	GEARY_FOLDER_PROPERTIES_IS_LOCAL_ONLY_PROPERTY,
	GEARY_FOLDER_PROPERTIES_IS_VIRTUAL_PROPERTY,
	GEARY_FOLDER_PROPERTIES_CREATE_NEVER_RETURNS_ID_PROPERTY,
	GEARY_FOLDER_PROPERTIES_NUM_PROPERTIES
};
static GParamSpec* geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_NUM_PROPERTIES];

struct _GearyFolderPropertiesPrivate {
	gint _email_total;
	gint _email_unread;
	GearyTrillian _has_children;
	GearyTrillian _supports_children;
	GearyTrillian _is_openable;
	gboolean _is_local_only;
	gboolean _is_virtual;
	gboolean _create_never_returns_id;
};

static gint GearyFolderProperties_private_offset;
static gpointer geary_folder_properties_parent_class = NULL;

static void geary_folder_properties_set_is_local_only (GearyFolderProperties* self,
                                                gboolean value);
static void geary_folder_properties_set_is_virtual (GearyFolderProperties* self,
                                             gboolean value);
static void geary_folder_properties_finalize (GObject * obj);
static GType geary_folder_properties_get_type_once (void);
static void _vala_geary_folder_properties_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_geary_folder_properties_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static inline gpointer
geary_folder_properties_get_instance_private (GearyFolderProperties* self)
{
	return G_STRUCT_MEMBER_P (self, GearyFolderProperties_private_offset);
}

gint
geary_folder_properties_get_email_total (GearyFolderProperties* self)
{
	gint result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), 0);
	result = self->priv->_email_total;
	return result;
}

void
geary_folder_properties_set_email_total (GearyFolderProperties* self,
                                         gint value)
{
	gint old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_email_total (self);
	if (old_value != value) {
		self->priv->_email_total = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_EMAIL_TOTAL_PROPERTY]);
	}
}

gint
geary_folder_properties_get_email_unread (GearyFolderProperties* self)
{
	gint result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), 0);
	result = self->priv->_email_unread;
	return result;
}

void
geary_folder_properties_set_email_unread (GearyFolderProperties* self,
                                          gint value)
{
	gint old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_email_unread (self);
	if (old_value != value) {
		self->priv->_email_unread = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_EMAIL_UNREAD_PROPERTY]);
	}
}

GearyTrillian
geary_folder_properties_get_has_children (GearyFolderProperties* self)
{
	GearyTrillian result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), 0);
	result = self->priv->_has_children;
	return result;
}

void
geary_folder_properties_set_has_children (GearyFolderProperties* self,
                                          GearyTrillian value)
{
	GearyTrillian old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_has_children (self);
	if (old_value != value) {
		self->priv->_has_children = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_HAS_CHILDREN_PROPERTY]);
	}
}

GearyTrillian
geary_folder_properties_get_supports_children (GearyFolderProperties* self)
{
	GearyTrillian result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), 0);
	result = self->priv->_supports_children;
	return result;
}

void
geary_folder_properties_set_supports_children (GearyFolderProperties* self,
                                               GearyTrillian value)
{
	GearyTrillian old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_supports_children (self);
	if (old_value != value) {
		self->priv->_supports_children = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_SUPPORTS_CHILDREN_PROPERTY]);
	}
}

GearyTrillian
geary_folder_properties_get_is_openable (GearyFolderProperties* self)
{
	GearyTrillian result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), 0);
	result = self->priv->_is_openable;
	return result;
}

void
geary_folder_properties_set_is_openable (GearyFolderProperties* self,
                                         GearyTrillian value)
{
	GearyTrillian old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_is_openable (self);
	if (old_value != value) {
		self->priv->_is_openable = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_IS_OPENABLE_PROPERTY]);
	}
}

gboolean
geary_folder_properties_get_is_local_only (GearyFolderProperties* self)
{
	gboolean result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), FALSE);
	result = self->priv->_is_local_only;
	return result;
}

static void
geary_folder_properties_set_is_local_only (GearyFolderProperties* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_is_local_only (self);
	if (old_value != value) {
		self->priv->_is_local_only = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_IS_LOCAL_ONLY_PROPERTY]);
	}
}

gboolean
geary_folder_properties_get_is_virtual (GearyFolderProperties* self)
{
	gboolean result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), FALSE);
	result = self->priv->_is_virtual;
	return result;
}

static void
geary_folder_properties_set_is_virtual (GearyFolderProperties* self,
                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_is_virtual (self);
	if (old_value != value) {
		self->priv->_is_virtual = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_IS_VIRTUAL_PROPERTY]);
	}
}

gboolean
geary_folder_properties_get_create_never_returns_id (GearyFolderProperties* self)
{
	gboolean result;
	g_return_val_if_fail (GEARY_IS_FOLDER_PROPERTIES (self), FALSE);
	result = self->priv->_create_never_returns_id;
	return result;
}

void
geary_folder_properties_set_create_never_returns_id (GearyFolderProperties* self,
                                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (GEARY_IS_FOLDER_PROPERTIES (self));
	old_value = geary_folder_properties_get_create_never_returns_id (self);
	if (old_value != value) {
		self->priv->_create_never_returns_id = value;
		g_object_notify_by_pspec ((GObject *) self, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_CREATE_NEVER_RETURNS_ID_PROPERTY]);
	}
}

GearyFolderProperties*
geary_folder_properties_construct (GType object_type,
                                   gint email_total,
                                   gint email_unread,
                                   GearyTrillian has_children,
                                   GearyTrillian supports_children,
                                   GearyTrillian is_openable,
                                   gboolean is_local_only,
                                   gboolean is_virtual,
                                   gboolean create_never_returns_id)
{
	GearyFolderProperties * self = NULL;
	self = (GearyFolderProperties*) geary_base_object_construct (object_type);
	geary_folder_properties_set_email_total (self, email_total);
	geary_folder_properties_set_email_unread (self, email_unread);
	geary_folder_properties_set_has_children (self, has_children);
	geary_folder_properties_set_supports_children (self, supports_children);
	geary_folder_properties_set_is_openable (self, is_openable);
	geary_folder_properties_set_is_local_only (self, is_local_only);
	geary_folder_properties_set_is_virtual (self, is_virtual);
	geary_folder_properties_set_create_never_returns_id (self, create_never_returns_id);
	return self;
}

static void
geary_folder_properties_class_init (GearyFolderPropertiesClass * klass,
                                    gpointer klass_data)
{
	geary_folder_properties_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GearyFolderProperties_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_geary_folder_properties_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_geary_folder_properties_set_property;
	G_OBJECT_CLASS (klass)->finalize = geary_folder_properties_finalize;
	/**
	     * The total count of email in the {@link Folder}.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_EMAIL_TOTAL_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_EMAIL_TOTAL_PROPERTY] = g_param_spec_int ("email-total", "email-total", "email-total", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * The total count of unread email in the {@link Folder}.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_EMAIL_UNREAD_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_EMAIL_UNREAD_PROPERTY] = g_param_spec_int ("email-unread", "email-unread", "email-unread", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * Returns a {@link Trillian} indicating if this {@link Folder} has children.
	     *
	     * has_children == {@link Trillian.TRUE} implies {@link supports_children} == Trilian.TRUE.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_HAS_CHILDREN_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_HAS_CHILDREN_PROPERTY] = g_param_spec_enum ("has-children", "has-children", "has-children", GEARY_TYPE_TRILLIAN, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * Returns a {@link Trillian} indicating if this {@link Folder} can parent new children
	     * {@link Folder}s.
	     *
	     * This does ''not'' mean creating a sub-folder is guaranteed to succeed.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_SUPPORTS_CHILDREN_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_SUPPORTS_CHILDREN_PROPERTY] = g_param_spec_enum ("supports-children", "supports-children", "supports-children", GEARY_TYPE_TRILLIAN, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * Returns a {@link Trillian} indicating if {@link Folder.open_async} can succeed remotely.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_IS_OPENABLE_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_IS_OPENABLE_PROPERTY] = g_param_spec_enum ("is-openable", "is-openable", "is-openable", GEARY_TYPE_TRILLIAN, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * Returns true if the {@link Folder} is local-only, that is, has no remote folder backing
	     * it.
	     *
	     * Note that this doesn't mean there's no network aspect to the Folder.  For example, an Outbox
	     * may present itself as a Folder but the network backing (SMTP) has nothing that resembles
	     * a Folder interface.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_IS_LOCAL_ONLY_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_IS_LOCAL_ONLY_PROPERTY] = g_param_spec_boolean ("is-local-only", "is-local-only", "is-local-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	     * Returns true if the {@link Folder} is virtual, that is, it is either generated by some
	     * external criteria and/or is aggregating the content of other Folders.
	     *
	     * In general, virtual folders cannot be the destination Folder for operations like move and
	     * copy.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_IS_VIRTUAL_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_IS_VIRTUAL_PROPERTY] = g_param_spec_boolean ("is-virtual", "is-virtual", "is-virtual", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	     * True if the {@link Folder} offers the {@link FolderSupport.Create} interface but is
	     * guaranteed not to return a {@link EmailIdentifier}, even if
	     * {@link FolderSupport.Create.create_email_async} succeeds.
	     *
	     * This is for IMAP servers that don't support UIDPLUS.  Most servers support UIDPLUS, so this
	     * will usually be false.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_FOLDER_PROPERTIES_CREATE_NEVER_RETURNS_ID_PROPERTY, geary_folder_properties_properties[GEARY_FOLDER_PROPERTIES_CREATE_NEVER_RETURNS_ID_PROPERTY] = g_param_spec_boolean ("create-never-returns-id", "create-never-returns-id", "create-never-returns-id", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
geary_folder_properties_instance_init (GearyFolderProperties * self,
                                       gpointer klass)
{
	self->priv = geary_folder_properties_get_instance_private (self);
}

static void
geary_folder_properties_finalize (GObject * obj)
{
	GearyFolderProperties * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEARY_TYPE_FOLDER_PROPERTIES, GearyFolderProperties);
	G_OBJECT_CLASS (geary_folder_properties_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
geary_folder_properties_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyFolderPropertiesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_folder_properties_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyFolderProperties), 0, (GInstanceInitFunc) geary_folder_properties_instance_init, NULL };
	GType geary_folder_properties_type_id;
	geary_folder_properties_type_id = g_type_register_static (GEARY_TYPE_BASE_OBJECT, "GearyFolderProperties", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	GearyFolderProperties_private_offset = g_type_add_instance_private (geary_folder_properties_type_id, sizeof (GearyFolderPropertiesPrivate));
	return geary_folder_properties_type_id;
}

GType
geary_folder_properties_get_type (void)
{
	static gsize geary_folder_properties_type_id__once = 0;
	if (g_once_init_enter (&geary_folder_properties_type_id__once)) {
		GType geary_folder_properties_type_id;
		geary_folder_properties_type_id = geary_folder_properties_get_type_once ();
		g_once_init_leave (&geary_folder_properties_type_id__once, geary_folder_properties_type_id);
	}
	return geary_folder_properties_type_id__once;
}

static void
_vala_geary_folder_properties_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	GearyFolderProperties * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEARY_TYPE_FOLDER_PROPERTIES, GearyFolderProperties);
	switch (property_id) {
		case GEARY_FOLDER_PROPERTIES_EMAIL_TOTAL_PROPERTY:
		g_value_set_int (value, geary_folder_properties_get_email_total (self));
		break;
		case GEARY_FOLDER_PROPERTIES_EMAIL_UNREAD_PROPERTY:
		g_value_set_int (value, geary_folder_properties_get_email_unread (self));
		break;
		case GEARY_FOLDER_PROPERTIES_HAS_CHILDREN_PROPERTY:
		g_value_set_enum (value, geary_folder_properties_get_has_children (self));
		break;
		case GEARY_FOLDER_PROPERTIES_SUPPORTS_CHILDREN_PROPERTY:
		g_value_set_enum (value, geary_folder_properties_get_supports_children (self));
		break;
		case GEARY_FOLDER_PROPERTIES_IS_OPENABLE_PROPERTY:
		g_value_set_enum (value, geary_folder_properties_get_is_openable (self));
		break;
		case GEARY_FOLDER_PROPERTIES_IS_LOCAL_ONLY_PROPERTY:
		g_value_set_boolean (value, geary_folder_properties_get_is_local_only (self));
		break;
		case GEARY_FOLDER_PROPERTIES_IS_VIRTUAL_PROPERTY:
		g_value_set_boolean (value, geary_folder_properties_get_is_virtual (self));
		break;
		case GEARY_FOLDER_PROPERTIES_CREATE_NEVER_RETURNS_ID_PROPERTY:
		g_value_set_boolean (value, geary_folder_properties_get_create_never_returns_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_geary_folder_properties_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	GearyFolderProperties * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEARY_TYPE_FOLDER_PROPERTIES, GearyFolderProperties);
	switch (property_id) {
		case GEARY_FOLDER_PROPERTIES_EMAIL_TOTAL_PROPERTY:
		geary_folder_properties_set_email_total (self, g_value_get_int (value));
		break;
		case GEARY_FOLDER_PROPERTIES_EMAIL_UNREAD_PROPERTY:
		geary_folder_properties_set_email_unread (self, g_value_get_int (value));
		break;
		case GEARY_FOLDER_PROPERTIES_HAS_CHILDREN_PROPERTY:
		geary_folder_properties_set_has_children (self, g_value_get_enum (value));
		break;
		case GEARY_FOLDER_PROPERTIES_SUPPORTS_CHILDREN_PROPERTY:
		geary_folder_properties_set_supports_children (self, g_value_get_enum (value));
		break;
		case GEARY_FOLDER_PROPERTIES_IS_OPENABLE_PROPERTY:
		geary_folder_properties_set_is_openable (self, g_value_get_enum (value));
		break;
		case GEARY_FOLDER_PROPERTIES_IS_LOCAL_ONLY_PROPERTY:
		geary_folder_properties_set_is_local_only (self, g_value_get_boolean (value));
		break;
		case GEARY_FOLDER_PROPERTIES_IS_VIRTUAL_PROPERTY:
		geary_folder_properties_set_is_virtual (self, g_value_get_boolean (value));
		break;
		case GEARY_FOLDER_PROPERTIES_CREATE_NEVER_RETURNS_ID_PROPERTY:
		geary_folder_properties_set_create_never_returns_id (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

