/* composer-application-interface.c generated by valac 0.56.3, the Vala compiler
 * generated from composer-application-interface.vala, do not modify */

/*
 * Copyright © 2020 Michael Gratton <mike@vee.net>
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later). See the COPYING file in this distribution.
 */

#include <glib-object.h>
#include "geary-engine.h"
#include "geary-client-43.0.h"
#include <gee.h>
#include <gio/gio.h>
#include <glib.h>

#define COMPOSER_TYPE_APPLICATION_INTERFACE (composer_application_interface_get_type ())
#define COMPOSER_APPLICATION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMPOSER_TYPE_APPLICATION_INTERFACE, ComposerApplicationInterface))
#define COMPOSER_IS_APPLICATION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMPOSER_TYPE_APPLICATION_INTERFACE))
#define COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), COMPOSER_TYPE_APPLICATION_INTERFACE, ComposerApplicationInterfaceIface))

typedef struct _ComposerApplicationInterface ComposerApplicationInterface;
typedef struct _ComposerApplicationInterfaceIface ComposerApplicationInterfaceIface;

#define APPLICATION_TYPE_ACCOUNT_INTERFACE (application_account_interface_get_type ())
#define APPLICATION_ACCOUNT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterface))
#define APPLICATION_IS_ACCOUNT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), APPLICATION_TYPE_ACCOUNT_INTERFACE))
#define APPLICATION_ACCOUNT_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterfaceIface))

typedef struct _ApplicationAccountInterface ApplicationAccountInterface;
typedef struct _ApplicationAccountInterfaceIface ApplicationAccountInterfaceIface;

struct _ApplicationAccountInterfaceIface {
	GTypeInterface parent_iface;
	ApplicationAccountContext* (*get_context_for_account) (ApplicationAccountInterface* self, GearyAccountInformation* account);
	GeeCollection* (*get_account_contexts) (ApplicationAccountInterface* self);
};

struct _ComposerApplicationInterfaceIface {
	GTypeInterface parent_iface;
	void (*report_problem) (ComposerApplicationInterface* self, GearyProblemReport* report);
	void (*send_composed_email) (ComposerApplicationInterface* self, ComposerWidget* composer, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*send_composed_email_finish) (ComposerApplicationInterface* self, GAsyncResult* _res_);
	void (*save_composed_email) (ComposerApplicationInterface* self, ComposerWidget* composer, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*save_composed_email_finish) (ComposerApplicationInterface* self, GAsyncResult* _res_);
	void (*discard_composed_email) (ComposerApplicationInterface* self, ComposerWidget* composer, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*discard_composed_email_finish) (ComposerApplicationInterface* self, GAsyncResult* _res_);
};

VALA_EXTERN GType application_account_interface_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType composer_application_interface_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void composer_application_interface_report_problem (ComposerApplicationInterface* self,
                                                    GearyProblemReport* report);
VALA_EXTERN void composer_application_interface_send_composed_email (ComposerApplicationInterface* self,
                                                         ComposerWidget* composer,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
VALA_EXTERN void composer_application_interface_send_composed_email_finish (ComposerApplicationInterface* self,
                                                                GAsyncResult* _res_);
VALA_EXTERN void composer_application_interface_save_composed_email (ComposerApplicationInterface* self,
                                                         ComposerWidget* composer,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
VALA_EXTERN void composer_application_interface_save_composed_email_finish (ComposerApplicationInterface* self,
                                                                GAsyncResult* _res_);
VALA_EXTERN void composer_application_interface_discard_composed_email (ComposerApplicationInterface* self,
                                                            ComposerWidget* composer,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
VALA_EXTERN void composer_application_interface_discard_composed_email_finish (ComposerApplicationInterface* self,
                                                                   GAsyncResult* _res_);
static GType composer_application_interface_get_type_once (void);

void
composer_application_interface_report_problem (ComposerApplicationInterface* self,
                                               GearyProblemReport* report)
{
	ComposerApplicationInterfaceIface* _iface_;
	g_return_if_fail (COMPOSER_IS_APPLICATION_INTERFACE (self));
	_iface_ = COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE (self);
	if (_iface_->report_problem) {
		_iface_->report_problem (self, report);
	}
}

void
composer_application_interface_send_composed_email (ComposerApplicationInterface* self,
                                                    ComposerWidget* composer,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	ComposerApplicationInterfaceIface* _iface_;
	_iface_ = COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE (self);
	if (_iface_->send_composed_email) {
		_iface_->send_composed_email (self, composer, _callback_, _user_data_);
	}
}

void
composer_application_interface_send_composed_email_finish (ComposerApplicationInterface* self,
                                                           GAsyncResult* _res_)
{
	ComposerApplicationInterfaceIface* _iface_;
	_iface_ = COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE (self);
	if (_iface_->send_composed_email_finish) {
		_iface_->send_composed_email_finish (self, _res_);
	}
}

void
composer_application_interface_save_composed_email (ComposerApplicationInterface* self,
                                                    ComposerWidget* composer,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	ComposerApplicationInterfaceIface* _iface_;
	_iface_ = COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE (self);
	if (_iface_->save_composed_email) {
		_iface_->save_composed_email (self, composer, _callback_, _user_data_);
	}
}

void
composer_application_interface_save_composed_email_finish (ComposerApplicationInterface* self,
                                                           GAsyncResult* _res_)
{
	ComposerApplicationInterfaceIface* _iface_;
	_iface_ = COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE (self);
	if (_iface_->save_composed_email_finish) {
		_iface_->save_composed_email_finish (self, _res_);
	}
}

void
composer_application_interface_discard_composed_email (ComposerApplicationInterface* self,
                                                       ComposerWidget* composer,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	ComposerApplicationInterfaceIface* _iface_;
	_iface_ = COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE (self);
	if (_iface_->discard_composed_email) {
		_iface_->discard_composed_email (self, composer, _callback_, _user_data_);
	}
}

void
composer_application_interface_discard_composed_email_finish (ComposerApplicationInterface* self,
                                                              GAsyncResult* _res_)
{
	ComposerApplicationInterfaceIface* _iface_;
	_iface_ = COMPOSER_APPLICATION_INTERFACE_GET_INTERFACE (self);
	if (_iface_->discard_composed_email_finish) {
		_iface_->discard_composed_email_finish (self, _res_);
	}
}

static void
composer_application_interface_default_init (ComposerApplicationInterfaceIface * iface,
                                             gpointer iface_data)
{
}

/**
 * Provides access to application objects and services to the composer.
 *
 * This interface defines the composer's requirements for integrating
 * with the application and enables the composer to be unit tested
 * without having to load the complete application.
 */
static GType
composer_application_interface_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ComposerApplicationInterfaceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) composer_application_interface_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType composer_application_interface_type_id;
	composer_application_interface_type_id = g_type_register_static (G_TYPE_INTERFACE, "ComposerApplicationInterface", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (composer_application_interface_type_id, G_TYPE_OBJECT);
	g_type_interface_add_prerequisite (composer_application_interface_type_id, APPLICATION_TYPE_ACCOUNT_INTERFACE);
	return composer_application_interface_type_id;
}

GType
composer_application_interface_get_type (void)
{
	static volatile gsize composer_application_interface_type_id__once = 0;
	if (g_once_init_enter (&composer_application_interface_type_id__once)) {
		GType composer_application_interface_type_id;
		composer_application_interface_type_id = composer_application_interface_get_type_once ();
		g_once_init_leave (&composer_application_interface_type_id__once, composer_application_interface_type_id);
	}
	return composer_application_interface_type_id__once;
}

