/* imap-engine-generic-folder.c generated by valac 0.56.3, the Vala compiler
 * generated from imap-engine-generic-folder.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-object.h>
#include <gee.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#define GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER (geary_imap_engine_minimal_folder_get_type ())
#define GEARY_IMAP_ENGINE_MINIMAL_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder))
#define GEARY_IMAP_ENGINE_MINIMAL_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolderClass))
#define GEARY_IMAP_ENGINE_IS_MINIMAL_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER))
#define GEARY_IMAP_ENGINE_IS_MINIMAL_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER))
#define GEARY_IMAP_ENGINE_MINIMAL_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolderClass))

typedef struct _GearyImapEngineMinimalFolder GearyImapEngineMinimalFolder;
typedef struct _GearyImapEngineMinimalFolderClass GearyImapEngineMinimalFolderClass;
typedef struct _GearyImapEngineMinimalFolderPrivate GearyImapEngineMinimalFolderPrivate;

#define GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION (geary_imap_engine_replay_operation_get_type ())
#define GEARY_IMAP_ENGINE_REPLAY_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation))
#define GEARY_IMAP_ENGINE_REPLAY_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperationClass))
#define GEARY_IMAP_ENGINE_IS_REPLAY_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION))
#define GEARY_IMAP_ENGINE_IS_REPLAY_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION))
#define GEARY_IMAP_ENGINE_REPLAY_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperationClass))

typedef struct _GearyImapEngineReplayOperation GearyImapEngineReplayOperation;
typedef struct _GearyImapEngineReplayOperationClass GearyImapEngineReplayOperationClass;

#define GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER (geary_imap_engine_generic_folder_get_type ())
#define GEARY_IMAP_ENGINE_GENERIC_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, GearyImapEngineGenericFolder))
#define GEARY_IMAP_ENGINE_GENERIC_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, GearyImapEngineGenericFolderClass))
#define GEARY_IMAP_ENGINE_IS_GENERIC_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER))
#define GEARY_IMAP_ENGINE_IS_GENERIC_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER))
#define GEARY_IMAP_ENGINE_GENERIC_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, GearyImapEngineGenericFolderClass))

typedef struct _GearyImapEngineGenericFolder GearyImapEngineGenericFolder;
typedef struct _GearyImapEngineGenericFolderClass GearyImapEngineGenericFolderClass;
typedef struct _GearyImapEngineGenericFolderPrivate GearyImapEngineGenericFolderPrivate;
enum  {
	GEARY_IMAP_ENGINE_GENERIC_FOLDER_0_PROPERTY,
	GEARY_IMAP_ENGINE_GENERIC_FOLDER_NUM_PROPERTIES
};
static GParamSpec* geary_imap_engine_generic_folder_properties[GEARY_IMAP_ENGINE_GENERIC_FOLDER_NUM_PROPERTIES];

#define GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT (geary_imap_engine_generic_account_get_type ())
#define GEARY_IMAP_ENGINE_GENERIC_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT, GearyImapEngineGenericAccount))
#define GEARY_IMAP_ENGINE_GENERIC_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT, GearyImapEngineGenericAccountClass))
#define GEARY_IMAP_ENGINE_IS_GENERIC_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT))
#define GEARY_IMAP_ENGINE_IS_GENERIC_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT))
#define GEARY_IMAP_ENGINE_GENERIC_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT, GearyImapEngineGenericAccountClass))

typedef struct _GearyImapEngineGenericAccount GearyImapEngineGenericAccount;
typedef struct _GearyImapEngineGenericAccountClass GearyImapEngineGenericAccountClass;

#define GEARY_IMAP_DB_TYPE_FOLDER (geary_imap_db_folder_get_type ())
#define GEARY_IMAP_DB_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_DB_TYPE_FOLDER, GearyImapDBFolder))
#define GEARY_IMAP_DB_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_DB_TYPE_FOLDER, GearyImapDBFolderClass))
#define GEARY_IMAP_DB_IS_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_DB_TYPE_FOLDER))
#define GEARY_IMAP_DB_IS_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_DB_TYPE_FOLDER))
#define GEARY_IMAP_DB_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_DB_TYPE_FOLDER, GearyImapDBFolderClass))

typedef struct _GearyImapDBFolder GearyImapDBFolder;
typedef struct _GearyImapDBFolderClass GearyImapDBFolderClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GearyImapEngineGenericFolderArchiveEmailAsyncData GearyImapEngineGenericFolderArchiveEmailAsyncData;
typedef struct _GearyImapEngineGenericFolderRemoveEmailAsyncData GearyImapEngineGenericFolderRemoveEmailAsyncData;
typedef struct _GearyImapEngineGenericFolderEmptyFolderAsyncData GearyImapEngineGenericFolderEmptyFolderAsyncData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _GearyImapEngineGenericFolderCreateEmailAsyncData GearyImapEngineGenericFolderCreateEmailAsyncData;

struct _GearyImapEngineMinimalFolder {
	GearyFolder parent_instance;
	GearyImapEngineMinimalFolderPrivate * priv;
};

struct _GearyImapEngineMinimalFolderClass {
	GearyFolderClass parent_class;
	void (*notify_closing) (GearyImapEngineMinimalFolder* self, GeeList* final_ops);
	void (*mark_email_async) (GearyImapEngineMinimalFolder* self, GeeCollection* to_mark, GearyEmailFlags* flags_to_add, GearyEmailFlags* flags_to_remove, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*mark_email_finish) (GearyImapEngineMinimalFolder* self, GAsyncResult* _res_, GError** error);
	void (*copy_email_async) (GearyImapEngineMinimalFolder* self, GeeCollection* to_copy, GearyFolderPath* destination, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*copy_email_finish) (GearyImapEngineMinimalFolder* self, GAsyncResult* _res_, GError** error);
	void (*move_email_async) (GearyImapEngineMinimalFolder* self, GeeCollection* to_move, GearyFolderPath* destination, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GearyRevokable* (*move_email_finish) (GearyImapEngineMinimalFolder* self, GAsyncResult* _res_, GError** error);
	void (*notify_marked_email_removed) (GearyImapEngineMinimalFolder* self, GeeCollection* removed);
};

struct _GearyImapEngineGenericFolder {
	GearyImapEngineMinimalFolder parent_instance;
	GearyImapEngineGenericFolderPrivate * priv;
};

struct _GearyImapEngineGenericFolderClass {
	GearyImapEngineMinimalFolderClass parent_class;
};

struct _GearyImapEngineGenericFolderArchiveEmailAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineGenericFolder* self;
	GeeCollection* email_ids;
	GCancellable* cancellable;
	GearyRevokable* result;
	GearyFolder* archive_folder;
	GearyFolder* _tmp0_;
	GearyAccount* _tmp1_;
	GearyAccount* _tmp2_;
	GearyFolder* _tmp3_;
	GearyFolder* _tmp4_;
	GError* e;
	GearyAccount* _tmp5_;
	GearyAccount* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GError* _tmp9_;
	const gchar* _tmp10_;
	GearyFolder* _tmp11_;
	GearyAccount* _tmp12_;
	GearyAccount* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GearyRevokable* _tmp16_;
	GearyFolder* _tmp17_;
	GearyFolderPath* _tmp18_;
	GearyFolderPath* _tmp19_;
	GearyRevokable* _tmp20_;
	GearyRevokable* _tmp21_;
	GError* _inner_error0_;
};

struct _GearyImapEngineGenericFolderRemoveEmailAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineGenericFolder* self;
	GeeCollection* email_ids;
	GCancellable* cancellable;
	GError* _inner_error0_;
};

struct _GearyImapEngineGenericFolderEmptyFolderAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineGenericFolder* self;
	GCancellable* cancellable;
	GError* _inner_error0_;
};

struct _GearyImapEngineGenericFolderCreateEmailAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineGenericFolder* self;
	GearyRFC822Message* rfc822;
	GearyEmailFlags* flags;
	GDateTime* date_received;
	GCancellable* cancellable;
	GearyEmailIdentifier* result;
	GearyEmailIdentifier* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	GError* _inner_error0_;
};

static gpointer geary_imap_engine_generic_folder_parent_class = NULL;
static GearyFolderSupportArchiveIface * geary_imap_engine_generic_folder_geary_folder_support_archive_parent_iface = NULL;
static GearyFolderSupportRemoveIface * geary_imap_engine_generic_folder_geary_folder_support_remove_parent_iface = NULL;
static GearyFolderSupportCreateIface * geary_imap_engine_generic_folder_geary_folder_support_create_parent_iface = NULL;
static GearyFolderSupportEmptyIface * geary_imap_engine_generic_folder_geary_folder_support_empty_parent_iface = NULL;

VALA_EXTERN GType geary_imap_engine_minimal_folder_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_replay_operation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_generic_folder_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_generic_account_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_db_folder_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GearyImapEngineGenericFolder* geary_imap_engine_generic_folder_new (GearyImapEngineGenericAccount* account,
                                                                    GearyImapDBFolder* local_folder,
                                                                    GearyFolderSpecialUse use);
VALA_EXTERN GearyImapEngineGenericFolder* geary_imap_engine_generic_folder_construct (GType object_type,
                                                                          GearyImapEngineGenericAccount* account,
                                                                          GearyImapDBFolder* local_folder,
                                                                          GearyFolderSpecialUse use);
VALA_EXTERN GearyImapEngineMinimalFolder* geary_imap_engine_minimal_folder_new (GearyImapEngineGenericAccount* account,
                                                                    GearyImapDBFolder* local_folder,
                                                                    GearyFolderSpecialUse use);
VALA_EXTERN GearyImapEngineMinimalFolder* geary_imap_engine_minimal_folder_construct (GType object_type,
                                                                          GearyImapEngineGenericAccount* account,
                                                                          GearyImapDBFolder* local_folder,
                                                                          GearyFolderSpecialUse use);
static void geary_imap_engine_generic_folder_real_archive_email_async_data_free (gpointer _data);
static void geary_imap_engine_generic_folder_real_archive_email_async (GearyFolderSupportArchive* base,
                                                                GeeCollection* email_ids,
                                                                GCancellable* cancellable,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
static gboolean geary_imap_engine_generic_folder_real_archive_email_async_co (GearyImapEngineGenericFolderArchiveEmailAsyncData* _data_);
static void geary_imap_engine_generic_folder_archive_email_async_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_);
VALA_EXTERN void geary_imap_engine_minimal_folder_move_email_async (GearyImapEngineMinimalFolder* self,
                                                        GeeCollection* to_move,
                                                        GearyFolderPath* destination,
                                                        GCancellable* cancellable,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_);
VALA_EXTERN GearyRevokable* geary_imap_engine_minimal_folder_move_email_finish (GearyImapEngineMinimalFolder* self,
                                                                    GAsyncResult* _res_,
                                                                    GError** error);
static void geary_imap_engine_generic_folder_real_remove_email_async_data_free (gpointer _data);
static void geary_imap_engine_generic_folder_real_remove_email_async (GearyFolderSupportRemove* base,
                                                               GeeCollection* email_ids,
                                                               GCancellable* cancellable,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
static gboolean geary_imap_engine_generic_folder_real_remove_email_async_co (GearyImapEngineGenericFolderRemoveEmailAsyncData* _data_);
VALA_EXTERN void geary_imap_engine_minimal_folder_expunge_email_async (GearyImapEngineMinimalFolder* self,
                                                           GeeCollection* to_expunge,
                                                           GCancellable* cancellable,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
VALA_EXTERN void geary_imap_engine_minimal_folder_expunge_email_finish (GearyImapEngineMinimalFolder* self,
                                                            GAsyncResult* _res_,
                                                            GError** error);
static void geary_imap_engine_generic_folder_remove_email_async_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void geary_imap_engine_generic_folder_real_empty_folder_async_data_free (gpointer _data);
static void geary_imap_engine_generic_folder_real_empty_folder_async (GearyFolderSupportEmpty* base,
                                                               GCancellable* cancellable,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
static gboolean geary_imap_engine_generic_folder_real_empty_folder_async_co (GearyImapEngineGenericFolderEmptyFolderAsyncData* _data_);
VALA_EXTERN void geary_imap_engine_minimal_folder_expunge_all_async (GearyImapEngineMinimalFolder* self,
                                                         GCancellable* cancellable,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
VALA_EXTERN void geary_imap_engine_minimal_folder_expunge_all_finish (GearyImapEngineMinimalFolder* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static void geary_imap_engine_generic_folder_empty_folder_async_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void geary_imap_engine_generic_folder_real_create_email_async_data_free (gpointer _data);
static void geary_imap_engine_generic_folder_real_create_email_async (GearyFolderSupportCreate* base,
                                                               GearyRFC822Message* rfc822,
                                                               GearyEmailFlags* flags,
                                                               GDateTime* date_received,
                                                               GCancellable* cancellable,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
static gboolean geary_imap_engine_generic_folder_real_create_email_async_co (GearyImapEngineGenericFolderCreateEmailAsyncData* _data_);
VALA_EXTERN void geary_imap_engine_minimal_folder_create_email_async (GearyImapEngineMinimalFolder* self,
                                                          GearyRFC822Message* rfc822,
                                                          GearyEmailFlags* flags,
                                                          GDateTime* date_received,
                                                          GCancellable* cancellable,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
VALA_EXTERN GearyEmailIdentifier* geary_imap_engine_minimal_folder_create_email_finish (GearyImapEngineMinimalFolder* self,
                                                                            GAsyncResult* _res_,
                                                                            GError** error);
static void geary_imap_engine_generic_folder_create_email_async_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static GType geary_imap_engine_generic_folder_get_type_once (void);

GearyImapEngineGenericFolder*
geary_imap_engine_generic_folder_construct (GType object_type,
                                            GearyImapEngineGenericAccount* account,
                                            GearyImapDBFolder* local_folder,
                                            GearyFolderSpecialUse use)
{
	GearyImapEngineGenericFolder * self = NULL;
	g_return_val_if_fail (GEARY_IMAP_ENGINE_IS_GENERIC_ACCOUNT (account), NULL);
	g_return_val_if_fail (GEARY_IMAP_DB_IS_FOLDER (local_folder), NULL);
	self = (GearyImapEngineGenericFolder*) geary_imap_engine_minimal_folder_construct (object_type, account, local_folder, use);
	return self;
}

GearyImapEngineGenericFolder*
geary_imap_engine_generic_folder_new (GearyImapEngineGenericAccount* account,
                                      GearyImapDBFolder* local_folder,
                                      GearyFolderSpecialUse use)
{
	return geary_imap_engine_generic_folder_construct (GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, account, local_folder, use);
}

static void
geary_imap_engine_generic_folder_real_archive_email_async_data_free (gpointer _data)
{
	GearyImapEngineGenericFolderArchiveEmailAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->email_ids);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyImapEngineGenericFolderArchiveEmailAsyncData, _data_);
}

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

static void
geary_imap_engine_generic_folder_real_archive_email_async (GearyFolderSupportArchive* base,
                                                           GeeCollection* email_ids,
                                                           GCancellable* cancellable,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	GearyImapEngineGenericFolder * self;
	GearyImapEngineGenericFolderArchiveEmailAsyncData* _data_;
	GearyImapEngineGenericFolder* _tmp0_;
	GeeCollection* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email_ids, GEE_TYPE_COLLECTION));
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, GearyImapEngineGenericFolder);
	_data_ = g_slice_new0 (GearyImapEngineGenericFolderArchiveEmailAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_generic_folder_real_archive_email_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (email_ids);
	_g_object_unref0 (_data_->email_ids);
	_data_->email_ids = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	geary_imap_engine_generic_folder_real_archive_email_async_co (_data_);
}

static GearyRevokable*
geary_imap_engine_generic_folder_archive_email_finish (GearyFolderSupportArchive* base,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	GearyRevokable* result;
	GearyImapEngineGenericFolderArchiveEmailAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
geary_imap_engine_generic_folder_archive_email_async_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_)
{
	GearyImapEngineGenericFolderArchiveEmailAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_generic_folder_real_archive_email_async_co (_data_);
}

static gboolean
geary_imap_engine_generic_folder_real_archive_email_async_co (GearyImapEngineGenericFolderArchiveEmailAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->archive_folder = NULL;
	{
		_data_->_tmp1_ = geary_folder_get_account (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_TYPE_FOLDER, GearyFolder));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_state_ = 1;
		geary_account_get_required_special_folder_async (_data_->_tmp2_, GEARY_FOLDER_SPECIAL_USE_ARCHIVE, _data_->cancellable, geary_imap_engine_generic_folder_archive_email_async_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = geary_account_get_required_special_folder_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp0_ = _data_->_tmp3_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp4_ = _data_->_tmp0_;
		_data_->_tmp0_ = NULL;
		_g_object_unref0 (_data_->archive_folder);
		_data_->archive_folder = _data_->_tmp4_;
		_g_object_unref0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp5_ = geary_folder_get_account (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_TYPE_FOLDER, GearyFolder));
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp6_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp9_ = _data_->e;
		_data_->_tmp10_ = _data_->_tmp9_->message;
		geary_logging_source_debug (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource), "Error looking up archive folder in %s: %s", _data_->_tmp8_, _data_->_tmp10_);
		_g_free0 (_data_->_tmp8_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->archive_folder);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->archive_folder;
	if (_data_->_tmp11_ == NULL) {
		_data_->_tmp12_ = geary_folder_get_account (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_TYPE_FOLDER, GearyFolder));
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
		_data_->_tmp15_ = _data_->_tmp14_;
		geary_logging_source_debug (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource), "Can't archive email because no archive folder was found in %s", _data_->_tmp15_);
		_g_free0 (_data_->_tmp15_);
	} else {
		_data_->_tmp17_ = _data_->archive_folder;
		_data_->_tmp18_ = geary_folder_get_path (_data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_state_ = 2;
		geary_imap_engine_minimal_folder_move_email_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->email_ids, _data_->_tmp19_, _data_->cancellable, geary_imap_engine_generic_folder_archive_email_async_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp20_ = geary_imap_engine_minimal_folder_move_email_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp16_ = _data_->_tmp20_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->archive_folder);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp21_ = _data_->_tmp16_;
		_data_->_tmp16_ = NULL;
		_data_->result = _data_->_tmp21_;
		_g_object_unref0 (_data_->_tmp16_);
		_g_object_unref0 (_data_->archive_folder);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = NULL;
	_g_object_unref0 (_data_->archive_folder);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_imap_engine_generic_folder_real_remove_email_async_data_free (gpointer _data)
{
	GearyImapEngineGenericFolderRemoveEmailAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->email_ids);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyImapEngineGenericFolderRemoveEmailAsyncData, _data_);
}

static void
geary_imap_engine_generic_folder_real_remove_email_async (GearyFolderSupportRemove* base,
                                                          GeeCollection* email_ids,
                                                          GCancellable* cancellable,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	GearyImapEngineGenericFolder * self;
	GearyImapEngineGenericFolderRemoveEmailAsyncData* _data_;
	GearyImapEngineGenericFolder* _tmp0_;
	GeeCollection* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email_ids, GEE_TYPE_COLLECTION));
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, GearyImapEngineGenericFolder);
	_data_ = g_slice_new0 (GearyImapEngineGenericFolderRemoveEmailAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_generic_folder_real_remove_email_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (email_ids);
	_g_object_unref0 (_data_->email_ids);
	_data_->email_ids = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	geary_imap_engine_generic_folder_real_remove_email_async_co (_data_);
}

static void
geary_imap_engine_generic_folder_remove_email_finish (GearyFolderSupportRemove* base,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	GearyImapEngineGenericFolderRemoveEmailAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
geary_imap_engine_generic_folder_remove_email_async_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	GearyImapEngineGenericFolderRemoveEmailAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_generic_folder_real_remove_email_async_co (_data_);
}

static gboolean
geary_imap_engine_generic_folder_real_remove_email_async_co (GearyImapEngineGenericFolderRemoveEmailAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	geary_imap_engine_minimal_folder_expunge_email_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->email_ids, _data_->cancellable, geary_imap_engine_generic_folder_remove_email_async_ready, _data_);
	return FALSE;
	_state_1:
	geary_imap_engine_minimal_folder_expunge_email_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_imap_engine_generic_folder_real_empty_folder_async_data_free (gpointer _data)
{
	GearyImapEngineGenericFolderEmptyFolderAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyImapEngineGenericFolderEmptyFolderAsyncData, _data_);
}

static void
geary_imap_engine_generic_folder_real_empty_folder_async (GearyFolderSupportEmpty* base,
                                                          GCancellable* cancellable,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	GearyImapEngineGenericFolder * self;
	GearyImapEngineGenericFolderEmptyFolderAsyncData* _data_;
	GearyImapEngineGenericFolder* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, GearyImapEngineGenericFolder);
	_data_ = g_slice_new0 (GearyImapEngineGenericFolderEmptyFolderAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_generic_folder_real_empty_folder_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	geary_imap_engine_generic_folder_real_empty_folder_async_co (_data_);
}

static void
geary_imap_engine_generic_folder_empty_folder_finish (GearyFolderSupportEmpty* base,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	GearyImapEngineGenericFolderEmptyFolderAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
geary_imap_engine_generic_folder_empty_folder_async_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	GearyImapEngineGenericFolderEmptyFolderAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_generic_folder_real_empty_folder_async_co (_data_);
}

static gboolean
geary_imap_engine_generic_folder_real_empty_folder_async_co (GearyImapEngineGenericFolderEmptyFolderAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	geary_imap_engine_minimal_folder_expunge_all_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->cancellable, geary_imap_engine_generic_folder_empty_folder_async_ready, _data_);
	return FALSE;
	_state_1:
	geary_imap_engine_minimal_folder_expunge_all_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_imap_engine_generic_folder_real_create_email_async_data_free (gpointer _data)
{
	GearyImapEngineGenericFolderCreateEmailAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->rfc822);
	_g_object_unref0 (_data_->flags);
	_g_date_time_unref0 (_data_->date_received);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyImapEngineGenericFolderCreateEmailAsyncData, _data_);
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

static void
geary_imap_engine_generic_folder_real_create_email_async (GearyFolderSupportCreate* base,
                                                          GearyRFC822Message* rfc822,
                                                          GearyEmailFlags* flags,
                                                          GDateTime* date_received,
                                                          GCancellable* cancellable,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	GearyImapEngineGenericFolder * self;
	GearyImapEngineGenericFolderCreateEmailAsyncData* _data_;
	GearyImapEngineGenericFolder* _tmp0_;
	GearyRFC822Message* _tmp1_;
	GearyEmailFlags* _tmp2_;
	GDateTime* _tmp3_;
	GCancellable* _tmp4_;
	g_return_if_fail (GEARY_RF_C822_IS_MESSAGE (rfc822));
	g_return_if_fail ((flags == NULL) || GEARY_IS_EMAIL_FLAGS (flags));
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_TYPE_GENERIC_FOLDER, GearyImapEngineGenericFolder);
	_data_ = g_slice_new0 (GearyImapEngineGenericFolderCreateEmailAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_generic_folder_real_create_email_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (rfc822);
	_g_object_unref0 (_data_->rfc822);
	_data_->rfc822 = _tmp1_;
	_tmp2_ = _g_object_ref0 (flags);
	_g_object_unref0 (_data_->flags);
	_data_->flags = _tmp2_;
	_tmp3_ = _g_date_time_ref0 (date_received);
	_g_date_time_unref0 (_data_->date_received);
	_data_->date_received = _tmp3_;
	_tmp4_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp4_;
	geary_imap_engine_generic_folder_real_create_email_async_co (_data_);
}

static GearyEmailIdentifier*
geary_imap_engine_generic_folder_create_email_finish (GearyFolderSupportCreate* base,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	GearyEmailIdentifier* result;
	GearyImapEngineGenericFolderCreateEmailAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
geary_imap_engine_generic_folder_create_email_async_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	GearyImapEngineGenericFolderCreateEmailAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_generic_folder_real_create_email_async_co (_data_);
}

static gboolean
geary_imap_engine_generic_folder_real_create_email_async_co (GearyImapEngineGenericFolderCreateEmailAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	geary_imap_engine_minimal_folder_create_email_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->rfc822, _data_->flags, _data_->date_received, _data_->cancellable, geary_imap_engine_generic_folder_create_email_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = geary_imap_engine_minimal_folder_create_email_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder), _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp1_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp2_;
	_g_object_unref0 (_data_->_tmp0_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_imap_engine_generic_folder_class_init (GearyImapEngineGenericFolderClass * klass,
                                             gpointer klass_data)
{
	geary_imap_engine_generic_folder_parent_class = g_type_class_peek_parent (klass);
}

static void
geary_imap_engine_generic_folder_geary_folder_support_archive_interface_init (GearyFolderSupportArchiveIface * iface,
                                                                              gpointer iface_data)
{
	geary_imap_engine_generic_folder_geary_folder_support_archive_parent_iface = g_type_interface_peek_parent (iface);
	iface->archive_email_async = (void (*) (GearyFolderSupportArchive*, GeeCollection*, GCancellable*, GAsyncReadyCallback, gpointer)) geary_imap_engine_generic_folder_real_archive_email_async;
	iface->archive_email_finish = (GearyRevokable* (*) (GearyFolderSupportArchive*, GAsyncResult*, GError**)) geary_imap_engine_generic_folder_archive_email_finish;
}

static void
geary_imap_engine_generic_folder_geary_folder_support_remove_interface_init (GearyFolderSupportRemoveIface * iface,
                                                                             gpointer iface_data)
{
	geary_imap_engine_generic_folder_geary_folder_support_remove_parent_iface = g_type_interface_peek_parent (iface);
	iface->remove_email_async = (void (*) (GearyFolderSupportRemove*, GeeCollection*, GCancellable*, GAsyncReadyCallback, gpointer)) geary_imap_engine_generic_folder_real_remove_email_async;
	iface->remove_email_finish = (void (*) (GearyFolderSupportRemove*, GAsyncResult*, GError**)) geary_imap_engine_generic_folder_remove_email_finish;
}

static void
geary_imap_engine_generic_folder_geary_folder_support_create_interface_init (GearyFolderSupportCreateIface * iface,
                                                                             gpointer iface_data)
{
	geary_imap_engine_generic_folder_geary_folder_support_create_parent_iface = g_type_interface_peek_parent (iface);
	iface->create_email_async = (void (*) (GearyFolderSupportCreate*, GearyRFC822Message*, GearyEmailFlags*, GDateTime*, GCancellable*, GAsyncReadyCallback, gpointer)) geary_imap_engine_generic_folder_real_create_email_async;
	iface->create_email_finish = (GearyEmailIdentifier* (*) (GearyFolderSupportCreate*, GAsyncResult*, GError**)) geary_imap_engine_generic_folder_create_email_finish;
}

static void
geary_imap_engine_generic_folder_geary_folder_support_empty_interface_init (GearyFolderSupportEmptyIface * iface,
                                                                            gpointer iface_data)
{
	geary_imap_engine_generic_folder_geary_folder_support_empty_parent_iface = g_type_interface_peek_parent (iface);
	iface->empty_folder_async = (void (*) (GearyFolderSupportEmpty*, GCancellable*, GAsyncReadyCallback, gpointer)) geary_imap_engine_generic_folder_real_empty_folder_async;
	iface->empty_folder_finish = (void (*) (GearyFolderSupportEmpty*, GAsyncResult*, GError**)) geary_imap_engine_generic_folder_empty_folder_finish;
}

static void
geary_imap_engine_generic_folder_instance_init (GearyImapEngineGenericFolder * self,
                                                gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
geary_imap_engine_generic_folder_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyImapEngineGenericFolderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_imap_engine_generic_folder_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyImapEngineGenericFolder), 0, (GInstanceInitFunc) geary_imap_engine_generic_folder_instance_init, NULL };
	static const GInterfaceInfo geary_folder_support_archive_info = { (GInterfaceInitFunc) geary_imap_engine_generic_folder_geary_folder_support_archive_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo geary_folder_support_remove_info = { (GInterfaceInitFunc) geary_imap_engine_generic_folder_geary_folder_support_remove_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo geary_folder_support_create_info = { (GInterfaceInitFunc) geary_imap_engine_generic_folder_geary_folder_support_create_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo geary_folder_support_empty_info = { (GInterfaceInitFunc) geary_imap_engine_generic_folder_geary_folder_support_empty_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType geary_imap_engine_generic_folder_type_id;
	geary_imap_engine_generic_folder_type_id = g_type_register_static (GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, "GearyImapEngineGenericFolder", &g_define_type_info, 0);
	g_type_add_interface_static (geary_imap_engine_generic_folder_type_id, GEARY_FOLDER_SUPPORT_TYPE_ARCHIVE, &geary_folder_support_archive_info);
	g_type_add_interface_static (geary_imap_engine_generic_folder_type_id, GEARY_FOLDER_SUPPORT_TYPE_REMOVE, &geary_folder_support_remove_info);
	g_type_add_interface_static (geary_imap_engine_generic_folder_type_id, GEARY_FOLDER_SUPPORT_TYPE_CREATE, &geary_folder_support_create_info);
	g_type_add_interface_static (geary_imap_engine_generic_folder_type_id, GEARY_FOLDER_SUPPORT_TYPE_EMPTY, &geary_folder_support_empty_info);
	return geary_imap_engine_generic_folder_type_id;
}

GType
geary_imap_engine_generic_folder_get_type (void)
{
	static gsize geary_imap_engine_generic_folder_type_id__once = 0;
	if (g_once_init_enter (&geary_imap_engine_generic_folder_type_id__once)) {
		GType geary_imap_engine_generic_folder_type_id;
		geary_imap_engine_generic_folder_type_id = geary_imap_engine_generic_folder_get_type_once ();
		g_once_init_leave (&geary_imap_engine_generic_folder_type_id__once, geary_imap_engine_generic_folder_type_id);
	}
	return geary_imap_engine_generic_folder_type_id__once;
}

