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

/*
 * Copyright © 2016 Software Freedom Conservancy Inc.
 * Copyright © 2017-2021 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.h>
#include <glib-object.h>
#include "geary-client-46.0.h"
#include "geary-engine.h"
#include <gtk/gtk.h>
#include <gee.h>
#include <gspell/gspell.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gobject/gvaluecollector.h>

#define COMPOSER_WIDGET_DEFAULT_TITLE _ ("New Message")
#define COMPOSER_WIDGET_ACTION_ADD_ATTACHMENT "add-attachment"
#define COMPOSER_WIDGET_ACTION_ADD_ORIGINAL_ATTACHMENTS "add-original-attachments"
#define COMPOSER_WIDGET_ACTION_CLOSE "composer-close"
#define COMPOSER_WIDGET_ACTION_CUT "cut"
#define COMPOSER_WIDGET_ACTION_DETACH "detach"
#define COMPOSER_WIDGET_ACTION_DISCARD "discard"
#define COMPOSER_WIDGET_ACTION_PASTE "paste"
#define COMPOSER_WIDGET_ACTION_SEND "send"
#define COMPOSER_WIDGET_ACTION_SHOW_EXTENDED_HEADERS "show-extended-headers"
#define COMPOSER_WIDGET_DRAFT_SAVED_TEXT _ ("Saved")
#define COMPOSER_WIDGET_DRAFT_SAVING_TEXT _ ("Saving")
#define COMPOSER_WIDGET_DRAFT_ERROR_TEXT _ ("Error saving")
#define COMPOSER_WIDGET_BACKSPACE_TEXT _ ("Press Backspace to delete quote")
#define COMPOSER_WIDGET_URI_LIST_MIME_TYPE "text/uri-list"
#define COMPOSER_WIDGET_FILE_URI_PREFIX "file://"
#define COMPOSER_WIDGET_MAILTO_URI_PREFIX "mailto:"
#define COMPOSER_WIDGET_ATTACHMENT_KEYWORDS "attach|attaching|attaches|attachment|attachments|attached|enclose|encl" \
"osed|enclosing|encloses|enclosure|enclosures"
#define COMPOSER_WIDGET_ATTACHMENT_KEYWORDS_LOCALISED _ ("attach|attaching|attaches|attachment|attachments|attached|enclose|encl" \
"osed|enclosing|encloses|enclosure|enclosures")
#define COMPOSER_WIDGET_PASTED_IMAGE_FILENAME_TEMPLATE "geary-pasted-image-%u.png"
#define COMPOSER_EDITOR_ACTION_TEXT_FORMAT "text-format"
#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

#define TYPE_ATTACHMENT_ERROR (attachment_error_get_type ())

#define COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP (composer_widget_from_address_map_get_type ())
#define COMPOSER_WIDGET_FROM_ADDRESS_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP, ComposerWidgetFromAddressMap))
#define COMPOSER_WIDGET_FROM_ADDRESS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP, ComposerWidgetFromAddressMapClass))
#define COMPOSER_WIDGET_IS_FROM_ADDRESS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP))
#define COMPOSER_WIDGET_IS_FROM_ADDRESS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP))
#define COMPOSER_WIDGET_FROM_ADDRESS_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP, ComposerWidgetFromAddressMapClass))

typedef struct _ComposerWidgetFromAddressMap ComposerWidgetFromAddressMap;
typedef struct _ComposerWidgetFromAddressMapClass ComposerWidgetFromAddressMapClass;

#define COMPOSER_WIDGET_TYPE_HEADER_ROW (composer_widget_header_row_get_type ())
#define COMPOSER_WIDGET_HEADER_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow))
#define COMPOSER_WIDGET_HEADER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRowClass))
#define COMPOSER_WIDGET_IS_HEADER_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMPOSER_WIDGET_TYPE_HEADER_ROW))
#define COMPOSER_WIDGET_IS_HEADER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COMPOSER_WIDGET_TYPE_HEADER_ROW))
#define COMPOSER_WIDGET_HEADER_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRowClass))

typedef struct _ComposerWidgetHeaderRow ComposerWidgetHeaderRow;
typedef struct _ComposerWidgetHeaderRowClass ComposerWidgetHeaderRowClass;
typedef enum  {
	COMPOSER_WIDGET_ATTACH_PENDING_ALL,
	COMPOSER_WIDGET_ATTACH_PENDING_INLINE_ONLY
} ComposerWidgetAttachPending;

#define COMPOSER_WIDGET_TYPE_ATTACH_PENDING (composer_widget_attach_pending_get_type ())

#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;
enum  {
	COMPOSER_WIDGET_0_PROPERTY,
	COMPOSER_WIDGET_SENDER_CONTEXT_PROPERTY,
	COMPOSER_WIDGET_SAVED_ID_PROPERTY,
	COMPOSER_WIDGET_CONTEXT_TYPE_PROPERTY,
	COMPOSER_WIDGET_CURRENT_MODE_PROPERTY,
	COMPOSER_WIDGET_IS_BLANK_PROPERTY,
	COMPOSER_WIDGET_EDITOR_PROPERTY,
	COMPOSER_WIDGET_FOCUSED_INPUT_WIDGET_PROPERTY,
	COMPOSER_WIDGET_CAN_SEND_PROPERTY,
	COMPOSER_WIDGET_FROM_PROPERTY,
	COMPOSER_WIDGET_TO_PROPERTY,
	COMPOSER_WIDGET_CC_PROPERTY,
	COMPOSER_WIDGET_BCC_PROPERTY,
	COMPOSER_WIDGET_REPLY_TO_PROPERTY,
	COMPOSER_WIDGET_SUBJECT_PROPERTY,
	COMPOSER_WIDGET_IN_REPLY_TO_PROPERTY,
	COMPOSER_WIDGET_REFERENCES_PROPERTY,
	COMPOSER_WIDGET_SAVE_TO_PROPERTY,
	COMPOSER_WIDGET_HEADER_PROPERTY,
	COMPOSER_WIDGET_HAS_MULTIPLE_FROM_ADDRESSES_PROPERTY,
	COMPOSER_WIDGET_NUM_PROPERTIES
};
static GParamSpec* composer_widget_properties[COMPOSER_WIDGET_NUM_PROPERTIES];
typedef enum  {
	COMPOSER_WIDGET_DRAFT_POLICY_DISCARD,
	COMPOSER_WIDGET_DRAFT_POLICY_KEEP
} ComposerWidgetDraftPolicy;

#define COMPOSER_WIDGET_TYPE_DRAFT_POLICY (composer_widget_draft_policy_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW (composer_widget_entry_header_row_get_type ())
#define COMPOSER_WIDGET_ENTRY_HEADER_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW, ComposerWidgetEntryHeaderRow))
#define COMPOSER_WIDGET_ENTRY_HEADER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW, ComposerWidgetEntryHeaderRowClass))
#define COMPOSER_WIDGET_IS_ENTRY_HEADER_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW))
#define COMPOSER_WIDGET_IS_ENTRY_HEADER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW))
#define COMPOSER_WIDGET_ENTRY_HEADER_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW, ComposerWidgetEntryHeaderRowClass))

typedef struct _ComposerWidgetEntryHeaderRow ComposerWidgetEntryHeaderRow;
typedef struct _ComposerWidgetEntryHeaderRowClass ComposerWidgetEntryHeaderRowClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _ComposerWidgetLoadEmptyBodyData ComposerWidgetLoadEmptyBodyData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ComposerWidgetLoadMailtoData ComposerWidgetLoadMailtoData;
typedef struct _ComposerWidgetLoadContextData ComposerWidgetLoadContextData;

#define TYPE_ALERT_DIALOG (alert_dialog_get_type ())
#define ALERT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALERT_DIALOG, AlertDialog))
#define ALERT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALERT_DIALOG, AlertDialogClass))
#define IS_ALERT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALERT_DIALOG))
#define IS_ALERT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALERT_DIALOG))
#define ALERT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALERT_DIALOG, AlertDialogClass))

typedef struct _AlertDialog AlertDialog;
typedef struct _AlertDialogClass AlertDialogClass;

#define TYPE_TERNARY_CONFIRMATION_DIALOG (ternary_confirmation_dialog_get_type ())
#define TERNARY_CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TERNARY_CONFIRMATION_DIALOG, TernaryConfirmationDialog))
#define TERNARY_CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TERNARY_CONFIRMATION_DIALOG, TernaryConfirmationDialogClass))
#define IS_TERNARY_CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TERNARY_CONFIRMATION_DIALOG))
#define IS_TERNARY_CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TERNARY_CONFIRMATION_DIALOG))
#define TERNARY_CONFIRMATION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TERNARY_CONFIRMATION_DIALOG, TernaryConfirmationDialogClass))

typedef struct _TernaryConfirmationDialog TernaryConfirmationDialog;
typedef struct _TernaryConfirmationDialogClass TernaryConfirmationDialogClass;

#define TYPE_CONFIRMATION_DIALOG (confirmation_dialog_get_type ())
#define CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIRMATION_DIALOG, ConfirmationDialog))
#define CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIRMATION_DIALOG, ConfirmationDialogClass))
#define IS_CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIRMATION_DIALOG))
#define IS_CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIRMATION_DIALOG))
#define CONFIRMATION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIRMATION_DIALOG, ConfirmationDialogClass))

typedef struct _ConfirmationDialog ConfirmationDialog;
typedef struct _ConfirmationDialogClass ConfirmationDialogClass;
typedef struct _ComposerWidgetCloseData ComposerWidgetCloseData;
typedef struct _Block71Data Block71Data;
typedef struct _ComposerWidgetRestoreReplyToStateData ComposerWidgetRestoreReplyToStateData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _ComposerWidgetToComposedEmailData ComposerWidgetToComposedEmailData;
typedef struct _Block72Data Block72Data;
typedef struct _ComposerWidgetFinishLoadingData ComposerWidgetFinishLoadingData;
typedef struct _ComposerWidgetShouldSendData ComposerWidgetShouldSendData;
typedef struct _ComposerWidgetOnSendAsyncData ComposerWidgetOnSendAsyncData;
typedef struct _Block73Data Block73Data;
typedef struct _ComposerWidgetOpenDraftManagerData ComposerWidgetOpenDraftManagerData;
typedef struct _ComposerWidgetReopenDraftManagerData ComposerWidgetReopenDraftManagerData;
typedef struct _ComposerWidgetCloseDraftManagerData ComposerWidgetCloseDraftManagerData;
typedef struct _ComposerWidgetSaveDraftData ComposerWidgetSaveDraftData;
typedef struct _ComposerWidgetSaveAndCloseData ComposerWidgetSaveAndCloseData;
typedef struct _ComposerWidgetDiscardAndCloseData ComposerWidgetDiscardAndCloseData;
typedef struct _Block74Data Block74Data;

#define TYPE_ERROR_DIALOG (error_dialog_get_type ())
#define ERROR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ERROR_DIALOG, ErrorDialog))
#define ERROR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ERROR_DIALOG, ErrorDialogClass))
#define IS_ERROR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ERROR_DIALOG))
#define IS_ERROR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ERROR_DIALOG))
#define ERROR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ERROR_DIALOG, ErrorDialogClass))

typedef struct _ErrorDialog ErrorDialog;
typedef struct _ErrorDialogClass ErrorDialogClass;
typedef struct _Block75Data Block75Data;
typedef struct _Block76Data Block76Data;
#define _g_time_zone_unref0(var) ((var == NULL) ? NULL : (var = (g_time_zone_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _composer_widget_from_address_map_unref0(var) ((var == NULL) ? NULL : (var = (composer_widget_from_address_map_unref (var), NULL)))
typedef struct _ComposerWidgetFromAddressMapPrivate ComposerWidgetFromAddressMapPrivate;
typedef struct _ComposerWidgetUpdateSignatureData ComposerWidgetUpdateSignatureData;
#define __vala_GspellLanguage_free0(var) ((var == NULL) ? NULL : (var = (_vala_GspellLanguage_free (var), NULL)))
typedef struct _Block77Data Block77Data;
typedef struct _ComposerWidgetHeaderRowPrivate ComposerWidgetHeaderRowPrivate;
enum  {
	COMPOSER_WIDGET_HEADER_ROW_0_PROPERTY,
	COMPOSER_WIDGET_HEADER_ROW_T_TYPE,
	COMPOSER_WIDGET_HEADER_ROW_T_DUP_FUNC,
	COMPOSER_WIDGET_HEADER_ROW_T_DESTROY_FUNC,
	COMPOSER_WIDGET_HEADER_ROW_LABEL_PROPERTY,
	COMPOSER_WIDGET_HEADER_ROW_VALUE_CONTAINER_PROPERTY,
	COMPOSER_WIDGET_HEADER_ROW_VALUE_PROPERTY,
	COMPOSER_WIDGET_HEADER_ROW_NUM_PROPERTIES
};
static GParamSpec* composer_widget_header_row_properties[COMPOSER_WIDGET_HEADER_ROW_NUM_PROPERTIES];
typedef struct _ComposerWidgetEntryHeaderRowPrivate ComposerWidgetEntryHeaderRowPrivate;
enum  {
	COMPOSER_WIDGET_ENTRY_HEADER_ROW_0_PROPERTY,
	COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_TYPE,
	COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DUP_FUNC,
	COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DESTROY_FUNC,
	COMPOSER_WIDGET_ENTRY_HEADER_ROW_UNDO_PROPERTY,
	COMPOSER_WIDGET_ENTRY_HEADER_ROW_NUM_PROPERTIES
};
static GParamSpec* composer_widget_entry_header_row_properties[COMPOSER_WIDGET_ENTRY_HEADER_ROW_NUM_PROPERTIES];
typedef struct _ComposerWidgetParamSpecFromAddressMap ComposerWidgetParamSpecFromAddressMap;

typedef enum  {
	ATTACHMENT_ERROR_FILE,
	ATTACHMENT_ERROR_DUPLICATE
} AttachmentError;
#define ATTACHMENT_ERROR attachment_error_quark ()

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_);
};

struct _ComposerWidgetPrivate {
	ApplicationAccountContext* _sender_context;
	GearyEmailIdentifier* _saved_id;
	ComposerWidgetContextType _context_type;
	ComposerWidgetPresentationMode _current_mode;
	ComposerEditor* _editor;
	GtkWidget* _focused_input_widget;
	gboolean _can_send;
	GearyRFC822MailboxAddresses* _from;
	GearyRFC822MessageIDList* _in_reply_to;
	GearyRFC822MessageIDList* _references;
	GearyFolder* _save_to;
	ComposerHeaderbar* _header;
	GtkBox* header_container;
	GtkGrid* editor_container;
	GtkGrid* email_headers;
	GtkBox* filled_headers;
	GtkRevealer* extended_headers_revealer;
	GtkBox* extended_headers;
	GtkToggleButton* show_extended_headers;
	GeeArrayList* from_list;
	GtkSizeGroup* header_labels_group;
	ComposerWidgetHeaderRow* from_row;
	ComposerWidgetHeaderRow* to_row;
	ComposerWidgetHeaderRow* cc_row;
	ComposerWidgetHeaderRow* bcc_row;
	ComposerWidgetHeaderRow* reply_to_row;
	ComposerWidgetHeaderRow* subject_row;
	GspellChecker* subject_spell_checker;
	GspellEntry* subject_spell_entry;
	GtkBox* attachments_box;
	GtkBox* hidden_on_attachment_drag_over;
	GtkBox* visible_on_attachment_drag_over;
	GtkWidget* hidden_on_attachment_drag_over_child;
	GtkWidget* visible_on_attachment_drag_over_child;
	GSimpleActionGroup* actions;
	gboolean is_attachment_overlay_visible;
	gboolean top_posting;
	GeeSet* referred_ids;
	GeeList* pending_attachments;
	ComposerWidgetAttachPending pending_include;
	GeeSet* attached_files;
	GeeMap* inline_files;
	GeeMap* cid_files;
	GearyAppDraftManager* draft_manager;
	GCancellable* draft_manager_opening;
	GearyTimeoutManager* draft_timer;
	gboolean is_draft_saved;
	gchar* _draft_status_text;
	gboolean _can_delete_quote;
	ComposerApplicationInterface* application;
	ApplicationConfiguration* config;
};

struct _ComposerWidgetLoadEmptyBodyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	GearyRFC822MailboxAddress* to;
	gchar* _tmp0_;
	gchar* _tmp1_;
};

struct _ComposerWidgetLoadMailtoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	gchar* mailto;
	GeeHashMultiMap* headers;
	GeeHashMultiMap* _tmp0_;
	gchar* email;
	gchar** parts;
	gint _tmp1_;
	gint _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	gchar** _tmp9_;
	gint _tmp9__length1;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	gint __tmp12__size_;
	gchar** _tmp13_;
	gint _tmp13__length1;
	gchar** _tmp14_;
	gint _tmp14__length1;
	const gchar* _tmp15_;
	gchar** _tmp16_;
	gchar** _tmp17_;
	gchar** _tmp18_;
	gchar** params;
	gchar** _tmp19_;
	gint _tmp19__length1;
	gint params_length1;
	gint _params_size_;
	gchar** _tmp20_;
	gint _tmp20__length1;
	gchar** param_collection;
	gint param_collection_length1;
	gint _param_collection_size_;
	gint param_it;
	gchar* _tmp21_;
	gchar* param;
	gchar** param_parts;
	const gchar* _tmp22_;
	gchar** _tmp23_;
	gchar** _tmp24_;
	gint param_parts_length1;
	gint _param_parts_size_;
	gchar** _tmp25_;
	gint _tmp25__length1;
	GeeHashMultiMap* _tmp26_;
	gchar** _tmp27_;
	gint _tmp27__length1;
	const gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar** _tmp33_;
	gint _tmp33__length1;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gboolean _tmp37_;
	const gchar* _tmp38_;
	GeeHashMultiMap* _tmp39_;
	const gchar* _tmp40_;
	GeeHashMultiMap* _tmp41_;
	GeeCollection* _tmp42_;
	GeeCollection* _tmp43_;
	gpointer _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	const gchar* _tmp48_;
	const gchar* _tmp49_;
	GeeHashMultiMap* _tmp50_;
	GeeHashMultiMap* _tmp51_;
	GeeCollection* _tmp52_;
	GeeCollection* _tmp53_;
	gpointer _tmp54_;
	gchar* _tmp55_;
	GeeHashMultiMap* _tmp56_;
	GeeHashMultiMap* _tmp57_;
	GeeCollection* _tmp58_;
	GeeCollection* _tmp59_;
	gpointer _tmp60_;
	gchar* _tmp61_;
	GeeHashMultiMap* _tmp62_;
	GeeHashMultiMap* _tmp63_;
	GeeCollection* _tmp64_;
	GeeCollection* _tmp65_;
	gpointer _tmp66_;
	gchar* _tmp67_;
	GeeHashMultiMap* _tmp68_;
	GeeHashMultiMap* _tmp69_;
	GeeCollection* _tmp70_;
	GeeCollection* _tmp71_;
	gpointer _tmp72_;
	gchar* _tmp73_;
	gchar* body;
	gchar* _tmp74_;
	GeeHashMultiMap* _tmp75_;
	GeeHashMultiMap* _tmp76_;
	GeeCollection* _tmp77_;
	GeeCollection* _tmp78_;
	gpointer _tmp79_;
	gchar* _tmp80_;
	gchar* _tmp81_;
	gchar* _tmp82_;
	gchar* _tmp83_;
	GeeList* attachments;
	GeeLinkedList* _tmp84_;
	GeeList* _tmp85_;
	GeeHashMultiMap* _tmp86_;
	GeeCollection* _tmp87_;
	GeeCollection* _tmp88_;
	GeeList* _tmp89_;
	GeeHashMultiMap* _tmp90_;
	GeeCollection* _tmp91_;
	GeeCollection* _tmp92_;
	GeeList* _attachment_list;
	GeeList* _tmp93_;
	gint _attachment_size;
	GeeList* _tmp94_;
	gint _tmp95_;
	gint _tmp96_;
	gint _attachment_index;
	gint _tmp97_;
	gint _tmp98_;
	gchar* attachment;
	GeeList* _tmp99_;
	gpointer _tmp100_;
	const gchar* _tmp101_;
	GFile* _tmp102_;
	GFile* _tmp103_;
	GError* err;
	GError* _tmp104_;
	const gchar* _tmp105_;
	const gchar* _tmp106_;
	GError* _inner_error0_;
};

struct _ComposerWidgetLoadContextData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	ComposerWidgetContextType type;
	GearyEmail* context;
	gchar* quote;
	GEnumValue* _tmp0_;
	GError* _tmp1_;
	GearyEmail* full_context;
	GearyEmail* _tmp2_;
	GearyEmailField _tmp3_;
	GearyEmailField _tmp4_;
	GeeCollection* email;
	ApplicationAccountContext* _tmp5_;
	GearyAppEmailStore* _tmp6_;
	GearyAppEmailStore* _tmp7_;
	GearyEmailIdentifier* _tmp8_;
	GearyEmailIdentifier* _tmp9_;
	GeeCollection* _tmp10_;
	GeeCollection* _tmp11_;
	ApplicationAccountContext* _tmp12_;
	GCancellable* _tmp13_;
	GCancellable* _tmp14_;
	GeeCollection* _tmp15_;
	GeeCollection* _tmp16_;
	gboolean _tmp17_;
	GeeCollection* _tmp18_;
	GeeCollection* _tmp19_;
	gboolean _tmp20_;
	gboolean _tmp21_;
	GearyEmailField _tmp22_;
	GearyEmailField _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	GError* _tmp26_;
	GError* _tmp27_;
	GeeCollection* _tmp28_;
	gpointer _tmp29_;
	gboolean _tmp30_;
	GearyEmail* _tmp31_;
	GeeList* _tmp32_;
	GeeList* _tmp33_;
	GeeList* _tmp34_;
	gchar* body;
	gchar* _tmp35_;
	gchar* complete_quote;
	gchar* _tmp36_;
	gboolean body_complete;
	GearyEmail* _tmp37_;
	GearyEmailIdentifier* _tmp38_;
	GearyEmailIdentifier* _tmp39_;
	GearyEmail* _tmp40_;
	GearyRFC822MailboxAddresses* _tmp41_;
	GearyRFC822MailboxAddresses* _tmp42_;
	GearyEmail* _tmp43_;
	GearyRFC822MailboxAddresses* _tmp44_;
	GearyRFC822MailboxAddresses* _tmp45_;
	GearyEmail* _tmp46_;
	GearyRFC822MailboxAddresses* _tmp47_;
	GearyRFC822MailboxAddresses* _tmp48_;
	ComposerWidgetHeaderRow* _tmp49_;
	gconstpointer _tmp50_;
	gconstpointer _tmp51_;
	GearyEmail* _tmp52_;
	GearyRFC822MailboxAddresses* _tmp53_;
	GearyRFC822MailboxAddresses* _tmp54_;
	GearyEmail* _tmp55_;
	GearyRFC822MailboxAddresses* _tmp56_;
	GearyRFC822MailboxAddresses* _tmp57_;
	ComposerWidgetHeaderRow* _tmp58_;
	gconstpointer _tmp59_;
	gconstpointer _tmp60_;
	GearyEmail* _tmp61_;
	GearyRFC822MailboxAddresses* _tmp62_;
	GearyRFC822MailboxAddresses* _tmp63_;
	GearyEmail* _tmp64_;
	GearyRFC822MailboxAddresses* _tmp65_;
	GearyRFC822MailboxAddresses* _tmp66_;
	ComposerWidgetHeaderRow* _tmp67_;
	gconstpointer _tmp68_;
	gconstpointer _tmp69_;
	GearyEmail* _tmp70_;
	GearyRFC822MailboxAddresses* _tmp71_;
	GearyRFC822MailboxAddresses* _tmp72_;
	GearyEmail* _tmp73_;
	GearyRFC822MailboxAddresses* _tmp74_;
	GearyRFC822MailboxAddresses* _tmp75_;
	ComposerWidgetHeaderRow* _tmp76_;
	gconstpointer _tmp77_;
	gconstpointer _tmp78_;
	GearyEmail* _tmp79_;
	GearyRFC822MailboxAddresses* _tmp80_;
	GearyRFC822MailboxAddresses* _tmp81_;
	GearyEmail* _tmp82_;
	GearyRFC822MessageIDList* _tmp83_;
	GearyRFC822MessageIDList* _tmp84_;
	GearyRFC822MessageIDList* _tmp85_;
	GearyEmail* _tmp86_;
	GearyRFC822MessageIDList* _tmp87_;
	GearyRFC822MessageIDList* _tmp88_;
	GearyRFC822MessageIDList* _tmp89_;
	GearyRFC822MessageIDList* _tmp90_;
	GearyEmail* _tmp91_;
	GearyRFC822MessageIDList* _tmp92_;
	GearyRFC822MessageIDList* _tmp93_;
	GearyRFC822MessageIDList* _tmp94_;
	GearyEmail* _tmp95_;
	GearyRFC822MessageIDList* _tmp96_;
	GearyRFC822MessageIDList* _tmp97_;
	GearyRFC822MessageIDList* _tmp98_;
	GearyRFC822MessageIDList* _tmp99_;
	GearyEmail* _tmp100_;
	GearyRFC822Subject* _tmp101_;
	GearyRFC822Subject* _tmp102_;
	const gchar* _tmp103_;
	GearyEmail* _tmp104_;
	GearyRFC822Subject* _tmp105_;
	GearyRFC822Subject* _tmp106_;
	const gchar* _tmp107_;
	const gchar* _tmp108_;
	GearyRFC822Message* message;
	GearyEmail* _tmp109_;
	GearyRFC822Message* _tmp110_;
	GearyRFC822Message* _tmp111_;
	gchar* _tmp112_;
	GearyRFC822Message* _tmp113_;
	gchar* _tmp114_;
	gchar* _tmp115_;
	const gchar* _tmp116_;
	gchar* _tmp117_;
	gchar* _tmp118_;
	gchar* _tmp119_;
	GearyRFC822Message* _tmp120_;
	gchar* _tmp121_;
	gchar* _tmp122_;
	GearyEmail* _tmp123_;
	GearyRFC822MailboxAddresses* _tmp124_;
	GearyRFC822MailboxAddresses* _tmp125_;
	GearyEmail* _tmp126_;
	GearyRFC822MailboxAddresses* _tmp127_;
	GearyRFC822MailboxAddresses* _tmp128_;
	GearyEmail* _tmp129_;
	GearyRFC822MailboxAddresses* _tmp130_;
	GearyRFC822MailboxAddresses* _tmp131_;
	GearyEmail* _tmp132_;
	GearyRFC822MailboxAddresses* _tmp133_;
	GearyRFC822MailboxAddresses* _tmp134_;
	GearyEmail* _tmp135_;
	gchar* _tmp136_;
	gchar* _tmp137_;
	GearyEmail* _tmp138_;
	GearyEmail* _tmp139_;
	gchar* _tmp140_;
	GearyEmail* _tmp141_;
	gchar* _tmp142_;
	gchar* _tmp143_;
	GearyEmail* _tmp144_;
	GearyRFC822MessageID* _tmp145_;
	GearyRFC822MessageID* _tmp146_;
	GearyRFC822MessageIDList* _tmp147_;
	GearyEmail* _tmp148_;
	GearyRFC822MessageID* _tmp149_;
	GearyRFC822MessageID* _tmp150_;
	GearyRFC822MessageIDList* _tmp151_;
	GearyRFC822MessageIDList* _tmp152_;
	GearyEmail* _tmp153_;
	gchar* _tmp154_;
	GeeSet* _tmp155_;
	GearyEmail* _tmp156_;
	GearyEmailIdentifier* _tmp157_;
	GearyEmailIdentifier* _tmp158_;
	const gchar* _tmp159_;
	const gchar* _tmp160_;
	GError* _inner_error0_;
};

struct _ComposerWidgetCloseData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	ComposerWidgetPresentationMode _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GError* _error_;
	ComposerApplicationInterface* _tmp3_;
	ApplicationAccountContext* _tmp4_;
	GearyAccount* _tmp5_;
	GearyAccount* _tmp6_;
	GearyAccountInformation* _tmp7_;
	GearyAccountInformation* _tmp8_;
	GError* _tmp9_;
	GearyAccountProblemReport* _tmp10_;
	GearyAccountProblemReport* _tmp11_;
	GError* _inner_error0_;
};

struct _Block71Data {
	int _ref_count_;
	ComposerWidget* self;
	GearyAccount* current_account;
};

struct _ComposerWidgetRestoreReplyToStateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	GeeList* sender_addresses;
	ApplicationAccountContext* _tmp0_;
	GearyAccount* _tmp1_;
	GearyAccount* _tmp2_;
	GearyAccountInformation* _tmp3_;
	GearyAccountInformation* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	GearyRFC822MailboxAddresses* to_addresses;
	GearyRFC822MailboxAddresses* _tmp7_;
	GearyRFC822MailboxAddresses* cc_addresses;
	GearyRFC822MailboxAddresses* _tmp8_;
	gboolean new_email;
	GearyRFC822MessageIDList* _mid_list;
	GearyRFC822MessageIDList* _tmp9_;
	gint _mid_size;
	GearyRFC822MessageIDList* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gint _mid_index;
	gint _tmp13_;
	gint _tmp14_;
	GearyRFC822MessageID* mid;
	GearyRFC822MessageIDList* _tmp15_;
	GearyRFC822MessageID* _tmp16_;
	GeeMultiMap* email_map;
	GeeMultiMap* _tmp17_;
	ApplicationAccountContext* _tmp18_;
	GearyAccount* _tmp19_;
	GearyAccount* _tmp20_;
	GearyRFC822MessageID* _tmp21_;
	GearyNamedFlag* _tmp22_;
	GearyNamedFlag* _tmp23_;
	GearyNamedFlag* _tmp24_;
	GearyEmailFlags* _tmp25_;
	GearyEmailFlags* _tmp26_;
	GeeMultiMap* _tmp27_;
	GeeMultiMap* _tmp28_;
	GeeMultiMap* _tmp29_;
	GError* _error_;
	GError* _tmp30_;
	const gchar* _tmp31_;
	GeeMultiMap* _tmp32_;
	GeeIterator* _candidate_it;
	GeeMultiMap* _tmp33_;
	GeeSet* _tmp34_;
	GeeSet* _tmp35_;
	GeeIterator* _tmp36_;
	GeeIterator* _tmp37_;
	GeeIterator* _tmp38_;
	GearyEmail* candidate;
	GeeIterator* _tmp39_;
	gpointer _tmp40_;
	gboolean _tmp41_;
	GearyEmail* _tmp42_;
	GearyRFC822MessageID* _tmp43_;
	GearyRFC822MessageID* _tmp44_;
	GearyRFC822MessageID* _tmp45_;
	GearyEmail* _tmp46_;
	GearyRFC822MessageID* _tmp47_;
	GearyRFC822MessageID* _tmp48_;
	GearyRFC822MailboxAddresses* _tmp49_;
	GearyEmail* _tmp50_;
	GeeList* _tmp51_;
	GearyRFC822MailboxAddresses* _tmp52_;
	GearyRFC822MailboxAddresses* _tmp53_;
	GearyRFC822MailboxAddresses* _tmp54_;
	GearyRFC822MailboxAddresses* _tmp55_;
	GearyEmail* _tmp56_;
	GeeList* _tmp57_;
	GearyRFC822MailboxAddresses* _tmp58_;
	GearyRFC822MailboxAddresses* _tmp59_;
	GearyRFC822MailboxAddresses* _tmp60_;
	GeeSet* _tmp61_;
	GearyEmail* _tmp62_;
	GearyEmailIdentifier* _tmp63_;
	GearyEmailIdentifier* _tmp64_;
	const gchar* _tmp65_;
	const gchar* _tmp66_;
	ComposerWidgetHeaderRow* _tmp67_;
	gconstpointer _tmp68_;
	gconstpointer _tmp69_;
	GearyRFC822MailboxAddresses* _tmp70_;
	GearyRFC822MailboxAddresses* _tmp71_;
	GearyRFC822MailboxAddresses* _tmp72_;
	ComposerWidgetHeaderRow* _tmp73_;
	gconstpointer _tmp74_;
	gconstpointer _tmp75_;
	ComposerWidgetHeaderRow* _tmp76_;
	gconstpointer _tmp77_;
	gconstpointer _tmp78_;
	GearyRFC822MailboxAddresses* _tmp79_;
	GearyRFC822MailboxAddresses* _tmp80_;
	GearyRFC822MailboxAddresses* _tmp81_;
	ComposerWidgetHeaderRow* _tmp82_;
	gconstpointer _tmp83_;
	gconstpointer _tmp84_;
	const gchar* _tmp85_;
	const gchar* _tmp86_;
	ComposerWidgetHeaderRow* _tmp87_;
	gconstpointer _tmp88_;
	gconstpointer _tmp89_;
	gboolean _tmp90_;
	ComposerWidgetPresentationMode _tmp91_;
	gboolean _tmp92_;
	gboolean _tmp93_;
	gboolean _tmp94_;
	ComposerWidgetHeaderRow* _tmp95_;
	gconstpointer _tmp96_;
	gconstpointer _tmp97_;
	gboolean _tmp98_;
	gboolean _tmp99_;
	ComposerWidgetHeaderRow* _tmp100_;
	gconstpointer _tmp101_;
	gconstpointer _tmp102_;
	gboolean _tmp103_;
	gboolean _tmp104_;
	ComposerWidgetHeaderRow* _tmp105_;
	gconstpointer _tmp106_;
	gconstpointer _tmp107_;
	gboolean _tmp108_;
	gboolean _tmp109_;
	ComposerWidgetHeaderRow* _tmp110_;
	gconstpointer _tmp111_;
	gconstpointer _tmp112_;
	gboolean _tmp113_;
	gboolean _tmp114_;
	gboolean _tmp115_;
	ComposerWidgetHeaderRow* _tmp116_;
	gconstpointer _tmp117_;
	gconstpointer _tmp118_;
	gboolean _tmp119_;
	gboolean _tmp120_;
	ComposerWidgetHeaderRow* _tmp121_;
	gconstpointer _tmp122_;
	gconstpointer _tmp123_;
	gboolean _tmp124_;
	gboolean _tmp125_;
	GSimpleActionGroup* _tmp126_;
	GVariant* _tmp127_;
	GError* _inner_error0_;
};

struct _ComposerWidgetToComposedEmailData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	GDateTime* date_override;
	gboolean for_draft;
	GearyComposedEmail* result;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GearyComposedEmail* email;
	GearyRFC822MailboxAddresses* _tmp3_;
	GearyComposedEmail* _tmp4_;
	GearyComposedEmail* _tmp5_;
	ComposerWidgetHeaderRow* _tmp6_;
	gconstpointer _tmp7_;
	gconstpointer _tmp8_;
	GearyRFC822MailboxAddresses* _tmp9_;
	GearyRFC822MailboxAddresses* _tmp10_;
	GearyComposedEmail* _tmp11_;
	GearyComposedEmail* _tmp12_;
	ComposerWidgetHeaderRow* _tmp13_;
	gconstpointer _tmp14_;
	gconstpointer _tmp15_;
	GearyRFC822MailboxAddresses* _tmp16_;
	GearyRFC822MailboxAddresses* _tmp17_;
	GearyComposedEmail* _tmp18_;
	GearyComposedEmail* _tmp19_;
	ComposerWidgetHeaderRow* _tmp20_;
	gconstpointer _tmp21_;
	gconstpointer _tmp22_;
	GearyRFC822MailboxAddresses* _tmp23_;
	GearyRFC822MailboxAddresses* _tmp24_;
	GearyComposedEmail* _tmp25_;
	GearyComposedEmail* _tmp26_;
	ComposerWidgetHeaderRow* _tmp27_;
	gconstpointer _tmp28_;
	gconstpointer _tmp29_;
	GearyRFC822MailboxAddresses* _tmp30_;
	GearyRFC822MailboxAddresses* _tmp31_;
	GearyComposedEmail* _tmp32_;
	GearyComposedEmail* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	GearyComposedEmail* _tmp36_;
	GearyComposedEmail* _tmp37_;
	GearyRFC822MessageIDList* _tmp38_;
	GearyComposedEmail* _tmp39_;
	GearyComposedEmail* _tmp40_;
	GearyRFC822MessageIDList* _tmp41_;
	GearyComposedEmail* _tmp42_;
	GearyComposedEmail* _tmp43_;
	GearyComposedEmail* _tmp44_;
	GeeSet* _tmp45_;
	GeeSet* _tmp46_;
	GeeSet* _tmp47_;
	GearyComposedEmail* _tmp48_;
	GeeMap* _tmp49_;
	GeeMap* _tmp50_;
	GeeMap* _tmp51_;
	GearyComposedEmail* _tmp52_;
	GeeMap* _tmp53_;
	GeeMap* _tmp54_;
	GeeMap* _tmp55_;
	GearyComposedEmail* _tmp56_;
	gchar* _tmp57_;
	ComposerEditor* _tmp58_;
	ComposerWebView* _tmp59_;
	ComposerWebView* _tmp60_;
	gchar* _tmp61_;
	GearyComposedEmail* _tmp62_;
	gchar* _tmp63_;
	ComposerEditor* _tmp64_;
	ComposerWebView* _tmp65_;
	ComposerWebView* _tmp66_;
	gchar* _tmp67_;
	GearyComposedEmail* _tmp68_;
	ComposerEditor* _tmp69_;
	ComposerWebView* _tmp70_;
	ComposerWebView* _tmp71_;
	gboolean _tmp72_;
	gboolean _tmp73_;
	gchar* _tmp74_;
	ComposerEditor* _tmp75_;
	ComposerWebView* _tmp76_;
	ComposerWebView* _tmp77_;
	gchar* _tmp78_;
	GearyComposedEmail* _tmp79_;
	GError* _error_;
	GError* _tmp80_;
	const gchar* _tmp81_;
	GearyComposedEmail* _tmp82_;
	const gchar* _tmp83_;
	gchar* _tmp84_;
	gchar* _tmp85_;
	gchar* _tmp86_;
	gchar* _tmp87_;
	GError* _inner_error0_;
};

struct _Block72Data {
	int _ref_count_;
	ComposerWidget* self;
	GearyAccount* current_account;
	gpointer _async_data_;
};

struct _ComposerWidgetFinishLoadingData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	gchar* body;
	gchar* quote;
	gboolean is_body_complete;
	Block72Data* _data72_;
	ComposerEditor* _tmp0_;
	ComposerWebView* _tmp1_;
	ComposerWebView* _tmp2_;
	ApplicationAccountContext* _tmp3_;
	GearyAccount* _tmp4_;
	GearyAccount* _tmp5_;
	GearyAccount* _tmp6_;
	GearyEmailIdentifier* _tmp7_;
};

struct _ComposerWidgetShouldSendData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	gboolean result;
	gboolean has_subject;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	gboolean has_attachment;
	GeeSet* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gboolean has_body;
	gchar* _tmp8_;
	ComposerEditor* _tmp9_;
	ComposerWebView* _tmp10_;
	ComposerWebView* _tmp11_;
	gchar* _tmp12_;
	GError* err;
	GError* _tmp13_;
	const gchar* _tmp14_;
	gchar* confirmation;
	gboolean _tmp15_;
	gboolean _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gboolean _tmp19_;
	gchar* _tmp20_;
	gchar* keywords;
	gchar* _tmp21_;
	gboolean* contains;
	ComposerEditor* _tmp22_;
	ComposerWebView* _tmp23_;
	ComposerWebView* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	gboolean* _tmp28_;
	gboolean _tmp29_;
	gboolean* _tmp30_;
	gboolean* _tmp31_;
	gchar* _tmp32_;
	const gchar* _tmp33_;
	ConfirmationDialog* dialog;
	ComposerContainer* _tmp34_;
	ComposerContainer* _tmp35_;
	GtkApplicationWindow* _tmp36_;
	GtkApplicationWindow* _tmp37_;
	const gchar* _tmp38_;
	ConfirmationDialog* _tmp39_;
	ConfirmationDialog* _tmp40_;
	GError* _inner_error0_;
};

struct _ComposerWidgetOnSendAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	ComposerEditor* _tmp0_;
	ComposerWebView* _tmp1_;
	ComposerWebView* _tmp2_;
	ComposerApplicationInterface* _tmp3_;
	ComposerContainer* _tmp4_;
	ComposerContainer* _tmp5_;
	ComposerContainer* _tmp6_;
	ComposerContainer* _tmp7_;
	GError* _error_;
	ComposerApplicationInterface* _tmp8_;
	ApplicationAccountContext* _tmp9_;
	GearyAccount* _tmp10_;
	GearyAccount* _tmp11_;
	GearyAccountInformation* _tmp12_;
	GearyAccountInformation* _tmp13_;
	GError* _tmp14_;
	GearyAccountProblemReport* _tmp15_;
	GearyAccountProblemReport* _tmp16_;
	GError* _inner_error0_;
};

struct _Block73Data {
	int _ref_count_;
	ComposerWidget* self;
	GCancellable* internal_cancellable;
	gpointer _async_data_;
};

struct _ComposerWidgetOpenDraftManagerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	GearyEmailIdentifier* editing_draft_id;
	Block73Data* _data73_;
	ApplicationAccountContext* _tmp0_;
	GearyAccount* _tmp1_;
	GearyAccount* _tmp2_;
	GearyAccountInformation* _tmp3_;
	GearyAccountInformation* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	ComposerHeaderbar* _tmp7_;
	GCancellable* _tmp8_;
	GCancellable* _tmp9_;
	GCancellable* _tmp10_;
	ApplicationAccountContext* _tmp11_;
	GCancellable* _tmp12_;
	GCancellable* _tmp13_;
	GCancellable* _tmp14_;
	GCancellable* _tmp15_;
	GearyFolder* target;
	GearyFolder* _tmp16_;
	GearyFolder* _tmp17_;
	GearyFolder* _tmp18_;
	GearyFolder* _tmp19_;
	ApplicationAccountContext* _tmp20_;
	GearyAccount* _tmp21_;
	GearyAccount* _tmp22_;
	GCancellable* _tmp23_;
	GearyFolder* _tmp24_;
	GearyFolder* _tmp25_;
	GearyEmailFlags* _tmp26_;
	GearyFolder* _tmp27_;
	GearyFolderSpecialUse _tmp28_;
	GearyFolderSpecialUse _tmp29_;
	GearyNamedFlag* _tmp30_;
	GearyNamedFlag* _tmp31_;
	GearyNamedFlag* _tmp32_;
	GearyEmailFlags* _tmp33_;
	GearyEmailFlags* _tmp34_;
	GearyEmailFlags* flags;
	GearyEmailFlags* _tmp35_;
	gboolean opened;
	GearyAppDraftManager* new_manager;
	ApplicationAccountContext* _tmp36_;
	GearyAccount* _tmp37_;
	GearyAccount* _tmp38_;
	GearyFolder* _tmp39_;
	GearyEmailFlags* _tmp40_;
	GCancellable* _tmp41_;
	GearyAppDraftManager* _tmp42_;
	GearyAppDraftManager* _tmp43_;
	gchar* _tmp44_;
	GearyAppDraftManager* _tmp45_;
	gchar* _tmp46_;
	GearyAppDraftManager* _tmp47_;
	GearyAppDraftManager* _tmp48_;
	GearyAppDraftManager* _tmp49_;
	GError* err;
	GError* _tmp50_;
	const gchar* _tmp51_;
	GError* _vala1_err;
	ComposerHeaderbar* _tmp52_;
	GError* _tmp53_;
	GError* _tmp54_;
	GError* _inner_error1_;
	ComposerHeaderbar* _tmp55_;
	GError* _inner_error0_;
};

struct _ComposerWidgetReopenDraftManagerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	GearyAccount* current_account;
	ApplicationAccountContext* _tmp0_;
	GearyAccount* _tmp1_;
	GearyAccount* _tmp2_;
	GearyAccount* _tmp3_;
	GError* _error_;
	ComposerApplicationInterface* _tmp4_;
	GearyAccount* _tmp5_;
	GearyAccountInformation* _tmp6_;
	GearyAccountInformation* _tmp7_;
	GError* _tmp8_;
	GearyAccountProblemReport* _tmp9_;
	GearyAccountProblemReport* _tmp10_;
	GError* _inner_error0_;
};

struct _ComposerWidgetCloseDraftManagerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	ComposerWidgetDraftPolicy draft_policy;
	GearyAppDraftManager* old_manager;
	GearyAppDraftManager* _tmp0_;
	GearyAppDraftManager* _tmp1_;
	GearyAppDraftManager* _tmp2_;
	GearyTimeoutManager* _tmp3_;
	GearyAppDraftManager* _tmp4_;
	gchar* _tmp5_;
	guint _tmp6_;
	GQuark _tmp7_;
	GearyAppDraftManager* _tmp8_;
	gchar* _tmp9_;
	guint _tmp10_;
	GQuark _tmp11_;
	GearyAppDraftManager* _tmp12_;
	guint _tmp13_;
	GearyAppDraftManager* _tmp14_;
	GearyAppDraftManager* _tmp15_;
	GError* _inner_error0_;
};

struct _ComposerWidgetSaveDraftData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	GearyTimeoutManager* _tmp0_;
	GearyAppDraftManager* _tmp1_;
	GearyComposedEmail* draft;
	GearyComposedEmail* _tmp2_;
	GearyRFC822Message* _tmp3_;
	GearyComposedEmail* _tmp4_;
	GearyRFC822Message* _tmp5_;
	GearyAppDraftManager* _tmp6_;
	GError* _inner_error0_;
};

struct _ComposerWidgetSaveAndCloseData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GError* _error_;
	ComposerApplicationInterface* _tmp2_;
	ApplicationAccountContext* _tmp3_;
	GearyAccount* _tmp4_;
	GearyAccount* _tmp5_;
	GearyAccountInformation* _tmp6_;
	GearyAccountInformation* _tmp7_;
	GError* _tmp8_;
	GearyAccountProblemReport* _tmp9_;
	GearyAccountProblemReport* _tmp10_;
	ComposerContainer* _tmp11_;
	ComposerContainer* _tmp12_;
	ComposerContainer* _tmp13_;
	ComposerContainer* _tmp14_;
	ComposerApplicationInterface* _tmp15_;
	GError* _inner_error0_;
};

struct _ComposerWidgetDiscardAndCloseData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	ComposerApplicationInterface* _tmp0_;
	GError* _error_;
	ComposerApplicationInterface* _tmp1_;
	ApplicationAccountContext* _tmp2_;
	GearyAccount* _tmp3_;
	GearyAccount* _tmp4_;
	GearyAccountInformation* _tmp5_;
	GearyAccountInformation* _tmp6_;
	GError* _tmp7_;
	GearyAccountProblemReport* _tmp8_;
	GearyAccountProblemReport* _tmp9_;
	ComposerContainer* _tmp10_;
	ComposerContainer* _tmp11_;
	ComposerContainer* _tmp12_;
	ComposerContainer* _tmp13_;
	GError* _inner_error0_;
};

struct _Block74Data {
	int _ref_count_;
	ComposerWidget* self;
	GtkBox* wrapper_box;
	GFile* target;
};

struct _Block75Data {
	int _ref_count_;
	ComposerWidget* self;
	GdkPixbuf* pixbuf;
};

struct _Block76Data {
	int _ref_count_;
	Block75Data * _data75_;
	GMemoryOutputStream* os;
};

struct _ComposerWidgetFromAddressMap {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ApplicationAccountContext* account;
	GearyRFC822MailboxAddresses* from;
	ComposerWidgetFromAddressMapPrivate * priv;
};

struct _ComposerWidgetFromAddressMapClass {
	GTypeClass parent_class;
	void (*finalize) (ComposerWidgetFromAddressMap *self);
};

struct _ComposerWidgetUpdateSignatureData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ComposerWidget* self;
	GCancellable* cancellable;
	gchar* sig;
	gchar* _tmp0_;
	GearyAccountInformation* account;
	ApplicationAccountContext* _tmp1_;
	GearyAccount* _tmp2_;
	GearyAccount* _tmp3_;
	GearyAccountInformation* _tmp4_;
	GearyAccountInformation* _tmp5_;
	GearyAccountInformation* _tmp6_;
	GearyAccountInformation* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	GearyAccountInformation* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	GFile* signature_file;
	const gchar* _tmp15_;
	GFile* _tmp16_;
	GFile* _tmp17_;
	GFile* _tmp18_;
	GFile* _tmp19_;
	guint8* data;
	gint data_length1;
	gint _data_size_;
	GFile* _tmp20_;
	guint8* _tmp21_;
	gsize _tmp22_;
	guint8* _tmp23_;
	gint _tmp23__length1;
	gchar* _tmp24_;
	GError* _error_;
	GError* _tmp25_;
	GFile* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	GError* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	gchar* _tmp32_;
	ComposerEditor* _tmp33_;
	ComposerWebView* _tmp34_;
	ComposerWebView* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	GError* _inner_error0_;
};

struct _Block77Data {
	int _ref_count_;
	ComposerWidget* self;
	GearyAccount* current_account;
};

struct _ComposerWidgetHeaderRow {
	GtkBox parent_instance;
	ComposerWidgetHeaderRowPrivate * priv;
};

struct _ComposerWidgetHeaderRowClass {
	GtkBoxClass parent_class;
};

struct _ComposerWidgetHeaderRowPrivate {
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	GtkLabel* _label;
	GtkBox* _value_container;
	gpointer _value;
};

struct _ComposerWidgetEntryHeaderRow {
	ComposerWidgetHeaderRow parent_instance;
	ComposerWidgetEntryHeaderRowPrivate * priv;
};

struct _ComposerWidgetEntryHeaderRowClass {
	ComposerWidgetHeaderRowClass parent_class;
};

struct _ComposerWidgetEntryHeaderRowPrivate {
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	ComponentsEntryUndo* _undo;
};

struct _ComposerWidgetParamSpecFromAddressMap {
	GParamSpec parent_instance;
};

static gint ComposerWidget_private_offset;
static gpointer composer_widget_parent_class = NULL;
static gint ComposerWidgetHeaderRow_private_offset;
static gpointer composer_widget_header_row_parent_class = NULL;
static GearyBaseInterfaceIface * composer_widget_header_row_geary_base_interface_parent_iface = NULL;
static gint ComposerWidgetEntryHeaderRow_private_offset;
static gpointer composer_widget_entry_header_row_parent_class = NULL;
static gpointer composer_widget_from_address_map_parent_class = NULL;
static GearyBaseInterfaceIface * composer_widget_geary_base_interface_parent_iface = NULL;

VALA_EXTERN GQuark attachment_error_quark (void);
VALA_EXTERN GType attachment_error_get_type (void) G_GNUC_CONST ;
static gpointer composer_widget_from_address_map_ref (gpointer instance);
static void composer_widget_from_address_map_unref (gpointer instance);
static GParamSpec* composer_widget_param_spec_from_address_map (const gchar* name,
                                                         const gchar* nick,
                                                         const gchar* blurb,
                                                         GType object_type,
                                                         GParamFlags flags) G_GNUC_UNUSED ;
static void composer_widget_value_set_from_address_map (GValue* value,
                                                 gpointer v_object) G_GNUC_UNUSED ;
static void composer_widget_value_take_from_address_map (GValue* value,
                                                  gpointer v_object) G_GNUC_UNUSED ;
static gpointer composer_widget_value_get_from_address_map (const GValue* value) G_GNUC_UNUSED ;
static GType composer_widget_from_address_map_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType composer_widget_header_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType composer_widget_attach_pending_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GType application_account_interface_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType composer_application_interface_get_type (void) G_GNUC_CONST ;
static GType composer_widget_draft_policy_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void composer_widget_on_copy (ComposerWidget* self,
                              GSimpleAction* action,
                              GVariant* param);
static void _composer_widget_on_copy_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self);
static void composer_widget_on_close (ComposerWidget* self);
static void _composer_widget_on_close_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static void composer_widget_on_show_help_overlay (ComposerWidget* self);
static void _composer_widget_on_show_help_overlay_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self);
static void composer_widget_on_show_window_menu (ComposerWidget* self);
static void _composer_widget_on_show_window_menu_gsimple_action_activate_callback (GSimpleAction* action,
                                                                            GVariant* parameter,
                                                                            gpointer self);
static void composer_widget_on_add_attachment (ComposerWidget* self);
static void _composer_widget_on_add_attachment_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self);
static void composer_widget_on_pending_attachments (ComposerWidget* self);
static void _composer_widget_on_pending_attachments_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void composer_widget_on_cut (ComposerWidget* self,
                             GSimpleAction* action,
                             GVariant* param);
static void _composer_widget_on_cut_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void composer_widget_on_detach (ComposerWidget* self);
static void _composer_widget_on_detach_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self);
static void composer_widget_on_discard (ComposerWidget* self);
static void _composer_widget_on_discard_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self);
static void composer_widget_on_paste (ComposerWidget* self,
                               GSimpleAction* action,
                               GVariant* param);
static void _composer_widget_on_paste_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static void composer_widget_on_send (ComposerWidget* self);
static void _composer_widget_on_send_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self);
static void composer_widget_on_toggle_action (ComposerWidget* self,
                                       GSimpleAction* action,
                                       GVariant* param);
static void _composer_widget_on_toggle_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                         GVariant* parameter,
                                                                         gpointer self);
static void composer_widget_on_show_extended_headers_toggled (ComposerWidget* self,
                                                       GSimpleAction* action,
                                                       GVariant* new_state);
static void _composer_widget_on_show_extended_headers_toggled_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                             GVariant* value,
                                                                                             gpointer self);
static void composer_widget_set_sender_context (ComposerWidget* self,
                                         ApplicationAccountContext* value);
static void composer_widget_set_saved_id (ComposerWidget* self,
                                   GearyEmailIdentifier* value);
static void composer_widget_set_context_type (ComposerWidget* self,
                                       ComposerWidgetContextType value);
static gconstpointer composer_widget_header_row_get_value (ComposerWidgetHeaderRow* self);
static void composer_widget_set_editor (ComposerWidget* self,
                                 ComposerEditor* value);
static void composer_widget_set_focused_input_widget (ComposerWidget* self,
                                               GtkWidget* value);
static void composer_widget_validate_send_button (ComposerWidget* self);
static void composer_widget_set_from (ComposerWidget* self,
                               GearyRFC822MailboxAddresses* value);
static void composer_widget_set_to (ComposerWidget* self,
                             const gchar* value);
static void composer_widget_set_cc (ComposerWidget* self,
                             const gchar* value);
static void composer_widget_set_bcc (ComposerWidget* self,
                              const gchar* value);
static void composer_widget_set_reply_to (ComposerWidget* self,
                                   const gchar* value);
static void composer_widget_set_subject (ComposerWidget* self,
                                  const gchar* value);
static void composer_widget_set_in_reply_to (ComposerWidget* self,
                                      GearyRFC822MessageIDList* value);
static void composer_widget_set_references (ComposerWidget* self,
                                     GearyRFC822MessageIDList* value);
VALA_EXTERN GearyFolder* composer_widget_get_save_to (ComposerWidget* self);
static void composer_widget_set_save_to (ComposerWidget* self,
                                  GearyFolder* value);
VALA_EXTERN ComposerHeaderbar* composer_widget_get_header (ComposerWidget* self);
static void composer_widget_set_header (ComposerWidget* self,
                                 ComposerHeaderbar* value);
VALA_EXTERN gboolean composer_widget_get_has_multiple_from_addresses (ComposerWidget* self);
VALA_EXTERN GeeCollection* application_account_interface_get_account_contexts (ApplicationAccountInterface* self);
static gboolean composer_widget_get_can_save (ComposerWidget* self);
static gboolean composer_widget_get_should_save (ComposerWidget* self);
static guint _geary_files_nullable_hash_gee_hash_data_func (gconstpointer v,
                                                     gpointer self);
static gboolean _geary_files_nullable_equal_gee_equal_data_func (gconstpointer a,
                                                          gconstpointer b,
                                                          gpointer self);
static const gchar* composer_widget_get_draft_status_text (ComposerWidget* self);
static void composer_widget_set_draft_status_text (ComposerWidget* self,
                                            const gchar* value);
static void composer_widget_update_info_label (ComposerWidget* self);
static gboolean composer_widget_get_can_delete_quote (ComposerWidget* self);
static void composer_widget_set_can_delete_quote (ComposerWidget* self,
                                           gboolean value);
static ComposerContainer* composer_widget_get_container (ComposerWidget* self);
VALA_EXTERN ComposerWidget* composer_widget_new (ComposerApplicationInterface* application,
                                     ApplicationConfiguration* config,
                                     ApplicationAccountContext* initial_account,
                                     GearyFolder* save_to);
VALA_EXTERN ComposerWidget* composer_widget_construct (GType object_type,
                                           ComposerApplicationInterface* application,
                                           ApplicationConfiguration* config,
                                           ApplicationAccountContext* initial_account,
                                           GearyFolder* save_to);
GType components_reflow_box_get_type (void);
static void composer_widget_on_expand_compact_headers (ComposerWidget* self);
static void _composer_widget_on_expand_compact_headers_composer_headerbar_expand_composer (ComposerHeaderbar* _sender,
                                                                                    gpointer self);
static ComposerWidgetHeaderRow* composer_widget_header_row_new (GType t_type,
                                                         GBoxedCopyFunc t_dup_func,
                                                         GDestroyNotify t_destroy_func,
                                                         const gchar* label,
                                                         gconstpointer value);
static ComposerWidgetHeaderRow* composer_widget_header_row_construct (GType object_type,
                                                               GType t_type,
                                                               GBoxedCopyFunc t_dup_func,
                                                               GDestroyNotify t_destroy_func,
                                                               const gchar* label,
                                                               gconstpointer value);
static void composer_widget_on_envelope_changed (ComposerWidget* self);
static void _composer_widget_on_envelope_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                 gpointer self);
static GtkLabel* composer_widget_header_row_get_label (ComposerWidgetHeaderRow* self);
static ComposerWidgetEntryHeaderRow* composer_widget_entry_header_row_new (GType t_type,
                                                                    GBoxedCopyFunc t_dup_func,
                                                                    GDestroyNotify t_destroy_func,
                                                                    const gchar* label,
                                                                    gconstpointer value);
static ComposerWidgetEntryHeaderRow* composer_widget_entry_header_row_construct (GType object_type,
                                                                          GType t_type,
                                                                          GBoxedCopyFunc t_dup_func,
                                                                          GDestroyNotify t_destroy_func,
                                                                          const gchar* label,
                                                                          gconstpointer value);
static GType composer_widget_entry_header_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GtkBox* composer_widget_header_row_get_value_container (ComposerWidgetHeaderRow* self);
static void _composer_widget_on_envelope_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                gpointer self);
static void composer_widget_on_subject_changed (ComposerWidget* self);
static void _composer_widget_on_subject_changed_gtk_editable_changed (GtkEditable* _sender,
                                                               gpointer self);
static void __lambda188_ (ComposerWidget* self);
static void composer_widget_update_subject_spell_checker (ComposerWidget* self);
static void ___lambda188__g_settings_changed (GSettings* _sender,
                                       const gchar* key,
                                       gpointer self);
VALA_EXTERN ComposerEditor* composer_editor_new (ApplicationConfiguration* config);
VALA_EXTERN ComposerEditor* composer_editor_construct (GType object_type,
                                           ApplicationConfiguration* config);
static void __lambda189_ (ComposerWidget* self,
                   gboolean from_clipboard);
static void composer_widget_paste_image (ComposerWidget* self);
static void composer_widget_insert_image (ComposerWidget* self);
static void ___lambda189__composer_editor_insert_image (ComposerEditor* _sender,
                                                 gboolean from_clipboard,
                                                 gpointer self);
static void composer_widget_on_content_loaded (ComposerWidget* self);
static void _composer_widget_on_content_loaded_components_web_view_content_loaded (ComponentsWebView* _sender,
                                                                            gpointer self);
static void __lambda193_ (ComposerWidget* self);
static inline void composer_widget_draft_changed (ComposerWidget* self);
static void ___lambda193__components_web_view_document_modified (ComponentsWebView* _sender,
                                                          gpointer self);
static gboolean composer_widget_on_editor_key_press_event (ComposerWidget* self,
                                                    GdkEventKey* event);
static gboolean _composer_widget_on_editor_key_press_event_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                GdkEventKey* event,
                                                                                gpointer self);
static void composer_widget_on_account_available (ComposerWidget* self);
static void _composer_widget_on_account_available_application_account_interface_account_available (ApplicationAccountInterface* _sender,
                                                                                            ApplicationAccountContext* context,
                                                                                            gboolean is_startup,
                                                                                            gpointer self);
static void composer_widget_on_account_unavailable (ComposerWidget* self);
static void _composer_widget_on_account_unavailable_application_account_interface_account_unavailable (ApplicationAccountInterface* _sender,
                                                                                                ApplicationAccountContext* context,
                                                                                                gboolean is_shutdown,
                                                                                                gpointer self);
static void composer_widget_on_image_file_dropped (ComposerWidget* self,
                                            const gchar* filename,
                                            const gchar* file_type,
                                            guint8* contents,
                                            gint contents_length1);
static void _composer_widget_on_image_file_dropped_composer_web_view_image_file_dropped (ComposerWebView* _sender,
                                                                                  const gchar* filename,
                                                                                  const gchar* type,
                                                                                  guint8* contents,
                                                                                  gint contents_length1,
                                                                                  gpointer self);
static void composer_widget_on_draft_timeout (ComposerWidget* self);
static void _composer_widget_on_draft_timeout_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                           gpointer self);
static GVariant* _variant_new21 (gboolean value);
static void composer_widget_load_entry_completions (ComposerWidget* self);
static void composer_widget_load_empty_body_data_free (gpointer _data);
static gboolean composer_widget_load_empty_body_co (ComposerWidgetLoadEmptyBodyData* _data_);
static void composer_widget_update_extended_headers (ComposerWidget* self,
                                              gboolean reorder);
static void composer_widget_finish_loading (ComposerWidget* self,
                                     const gchar* body,
                                     const gchar* quote,
                                     gboolean is_body_complete,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static void composer_widget_finish_loading_finish (ComposerWidget* self,
                                            GAsyncResult* _res_);
static void composer_widget_load_empty_body_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void composer_widget_load_mailto_data_free (gpointer _data);
static gboolean composer_widget_load_mailto_co (ComposerWidgetLoadMailtoData* _data_);
static void composer_widget_add_attachment_part (ComposerWidget* self,
                                          GFile* target,
                                          GError** error);
static void composer_widget_attachment_failed (ComposerWidget* self,
                                        const gchar* msg);
static void composer_widget_load_mailto_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void composer_widget_load_context_data_free (gpointer _data);
static gboolean composer_widget_load_context_co (ComposerWidgetLoadContextData* _data_);
static void composer_widget_load_context_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void composer_widget_restore_reply_to_state (ComposerWidget* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void composer_widget_restore_reply_to_state_finish (ComposerWidget* self,
                                                    GAsyncResult* _res_);
static gboolean composer_widget_update_from_address (ComposerWidget* self,
                                              GearyRFC822MailboxAddresses* referred_addresses);
static void composer_widget_add_recipients_and_ids (ComposerWidget* self,
                                             ComposerWidgetContextType type,
                                             GearyEmail* referred);
static GVariant* _variant_new22 (const gchar* value);
VALA_EXTERN void composer_widget_set_mode (ComposerWidget* self,
                               ComposerWidgetPresentationMode new_mode);
VALA_EXTERN GType alert_dialog_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType ternary_confirmation_dialog_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TernaryConfirmationDialog* ternary_confirmation_dialog_new (GtkWindow* parent,
                                                            const gchar* title,
                                                            const gchar* description,
                                                            const gchar* ok_button,
                                                            const gchar* tertiary_button,
                                                            GtkResponseType tertiary_response_type,
                                                            const gchar* ok_action_type,
                                                            const gchar* tertiary_action_type,
                                                            GtkResponseType* default_response);
VALA_EXTERN TernaryConfirmationDialog* ternary_confirmation_dialog_construct (GType object_type,
                                                                  GtkWindow* parent,
                                                                  const gchar* title,
                                                                  const gchar* description,
                                                                  const gchar* ok_button,
                                                                  const gchar* tertiary_button,
                                                                  GtkResponseType tertiary_response_type,
                                                                  const gchar* ok_action_type,
                                                                  const gchar* tertiary_action_type,
                                                                  GtkResponseType* default_response);
VALA_EXTERN GtkResponseType alert_dialog_run (AlertDialog* self);
static void composer_widget_save_and_close (ComposerWidget* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static void composer_widget_save_and_close_finish (ComposerWidget* self,
                                            GAsyncResult* _res_);
static void composer_widget_discard_and_close (ComposerWidget* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static void composer_widget_discard_and_close_finish (ComposerWidget* self,
                                               GAsyncResult* _res_);
VALA_EXTERN ConfirmationDialog* confirmation_dialog_new (GtkWindow* parent,
                                             const gchar* title,
                                             const gchar* description,
                                             const gchar* ok_button,
                                             const gchar* ok_action_type);
VALA_EXTERN ConfirmationDialog* confirmation_dialog_construct (GType object_type,
                                                   GtkWindow* parent,
                                                   const gchar* title,
                                                   const gchar* description,
                                                   const gchar* ok_button,
                                                   const gchar* ok_action_type);
VALA_EXTERN GType confirmation_dialog_get_type (void) G_GNUC_CONST ;
static void composer_widget_close_data_free (gpointer _data);
static gboolean composer_widget_close_co (ComposerWidgetCloseData* _data_);
static void composer_widget_close_draft_manager (ComposerWidget* self,
                                          ComposerWidgetDraftPolicy draft_policy,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void composer_widget_close_draft_manager_finish (ComposerWidget* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static void composer_widget_close_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_);
VALA_EXTERN void composer_application_interface_report_problem (ComposerApplicationInterface* self,
                                                    GearyProblemReport* report);
static void composer_widget_real_destroy (GtkWidget* base);
static Block71Data* block71_data_ref (Block71Data* _data71_);
static void block71_data_unref (void * _userdata_);
static void composer_widget_open_draft_manager (ComposerWidget* self,
                                         GearyEmailIdentifier* editing_draft_id,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static void composer_widget_open_draft_manager_finish (ComposerWidget* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static void ___lambda48_ (Block71Data* _data71_,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda48__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void composer_widget_reopen_draft_manager (ComposerWidget* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static void composer_widget_reopen_draft_manager_finish (ComposerWidget* self,
                                                  GAsyncResult* _res_);
static void composer_widget_restore_reply_to_state_data_free (gpointer _data);
static gboolean composer_widget_restore_reply_to_state_co (ComposerWidgetRestoreReplyToStateData* _data_);
static void composer_widget_restore_reply_to_state_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static GVariant* _variant_new23 (gboolean value);
static void _____lambda49_ (ComposerWidget* self);
static void ______lambda49__components_web_view_content_loaded (ComponentsWebView* _sender,
                                                         gpointer self);
static void composer_widget_update_signature (ComposerWidget* self,
                                       GCancellable* cancellable,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static void composer_widget_update_signature_finish (ComposerWidget* self,
                                              GAsyncResult* _res_);
static void ___lambda192_ (ComposerWidget* self);
static void ____lambda192__g_object_notify (GObject* _sender,
                                     GParamSpec* pspec,
                                     gpointer self);
static void composer_widget_show_attachment_overlay (ComposerWidget* self,
                                              gboolean visible);
static void composer_widget_on_set_focus_child (ComposerWidget* self);
static void _composer_widget_on_set_focus_child_gtk_container_set_focus_child (GtkContainer* _sender,
                                                                        GtkWidget* child,
                                                                        gpointer self);
static gboolean composer_widget_on_drag_motion (ComposerWidget* self);
static gboolean _composer_widget_on_drag_motion_gtk_widget_drag_motion (GtkWidget* _sender,
                                                                 GdkDragContext* context,
                                                                 gint x,
                                                                 gint y,
                                                                 guint time_,
                                                                 gpointer self);
static void composer_widget_on_drag_leave (ComposerWidget* self);
static void _composer_widget_on_drag_leave_gtk_widget_drag_leave (GtkWidget* _sender,
                                                           GdkDragContext* context,
                                                           guint time_,
                                                           gpointer self);
static void composer_widget_on_drag_data_received (ComposerWidget* self,
                                            GtkWidget* sender,
                                            GdkDragContext* context,
                                            gint x,
                                            gint y,
                                            GtkSelectionData* selection_data,
                                            guint info,
                                            guint time_);
static void _composer_widget_on_drag_data_received_gtk_widget_drag_data_received (GtkWidget* _sender,
                                                                           GdkDragContext* context,
                                                                           gint x,
                                                                           gint y,
                                                                           GtkSelectionData* selection_data,
                                                                           guint info,
                                                                           guint time_,
                                                                           gpointer self);
static gboolean composer_widget_on_drag_drop (ComposerWidget* self,
                                       GtkWidget* sender,
                                       GdkDragContext* context,
                                       gint x,
                                       gint y,
                                       guint time_);
static GdkAtom* _gdk_atom_dup (GdkAtom* self);
static gboolean _composer_widget_on_drag_drop_gtk_widget_drag_drop (GtkWidget* _sender,
                                                             GdkDragContext* context,
                                                             gint x,
                                                             gint y,
                                                             guint time_,
                                                             gpointer self);
static void composer_widget_to_composed_email_data_free (gpointer _data);
static gboolean composer_widget_to_composed_email_co (ComposerWidgetToComposedEmailData* _data_);
static void composer_widget_to_composed_email_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static gboolean composer_widget_real_key_press_event (GtkWidget* base,
                                               GdkEventKey* event);
static gboolean composer_widget_check_send_on_return (ComposerWidget* self,
                                               GdkEventKey* event);
VALA_EXTERN void composer_headerbar_set_mode (ComposerHeaderbar* self,
                                  ComposerWidgetPresentationMode mode);
static void composer_widget_set_compact_header_recipients (ComposerWidget* self);
static gboolean composer_widget_update_from_field (ComposerWidget* self);
VALA_EXTERN void composer_widget_embed_header (ComposerWidget* self);
VALA_EXTERN void composer_widget_free_header (ComposerWidget* self);
static void composer_widget_finish_loading_data_free (gpointer _data);
static gboolean composer_widget_finish_loading_co (ComposerWidgetFinishLoadingData* _data_);
static Block72Data* block72_data_ref (Block72Data* _data72_);
static void block72_data_unref (void * _userdata_);
static void composer_widget_update_attachments_view (ComposerWidget* self);
static gboolean composer_widget_update_pending_attachments (ComposerWidget* self,
                                                     ComposerWidgetAttachPending include,
                                                     gboolean do_add);
static void __lambda79_ (Block72Data* _data72_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda79__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void composer_widget_should_send_data_free (gpointer _data);
static void composer_widget_should_send (ComposerWidget* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
static gboolean composer_widget_should_send_finish (ComposerWidget* self,
                                             GAsyncResult* _res_);
static gboolean composer_widget_should_send_co (ComposerWidgetShouldSendData* _data_);
static void composer_widget_should_send_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void __lambda187_ (ComposerWidget* self,
                   GObject* obj,
                   GAsyncResult* res);
static void composer_widget_on_send_async (ComposerWidget* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
static void composer_widget_on_send_finish (ComposerWidget* self,
                                     GAsyncResult* _res_);
static void ___lambda187__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void composer_widget_on_send_async_data_free (gpointer _data);
static gboolean composer_widget_on_send_async_co (ComposerWidgetOnSendAsyncData* _data_);
static void composer_widget_on_send_async_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
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_);
static void composer_widget_open_draft_manager_data_free (gpointer _data);
static gboolean composer_widget_open_draft_manager_co (ComposerWidgetOpenDraftManagerData* _data_);
static Block73Data* block73_data_ref (Block73Data* _data73_);
static void block73_data_unref (void * _userdata_);
static void __lambda19_ (Block73Data* _data73_);
static void ___lambda19__g_cancellable_cancelled (GCancellable* _sender,
                                           gpointer self);
static void composer_widget_open_draft_manager_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void composer_widget_on_draft_state_changed (ComposerWidget* self);
static void _composer_widget_on_draft_state_changed_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self);
static void composer_widget_on_draft_id_changed (ComposerWidget* self);
static void _composer_widget_on_draft_id_changed_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self);
static void composer_widget_on_draft_manager_fatal (ComposerWidget* self,
                                             GError* err);
static void _composer_widget_on_draft_manager_fatal_geary_app_draft_manager_fatal (GearyAppDraftManager* _sender,
                                                                            GError* err,
                                                                            gpointer self);
static void composer_widget_update_draft_state (ComposerWidget* self);
static void composer_widget_reopen_draft_manager_data_free (gpointer _data);
static gboolean composer_widget_reopen_draft_manager_co (ComposerWidgetReopenDraftManagerData* _data_);
static void composer_widget_reopen_draft_manager_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void composer_widget_save_draft (ComposerWidget* self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
static void composer_widget_save_draft_finish (ComposerWidget* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static void composer_widget_close_draft_manager_data_free (gpointer _data);
static gboolean composer_widget_close_draft_manager_co (ComposerWidgetCloseDraftManagerData* _data_);
static void composer_widget_close_draft_manager_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void composer_widget_save_draft_data_free (gpointer _data);
static gboolean composer_widget_save_draft_co (ComposerWidgetSaveDraftData* _data_);
static void composer_widget_save_draft_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void composer_widget_save_and_close_data_free (gpointer _data);
static gboolean composer_widget_save_and_close_co (ComposerWidgetSaveAndCloseData* _data_);
static void composer_widget_save_and_close_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
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_);
static void composer_widget_discard_and_close_data_free (gpointer _data);
static gboolean composer_widget_discard_and_close_co (ComposerWidgetDiscardAndCloseData* _data_);
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 void composer_widget_discard_and_close_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static GearyMimeDispositionType* _geary_mime_disposition_type_dup (GearyMimeDispositionType* self);
static gboolean _geary_mime_disposition_type_equal (const GearyMimeDispositionType * s1,
                                             const GearyMimeDispositionType * s2);
static GFileInfo* composer_widget_check_attachment_file (ComposerWidget* self,
                                                  GFile* target,
                                                  GError** error);
static void composer_widget_add_inline_part (ComposerWidget* self,
                                      GearyMemoryBuffer* target,
                                      const gchar* content_id,
                                      gchar** unique_contentid,
                                      GError** error);
static Block74Data* block74_data_ref (Block74Data* _data74_);
static void block74_data_unref (void * _userdata_);
static gboolean _util_gtk_query_tooltip_label_gtk_widget_query_tooltip (GtkWidget* _sender,
                                                                 gint x,
                                                                 gint y,
                                                                 gboolean keyboard_tooltip,
                                                                 GtkTooltip* tooltip,
                                                                 gpointer self);
static void __lambda78_ (Block74Data* _data74_);
static void composer_widget_remove_attachment (ComposerWidget* self,
                                        GFile* file,
                                        GtkBox* box);
static void ___lambda78__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
VALA_EXTERN GType error_dialog_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ErrorDialog* error_dialog_new (GtkWindow* parent,
                               const gchar* title,
                               const gchar* description);
VALA_EXTERN ErrorDialog* error_dialog_construct (GType object_type,
                                     GtkWindow* parent,
                                     const gchar* title,
                                     const gchar* description);
VALA_EXTERN void composer_editor_start_background_work_pulse (ComposerEditor* self);
static void __lambda190_ (ComposerWidget* self,
                   GtkClipboard* clipboard,
                   GdkPixbuf* pixbuf);
static Block75Data* block75_data_ref (Block75Data* _data75_);
static void block75_data_unref (void * _userdata_);
static Block76Data* block76_data_ref (Block76Data* _data76_);
static void block76_data_unref (void * _userdata_);
static void ___lambda191_ (Block76Data* _data76_,
                    GObject* obj,
                    GAsyncResult* res);
VALA_EXTERN void composer_editor_stop_background_work_pulse (ComposerEditor* self);
static void ____lambda191__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void ___lambda190__gtk_clipboard_image_received_func (GtkClipboard* clipboard,
                                                      GdkPixbuf* pixbuf,
                                                      gpointer self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_slist_free__g_object_unref0_ (GSList* self);
static GSimpleAction* composer_widget_get_action (ComposerWidget* self,
                                           const gchar* action_name);
static GVariant* _variant_new24 (gboolean value);
static void composer_widget_reparent_widget (ComposerWidget* self,
                                      GtkWidget* child,
                                      GtkContainer* new_parent);
static GVariant* _variant_new25 (gboolean value);
static gboolean composer_widget_add_account_emails_to_from_list (ComposerWidget* self,
                                                          ApplicationAccountContext* other_account,
                                                          gboolean set_active);
static ComposerWidgetFromAddressMap* composer_widget_from_address_map_new (ApplicationAccountContext* account,
                                                                    GearyRFC822MailboxAddresses* from);
static ComposerWidgetFromAddressMap* composer_widget_from_address_map_construct (GType object_type,
                                                                          ApplicationAccountContext* account,
                                                                          GearyRFC822MailboxAddresses* from);
VALA_EXTERN void composer_editor_set_info_label (ComposerEditor* self,
                                     const gchar* text);
static void composer_widget_on_from_changed (ComposerWidget* self);
static void _composer_widget_on_from_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                             gpointer self);
static void composer_widget_update_from (ComposerWidget* self,
                                  GError** error);
static void composer_widget_update_signature_data_free (gpointer _data);
static gboolean composer_widget_update_signature_co (ComposerWidgetUpdateSignatureData* _data_);
static void composer_widget_update_signature_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static GspellLanguage* _vala_GspellLanguage_copy (GspellLanguage* self);
static void _vala_GspellLanguage_free (GspellLanguage* self);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
static Block77Data* block77_data_ref (Block77Data* _data77_);
static void block77_data_unref (void * _userdata_);
static void __lambda194_ (Block77Data* _data77_,
                   GObject* obj,
                   GAsyncResult* res);
static void ___lambda194__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void composer_widget_header_row_set_label (ComposerWidgetHeaderRow* self,
                                           GtkLabel* value);
static void composer_widget_header_row_set_value_container (ComposerWidgetHeaderRow* self,
                                                     GtkBox* value);
static void composer_widget_header_row_set_value (ComposerWidgetHeaderRow* self,
                                           gconstpointer value);
static void composer_widget_header_row_finalize (GObject * obj);
static GType composer_widget_header_row_get_type_once (void);
static void _vala_composer_widget_header_row_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_composer_widget_header_row_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static ComponentsEntryUndo* composer_widget_entry_header_row_get_undo (ComposerWidgetEntryHeaderRow* self);
static void composer_widget_entry_header_row_set_undo (ComposerWidgetEntryHeaderRow* self,
                                                ComponentsEntryUndo* value);
static void composer_widget_entry_header_row_finalize (GObject * obj);
static GType composer_widget_entry_header_row_get_type_once (void);
static void _vala_composer_widget_entry_header_row_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_composer_widget_entry_header_row_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec);
static void composer_widget_from_address_map_finalize (ComposerWidgetFromAddressMap * obj);
static GType composer_widget_from_address_map_get_type_once (void);
static void composer_widget_finalize (GObject * obj);
static GType composer_widget_get_type_once (void);
static void _vala_composer_widget_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_composer_widget_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static const GActionEntry COMPOSER_WIDGET_ACTIONS[13] = {{ACTION_EDIT_COPY, _composer_widget_on_copy_gsimple_action_activate_callback}, {ACTION_WINDOW_CLOSE, _composer_widget_on_close_gsimple_action_activate_callback}, {ACTION_WINDOW_SHOW_HELP_OVERLAY, _composer_widget_on_show_help_overlay_gsimple_action_activate_callback}, {ACTION_WINDOW_SHOW_MENU, _composer_widget_on_show_window_menu_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_ADD_ATTACHMENT, _composer_widget_on_add_attachment_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_ADD_ORIGINAL_ATTACHMENTS, _composer_widget_on_pending_attachments_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_CLOSE, _composer_widget_on_close_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_CUT, _composer_widget_on_cut_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_DETACH, _composer_widget_on_detach_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_DISCARD, _composer_widget_on_discard_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_PASTE, _composer_widget_on_paste_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_SEND, _composer_widget_on_send_gsimple_action_activate_callback}, {COMPOSER_WIDGET_ACTION_SHOW_EXTENDED_HEADERS, _composer_widget_on_toggle_action_gsimple_action_activate_callback, NULL, "false", _composer_widget_on_show_extended_headers_toggled_gsimple_action_change_state_callback}};

GQuark
attachment_error_quark (void)
{
	return g_quark_from_static_string ("attachment-error-quark");
}

static GType
attachment_error_get_type_once (void)
{
	static const GEnumValue values[] = {{ATTACHMENT_ERROR_FILE, "ATTACHMENT_ERROR_FILE", "file"}, {ATTACHMENT_ERROR_DUPLICATE, "ATTACHMENT_ERROR_DUPLICATE", "duplicate"}, {0, NULL, NULL}};
	GType attachment_error_type_id;
	attachment_error_type_id = g_enum_register_static ("AttachmentError", values);
	return attachment_error_type_id;
}

GType
attachment_error_get_type (void)
{
	static volatile gsize attachment_error_type_id__once = 0;
	if (g_once_init_enter (&attachment_error_type_id__once)) {
		GType attachment_error_type_id;
		attachment_error_type_id = attachment_error_get_type_once ();
		g_once_init_leave (&attachment_error_type_id__once, attachment_error_type_id);
	}
	return attachment_error_type_id__once;
}

static inline gpointer
composer_widget_get_instance_private (ComposerWidget* self)
{
	return G_STRUCT_MEMBER_P (self, ComposerWidget_private_offset);
}

/**
     * Determines the type of the context email passed to the composer
     *
     * @see context_type
     * @see load_context
     */
static GType
composer_widget_context_type_get_type_once (void)
{
	static const GEnumValue values[] = {{COMPOSER_WIDGET_CONTEXT_TYPE_NONE, "COMPOSER_WIDGET_CONTEXT_TYPE_NONE", "none"}, {COMPOSER_WIDGET_CONTEXT_TYPE_EDIT, "COMPOSER_WIDGET_CONTEXT_TYPE_EDIT", "edit"}, {COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_SENDER, "COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_SENDER", "reply-sender"}, {COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_ALL, "COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_ALL", "reply-all"}, {COMPOSER_WIDGET_CONTEXT_TYPE_FORWARD, "COMPOSER_WIDGET_CONTEXT_TYPE_FORWARD", "forward"}, {0, NULL, NULL}};
	GType composer_widget_context_type_type_id;
	composer_widget_context_type_type_id = g_enum_register_static ("ComposerWidgetContextType", values);
	return composer_widget_context_type_type_id;
}

GType
composer_widget_context_type_get_type (void)
{
	static volatile gsize composer_widget_context_type_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_context_type_type_id__once)) {
		GType composer_widget_context_type_type_id;
		composer_widget_context_type_type_id = composer_widget_context_type_get_type_once ();
		g_once_init_leave (&composer_widget_context_type_type_id__once, composer_widget_context_type_type_id);
	}
	return composer_widget_context_type_type_id__once;
}

/**
     * Determines the result of prompting whether to close the composer.
     *
     * @see conditional_close
     */
static GType
composer_widget_close_status_get_type_once (void)
{
	static const GEnumValue values[] = {{COMPOSER_WIDGET_CLOSE_STATUS_CLOSED, "COMPOSER_WIDGET_CLOSE_STATUS_CLOSED", "closed"}, {COMPOSER_WIDGET_CLOSE_STATUS_READY, "COMPOSER_WIDGET_CLOSE_STATUS_READY", "ready"}, {COMPOSER_WIDGET_CLOSE_STATUS_CANCELLED, "COMPOSER_WIDGET_CLOSE_STATUS_CANCELLED", "cancelled"}, {0, NULL, NULL}};
	GType composer_widget_close_status_type_id;
	composer_widget_close_status_type_id = g_enum_register_static ("ComposerWidgetCloseStatus", values);
	return composer_widget_close_status_type_id;
}

GType
composer_widget_close_status_get_type (void)
{
	static volatile gsize composer_widget_close_status_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_close_status_type_id__once)) {
		GType composer_widget_close_status_type_id;
		composer_widget_close_status_type_id = composer_widget_close_status_get_type_once ();
		g_once_init_leave (&composer_widget_close_status_type_id__once, composer_widget_close_status_type_id);
	}
	return composer_widget_close_status_type_id__once;
}

/** Defines different supported user interface modes. */
static GType
composer_widget_presentation_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{COMPOSER_WIDGET_PRESENTATION_MODE_CLOSED, "COMPOSER_WIDGET_PRESENTATION_MODE_CLOSED", "closed"}, {COMPOSER_WIDGET_PRESENTATION_MODE_NONE, "COMPOSER_WIDGET_PRESENTATION_MODE_NONE", "none"}, {COMPOSER_WIDGET_PRESENTATION_MODE_DETACHED, "COMPOSER_WIDGET_PRESENTATION_MODE_DETACHED", "detached"}, {COMPOSER_WIDGET_PRESENTATION_MODE_PANED, "COMPOSER_WIDGET_PRESENTATION_MODE_PANED", "paned"}, {COMPOSER_WIDGET_PRESENTATION_MODE_INLINE, "COMPOSER_WIDGET_PRESENTATION_MODE_INLINE", "inline"}, {COMPOSER_WIDGET_PRESENTATION_MODE_INLINE_COMPACT, "COMPOSER_WIDGET_PRESENTATION_MODE_INLINE_COMPACT", "inline-compact"}, {0, NULL, NULL}};
	GType composer_widget_presentation_mode_type_id;
	composer_widget_presentation_mode_type_id = g_enum_register_static ("ComposerWidgetPresentationMode", values);
	return composer_widget_presentation_mode_type_id;
}

GType
composer_widget_presentation_mode_get_type (void)
{
	static volatile gsize composer_widget_presentation_mode_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_presentation_mode_type_id__once)) {
		GType composer_widget_presentation_mode_type_id;
		composer_widget_presentation_mode_type_id = composer_widget_presentation_mode_get_type_once ();
		g_once_init_leave (&composer_widget_presentation_mode_type_id__once, composer_widget_presentation_mode_type_id);
	}
	return composer_widget_presentation_mode_type_id__once;
}

static GType
composer_widget_attach_pending_get_type_once (void)
{
	static const GEnumValue values[] = {{COMPOSER_WIDGET_ATTACH_PENDING_ALL, "COMPOSER_WIDGET_ATTACH_PENDING_ALL", "all"}, {COMPOSER_WIDGET_ATTACH_PENDING_INLINE_ONLY, "COMPOSER_WIDGET_ATTACH_PENDING_INLINE_ONLY", "inline-only"}, {0, NULL, NULL}};
	GType composer_widget_attach_pending_type_id;
	composer_widget_attach_pending_type_id = g_enum_register_static ("ComposerWidgetAttachPending", values);
	return composer_widget_attach_pending_type_id;
}

static GType
composer_widget_attach_pending_get_type (void)
{
	static volatile gsize composer_widget_attach_pending_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_attach_pending_type_id__once)) {
		GType composer_widget_attach_pending_type_id;
		composer_widget_attach_pending_type_id = composer_widget_attach_pending_get_type_once ();
		g_once_init_leave (&composer_widget_attach_pending_type_id__once, composer_widget_attach_pending_type_id);
	}
	return composer_widget_attach_pending_type_id__once;
}

static GType
composer_widget_draft_policy_get_type_once (void)
{
	static const GEnumValue values[] = {{COMPOSER_WIDGET_DRAFT_POLICY_DISCARD, "COMPOSER_WIDGET_DRAFT_POLICY_DISCARD", "discard"}, {COMPOSER_WIDGET_DRAFT_POLICY_KEEP, "COMPOSER_WIDGET_DRAFT_POLICY_KEEP", "keep"}, {0, NULL, NULL}};
	GType composer_widget_draft_policy_type_id;
	composer_widget_draft_policy_type_id = g_enum_register_static ("ComposerWidgetDraftPolicy", values);
	return composer_widget_draft_policy_type_id;
}

static GType
composer_widget_draft_policy_get_type (void)
{
	static volatile gsize composer_widget_draft_policy_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_draft_policy_type_id__once)) {
		GType composer_widget_draft_policy_type_id;
		composer_widget_draft_policy_type_id = composer_widget_draft_policy_get_type_once ();
		g_once_init_leave (&composer_widget_draft_policy_type_id__once, composer_widget_draft_policy_type_id);
	}
	return composer_widget_draft_policy_type_id__once;
}

static void
_composer_widget_on_copy_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self)
{
	composer_widget_on_copy ((ComposerWidget*) self, action, parameter);
}

static void
_composer_widget_on_close_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	composer_widget_on_close ((ComposerWidget*) self);
}

static void
_composer_widget_on_show_help_overlay_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self)
{
	composer_widget_on_show_help_overlay ((ComposerWidget*) self);
}

static void
_composer_widget_on_show_window_menu_gsimple_action_activate_callback (GSimpleAction* action,
                                                                       GVariant* parameter,
                                                                       gpointer self)
{
	composer_widget_on_show_window_menu ((ComposerWidget*) self);
}

static void
_composer_widget_on_add_attachment_gsimple_action_activate_callback (GSimpleAction* action,
                                                                     GVariant* parameter,
                                                                     gpointer self)
{
	composer_widget_on_add_attachment ((ComposerWidget*) self);
}

static void
_composer_widget_on_pending_attachments_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	composer_widget_on_pending_attachments ((ComposerWidget*) self);
}

static void
_composer_widget_on_cut_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	composer_widget_on_cut ((ComposerWidget*) self, action, parameter);
}

static void
_composer_widget_on_detach_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self)
{
	composer_widget_on_detach ((ComposerWidget*) self);
}

static void
_composer_widget_on_discard_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	composer_widget_on_discard ((ComposerWidget*) self);
}

static void
_composer_widget_on_paste_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	composer_widget_on_paste ((ComposerWidget*) self, action, parameter);
}

static void
_composer_widget_on_send_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self)
{
	composer_widget_on_send ((ComposerWidget*) self);
}

static void
_composer_widget_on_toggle_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self)
{
	composer_widget_on_toggle_action ((ComposerWidget*) self, action, parameter);
}

static void
_composer_widget_on_show_extended_headers_toggled_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                        GVariant* value,
                                                                                        gpointer self)
{
	composer_widget_on_show_extended_headers_toggled ((ComposerWidget*) self, action, value);
}

void
composer_widget_add_accelerators (ApplicationClient* application)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	gchar* _tmp9_;
	gchar** _tmp10_;
	gchar** _tmp11_;
	gint _tmp11__length1;
	gchar* _tmp12_;
	gchar** _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	g_return_if_fail (APPLICATION_IS_CLIENT (application));
	_tmp0_ = g_strdup ("Escape");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	application_client_add_window_accelerators (application, COMPOSER_WIDGET_ACTION_DISCARD, _tmp2_, (gint) 1, NULL);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	_tmp3_ = g_strdup ("<Ctrl>t");
	_tmp4_ = g_new0 (gchar*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 1;
	application_client_add_window_accelerators (application, COMPOSER_WIDGET_ACTION_ADD_ATTACHMENT, _tmp5_, (gint) 1, NULL);
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
	_tmp6_ = g_strdup ("<Ctrl>d");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 1;
	application_client_add_window_accelerators (application, COMPOSER_WIDGET_ACTION_DETACH, _tmp8_, (gint) 1, NULL);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL);
	_tmp9_ = g_strdup ("<Ctrl>x");
	_tmp10_ = g_new0 (gchar*, 1 + 1);
	_tmp10_[0] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 1;
	application_client_add_window_accelerators (application, COMPOSER_WIDGET_ACTION_CUT, _tmp11_, (gint) 1, NULL);
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_free), NULL);
	_tmp12_ = g_strdup ("<Ctrl>v");
	_tmp13_ = g_new0 (gchar*, 1 + 1);
	_tmp13_[0] = _tmp12_;
	_tmp14_ = _tmp13_;
	_tmp14__length1 = 1;
	application_client_add_window_accelerators (application, COMPOSER_WIDGET_ACTION_PASTE, _tmp14_, (gint) 1, NULL);
	_tmp14_ = (_vala_array_free (_tmp14_, _tmp14__length1, (GDestroyNotify) g_free), NULL);
}

ApplicationAccountContext*
composer_widget_get_sender_context (ComposerWidget* self)
{
	ApplicationAccountContext* result;
	ApplicationAccountContext* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_sender_context;
	result = _tmp0_;
	return result;
}

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

static void
composer_widget_set_sender_context (ComposerWidget* self,
                                    ApplicationAccountContext* value)
{
	ApplicationAccountContext* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_sender_context (self);
	if (old_value != value) {
		ApplicationAccountContext* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_sender_context);
		self->priv->_sender_context = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_SENDER_CONTEXT_PROPERTY]);
	}
}

GearyEmailIdentifier*
composer_widget_get_saved_id (ComposerWidget* self)
{
	GearyEmailIdentifier* result;
	GearyEmailIdentifier* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_saved_id;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_saved_id (ComposerWidget* self,
                              GearyEmailIdentifier* value)
{
	GearyEmailIdentifier* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_saved_id (self);
	if (old_value != value) {
		GearyEmailIdentifier* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_saved_id);
		self->priv->_saved_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_SAVED_ID_PROPERTY]);
	}
}

ComposerWidgetContextType
composer_widget_get_context_type (ComposerWidget* self)
{
	ComposerWidgetContextType result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), 0);
	result = self->priv->_context_type;
	return result;
}

static void
composer_widget_set_context_type (ComposerWidget* self,
                                  ComposerWidgetContextType value)
{
	ComposerWidgetContextType old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_context_type (self);
	if (old_value != value) {
		self->priv->_context_type = value;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_CONTEXT_TYPE_PROPERTY]);
	}
}

ComposerWidgetPresentationMode
composer_widget_get_current_mode (ComposerWidget* self)
{
	ComposerWidgetPresentationMode result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), 0);
	result = self->priv->_current_mode;
	return result;
}

void
composer_widget_set_current_mode (ComposerWidget* self,
                                  ComposerWidgetPresentationMode value)
{
	ComposerWidgetPresentationMode old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_current_mode (self);
	if (old_value != value) {
		self->priv->_current_mode = value;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_CURRENT_MODE_PROPERTY]);
	}
}

gboolean
composer_widget_get_is_blank (ComposerWidget* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	ComposerWidgetHeaderRow* _tmp6_;
	gconstpointer _tmp7_;
	gconstpointer _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	_tmp6_ = self->priv->to_row;
	_tmp7_ = composer_widget_header_row_get_value (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp10_) {
		ComposerWidgetHeaderRow* _tmp11_;
		gconstpointer _tmp12_;
		gconstpointer _tmp13_;
		gboolean _tmp14_;
		gboolean _tmp15_;
		_tmp11_ = self->priv->cc_row;
		_tmp12_ = composer_widget_header_row_get_value (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp5_ = _tmp15_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		ComposerWidgetHeaderRow* _tmp16_;
		gconstpointer _tmp17_;
		gconstpointer _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		_tmp16_ = self->priv->bcc_row;
		_tmp17_ = composer_widget_header_row_get_value (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp18_);
		_tmp20_ = _tmp19_;
		_tmp4_ = _tmp20_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		ComposerWidgetHeaderRow* _tmp21_;
		gconstpointer _tmp22_;
		gconstpointer _tmp23_;
		gboolean _tmp24_;
		gboolean _tmp25_;
		_tmp21_ = self->priv->reply_to_row;
		_tmp22_ = composer_widget_header_row_get_value (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp23_);
		_tmp25_ = _tmp24_;
		_tmp3_ = _tmp25_;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		ComposerWidgetHeaderRow* _tmp26_;
		gconstpointer _tmp27_;
		gconstpointer _tmp28_;
		GtkEntryBuffer* _tmp29_;
		GtkEntryBuffer* _tmp30_;
		guint _tmp31_;
		guint _tmp32_;
		_tmp26_ = self->priv->subject_row;
		_tmp27_ = composer_widget_header_row_get_value (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp29_ = gtk_entry_get_buffer ((GtkEntry*) _tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = gtk_entry_buffer_get_length (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp2_ = _tmp32_ == ((guint) 0);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		ComposerEditor* _tmp33_;
		ComposerWebView* _tmp34_;
		ComposerWebView* _tmp35_;
		gboolean _tmp36_;
		gboolean _tmp37_;
		_tmp33_ = self->priv->_editor;
		_tmp34_ = composer_editor_get_body (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = composer_web_view_get_is_empty (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp1_ = _tmp37_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GeeSet* _tmp38_;
		gint _tmp39_;
		gint _tmp40_;
		_tmp38_ = self->priv->attached_files;
		_tmp39_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp40_ = _tmp39_;
		_tmp0_ = _tmp40_ == 0;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

ComposerEditor*
composer_widget_get_editor (ComposerWidget* self)
{
	ComposerEditor* result;
	ComposerEditor* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_editor;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_editor (ComposerWidget* self,
                            ComposerEditor* value)
{
	ComposerEditor* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_editor (self);
	if (old_value != value) {
		ComposerEditor* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_editor);
		self->priv->_editor = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_EDITOR_PROPERTY]);
	}
}

GtkWidget*
composer_widget_get_focused_input_widget (ComposerWidget* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_focused_input_widget;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_focused_input_widget (ComposerWidget* self,
                                          GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_focused_input_widget (self);
	if (old_value != value) {
		GtkWidget* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_focused_input_widget);
		self->priv->_focused_input_widget = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_FOCUSED_INPUT_WIDGET_PROPERTY]);
	}
}

gboolean
composer_widget_get_can_send (ComposerWidget* self)
{
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	result = self->priv->_can_send;
	return result;
}

void
composer_widget_set_can_send (ComposerWidget* self,
                              gboolean value)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	self->priv->_can_send = value;
	composer_widget_validate_send_button (self);
	g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_CAN_SEND_PROPERTY]);
}

GearyRFC822MailboxAddresses*
composer_widget_get_from (ComposerWidget* self)
{
	GearyRFC822MailboxAddresses* result;
	GearyRFC822MailboxAddresses* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_from;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_from (ComposerWidget* self,
                          GearyRFC822MailboxAddresses* value)
{
	GearyRFC822MailboxAddresses* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_from (self);
	if (old_value != value) {
		GearyRFC822MailboxAddresses* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_from);
		self->priv->_from = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_FROM_PROPERTY]);
	}
}

const gchar*
composer_widget_get_to (ComposerWidget* self)
{
	const gchar* result;
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->to_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_entry_get_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry));
	result = _tmp3_;
	return result;
}

static void
composer_widget_set_to (ComposerWidget* self,
                        const gchar* value)
{
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->to_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_entry_set_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry), value);
	g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_TO_PROPERTY]);
}

const gchar*
composer_widget_get_cc (ComposerWidget* self)
{
	const gchar* result;
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->cc_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_entry_get_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry));
	result = _tmp3_;
	return result;
}

static void
composer_widget_set_cc (ComposerWidget* self,
                        const gchar* value)
{
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->cc_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_entry_set_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry), value);
	g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_CC_PROPERTY]);
}

const gchar*
composer_widget_get_bcc (ComposerWidget* self)
{
	const gchar* result;
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->bcc_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_entry_get_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry));
	result = _tmp3_;
	return result;
}

static void
composer_widget_set_bcc (ComposerWidget* self,
                         const gchar* value)
{
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->bcc_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_entry_set_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry), value);
	g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_BCC_PROPERTY]);
}

const gchar*
composer_widget_get_reply_to (ComposerWidget* self)
{
	const gchar* result;
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->reply_to_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_entry_get_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry));
	result = _tmp3_;
	return result;
}

static void
composer_widget_set_reply_to (ComposerWidget* self,
                              const gchar* value)
{
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->reply_to_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_entry_set_text (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp2_, gtk_entry_get_type (), GtkEntry), value);
	g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_REPLY_TO_PROPERTY]);
}

const gchar*
composer_widget_get_subject (ComposerWidget* self)
{
	const gchar* result;
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->subject_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_entry_get_text ((GtkEntry*) _tmp2_);
	result = _tmp3_;
	return result;
}

static void
composer_widget_set_subject (ComposerWidget* self,
                             const gchar* value)
{
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->subject_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_entry_set_text ((GtkEntry*) _tmp2_, value);
	g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_SUBJECT_PROPERTY]);
}

GearyRFC822MessageIDList*
composer_widget_get_in_reply_to (ComposerWidget* self)
{
	GearyRFC822MessageIDList* result;
	GearyRFC822MessageIDList* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_in_reply_to;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_in_reply_to (ComposerWidget* self,
                                 GearyRFC822MessageIDList* value)
{
	GearyRFC822MessageIDList* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_in_reply_to (self);
	if (old_value != value) {
		GearyRFC822MessageIDList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_in_reply_to);
		self->priv->_in_reply_to = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_IN_REPLY_TO_PROPERTY]);
	}
}

GearyRFC822MessageIDList*
composer_widget_get_references (ComposerWidget* self)
{
	GearyRFC822MessageIDList* result;
	GearyRFC822MessageIDList* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_references;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_references (ComposerWidget* self,
                                GearyRFC822MessageIDList* value)
{
	GearyRFC822MessageIDList* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_references (self);
	if (old_value != value) {
		GearyRFC822MessageIDList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_references);
		self->priv->_references = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_REFERENCES_PROPERTY]);
	}
}

GearyFolder*
composer_widget_get_save_to (ComposerWidget* self)
{
	GearyFolder* result;
	GearyFolder* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_save_to;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_save_to (ComposerWidget* self,
                             GearyFolder* value)
{
	GearyFolder* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_save_to (self);
	if (old_value != value) {
		GearyFolder* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_save_to);
		self->priv->_save_to = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_SAVE_TO_PROPERTY]);
	}
}

ComposerHeaderbar*
composer_widget_get_header (ComposerWidget* self)
{
	ComposerHeaderbar* result;
	ComposerHeaderbar* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_header;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_header (ComposerWidget* self,
                            ComposerHeaderbar* value)
{
	ComposerHeaderbar* old_value;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	old_value = composer_widget_get_header (self);
	if (old_value != value) {
		ComposerHeaderbar* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_header);
		self->priv->_header = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_properties[COMPOSER_WIDGET_HEADER_PROPERTY]);
	}
}

gboolean
composer_widget_get_has_multiple_from_addresses (ComposerWidget* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	ComposerApplicationInterface* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gboolean _tmp6_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	_tmp1_ = self->priv->application;
	_tmp2_ = application_account_interface_get_account_contexts (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterface));
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_collection_get_size (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_ > 1;
	_g_object_unref0 (_tmp3_);
	if (_tmp6_) {
		_tmp0_ = TRUE;
	} else {
		ApplicationAccountContext* _tmp7_;
		GearyAccount* _tmp8_;
		GearyAccount* _tmp9_;
		GearyAccountInformation* _tmp10_;
		GearyAccountInformation* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		_tmp7_ = self->priv->_sender_context;
		_tmp8_ = application_account_context_get_account (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = geary_account_get_information (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = geary_account_information_get_has_sender_aliases (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp0_ = _tmp13_;
	}
	result = _tmp0_;
	return result;
}

static gboolean
composer_widget_get_can_save (ComposerWidget* self)
{
	gboolean result;
	GearyAppDraftManager* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	_tmp0_ = self->priv->draft_manager;
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
composer_widget_get_should_save (ComposerWidget* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	_tmp2_ = composer_widget_get_can_save (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp1_ = !self->priv->is_draft_saved;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = composer_widget_get_is_blank (self);
		_tmp5_ = _tmp4_;
		_tmp0_ = !_tmp5_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static guint
_geary_files_nullable_hash_gee_hash_data_func (gconstpointer v,
                                               gpointer self)
{
	guint result;
	result = geary_files_nullable_hash ((GFile*) v);
	return result;
}

static gboolean
_geary_files_nullable_equal_gee_equal_data_func (gconstpointer a,
                                                 gconstpointer b,
                                                 gpointer self)
{
	gboolean result;
	result = geary_files_nullable_equal ((GFile*) a, (GFile*) b);
	return result;
}

static const gchar*
composer_widget_get_draft_status_text (ComposerWidget* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->_draft_status_text;
	result = _tmp0_;
	return result;
}

static void
composer_widget_set_draft_status_text (ComposerWidget* self,
                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_draft_status_text);
	self->priv->_draft_status_text = _tmp0_;
	composer_widget_update_info_label (self);
}

static gboolean
composer_widget_get_can_delete_quote (ComposerWidget* self)
{
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	result = self->priv->_can_delete_quote;
	return result;
}

static void
composer_widget_set_can_delete_quote (ComposerWidget* self,
                                      gboolean value)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	self->priv->_can_delete_quote = value;
	composer_widget_update_info_label (self);
}

static ComposerContainer*
composer_widget_get_container (ComposerWidget* self)
{
	ComposerContainer* result;
	GtkContainer* _tmp0_;
	GtkContainer* _tmp1_;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = _tmp0_;
	result = COMPOSER_IS_CONTAINER (_tmp1_) ? ((ComposerContainer*) _tmp1_) : NULL;
	return result;
}

static void
_composer_widget_on_expand_compact_headers_composer_headerbar_expand_composer (ComposerHeaderbar* _sender,
                                                                               gpointer self)
{
	composer_widget_on_expand_compact_headers ((ComposerWidget*) self);
}

static void
_composer_widget_on_envelope_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                            gpointer self)
{
	composer_widget_on_envelope_changed ((ComposerWidget*) self);
}

static void
_composer_widget_on_envelope_changed_gtk_editable_changed (GtkEditable* _sender,
                                                           gpointer self)
{
	composer_widget_on_envelope_changed ((ComposerWidget*) self);
}

static void
_composer_widget_on_subject_changed_gtk_editable_changed (GtkEditable* _sender,
                                                          gpointer self)
{
	composer_widget_on_subject_changed ((ComposerWidget*) self);
}

static void
__lambda188_ (ComposerWidget* self)
{
	composer_widget_update_subject_spell_checker (self);
}

static void
___lambda188__g_settings_changed (GSettings* _sender,
                                  const gchar* key,
                                  gpointer self)
{
	__lambda188_ ((ComposerWidget*) self);
}

static void
__lambda189_ (ComposerWidget* self,
              gboolean from_clipboard)
{
	if (from_clipboard) {
		composer_widget_paste_image (self);
	} else {
		composer_widget_insert_image (self);
	}
}

static void
___lambda189__composer_editor_insert_image (ComposerEditor* _sender,
                                            gboolean from_clipboard,
                                            gpointer self)
{
	__lambda189_ ((ComposerWidget*) self, from_clipboard);
}

static void
_composer_widget_on_content_loaded_components_web_view_content_loaded (ComponentsWebView* _sender,
                                                                       gpointer self)
{
	composer_widget_on_content_loaded ((ComposerWidget*) self);
}

static void
__lambda193_ (ComposerWidget* self)
{
	composer_widget_draft_changed (self);
}

static void
___lambda193__components_web_view_document_modified (ComponentsWebView* _sender,
                                                     gpointer self)
{
	__lambda193_ ((ComposerWidget*) self);
}

static gboolean
_composer_widget_on_editor_key_press_event_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                       GdkEventKey* event,
                                                                       gpointer self)
{
	gboolean result;
	result = composer_widget_on_editor_key_press_event ((ComposerWidget*) self, event);
	return result;
}

static void
_composer_widget_on_account_available_application_account_interface_account_available (ApplicationAccountInterface* _sender,
                                                                                       ApplicationAccountContext* context,
                                                                                       gboolean is_startup,
                                                                                       gpointer self)
{
	composer_widget_on_account_available ((ComposerWidget*) self);
}

static void
_composer_widget_on_account_unavailable_application_account_interface_account_unavailable (ApplicationAccountInterface* _sender,
                                                                                           ApplicationAccountContext* context,
                                                                                           gboolean is_shutdown,
                                                                                           gpointer self)
{
	composer_widget_on_account_unavailable ((ComposerWidget*) self);
}

static void
_composer_widget_on_image_file_dropped_composer_web_view_image_file_dropped (ComposerWebView* _sender,
                                                                             const gchar* filename,
                                                                             const gchar* type,
                                                                             guint8* contents,
                                                                             gint contents_length1,
                                                                             gpointer self)
{
	composer_widget_on_image_file_dropped ((ComposerWidget*) self, filename, type, contents, contents_length1);
}

static void
_composer_widget_on_draft_timeout_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                      gpointer self)
{
	composer_widget_on_draft_timeout ((ComposerWidget*) self);
}

static GVariant*
_variant_new21 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

ComposerWidget*
composer_widget_construct (GType object_type,
                           ComposerApplicationInterface* application,
                           ApplicationConfiguration* config,
                           ApplicationAccountContext* initial_account,
                           GearyFolder* save_to)
{
	ComposerWidget * self = NULL;
	ComposerApplicationInterface* _tmp0_;
	ApplicationConfiguration* _tmp1_;
	ComposerHeaderbar* _tmp2_;
	ComposerHeaderbar* _tmp3_;
	ComposerHeaderbar* _tmp4_;
	ComposerHeaderbar* _tmp5_;
	static const GtkTargetEntry target_entries[1] = {{COMPOSER_WIDGET_URI_LIST_MIME_TYPE, (guint) 0, (guint) 0}};
	GtkBox* _tmp6_;
	GtkWidget* _tmp7_;
	GtkComboBoxText* _tmp8_;
	GtkComboBoxText* _tmp9_;
	ComposerWidgetHeaderRow* _tmp10_;
	ComposerWidgetHeaderRow* _tmp11_;
	gconstpointer _tmp12_;
	gconstpointer _tmp13_;
	GList* cells = NULL;
	ComposerWidgetHeaderRow* _tmp14_;
	gconstpointer _tmp15_;
	gconstpointer _tmp16_;
	GList* _tmp17_;
	gconstpointer _tmp18_;
	GtkSizeGroup* _tmp19_;
	ComposerWidgetHeaderRow* _tmp20_;
	GtkLabel* _tmp21_;
	GtkLabel* _tmp22_;
	GtkBox* _tmp23_;
	ComposerWidgetHeaderRow* _tmp24_;
	ComposerEmailEntry* _tmp25_;
	ComposerEmailEntry* _tmp26_;
	ComposerWidgetEntryHeaderRow* _tmp27_;
	ComposerWidgetHeaderRow* _tmp28_;
	GtkBox* _tmp29_;
	GtkBox* _tmp30_;
	GtkToggleButton* _tmp31_;
	ComposerWidgetHeaderRow* _tmp32_;
	gconstpointer _tmp33_;
	gconstpointer _tmp34_;
	GtkSizeGroup* _tmp35_;
	ComposerWidgetHeaderRow* _tmp36_;
	GtkLabel* _tmp37_;
	GtkLabel* _tmp38_;
	GtkBox* _tmp39_;
	ComposerWidgetHeaderRow* _tmp40_;
	ComposerEmailEntry* _tmp41_;
	ComposerEmailEntry* _tmp42_;
	ComposerWidgetEntryHeaderRow* _tmp43_;
	ComposerWidgetHeaderRow* _tmp44_;
	gconstpointer _tmp45_;
	gconstpointer _tmp46_;
	GtkSizeGroup* _tmp47_;
	ComposerWidgetHeaderRow* _tmp48_;
	GtkLabel* _tmp49_;
	GtkLabel* _tmp50_;
	GtkBox* _tmp51_;
	ComposerWidgetHeaderRow* _tmp52_;
	ComposerEmailEntry* _tmp53_;
	ComposerEmailEntry* _tmp54_;
	ComposerWidgetEntryHeaderRow* _tmp55_;
	ComposerWidgetHeaderRow* _tmp56_;
	gconstpointer _tmp57_;
	gconstpointer _tmp58_;
	GtkSizeGroup* _tmp59_;
	ComposerWidgetHeaderRow* _tmp60_;
	GtkLabel* _tmp61_;
	GtkLabel* _tmp62_;
	GtkBox* _tmp63_;
	ComposerWidgetHeaderRow* _tmp64_;
	ComposerEmailEntry* _tmp65_;
	ComposerEmailEntry* _tmp66_;
	ComposerWidgetEntryHeaderRow* _tmp67_;
	ComposerWidgetHeaderRow* _tmp68_;
	gconstpointer _tmp69_;
	gconstpointer _tmp70_;
	GtkSizeGroup* _tmp71_;
	ComposerWidgetHeaderRow* _tmp72_;
	GtkLabel* _tmp73_;
	GtkLabel* _tmp74_;
	GtkBox* _tmp75_;
	ComposerWidgetHeaderRow* _tmp76_;
	GtkEntry* _tmp77_;
	GtkEntry* _tmp78_;
	ComposerWidgetEntryHeaderRow* _tmp79_;
	ComposerWidgetHeaderRow* _tmp80_;
	gconstpointer _tmp81_;
	gconstpointer _tmp82_;
	GtkSizeGroup* _tmp83_;
	ComposerWidgetHeaderRow* _tmp84_;
	GtkLabel* _tmp85_;
	GtkLabel* _tmp86_;
	GtkGrid* _tmp87_;
	ComposerWidgetHeaderRow* _tmp88_;
	ComposerWidgetHeaderRow* _tmp89_;
	gconstpointer _tmp90_;
	gconstpointer _tmp91_;
	GspellEntry* _tmp92_;
	GspellEntry* _tmp93_;
	GSettings* _tmp94_;
	GSettings* _tmp95_;
	gchar* _tmp96_;
	ComposerEditor* _tmp97_;
	ComposerEditor* _tmp98_;
	ComposerEditor* _tmp99_;
	ComposerEditor* _tmp100_;
	ComposerWebView* _tmp101_;
	ComposerWebView* _tmp102_;
	ComposerEditor* _tmp103_;
	ComposerWebView* _tmp104_;
	ComposerWebView* _tmp105_;
	ComposerEditor* _tmp106_;
	ComposerWebView* _tmp107_;
	ComposerWebView* _tmp108_;
	ComposerEditor* _tmp109_;
	GtkGrid* _tmp110_;
	ComposerEditor* _tmp111_;
	ComposerApplicationInterface* _tmp112_;
	ComposerApplicationInterface* _tmp113_;
	ComposerEditor* _tmp114_;
	ComposerWebView* _tmp115_;
	ComposerWebView* _tmp116_;
	ApplicationAccountContext* _tmp117_;
	GearyAccount* _tmp118_;
	GearyAccount* _tmp119_;
	GearyAccountInformation* _tmp120_;
	GearyAccountInformation* _tmp121_;
	GearyRFC822MailboxAddress* _tmp122_;
	GearyRFC822MailboxAddress* _tmp123_;
	GearyRFC822MailboxAddress* _tmp124_;
	GearyRFC822MailboxAddresses* _tmp125_;
	GearyRFC822MailboxAddresses* _tmp126_;
	GearyTimeoutManager* _tmp127_;
	GSimpleActionGroup* _tmp128_;
	GSimpleActionGroup* _tmp129_;
	GVariant* _tmp130_;
	GSimpleActionGroup* _tmp131_;
	ComposerHeaderbar* _tmp132_;
	GSimpleActionGroup* _tmp133_;
	g_return_val_if_fail (COMPOSER_IS_APPLICATION_INTERFACE (application), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONFIGURATION (config), NULL);
	g_return_val_if_fail (APPLICATION_IS_ACCOUNT_CONTEXT (initial_account), NULL);
	g_return_val_if_fail ((save_to == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (save_to, GEARY_TYPE_FOLDER), NULL);
	self = (ComposerWidget*) g_object_new (object_type, NULL);
	components_reflow_box_get_type ();
	geary_base_interface_base_ref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_tmp0_ = _g_object_ref0 (application);
	_g_object_unref0 (self->priv->application);
	self->priv->application = _tmp0_;
	_tmp1_ = _g_object_ref0 (config);
	_g_object_unref0 (self->priv->config);
	self->priv->config = _tmp1_;
	composer_widget_set_sender_context (self, initial_account);
	composer_widget_set_save_to (self, save_to);
	_tmp2_ = composer_headerbar_new (config);
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	composer_widget_set_header (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = self->priv->_header;
	g_signal_connect_object (_tmp4_, "expand-composer", (GCallback) _composer_widget_on_expand_compact_headers_composer_headerbar_expand_composer, self, 0);
	_tmp5_ = self->priv->_header;
	composer_headerbar_set_show_save_and_close (_tmp5_, FALSE);
	gtk_drag_dest_set (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT, target_entries, (gint) G_N_ELEMENTS (target_entries), GDK_ACTION_COPY);
	gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) (GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK));
	_tmp6_ = self->priv->visible_on_attachment_drag_over;
	_tmp7_ = self->priv->visible_on_attachment_drag_over_child;
	gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_container_get_type (), GtkContainer), _tmp7_);
	_tmp8_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	g_object_ref_sink (_tmp8_);
	_tmp9_ = _tmp8_;
	_tmp10_ = composer_widget_header_row_new (gtk_combo_box_text_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _ ("_From"), _tmp9_);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->from_row);
	self->priv->from_row = _tmp10_;
	_g_object_unref0 (_tmp9_);
	_tmp11_ = self->priv->from_row;
	_tmp12_ = composer_widget_header_row_get_value (_tmp11_);
	_tmp13_ = _tmp12_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST ((GtkComboBoxText*) _tmp13_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _composer_widget_on_envelope_changed_gtk_combo_box_changed, self, 0);
	_tmp14_ = self->priv->from_row;
	_tmp15_ = composer_widget_header_row_get_value (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = gtk_cell_layout_get_cells (G_TYPE_CHECK_INSTANCE_CAST ((GtkComboBoxText*) _tmp16_, gtk_cell_layout_get_type (), GtkCellLayout));
	cells = _tmp17_;
	_tmp18_ = cells->data;
	g_object_set (G_TYPE_CHECK_INSTANCE_CAST ((GtkCellRenderer*) _tmp18_, gtk_cell_renderer_text_get_type (), GtkCellRendererText), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
	_tmp19_ = self->priv->header_labels_group;
	_tmp20_ = self->priv->from_row;
	_tmp21_ = composer_widget_header_row_get_label (_tmp20_);
	_tmp22_ = _tmp21_;
	gtk_size_group_add_widget (_tmp19_, G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget));
	_tmp23_ = self->priv->filled_headers;
	_tmp24_ = self->priv->from_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_widget_get_type (), GtkWidget));
	_tmp25_ = composer_email_entry_new (self);
	g_object_ref_sink (_tmp25_);
	_tmp26_ = _tmp25_;
	_tmp27_ = composer_widget_entry_header_row_new (COMPOSER_TYPE_EMAIL_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _ ("_To"), _tmp26_);
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->to_row);
	self->priv->to_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	_g_object_unref0 (_tmp26_);
	_tmp28_ = self->priv->to_row;
	_tmp29_ = composer_widget_header_row_get_value_container (_tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = self->priv->show_extended_headers;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget));
	_tmp32_ = self->priv->to_row;
	_tmp33_ = composer_widget_header_row_get_value (_tmp32_);
	_tmp34_ = _tmp33_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp34_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _composer_widget_on_envelope_changed_gtk_editable_changed, self, 0);
	_tmp35_ = self->priv->header_labels_group;
	_tmp36_ = self->priv->to_row;
	_tmp37_ = composer_widget_header_row_get_label (_tmp36_);
	_tmp38_ = _tmp37_;
	gtk_size_group_add_widget (_tmp35_, G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_widget_get_type (), GtkWidget));
	_tmp39_ = self->priv->filled_headers;
	_tmp40_ = self->priv->to_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_widget_get_type (), GtkWidget));
	_tmp41_ = composer_email_entry_new (self);
	g_object_ref_sink (_tmp41_);
	_tmp42_ = _tmp41_;
	_tmp43_ = composer_widget_entry_header_row_new (COMPOSER_TYPE_EMAIL_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _ ("_Cc"), _tmp42_);
	g_object_ref_sink (_tmp43_);
	_g_object_unref0 (self->priv->cc_row);
	self->priv->cc_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	_g_object_unref0 (_tmp42_);
	_tmp44_ = self->priv->cc_row;
	_tmp45_ = composer_widget_header_row_get_value (_tmp44_);
	_tmp46_ = _tmp45_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp46_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _composer_widget_on_envelope_changed_gtk_editable_changed, self, 0);
	_tmp47_ = self->priv->header_labels_group;
	_tmp48_ = self->priv->cc_row;
	_tmp49_ = composer_widget_header_row_get_label (_tmp48_);
	_tmp50_ = _tmp49_;
	gtk_size_group_add_widget (_tmp47_, G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, gtk_widget_get_type (), GtkWidget));
	_tmp51_ = self->priv->extended_headers;
	_tmp52_ = self->priv->cc_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, gtk_widget_get_type (), GtkWidget));
	_tmp53_ = composer_email_entry_new (self);
	g_object_ref_sink (_tmp53_);
	_tmp54_ = _tmp53_;
	_tmp55_ = composer_widget_entry_header_row_new (COMPOSER_TYPE_EMAIL_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _ ("_Bcc"), _tmp54_);
	g_object_ref_sink (_tmp55_);
	_g_object_unref0 (self->priv->bcc_row);
	self->priv->bcc_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	_g_object_unref0 (_tmp54_);
	_tmp56_ = self->priv->bcc_row;
	_tmp57_ = composer_widget_header_row_get_value (_tmp56_);
	_tmp58_ = _tmp57_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp58_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _composer_widget_on_envelope_changed_gtk_editable_changed, self, 0);
	_tmp59_ = self->priv->header_labels_group;
	_tmp60_ = self->priv->bcc_row;
	_tmp61_ = composer_widget_header_row_get_label (_tmp60_);
	_tmp62_ = _tmp61_;
	gtk_size_group_add_widget (_tmp59_, G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_widget_get_type (), GtkWidget));
	_tmp63_ = self->priv->extended_headers;
	_tmp64_ = self->priv->bcc_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget));
	_tmp65_ = composer_email_entry_new (self);
	g_object_ref_sink (_tmp65_);
	_tmp66_ = _tmp65_;
	_tmp67_ = composer_widget_entry_header_row_new (COMPOSER_TYPE_EMAIL_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _ ("_Reply to"), _tmp66_);
	g_object_ref_sink (_tmp67_);
	_g_object_unref0 (self->priv->reply_to_row);
	self->priv->reply_to_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	_g_object_unref0 (_tmp66_);
	_tmp68_ = self->priv->reply_to_row;
	_tmp69_ = composer_widget_header_row_get_value (_tmp68_);
	_tmp70_ = _tmp69_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp70_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _composer_widget_on_envelope_changed_gtk_editable_changed, self, 0);
	_tmp71_ = self->priv->header_labels_group;
	_tmp72_ = self->priv->reply_to_row;
	_tmp73_ = composer_widget_header_row_get_label (_tmp72_);
	_tmp74_ = _tmp73_;
	gtk_size_group_add_widget (_tmp71_, G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, gtk_widget_get_type (), GtkWidget));
	_tmp75_ = self->priv->extended_headers;
	_tmp76_ = self->priv->reply_to_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp76_, gtk_widget_get_type (), GtkWidget));
	_tmp77_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp77_);
	_tmp78_ = _tmp77_;
	_tmp79_ = composer_widget_entry_header_row_new (gtk_entry_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _ ("_Subject"), _tmp78_);
	g_object_ref_sink (_tmp79_);
	_g_object_unref0 (self->priv->subject_row);
	self->priv->subject_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp79_, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	_g_object_unref0 (_tmp78_);
	_tmp80_ = self->priv->subject_row;
	_tmp81_ = composer_widget_header_row_get_value (_tmp80_);
	_tmp82_ = _tmp81_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST ((GtkEntry*) _tmp82_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _composer_widget_on_subject_changed_gtk_editable_changed, self, 0);
	_tmp83_ = self->priv->header_labels_group;
	_tmp84_ = self->priv->subject_row;
	_tmp85_ = composer_widget_header_row_get_label (_tmp84_);
	_tmp86_ = _tmp85_;
	gtk_size_group_add_widget (_tmp83_, G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, gtk_widget_get_type (), GtkWidget));
	_tmp87_ = self->priv->email_headers;
	_tmp88_ = self->priv->subject_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp87_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp88_, gtk_widget_get_type (), GtkWidget));
	_tmp89_ = self->priv->subject_row;
	_tmp90_ = composer_widget_header_row_get_value (_tmp89_);
	_tmp91_ = _tmp90_;
	_tmp92_ = gspell_entry_get_from_gtk_entry ((GtkEntry*) _tmp91_);
	_tmp93_ = _g_object_ref0 (_tmp92_);
	_g_object_unref0 (self->priv->subject_spell_entry);
	self->priv->subject_spell_entry = _tmp93_;
	_tmp94_ = application_configuration_get_settings (config);
	_tmp95_ = _tmp94_;
	_tmp96_ = g_strconcat ("changed::", APPLICATION_CONFIGURATION_SPELL_CHECK_LANGUAGES, NULL);
	g_signal_connect_object (_tmp95_, _tmp96_, (GCallback) ___lambda188__g_settings_changed, self, 0);
	_g_free0 (_tmp96_);
	composer_widget_update_subject_spell_checker (self);
	_tmp97_ = composer_editor_new (config);
	g_object_ref_sink (_tmp97_);
	_tmp98_ = _tmp97_;
	composer_widget_set_editor (self, _tmp98_);
	_g_object_unref0 (_tmp98_);
	_tmp99_ = self->priv->_editor;
	g_signal_connect_object (_tmp99_, "insert-image", (GCallback) ___lambda189__composer_editor_insert_image, self, 0);
	_tmp100_ = self->priv->_editor;
	_tmp101_ = composer_editor_get_body (_tmp100_);
	_tmp102_ = _tmp101_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp102_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), "content-loaded", (GCallback) _composer_widget_on_content_loaded_components_web_view_content_loaded, self, 0);
	_tmp103_ = self->priv->_editor;
	_tmp104_ = composer_editor_get_body (_tmp103_);
	_tmp105_ = _tmp104_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp105_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), "document-modified", (GCallback) ___lambda193__components_web_view_document_modified, self, 0);
	_tmp106_ = self->priv->_editor;
	_tmp107_ = composer_editor_get_body (_tmp106_);
	_tmp108_ = _tmp107_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp108_, gtk_widget_get_type (), GtkWidget), "key-press-event", (GCallback) _composer_widget_on_editor_key_press_event_gtk_widget_key_press_event, self, 0);
	_tmp109_ = self->priv->_editor;
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp109_, gtk_widget_get_type (), GtkWidget));
	_tmp110_ = self->priv->editor_container;
	_tmp111_ = self->priv->_editor;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp110_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp111_, gtk_widget_get_type (), GtkWidget));
	_tmp112_ = self->priv->application;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp112_, APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterface), "account-available", (GCallback) _composer_widget_on_account_available_application_account_interface_account_available, self, 0);
	_tmp113_ = self->priv->application;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp113_, APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterface), "account-unavailable", (GCallback) _composer_widget_on_account_unavailable_application_account_interface_account_unavailable, self, 0);
	_tmp114_ = self->priv->_editor;
	_tmp115_ = composer_editor_get_body (_tmp114_);
	_tmp116_ = _tmp115_;
	g_signal_connect_object (_tmp116_, "image-file-dropped", (GCallback) _composer_widget_on_image_file_dropped_composer_web_view_image_file_dropped, self, 0);
	_tmp117_ = self->priv->_sender_context;
	_tmp118_ = application_account_context_get_account (_tmp117_);
	_tmp119_ = _tmp118_;
	_tmp120_ = geary_account_get_information (_tmp119_);
	_tmp121_ = _tmp120_;
	_tmp122_ = geary_account_information_get_primary_mailbox (_tmp121_);
	_tmp123_ = _tmp122_;
	_tmp124_ = _tmp123_;
	_tmp125_ = geary_rf_c822_mailbox_addresses_new_single (_tmp124_);
	_tmp126_ = _tmp125_;
	composer_widget_set_from (self, _tmp126_);
	_g_object_unref0 (_tmp126_);
	_g_object_unref0 (_tmp124_);
	_tmp127_ = geary_timeout_manager_new_seconds ((guint) 10, _composer_widget_on_draft_timeout_geary_timeout_manager_timeout_func, self);
	_g_object_unref0 (self->priv->draft_timer);
	self->priv->draft_timer = _tmp127_;
	_tmp128_ = self->priv->actions;
	g_action_map_add_action_entries (G_TYPE_CHECK_INSTANCE_CAST (_tmp128_, g_action_map_get_type (), GActionMap), COMPOSER_WIDGET_ACTIONS, (gint) G_N_ELEMENTS (COMPOSER_WIDGET_ACTIONS), self);
	_tmp129_ = self->priv->actions;
	_tmp130_ = _variant_new21 (FALSE);
	g_action_group_change_action_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp129_, g_action_group_get_type (), GActionGroup), COMPOSER_WIDGET_ACTION_SHOW_EXTENDED_HEADERS, _tmp130_);
	_g_variant_unref0 (_tmp130_);
	_tmp131_ = self->priv->actions;
	gtk_widget_insert_action_group (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), ACTION_WINDOW_GROUP_NAME, G_TYPE_CHECK_INSTANCE_CAST (_tmp131_, g_action_group_get_type (), GActionGroup));
	_tmp132_ = self->priv->_header;
	_tmp133_ = self->priv->actions;
	gtk_widget_insert_action_group (G_TYPE_CHECK_INSTANCE_CAST (_tmp132_, gtk_widget_get_type (), GtkWidget), "cmh", G_TYPE_CHECK_INSTANCE_CAST (_tmp133_, g_action_group_get_type (), GActionGroup));
	composer_widget_validate_send_button (self);
	composer_widget_load_entry_completions (self);
	(cells == NULL) ? NULL : (cells = (g_list_free (cells), NULL));
	return self;
}

ComposerWidget*
composer_widget_new (ComposerApplicationInterface* application,
                     ApplicationConfiguration* config,
                     ApplicationAccountContext* initial_account,
                     GearyFolder* save_to)
{
	return composer_widget_construct (COMPOSER_TYPE_WIDGET, application, config, initial_account, save_to);
}

static void
composer_widget_load_empty_body_data_free (gpointer _data)
{
	ComposerWidgetLoadEmptyBodyData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->to);
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetLoadEmptyBodyData, _data_);
}

void
composer_widget_load_empty_body (ComposerWidget* self,
                                 GearyRFC822MailboxAddress* to,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	ComposerWidgetLoadEmptyBodyData* _data_;
	ComposerWidget* _tmp0_;
	GearyRFC822MailboxAddress* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail ((to == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (to, GEARY_RF_C822_TYPE_MAILBOX_ADDRESS));
	_data_ = g_slice_new0 (ComposerWidgetLoadEmptyBodyData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_load_empty_body_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (to);
	_g_object_unref0 (_data_->to);
	_data_->to = _tmp1_;
	composer_widget_load_empty_body_co (_data_);
}

void
composer_widget_load_empty_body_finish (ComposerWidget* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	ComposerWidgetLoadEmptyBodyData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/** Loads an empty message into the composer. */
static void
composer_widget_load_empty_body_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	ComposerWidgetLoadEmptyBodyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_load_empty_body_co (_data_);
}

static gboolean
composer_widget_load_empty_body_co (ComposerWidgetLoadEmptyBodyData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->to != NULL) {
		_data_->_tmp0_ = geary_rf_c822_mailbox_address_to_full_display (_data_->to, "<", ">");
		_data_->_tmp1_ = _data_->_tmp0_;
		composer_widget_set_to (_data_->self, _data_->_tmp1_);
		_g_free0 (_data_->_tmp1_);
		composer_widget_update_extended_headers (_data_->self, TRUE);
	}
	_data_->_state_ = 1;
	composer_widget_finish_loading (_data_->self, "", "", FALSE, composer_widget_load_empty_body_ready, _data_);
	return FALSE;
	_state_1:
	composer_widget_finish_loading_finish (_data_->self, _data_->_res_);
	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
composer_widget_load_mailto_data_free (gpointer _data)
{
	ComposerWidgetLoadMailtoData* _data_;
	_data_ = _data;
	_g_free0 (_data_->mailto);
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetLoadMailtoData, _data_);
}

void
composer_widget_load_mailto (ComposerWidget* self,
                             const gchar* mailto,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	ComposerWidgetLoadMailtoData* _data_;
	ComposerWidget* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (mailto != NULL);
	_data_ = g_slice_new0 (ComposerWidgetLoadMailtoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_load_mailto_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (mailto);
	_g_free0 (_data_->mailto);
	_data_->mailto = _tmp1_;
	composer_widget_load_mailto_co (_data_);
}

void
composer_widget_load_mailto_finish (ComposerWidget* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	ComposerWidgetLoadMailtoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/** Loads a mailto: URL into the composer. */
static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
composer_widget_load_mailto_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	ComposerWidgetLoadMailtoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_load_mailto_co (_data_);
}

static gboolean
composer_widget_load_mailto_co (ComposerWidgetLoadMailtoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->headers = _data_->_tmp0_;
	if (g_str_has_prefix (_data_->mailto, COMPOSER_WIDGET_MAILTO_URI_PREFIX)) {
		_data_->email = NULL;
		_data_->_tmp1_ = strlen (COMPOSER_WIDGET_MAILTO_URI_PREFIX);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = string_substring (_data_->mailto, (glong) _data_->_tmp2_, (glong) -1);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp6_ = _data_->_tmp5_ = g_strsplit (_data_->_tmp4_, "?", 2);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp7__length1 = _vala_array_length (_data_->_tmp5_);
		_g_free0 (_data_->_tmp4_);
		_data_->parts = _data_->_tmp7_;
		_data_->parts_length1 = _data_->_tmp7__length1;
		_data_->_parts_size_ = _data_->parts_length1;
		_data_->_tmp8_ = _data_->parts;
		_data_->_tmp8__length1 = _data_->parts_length1;
		if (_data_->_tmp8__length1 > 0) {
			_data_->_tmp9_ = _data_->parts;
			_data_->_tmp9__length1 = _data_->parts_length1;
			_data_->_tmp10_ = _data_->_tmp9_[0];
			_data_->_tmp11_ = g_uri_unescape_string (_data_->_tmp10_, NULL);
			_g_free0 (_data_->email);
			_data_->email = _data_->_tmp11_;
		}
		_data_->_tmp12__length1 = 0;
		_data_->__tmp12__size_ = 0;
		_data_->_tmp13_ = _data_->parts;
		_data_->_tmp13__length1 = _data_->parts_length1;
		if (_data_->_tmp13__length1 == 2) {
			_data_->_tmp14_ = _data_->parts;
			_data_->_tmp14__length1 = _data_->parts_length1;
			_data_->_tmp15_ = _data_->_tmp14_[1];
			_data_->_tmp17_ = _data_->_tmp16_ = g_strsplit (_data_->_tmp15_, "&", 0);
			_data_->_tmp12_ = (_vala_array_free (_data_->_tmp12_, _data_->_tmp12__length1, (GDestroyNotify) g_free), NULL);
			_data_->_tmp12_ = _data_->_tmp17_;
			_data_->_tmp12__length1 = _vala_array_length (_data_->_tmp16_);
			_data_->__tmp12__size_ = _data_->_tmp12__length1;
		} else {
			_data_->_tmp18_ = g_new0 (gchar*, 0 + 1);
			_data_->_tmp12_ = (_vala_array_free (_data_->_tmp12_, _data_->_tmp12__length1, (GDestroyNotify) g_free), NULL);
			_data_->_tmp12_ = _data_->_tmp18_;
			_data_->_tmp12__length1 = 0;
			_data_->__tmp12__size_ = _data_->_tmp12__length1;
		}
		_data_->_tmp19_ = _data_->_tmp12_;
		_data_->_tmp19__length1 = _data_->_tmp12__length1;
		_data_->_tmp12_ = NULL;
		_data_->_tmp12__length1 = 0;
		_data_->params = _data_->_tmp19_;
		_data_->params_length1 = _data_->_tmp19__length1;
		_data_->_params_size_ = _data_->params_length1;
		_data_->_tmp20_ = _data_->params;
		_data_->_tmp20__length1 = _data_->params_length1;
		{
			_data_->param_collection_length1 = 0;
			_data_->_param_collection_size_ = 0;
			_data_->param_collection = _data_->_tmp20_;
			_data_->param_collection_length1 = _data_->_tmp20__length1;
			for (_data_->param_it = 0; _data_->param_it < _data_->param_collection_length1; _data_->param_it = _data_->param_it + 1) {
				_data_->_tmp21_ = g_strdup (_data_->param_collection[_data_->param_it]);
				_data_->param = _data_->_tmp21_;
				{
					_data_->_tmp22_ = _data_->param;
					_data_->_tmp24_ = _data_->_tmp23_ = g_strsplit (_data_->_tmp22_, "=", 2);
					_data_->param_parts = _data_->_tmp24_;
					_data_->param_parts_length1 = _vala_array_length (_data_->_tmp23_);
					_data_->_param_parts_size_ = _data_->param_parts_length1;
					_data_->_tmp25_ = _data_->param_parts;
					_data_->_tmp25__length1 = _data_->param_parts_length1;
					if (_data_->_tmp25__length1 == 2) {
						_data_->_tmp26_ = _data_->headers;
						_data_->_tmp27_ = _data_->param_parts;
						_data_->_tmp27__length1 = _data_->param_parts_length1;
						_data_->_tmp28_ = _data_->_tmp27_[0];
						_data_->_tmp29_ = g_uri_unescape_string (_data_->_tmp28_, NULL);
						_data_->_tmp30_ = _data_->_tmp29_;
						_data_->_tmp31_ = g_utf8_strdown (_data_->_tmp30_, (gssize) -1);
						_data_->_tmp32_ = _data_->_tmp31_;
						_data_->_tmp33_ = _data_->param_parts;
						_data_->_tmp33__length1 = _data_->param_parts_length1;
						_data_->_tmp34_ = _data_->_tmp33_[1];
						_data_->_tmp35_ = g_uri_unescape_string (_data_->_tmp34_, NULL);
						_data_->_tmp36_ = _data_->_tmp35_;
						gee_multi_map_set (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp26_, GEE_TYPE_MULTI_MAP, GeeMultiMap), _data_->_tmp32_, _data_->_tmp36_);
						_g_free0 (_data_->_tmp36_);
						_g_free0 (_data_->_tmp32_);
						_g_free0 (_data_->_tmp30_);
					}
					_data_->param_parts = (_vala_array_free (_data_->param_parts, _data_->param_parts_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (_data_->param);
				}
			}
		}
		_data_->_tmp38_ = _data_->email;
		if (!geary_string_is_empty_or_whitespace (_data_->_tmp38_)) {
			_data_->_tmp39_ = _data_->headers;
			_data_->_tmp37_ = gee_multi_map_contains (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp39_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "to");
		} else {
			_data_->_tmp37_ = FALSE;
		}
		if (_data_->_tmp37_) {
			_data_->_tmp40_ = _data_->email;
			_data_->_tmp41_ = _data_->headers;
			_data_->_tmp42_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp41_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "to");
			_data_->_tmp43_ = _data_->_tmp42_;
			_data_->_tmp44_ = geary_collection_first (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->_tmp43_);
			_data_->_tmp45_ = (gchar*) _data_->_tmp44_;
			_data_->_tmp46_ = g_strdup_printf ("%s,%s", _data_->_tmp40_, _data_->_tmp45_);
			_data_->_tmp47_ = _data_->_tmp46_;
			composer_widget_set_to (_data_->self, _data_->_tmp47_);
			_g_free0 (_data_->_tmp47_);
			_g_free0 (_data_->_tmp45_);
			_g_object_unref0 (_data_->_tmp43_);
		} else {
			_data_->_tmp48_ = _data_->email;
			if (!geary_string_is_empty_or_whitespace (_data_->_tmp48_)) {
				_data_->_tmp49_ = _data_->email;
				composer_widget_set_to (_data_->self, _data_->_tmp49_);
			} else {
				_data_->_tmp50_ = _data_->headers;
				if (gee_multi_map_contains (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp50_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "to")) {
					_data_->_tmp51_ = _data_->headers;
					_data_->_tmp52_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp51_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "to");
					_data_->_tmp53_ = _data_->_tmp52_;
					_data_->_tmp54_ = geary_collection_first (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->_tmp53_);
					_data_->_tmp55_ = (gchar*) _data_->_tmp54_;
					composer_widget_set_to (_data_->self, _data_->_tmp55_);
					_g_free0 (_data_->_tmp55_);
					_g_object_unref0 (_data_->_tmp53_);
				}
			}
		}
		_data_->_tmp56_ = _data_->headers;
		if (gee_multi_map_contains (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp56_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "cc")) {
			_data_->_tmp57_ = _data_->headers;
			_data_->_tmp58_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp57_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "cc");
			_data_->_tmp59_ = _data_->_tmp58_;
			_data_->_tmp60_ = geary_collection_first (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->_tmp59_);
			_data_->_tmp61_ = (gchar*) _data_->_tmp60_;
			composer_widget_set_cc (_data_->self, _data_->_tmp61_);
			_g_free0 (_data_->_tmp61_);
			_g_object_unref0 (_data_->_tmp59_);
		}
		_data_->_tmp62_ = _data_->headers;
		if (gee_multi_map_contains (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp62_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "bcc")) {
			_data_->_tmp63_ = _data_->headers;
			_data_->_tmp64_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp63_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "bcc");
			_data_->_tmp65_ = _data_->_tmp64_;
			_data_->_tmp66_ = geary_collection_first (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->_tmp65_);
			_data_->_tmp67_ = (gchar*) _data_->_tmp66_;
			composer_widget_set_bcc (_data_->self, _data_->_tmp67_);
			_g_free0 (_data_->_tmp67_);
			_g_object_unref0 (_data_->_tmp65_);
		}
		_data_->_tmp68_ = _data_->headers;
		if (gee_multi_map_contains (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp68_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "subject")) {
			_data_->_tmp69_ = _data_->headers;
			_data_->_tmp70_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp69_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "subject");
			_data_->_tmp71_ = _data_->_tmp70_;
			_data_->_tmp72_ = geary_collection_first (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->_tmp71_);
			_data_->_tmp73_ = (gchar*) _data_->_tmp72_;
			composer_widget_set_subject (_data_->self, _data_->_tmp73_);
			_g_free0 (_data_->_tmp73_);
			_g_object_unref0 (_data_->_tmp71_);
		}
		_data_->_tmp74_ = g_strdup ("");
		_data_->body = _data_->_tmp74_;
		_data_->_tmp75_ = _data_->headers;
		if (gee_multi_map_contains (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp75_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "body")) {
			_data_->_tmp76_ = _data_->headers;
			_data_->_tmp77_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp76_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "body");
			_data_->_tmp78_ = _data_->_tmp77_;
			_data_->_tmp79_ = geary_collection_first (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->_tmp78_);
			_data_->_tmp80_ = (gchar*) _data_->_tmp79_;
			_data_->_tmp81_ = geary_html_escape_markup (_data_->_tmp80_);
			_data_->_tmp82_ = _data_->_tmp81_;
			_data_->_tmp83_ = geary_html_preserve_whitespace (_data_->_tmp82_);
			_g_free0 (_data_->body);
			_data_->body = _data_->_tmp83_;
			_g_free0 (_data_->_tmp82_);
			_g_free0 (_data_->_tmp80_);
			_g_object_unref0 (_data_->_tmp78_);
		}
		_data_->_tmp84_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
		_data_->attachments = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp84_, GEE_TYPE_LIST, GeeList);
		_data_->_tmp85_ = _data_->attachments;
		_data_->_tmp86_ = _data_->headers;
		_data_->_tmp87_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp86_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "attach");
		_data_->_tmp88_ = _data_->_tmp87_;
		gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp85_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp88_);
		_g_object_unref0 (_data_->_tmp88_);
		_data_->_tmp89_ = _data_->attachments;
		_data_->_tmp90_ = _data_->headers;
		_data_->_tmp91_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp90_, GEE_TYPE_MULTI_MAP, GeeMultiMap), "attachment");
		_data_->_tmp92_ = _data_->_tmp91_;
		gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp89_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp92_);
		_g_object_unref0 (_data_->_tmp92_);
		{
			_data_->_tmp93_ = _data_->attachments;
			_data_->_attachment_list = _data_->_tmp93_;
			_data_->_tmp94_ = _data_->_attachment_list;
			_data_->_tmp95_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp94_, GEE_TYPE_COLLECTION, GeeCollection));
			_data_->_tmp96_ = _data_->_tmp95_;
			_data_->_attachment_size = _data_->_tmp96_;
			_data_->_attachment_index = -1;
			while (TRUE) {
				_data_->_attachment_index = _data_->_attachment_index + 1;
				_data_->_tmp97_ = _data_->_attachment_index;
				_data_->_tmp98_ = _data_->_attachment_size;
				if (!(_data_->_tmp97_ < _data_->_tmp98_)) {
					break;
				}
				_data_->_tmp99_ = _data_->_attachment_list;
				_data_->_tmp100_ = gee_list_get (_data_->_tmp99_, _data_->_attachment_index);
				_data_->attachment = (gchar*) _data_->_tmp100_;
				{
					_data_->_tmp101_ = _data_->attachment;
					_data_->_tmp102_ = g_file_new_for_commandline_arg (_data_->_tmp101_);
					_data_->_tmp103_ = _data_->_tmp102_;
					composer_widget_add_attachment_part (_data_->self, _data_->_tmp103_, &_data_->_inner_error0_);
					_g_object_unref0 (_data_->_tmp103_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
				}
				goto __finally0;
				__catch0_g_error:
				{
					_data_->err = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp104_ = _data_->err;
					_data_->_tmp105_ = _data_->_tmp104_->message;
					composer_widget_attachment_failed (_data_->self, _data_->_tmp105_);
					_g_error_free0 (_data_->err);
				}
				__finally0:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_free0 (_data_->attachment);
					_g_object_unref0 (_data_->attachments);
					_g_free0 (_data_->body);
					_data_->params = (_vala_array_free (_data_->params, _data_->params_length1, (GDestroyNotify) g_free), NULL);
					_data_->_tmp12_ = (_vala_array_free (_data_->_tmp12_, _data_->_tmp12__length1, (GDestroyNotify) g_free), NULL);
					_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (_data_->email);
					_g_object_unref0 (_data_->headers);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_g_free0 (_data_->attachment);
			}
		}
		_data_->_tmp106_ = _data_->body;
		_data_->_state_ = 1;
		composer_widget_finish_loading (_data_->self, _data_->_tmp106_, "", FALSE, composer_widget_load_mailto_ready, _data_);
		return FALSE;
		_state_1:
		composer_widget_finish_loading_finish (_data_->self, _data_->_res_);
		composer_widget_update_extended_headers (_data_->self, TRUE);
		_g_object_unref0 (_data_->attachments);
		_g_free0 (_data_->body);
		_data_->params = (_vala_array_free (_data_->params, _data_->params_length1, (GDestroyNotify) g_free), NULL);
		_data_->_tmp12_ = (_vala_array_free (_data_->_tmp12_, _data_->_tmp12__length1, (GDestroyNotify) g_free), NULL);
		_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (_data_->email);
	}
	_g_object_unref0 (_data_->headers);
	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
composer_widget_load_context_data_free (gpointer _data)
{
	ComposerWidgetLoadContextData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->context);
	_g_free0 (_data_->quote);
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetLoadContextData, _data_);
}

void
composer_widget_load_context (ComposerWidget* self,
                              ComposerWidgetContextType type,
                              GearyEmail* context,
                              const gchar* quote,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	ComposerWidgetLoadContextData* _data_;
	ComposerWidget* _tmp0_;
	GearyEmail* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (context, GEARY_TYPE_EMAIL));
	_data_ = g_slice_new0 (ComposerWidgetLoadContextData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_load_context_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->type = type;
	_tmp1_ = _g_object_ref0 (context);
	_g_object_unref0 (_data_->context);
	_data_->context = _tmp1_;
	_tmp2_ = g_strdup (quote);
	_g_free0 (_data_->quote);
	_data_->quote = _tmp2_;
	composer_widget_load_context_co (_data_);
}

void
composer_widget_load_context_finish (ComposerWidget* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	ComposerWidgetLoadContextData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
     * Loads a draft, reply, or forwarded message into the composer.
     *
     * If the given context email does not contain the fields
     * specified by {@link REQUIRED_FIELDS}, it will be loaded from
     * the current account context's store with those.
     */
static void
composer_widget_load_context_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	ComposerWidgetLoadContextData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_load_context_co (_data_);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
composer_widget_load_context_co (ComposerWidgetLoadContextData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->type == COMPOSER_WIDGET_CONTEXT_TYPE_NONE) {
		_data_->_tmp0_ = g_enum_get_value (g_type_class_ref (COMPOSER_WIDGET_TYPE_CONTEXT_TYPE), _data_->type);
		_data_->_tmp1_ = g_error_new (GEARY_ENGINE_ERROR, GEARY_ENGINE_ERROR_BAD_PARAMETERS, "Invalid context type: %s", (_data_->_tmp0_ != NULL) ? _data_->_tmp0_->value_name : NULL);
		_data_->_inner_error0_ = _data_->_tmp1_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _g_object_ref0 (_data_->context);
	_data_->full_context = _data_->_tmp2_;
	_data_->_tmp3_ = geary_email_get_fields (_data_->context);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (!geary_email_field_is_all_set (_data_->_tmp4_, COMPOSER_WIDGET_REQUIRED_FIELDS)) {
		_data_->_tmp5_ = _data_->self->priv->_sender_context;
		_data_->_tmp6_ = application_account_context_get_emails (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = geary_email_get_id (_data_->context);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = geary_collection_single (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp9_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = _data_->self->priv->_sender_context;
		_data_->_tmp13_ = application_account_context_get_cancellable (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_state_ = 1;
		geary_app_email_store_list_email_by_sparse_id_async (_data_->_tmp7_, _data_->_tmp11_, COMPOSER_WIDGET_REQUIRED_FIELDS, GEARY_FOLDER_LIST_FLAGS_NONE, _data_->_tmp14_, composer_widget_load_context_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp15_ = geary_app_email_store_list_email_by_sparse_id_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp16_ = _data_->_tmp15_;
		_g_object_unref0 (_data_->_tmp11_);
		_data_->email = _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->full_context);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp18_ = _data_->email;
		if (_data_->_tmp18_ == NULL) {
			_data_->_tmp17_ = TRUE;
		} else {
			_data_->_tmp19_ = _data_->email;
			_data_->_tmp20_ = gee_collection_get_is_empty (_data_->_tmp19_);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp17_ = _data_->_tmp21_;
		}
		if (_data_->_tmp17_) {
			_data_->_tmp22_ = geary_email_get_fields (_data_->context);
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_tmp24_ = geary_email_field_to_string (_data_->_tmp23_);
			_data_->_tmp25_ = _data_->_tmp24_;
			_data_->_tmp26_ = g_error_new (GEARY_ENGINE_ERROR, GEARY_ENGINE_ERROR_INCOMPLETE_MESSAGE, "Unable to load email fields required for composer: %s", _data_->_tmp25_);
			_data_->_tmp27_ = _data_->_tmp26_;
			_g_free0 (_data_->_tmp25_);
			_data_->_inner_error0_ = _data_->_tmp27_;
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->email);
			_g_object_unref0 (_data_->full_context);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp28_ = _data_->email;
		_data_->_tmp29_ = geary_collection_first (GEARY_TYPE_EMAIL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp28_);
		_g_object_unref0 (_data_->full_context);
		_data_->full_context = (GearyEmail*) _data_->_tmp29_;
		_g_object_unref0 (_data_->email);
	}
	composer_widget_set_context_type (_data_->self, _data_->type);
	if (_data_->type == COMPOSER_WIDGET_CONTEXT_TYPE_EDIT) {
		_data_->_tmp30_ = TRUE;
	} else {
		_data_->_tmp30_ = _data_->type == COMPOSER_WIDGET_CONTEXT_TYPE_FORWARD;
	}
	if (_data_->_tmp30_) {
		_data_->self->priv->pending_include = COMPOSER_WIDGET_ATTACH_PENDING_ALL;
	}
	_data_->_tmp31_ = _data_->full_context;
	_data_->_tmp32_ = geary_email_get_attachments (_data_->_tmp31_);
	_data_->_tmp33_ = _data_->_tmp32_;
	_data_->_tmp34_ = _g_object_ref0 (_data_->_tmp33_);
	_g_object_unref0 (_data_->self->priv->pending_attachments);
	_data_->self->priv->pending_attachments = _data_->_tmp34_;
	_data_->_tmp35_ = g_strdup ("");
	_data_->body = _data_->_tmp35_;
	_data_->_tmp36_ = g_strdup ("");
	_data_->complete_quote = _data_->_tmp36_;
	_data_->body_complete = FALSE;
	switch (_data_->type) {
		case COMPOSER_WIDGET_CONTEXT_TYPE_EDIT:
		{
			_data_->_tmp37_ = _data_->full_context;
			_data_->_tmp38_ = geary_email_get_id (_data_->_tmp37_);
			_data_->_tmp39_ = _data_->_tmp38_;
			composer_widget_set_saved_id (_data_->self, _data_->_tmp39_);
			_data_->_tmp40_ = _data_->full_context;
			_data_->_tmp41_ = geary_email_header_set_get_from (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp40_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp42_ = _data_->_tmp41_;
			if (_data_->_tmp42_ != NULL) {
				_data_->_tmp43_ = _data_->full_context;
				_data_->_tmp44_ = geary_email_header_set_get_from (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp43_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp45_ = _data_->_tmp44_;
				composer_widget_set_from (_data_->self, _data_->_tmp45_);
			}
			_data_->_tmp46_ = _data_->full_context;
			_data_->_tmp47_ = geary_email_header_set_get_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp46_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp48_ = _data_->_tmp47_;
			if (_data_->_tmp48_ != NULL) {
				_data_->_tmp49_ = _data_->self->priv->to_row;
				_data_->_tmp50_ = composer_widget_header_row_get_value (_data_->_tmp49_);
				_data_->_tmp51_ = _data_->_tmp50_;
				_data_->_tmp52_ = _data_->full_context;
				_data_->_tmp53_ = geary_email_header_set_get_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp52_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp54_ = _data_->_tmp53_;
				composer_email_entry_set_addresses ((ComposerEmailEntry*) _data_->_tmp51_, _data_->_tmp54_);
			}
			_data_->_tmp55_ = _data_->full_context;
			_data_->_tmp56_ = geary_email_header_set_get_cc (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp55_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp57_ = _data_->_tmp56_;
			if (_data_->_tmp57_ != NULL) {
				_data_->_tmp58_ = _data_->self->priv->cc_row;
				_data_->_tmp59_ = composer_widget_header_row_get_value (_data_->_tmp58_);
				_data_->_tmp60_ = _data_->_tmp59_;
				_data_->_tmp61_ = _data_->full_context;
				_data_->_tmp62_ = geary_email_header_set_get_cc (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp61_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp63_ = _data_->_tmp62_;
				composer_email_entry_set_addresses ((ComposerEmailEntry*) _data_->_tmp60_, _data_->_tmp63_);
			}
			_data_->_tmp64_ = _data_->full_context;
			_data_->_tmp65_ = geary_email_header_set_get_bcc (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp64_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp66_ = _data_->_tmp65_;
			if (_data_->_tmp66_ != NULL) {
				_data_->_tmp67_ = _data_->self->priv->bcc_row;
				_data_->_tmp68_ = composer_widget_header_row_get_value (_data_->_tmp67_);
				_data_->_tmp69_ = _data_->_tmp68_;
				_data_->_tmp70_ = _data_->full_context;
				_data_->_tmp71_ = geary_email_header_set_get_bcc (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp70_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp72_ = _data_->_tmp71_;
				composer_email_entry_set_addresses ((ComposerEmailEntry*) _data_->_tmp69_, _data_->_tmp72_);
			}
			_data_->_tmp73_ = _data_->full_context;
			_data_->_tmp74_ = geary_email_header_set_get_reply_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp73_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp75_ = _data_->_tmp74_;
			if (_data_->_tmp75_ != NULL) {
				_data_->_tmp76_ = _data_->self->priv->reply_to_row;
				_data_->_tmp77_ = composer_widget_header_row_get_value (_data_->_tmp76_);
				_data_->_tmp78_ = _data_->_tmp77_;
				_data_->_tmp79_ = _data_->full_context;
				_data_->_tmp80_ = geary_email_header_set_get_reply_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp79_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp81_ = _data_->_tmp80_;
				composer_email_entry_set_addresses ((ComposerEmailEntry*) _data_->_tmp78_, _data_->_tmp81_);
			}
			_data_->_tmp82_ = _data_->full_context;
			_data_->_tmp83_ = geary_email_header_set_get_in_reply_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp82_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp84_ = _data_->_tmp83_;
			if (_data_->_tmp84_ != NULL) {
				_data_->_tmp85_ = _data_->self->priv->_in_reply_to;
				_data_->_tmp86_ = _data_->full_context;
				_data_->_tmp87_ = geary_email_header_set_get_in_reply_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp86_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp88_ = _data_->_tmp87_;
				_data_->_tmp89_ = geary_rf_c822_message_id_list_concatenate_list (_data_->_tmp85_, _data_->_tmp88_);
				_data_->_tmp90_ = _data_->_tmp89_;
				composer_widget_set_in_reply_to (_data_->self, _data_->_tmp90_);
				_g_object_unref0 (_data_->_tmp90_);
			}
			_data_->_tmp91_ = _data_->full_context;
			_data_->_tmp92_ = geary_email_header_set_get_references (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp91_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp93_ = _data_->_tmp92_;
			if (_data_->_tmp93_ != NULL) {
				_data_->_tmp94_ = _data_->self->priv->_references;
				_data_->_tmp95_ = _data_->full_context;
				_data_->_tmp96_ = geary_email_header_set_get_references (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp95_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp97_ = _data_->_tmp96_;
				_data_->_tmp98_ = geary_rf_c822_message_id_list_concatenate_list (_data_->_tmp94_, _data_->_tmp97_);
				_data_->_tmp99_ = _data_->_tmp98_;
				composer_widget_set_references (_data_->self, _data_->_tmp99_);
				_g_object_unref0 (_data_->_tmp99_);
			}
			_data_->_tmp100_ = _data_->full_context;
			_data_->_tmp101_ = geary_email_header_set_get_subject (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp100_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp102_ = _data_->_tmp101_;
			if (_data_->_tmp102_ != NULL) {
				_data_->_tmp104_ = _data_->full_context;
				_data_->_tmp105_ = geary_email_header_set_get_subject (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp104_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp106_ = _data_->_tmp105_;
				_data_->_tmp107_ = geary_message_data_string_message_data_get_value (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp106_, GEARY_MESSAGE_DATA_TYPE_STRING_MESSAGE_DATA, GearyMessageDataStringMessageData));
				_data_->_tmp108_ = _data_->_tmp107_;
				_data_->_tmp103_ = _data_->_tmp108_;
				if (_data_->_tmp103_ == NULL) {
					_data_->_tmp103_ = "";
				}
				composer_widget_set_subject (_data_->self, _data_->_tmp103_);
			}
			_data_->_tmp109_ = _data_->full_context;
			_data_->_tmp110_ = geary_email_get_message (_data_->_tmp109_, &_data_->_inner_error0_);
			_data_->message = _data_->_tmp110_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->complete_quote);
				_g_free0 (_data_->body);
				_g_object_unref0 (_data_->full_context);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp111_ = _data_->message;
			if (geary_rf_c822_message_has_html_body (_data_->_tmp111_)) {
				_data_->_tmp113_ = _data_->message;
				_data_->_tmp114_ = geary_rf_c822_message_get_html_body (_data_->_tmp113_, NULL, NULL, &_data_->_inner_error0_);
				_data_->_tmp112_ = _data_->_tmp114_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->message);
					_g_free0 (_data_->complete_quote);
					_g_free0 (_data_->body);
					_g_object_unref0 (_data_->full_context);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_data_->_tmp115_ = _data_->_tmp112_;
				_data_->_tmp112_ = NULL;
				_g_free0 (_data_->body);
				_data_->body = _data_->_tmp115_;
				_data_->_tmp116_ = _data_->body;
				_data_->_tmp117_ = g_strdup_printf ("id=\"%s\"", COMPOSER_WEB_VIEW_BODY_HTML_ID);
				_data_->_tmp118_ = _data_->_tmp117_;
				_data_->body_complete = string_contains (_data_->_tmp116_, _data_->_tmp118_);
				_g_free0 (_data_->_tmp118_);
				_g_free0 (_data_->_tmp112_);
			} else {
				_data_->_tmp120_ = _data_->message;
				_data_->_tmp121_ = geary_rf_c822_message_get_plain_body (_data_->_tmp120_, TRUE, NULL, NULL, &_data_->_inner_error0_);
				_data_->_tmp119_ = _data_->_tmp121_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->message);
					_g_free0 (_data_->complete_quote);
					_g_free0 (_data_->body);
					_g_object_unref0 (_data_->full_context);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_data_->_tmp122_ = _data_->_tmp119_;
				_data_->_tmp119_ = NULL;
				_g_free0 (_data_->body);
				_data_->body = _data_->_tmp122_;
				_g_free0 (_data_->_tmp119_);
			}
			_data_->_state_ = 2;
			composer_widget_restore_reply_to_state (_data_->self, composer_widget_load_context_ready, _data_);
			return FALSE;
			_state_2:
			composer_widget_restore_reply_to_state_finish (_data_->self, _data_->_res_);
			_g_object_unref0 (_data_->message);
			break;
		}
		case COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_SENDER:
		case COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_ALL:
		{
			_data_->_tmp123_ = _data_->full_context;
			_data_->_tmp124_ = geary_email_header_set_get_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp123_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp125_ = _data_->_tmp124_;
			if (!composer_widget_update_from_address (_data_->self, _data_->_tmp125_)) {
				_data_->_tmp126_ = _data_->full_context;
				_data_->_tmp127_ = geary_email_header_set_get_cc (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp126_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp128_ = _data_->_tmp127_;
				if (!composer_widget_update_from_address (_data_->self, _data_->_tmp128_)) {
					_data_->_tmp129_ = _data_->full_context;
					_data_->_tmp130_ = geary_email_header_set_get_bcc (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp129_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
					_data_->_tmp131_ = _data_->_tmp130_;
					if (!composer_widget_update_from_address (_data_->self, _data_->_tmp131_)) {
						_data_->_tmp132_ = _data_->full_context;
						_data_->_tmp133_ = geary_email_header_set_get_from (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp132_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
						_data_->_tmp134_ = _data_->_tmp133_;
						composer_widget_update_from_address (_data_->self, _data_->_tmp134_);
					}
				}
			}
			_data_->_tmp135_ = _data_->full_context;
			_data_->_tmp136_ = geary_rf_c822_utils_create_subject_for_reply (_data_->_tmp135_);
			_data_->_tmp137_ = _data_->_tmp136_;
			composer_widget_set_subject (_data_->self, _data_->_tmp137_);
			_g_free0 (_data_->_tmp137_);
			_data_->_tmp138_ = _data_->full_context;
			composer_widget_add_recipients_and_ids (_data_->self, _data_->type, _data_->_tmp138_);
			_data_->_tmp139_ = _data_->full_context;
			_data_->_tmp140_ = util_email_quote_email_for_reply (_data_->_tmp139_, _data_->quote, GEARY_RF_C822_TEXT_FORMAT_HTML);
			_g_free0 (_data_->complete_quote);
			_data_->complete_quote = _data_->_tmp140_;
			if (!geary_string_is_empty (_data_->quote)) {
				_data_->self->priv->top_posting = FALSE;
			} else {
				composer_widget_set_can_delete_quote (_data_->self, TRUE);
			}
			break;
		}
		case COMPOSER_WIDGET_CONTEXT_TYPE_FORWARD:
		{
			_data_->_tmp141_ = _data_->full_context;
			_data_->_tmp142_ = geary_rf_c822_utils_create_subject_for_forward (_data_->_tmp141_);
			_data_->_tmp143_ = _data_->_tmp142_;
			composer_widget_set_subject (_data_->self, _data_->_tmp143_);
			_g_free0 (_data_->_tmp143_);
			_data_->_tmp144_ = _data_->full_context;
			_data_->_tmp145_ = geary_email_header_set_get_message_id (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp144_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_data_->_tmp146_ = _data_->_tmp145_;
			if (_data_->_tmp146_ != NULL) {
				_data_->_tmp147_ = _data_->self->priv->_references;
				_data_->_tmp148_ = _data_->full_context;
				_data_->_tmp149_ = geary_email_header_set_get_message_id (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp148_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
				_data_->_tmp150_ = _data_->_tmp149_;
				_data_->_tmp151_ = geary_rf_c822_message_id_list_concatenate_id (_data_->_tmp147_, _data_->_tmp150_);
				_data_->_tmp152_ = _data_->_tmp151_;
				composer_widget_set_references (_data_->self, _data_->_tmp152_);
				_g_object_unref0 (_data_->_tmp152_);
			}
			_data_->_tmp153_ = _data_->full_context;
			_data_->_tmp154_ = util_email_quote_email_for_forward (_data_->_tmp153_, _data_->quote, GEARY_RF_C822_TEXT_FORMAT_HTML);
			_g_free0 (_data_->complete_quote);
			_data_->complete_quote = _data_->_tmp154_;
			_data_->_tmp155_ = _data_->self->priv->referred_ids;
			_data_->_tmp156_ = _data_->full_context;
			_data_->_tmp157_ = geary_email_get_id (_data_->_tmp156_);
			_data_->_tmp158_ = _data_->_tmp157_;
			gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp155_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp158_);
			break;
		}
		case COMPOSER_WIDGET_CONTEXT_TYPE_NONE:
		{
			break;
		}
		default:
		break;
	}
	composer_widget_update_extended_headers (_data_->self, TRUE);
	_data_->_tmp159_ = _data_->body;
	_data_->_tmp160_ = _data_->complete_quote;
	_data_->_state_ = 3;
	composer_widget_finish_loading (_data_->self, _data_->_tmp159_, _data_->_tmp160_, _data_->body_complete, composer_widget_load_context_ready, _data_);
	return FALSE;
	_state_3:
	composer_widget_finish_loading_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->complete_quote);
	_g_free0 (_data_->body);
	_g_object_unref0 (_data_->full_context);
	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;
}

/**
     * Returns the emails referred to by the composed email.
     *
     * A referred email is the email this composer is a reply to, or
     * forwarded from. There may be multiple if a composer was already
     * open and another email was replied to.
     */
GeeSet*
composer_widget_get_referred_ids (ComposerWidget* self)
{
	GeeSet* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	GeeSet* result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	_tmp0_ = self->priv->referred_ids;
	_tmp1_ = gee_set_get_read_only_view (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

/** Detaches the composer and opens it in a new window. */
static GVariant*
_variant_new22 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

void
composer_widget_detach (ComposerWidget* self,
                        ApplicationClient* application)
{
	GtkWidget* focused_widget = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	ComposerWindow* new_window = NULL;
	ComposerWindow* _tmp10_;
	const gchar* _tmp11_ = NULL;
	ApplicationConfiguration* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	ComposerEditor* _tmp15_;
	GSimpleActionGroup* _tmp16_;
	GVariant* _tmp17_;
	gboolean refocus = FALSE;
	GtkWidget* _tmp18_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (APPLICATION_IS_CLIENT (application));
	focused_widget = NULL;
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ComposerContainer* _tmp2_;
		ComposerContainer* _tmp3_;
		GtkApplicationWindow* _tmp4_;
		GtkApplicationWindow* _tmp5_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		ComposerContainer* _tmp8_;
		ComposerContainer* _tmp9_;
		_tmp2_ = composer_widget_get_container (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = composer_container_get_top_window (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = gtk_window_get_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_window_get_type (), GtkWindow));
		_tmp7_ = _g_object_ref0 (_tmp6_);
		_g_object_unref0 (focused_widget);
		focused_widget = _tmp7_;
		_tmp8_ = composer_widget_get_container (self);
		_tmp9_ = _tmp8_;
		composer_container_close (_tmp9_);
	}
	_tmp10_ = composer_window_new (self, application);
	g_object_ref_sink (_tmp10_);
	new_window = _tmp10_;
	_tmp12_ = self->priv->config;
	_tmp13_ = application_configuration_get_compose_as_html (_tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_) {
		_tmp11_ = "html";
	} else {
		_tmp11_ = "plain";
	}
	_tmp15_ = self->priv->_editor;
	_tmp16_ = _tmp15_->actions;
	_tmp17_ = _variant_new22 (_tmp11_);
	g_action_group_change_action_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, g_action_group_get_type (), GActionGroup), COMPOSER_EDITOR_ACTION_TEXT_FORMAT, _tmp17_);
	_g_variant_unref0 (_tmp17_);
	composer_widget_set_mode (self, COMPOSER_WIDGET_PRESENTATION_MODE_DETACHED);
	refocus = TRUE;
	_tmp18_ = focused_widget;
	if (_tmp18_ != NULL) {
		ComposerWindow* focused_window = NULL;
		GtkWidget* _tmp19_;
		GtkWidget* _tmp20_;
		ComposerWindow* _tmp21_;
		ComposerWindow* _tmp22_;
		ComposerWindow* _tmp23_;
		_tmp19_ = focused_widget;
		_tmp20_ = gtk_widget_get_toplevel (_tmp19_);
		_tmp21_ = _g_object_ref0 (COMPOSER_IS_WINDOW (_tmp20_) ? ((ComposerWindow*) _tmp20_) : NULL);
		focused_window = _tmp21_;
		_tmp22_ = new_window;
		_tmp23_ = focused_window;
		if (_tmp22_ == _tmp23_) {
			GtkWidget* _tmp24_;
			_tmp24_ = focused_widget;
			gtk_widget_grab_focus (_tmp24_);
			refocus = FALSE;
		}
		_g_object_unref0 (focused_window);
	}
	if (refocus) {
		composer_widget_set_focus (self);
	}
	_g_object_unref0 (new_window);
	_g_object_unref0 (focused_widget);
}

/**
     * Prompts to close the composer if needed, before closing it.
     *
     * If the composer is already closed no action is taken. If the
     * composer is blank then this method will close the composer,
     * else the composer will either be saved or discarded as needed
     * then closed.
     *
     * The return value specifies whether the composer is being closed
     * or if the prompt was cancelled by a human.
     */
ComposerWidgetCloseStatus
composer_widget_conditional_close (ComposerWidget* self,
                                   gboolean should_prompt,
                                   gboolean is_shutdown)
{
	ComposerWidgetCloseStatus status = 0;
	ComposerWidgetPresentationMode _tmp0_;
	ComposerWidgetCloseStatus result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), 0);
	status = COMPOSER_WIDGET_CLOSE_STATUS_CLOSED;
	_tmp0_ = self->priv->_current_mode;
	switch (_tmp0_) {
		case COMPOSER_WIDGET_PRESENTATION_MODE_CLOSED:
		{
			break;
		}
		case COMPOSER_WIDGET_PRESENTATION_MODE_NONE:
		{
			status = COMPOSER_WIDGET_CLOSE_STATUS_READY;
			break;
		}
		default:
		{
			gboolean _tmp1_;
			gboolean _tmp2_;
			_tmp1_ = composer_widget_get_is_blank (self);
			_tmp2_ = _tmp1_;
			if (_tmp2_) {
				composer_widget_close (self, NULL, NULL);
				status = COMPOSER_WIDGET_CLOSE_STATUS_CLOSED;
			} else {
				if (should_prompt) {
					gboolean _tmp3_;
					gboolean _tmp4_;
					composer_widget_present (self);
					_tmp3_ = composer_widget_get_can_save (self);
					_tmp4_ = _tmp3_;
					if (_tmp4_) {
						const gchar* _tmp5_ = NULL;
						TernaryConfirmationDialog* dialog = NULL;
						ComposerContainer* _tmp6_;
						ComposerContainer* _tmp7_;
						GtkApplicationWindow* _tmp8_;
						GtkApplicationWindow* _tmp9_;
						GtkResponseType _tmp10_;
						TernaryConfirmationDialog* _tmp11_;
						GtkResponseType response = 0;
						TernaryConfirmationDialog* _tmp12_;
						gboolean _tmp13_ = FALSE;
						if (is_shutdown) {
							_tmp5_ = "destructive-action";
						} else {
							_tmp5_ = "";
						}
						_tmp6_ = composer_widget_get_container (self);
						_tmp7_ = _tmp6_;
						_tmp8_ = composer_container_get_top_window (_tmp7_);
						_tmp9_ = _tmp8_;
						_tmp10_ = GTK_RESPONSE_OK;
						_tmp11_ = ternary_confirmation_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_window_get_type (), GtkWindow), _ ("Do you want to keep or discard this draft message?"), NULL, STOCK__KEEP, STOCK__DISCARD, GTK_RESPONSE_CLOSE, "", _tmp5_, &_tmp10_);
						dialog = _tmp11_;
						_tmp12_ = dialog;
						response = alert_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_ALERT_DIALOG, AlertDialog));
						if (response == GTK_RESPONSE_CANCEL) {
							_tmp13_ = TRUE;
						} else {
							_tmp13_ = response == GTK_RESPONSE_DELETE_EVENT;
						}
						if (_tmp13_) {
							status = COMPOSER_WIDGET_CLOSE_STATUS_CANCELLED;
						} else {
							if (response == GTK_RESPONSE_OK) {
								composer_widget_save_and_close (self, NULL, NULL);
							} else {
								composer_widget_discard_and_close (self, NULL, NULL);
							}
						}
						_g_object_unref0 (dialog);
					} else {
						AlertDialog* dialog = NULL;
						ComposerContainer* _tmp14_;
						ComposerContainer* _tmp15_;
						GtkApplicationWindow* _tmp16_;
						GtkApplicationWindow* _tmp17_;
						ConfirmationDialog* _tmp18_;
						GtkResponseType response = 0;
						AlertDialog* _tmp19_;
						_tmp14_ = composer_widget_get_container (self);
						_tmp15_ = _tmp14_;
						_tmp16_ = composer_container_get_top_window (_tmp15_);
						_tmp17_ = _tmp16_;
						_tmp18_ = confirmation_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_window_get_type (), GtkWindow), _ ("Do you want to discard this draft message?"), NULL, STOCK__DISCARD, "");
						dialog = G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_ALERT_DIALOG, AlertDialog);
						_tmp19_ = dialog;
						response = alert_dialog_run (_tmp19_);
						if (response == GTK_RESPONSE_OK) {
							composer_widget_discard_and_close (self, NULL, NULL);
						} else {
							status = COMPOSER_WIDGET_CLOSE_STATUS_CANCELLED;
						}
						_g_object_unref0 (dialog);
					}
				} else {
					gboolean _tmp20_;
					gboolean _tmp21_;
					_tmp20_ = composer_widget_get_can_save (self);
					_tmp21_ = _tmp20_;
					if (_tmp21_) {
						composer_widget_save_and_close (self, NULL, NULL);
					} else {
						composer_widget_discard_and_close (self, NULL, NULL);
					}
				}
			}
			break;
		}
	}
	result = status;
	return result;
}

static void
composer_widget_close_data_free (gpointer _data)
{
	ComposerWidgetCloseData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetCloseData, _data_);
}

void
composer_widget_close (ComposerWidget* self,
                       GAsyncReadyCallback _callback_,
                       gpointer _user_data_)
{
	ComposerWidgetCloseData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetCloseData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_close_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_close_co (_data_);
}

void
composer_widget_close_finish (ComposerWidget* self,
                              GAsyncResult* _res_)
{
	ComposerWidgetCloseData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Closes the composer and any drafts unconditionally.
     *
     * This method disables the composer, closes the draft manager,
     * then destroys the composer itself.
     */
static void
composer_widget_close_ready (GObject* source_object,
                             GAsyncResult* _res_,
                             gpointer _user_data_)
{
	ComposerWidgetCloseData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_close_co (_data_);
}

static gboolean
composer_widget_close_co (ComposerWidgetCloseData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_current_mode;
	if (_data_->_tmp0_ != COMPOSER_WIDGET_PRESENTATION_MODE_CLOSED) {
		composer_widget_set_enabled (_data_->self, FALSE);
		composer_widget_set_current_mode (_data_->self, COMPOSER_WIDGET_PRESENTATION_MODE_CLOSED);
		_data_->_tmp1_ = _data_->self->priv->draft_manager_opening;
		if (_data_->_tmp1_ != NULL) {
			_data_->_tmp2_ = _data_->self->priv->draft_manager_opening;
			g_cancellable_cancel (_data_->_tmp2_);
			_g_object_unref0 (_data_->self->priv->draft_manager_opening);
			_data_->self->priv->draft_manager_opening = NULL;
		}
		{
			_data_->_state_ = 1;
			composer_widget_close_draft_manager (_data_->self, COMPOSER_WIDGET_DRAFT_POLICY_KEEP, composer_widget_close_ready, _data_);
			return FALSE;
			_state_1:
			composer_widget_close_draft_manager_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->_error_ = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp3_ = _data_->self->priv->application;
			_data_->_tmp4_ = _data_->self->priv->_sender_context;
			_data_->_tmp5_ = application_account_context_get_account (_data_->_tmp4_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->_tmp7_ = geary_account_get_information (_data_->_tmp6_);
			_data_->_tmp8_ = _data_->_tmp7_;
			_data_->_tmp9_ = _data_->_error_;
			_data_->_tmp10_ = geary_account_problem_report_new (_data_->_tmp8_, _data_->_tmp9_);
			_data_->_tmp11_ = _data_->_tmp10_;
			composer_application_interface_report_problem (_data_->_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
			_g_object_unref0 (_data_->_tmp11_);
			_g_error_free0 (_data_->_error_);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_widget_get_type (), GtkWidget));
	}
	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
composer_widget_real_destroy (GtkWidget* base)
{
	ComposerWidget * self;
	GearyAppDraftManager* _tmp0_;
	ComposerApplicationInterface* _tmp1_;
	guint _tmp2_;
	ComposerApplicationInterface* _tmp3_;
	guint _tmp4_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, COMPOSER_TYPE_WIDGET, ComposerWidget);
	_tmp0_ = self->priv->draft_manager;
	if (_tmp0_ != NULL) {
		g_warning ("composer-widget.vala:986: Draft manager still open on composer destroy");
	}
	_tmp1_ = self->priv->application;
	g_signal_parse_name ("account-available", APPLICATION_TYPE_ACCOUNT_INTERFACE, &_tmp2_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterface), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _composer_widget_on_account_available_application_account_interface_account_available, self);
	_tmp3_ = self->priv->application;
	g_signal_parse_name ("account-unavailable", APPLICATION_TYPE_ACCOUNT_INTERFACE, &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterface), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _composer_widget_on_account_unavailable_application_account_interface_account_unavailable, self);
	GTK_WIDGET_CLASS (composer_widget_parent_class)->destroy (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_event_box_get_type (), GtkEventBox), gtk_widget_get_type (), GtkWidget));
}

/**
     * Sets whether the composer is able to be used.
     *
     * If disabled, the composer hidden, detached from its container
     * and will stop periodically saving drafts.
     */
static Block71Data*
block71_data_ref (Block71Data* _data71_)
{
	g_atomic_int_inc (&_data71_->_ref_count_);
	return _data71_;
}

static void
block71_data_unref (void * _userdata_)
{
	Block71Data* _data71_;
	_data71_ = (Block71Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data71_->_ref_count_)) {
		ComposerWidget* self;
		self = _data71_->self;
		_g_object_unref0 (_data71_->current_account);
		_g_object_unref0 (self);
		g_slice_free (Block71Data, _data71_);
	}
}

static void
___lambda48_ (Block71Data* _data71_,
              GObject* obj,
              GAsyncResult* res)
{
	ComposerWidget* self;
	GError* _inner_error0_ = NULL;
	self = _data71_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	{
		composer_widget_open_draft_manager_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		ComposerApplicationInterface* _tmp0_;
		GearyAccount* _tmp1_;
		GearyAccountInformation* _tmp2_;
		GearyAccountInformation* _tmp3_;
		GError* _tmp4_;
		GearyAccountProblemReport* _tmp5_;
		GearyAccountProblemReport* _tmp6_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = self->priv->application;
		_tmp1_ = _data71_->current_account;
		_tmp2_ = geary_account_get_information (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _error_;
		_tmp5_ = geary_account_problem_report_new (_tmp3_, _tmp4_);
		_tmp6_ = _tmp5_;
		composer_application_interface_report_problem (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
		_g_object_unref0 (_tmp6_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda48__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda48_ (self, source_object, res);
	block71_data_unref (self);
}

void
composer_widget_set_enabled (ComposerWidget* self,
                             gboolean enabled)
{
	ComposerHeaderbar* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_set_current_mode (self, COMPOSER_WIDGET_PRESENTATION_MODE_NONE);
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), enabled);
	_tmp0_ = self->priv->_header;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), enabled);
	if (enabled) {
		Block71Data* _data71_;
		ApplicationAccountContext* _tmp1_;
		GearyAccount* _tmp2_;
		GearyAccount* _tmp3_;
		GearyAccount* _tmp4_;
		GearyEmailIdentifier* _tmp5_;
		_data71_ = g_slice_new0 (Block71Data);
		_data71_->_ref_count_ = 1;
		_data71_->self = g_object_ref (self);
		_tmp1_ = self->priv->_sender_context;
		_tmp2_ = application_account_context_get_account (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		_data71_->current_account = _tmp4_;
		_tmp5_ = self->priv->_saved_id;
		composer_widget_open_draft_manager (self, _tmp5_, ____lambda48__gasync_ready_callback, block71_data_ref (_data71_));
		block71_data_unref (_data71_);
		_data71_ = NULL;
	} else {
		ComposerContainer* _tmp6_;
		ComposerContainer* _tmp7_;
		GearyTimeoutManager* _tmp10_;
		_tmp6_ = composer_widget_get_container (self);
		_tmp7_ = _tmp6_;
		if (_tmp7_ != NULL) {
			ComposerContainer* _tmp8_;
			ComposerContainer* _tmp9_;
			_tmp8_ = composer_widget_get_container (self);
			_tmp9_ = _tmp8_;
			composer_container_close (_tmp9_);
		}
		_tmp10_ = self->priv->draft_timer;
		geary_timeout_manager_reset (_tmp10_);
	}
}

/** Overrides the folder used for saving drafts. */
void
composer_widget_set_save_to_override (ComposerWidget* self,
                                      GearyFolder* save_to)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail ((save_to == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (save_to, GEARY_TYPE_FOLDER));
	composer_widget_set_save_to (self, save_to);
	composer_widget_reopen_draft_manager (self, NULL, NULL);
}

/**
     * Loads and sets contact auto-complete data for the current account.
     */
static void
composer_widget_load_entry_completions (ComposerWidget* self)
{
	ApplicationContactStore* contacts = NULL;
	ApplicationAccountContext* _tmp0_;
	ApplicationContactStore* _tmp1_;
	ApplicationContactStore* _tmp2_;
	ApplicationContactStore* _tmp3_;
	ComposerWidgetHeaderRow* _tmp4_;
	gconstpointer _tmp5_;
	gconstpointer _tmp6_;
	ContactEntryCompletion* _tmp7_;
	ContactEntryCompletion* _tmp8_;
	ComposerWidgetHeaderRow* _tmp9_;
	gconstpointer _tmp10_;
	gconstpointer _tmp11_;
	ContactEntryCompletion* _tmp12_;
	ContactEntryCompletion* _tmp13_;
	ComposerWidgetHeaderRow* _tmp14_;
	gconstpointer _tmp15_;
	gconstpointer _tmp16_;
	ContactEntryCompletion* _tmp17_;
	ContactEntryCompletion* _tmp18_;
	ComposerWidgetHeaderRow* _tmp19_;
	gconstpointer _tmp20_;
	gconstpointer _tmp21_;
	ContactEntryCompletion* _tmp22_;
	ContactEntryCompletion* _tmp23_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->_sender_context;
	_tmp1_ = application_account_context_get_contacts (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	contacts = _tmp3_;
	_tmp4_ = self->priv->to_row;
	_tmp5_ = composer_widget_header_row_get_value (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = contact_entry_completion_new (contacts);
	_tmp8_ = _tmp7_;
	gtk_entry_set_completion (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp6_, gtk_entry_get_type (), GtkEntry), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_entry_completion_get_type (), GtkEntryCompletion));
	_g_object_unref0 (_tmp8_);
	_tmp9_ = self->priv->cc_row;
	_tmp10_ = composer_widget_header_row_get_value (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = contact_entry_completion_new (contacts);
	_tmp13_ = _tmp12_;
	gtk_entry_set_completion (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp11_, gtk_entry_get_type (), GtkEntry), G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_entry_completion_get_type (), GtkEntryCompletion));
	_g_object_unref0 (_tmp13_);
	_tmp14_ = self->priv->bcc_row;
	_tmp15_ = composer_widget_header_row_get_value (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = contact_entry_completion_new (contacts);
	_tmp18_ = _tmp17_;
	gtk_entry_set_completion (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp16_, gtk_entry_get_type (), GtkEntry), G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_entry_completion_get_type (), GtkEntryCompletion));
	_g_object_unref0 (_tmp18_);
	_tmp19_ = self->priv->reply_to_row;
	_tmp20_ = composer_widget_header_row_get_value (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = contact_entry_completion_new (contacts);
	_tmp23_ = _tmp22_;
	gtk_entry_set_completion (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp21_, gtk_entry_get_type (), GtkEntry), G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_entry_completion_get_type (), GtkEntryCompletion));
	_g_object_unref0 (_tmp23_);
	_g_object_unref0 (contacts);
}

static void
composer_widget_restore_reply_to_state_data_free (gpointer _data)
{
	ComposerWidgetRestoreReplyToStateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetRestoreReplyToStateData, _data_);
}

static void
composer_widget_restore_reply_to_state (ComposerWidget* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ComposerWidgetRestoreReplyToStateData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetRestoreReplyToStateData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_restore_reply_to_state_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_restore_reply_to_state_co (_data_);
}

static void
composer_widget_restore_reply_to_state_finish (ComposerWidget* self,
                                               GAsyncResult* _res_)
{
	ComposerWidgetRestoreReplyToStateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Restores the composer's widget state from any replied to messages.
     */
static void
composer_widget_restore_reply_to_state_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ComposerWidgetRestoreReplyToStateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_restore_reply_to_state_co (_data_);
}

static GVariant*
_variant_new23 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static gboolean
composer_widget_restore_reply_to_state_co (ComposerWidgetRestoreReplyToStateData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_sender_context;
	_data_->_tmp1_ = application_account_context_get_account (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = geary_account_get_information (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = geary_account_information_get_sender_mailboxes (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->sender_addresses = _data_->_tmp6_;
	_data_->_tmp7_ = geary_rf_c822_mailbox_addresses_new (NULL);
	_data_->to_addresses = _data_->_tmp7_;
	_data_->_tmp8_ = geary_rf_c822_mailbox_addresses_new (NULL);
	_data_->cc_addresses = _data_->_tmp8_;
	_data_->new_email = TRUE;
	{
		_data_->_tmp9_ = _data_->self->priv->_in_reply_to;
		_data_->_mid_list = _data_->_tmp9_;
		_data_->_tmp10_ = _data_->_mid_list;
		_data_->_tmp11_ = geary_rf_c822_message_id_list_get_size (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_mid_size = _data_->_tmp12_;
		_data_->_mid_index = -1;
		while (TRUE) {
			_data_->_mid_index = _data_->_mid_index + 1;
			_data_->_tmp13_ = _data_->_mid_index;
			_data_->_tmp14_ = _data_->_mid_size;
			if (!(_data_->_tmp13_ < _data_->_tmp14_)) {
				break;
			}
			_data_->_tmp15_ = _data_->_mid_list;
			_data_->_tmp16_ = geary_rf_c822_message_id_list_get (_data_->_tmp15_, _data_->_mid_index);
			_data_->mid = _data_->_tmp16_;
			_data_->email_map = NULL;
			{
				_data_->_tmp18_ = _data_->self->priv->_sender_context;
				_data_->_tmp19_ = application_account_context_get_account (_data_->_tmp18_);
				_data_->_tmp20_ = _data_->_tmp19_;
				_data_->_tmp21_ = _data_->mid;
				_data_->_tmp22_ = geary_email_flags_get_DRAFT ();
				_data_->_tmp23_ = _data_->_tmp22_;
				_data_->_tmp24_ = _data_->_tmp23_;
				_data_->_tmp25_ = geary_email_flags_new_with (_data_->_tmp24_, NULL);
				_data_->_tmp26_ = _data_->_tmp25_;
				_data_->_state_ = 1;
				geary_account_local_search_message_id_async (_data_->_tmp20_, _data_->_tmp21_, GEARY_EMAIL_FIELD_ENVELOPE, TRUE, NULL, _data_->_tmp26_, NULL, composer_widget_restore_reply_to_state_ready, _data_);
				return FALSE;
				_state_1:
				_data_->_tmp27_ = geary_account_local_search_message_id_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error0_);
				_data_->_tmp28_ = _data_->_tmp27_;
				_g_object_unref0 (_data_->_tmp26_);
				_g_object_unref0 (_data_->_tmp24_);
				_data_->_tmp17_ = _data_->_tmp28_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_data_->_tmp29_ = _data_->_tmp17_;
				_data_->_tmp17_ = NULL;
				_g_object_unref0 (_data_->email_map);
				_data_->email_map = _data_->_tmp29_;
				_g_object_unref0 (_data_->_tmp17_);
			}
			goto __finally0;
			__catch0_g_error:
			{
				_data_->_error_ = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp30_ = _data_->_error_;
				_data_->_tmp31_ = _data_->_tmp30_->message;
				g_warning ("composer-widget.vala:1076: Error restoring edited message state from I" \
"n-Reply-To: %s", _data_->_tmp31_);
				_g_error_free0 (_data_->_error_);
			}
			__finally0:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->email_map);
				_g_object_unref0 (_data_->mid);
				_g_object_unref0 (_data_->cc_addresses);
				_g_object_unref0 (_data_->to_addresses);
				_g_object_unref0 (_data_->sender_addresses);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp32_ = _data_->email_map;
			if (_data_->_tmp32_ != NULL) {
				{
					_data_->_tmp33_ = _data_->email_map;
					_data_->_tmp34_ = gee_multi_map_get_keys (_data_->_tmp33_);
					_data_->_tmp35_ = _data_->_tmp34_;
					_data_->_tmp36_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp35_, GEE_TYPE_ITERABLE, GeeIterable));
					_data_->_tmp37_ = _data_->_tmp36_;
					_g_object_unref0 (_data_->_tmp35_);
					_data_->_candidate_it = _data_->_tmp37_;
					while (TRUE) {
						_data_->_tmp38_ = _data_->_candidate_it;
						if (!gee_iterator_next (_data_->_tmp38_)) {
							break;
						}
						_data_->_tmp39_ = _data_->_candidate_it;
						_data_->_tmp40_ = gee_iterator_get (_data_->_tmp39_);
						_data_->candidate = (GearyEmail*) _data_->_tmp40_;
						_data_->_tmp42_ = _data_->candidate;
						_data_->_tmp43_ = geary_email_header_set_get_message_id (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp42_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
						_data_->_tmp44_ = _data_->_tmp43_;
						if (_data_->_tmp44_ != NULL) {
							_data_->_tmp45_ = _data_->mid;
							_data_->_tmp46_ = _data_->candidate;
							_data_->_tmp47_ = geary_email_header_set_get_message_id (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp46_, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
							_data_->_tmp48_ = _data_->_tmp47_;
							_data_->_tmp41_ = geary_message_data_string_message_data_equal_to (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp45_, GEARY_MESSAGE_DATA_TYPE_STRING_MESSAGE_DATA, GearyMessageDataStringMessageData), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp48_, GEARY_MESSAGE_DATA_TYPE_STRING_MESSAGE_DATA, GearyMessageDataStringMessageData));
						} else {
							_data_->_tmp41_ = FALSE;
						}
						if (_data_->_tmp41_) {
							_data_->_tmp49_ = _data_->to_addresses;
							_data_->_tmp50_ = _data_->candidate;
							_data_->_tmp51_ = _data_->sender_addresses;
							_data_->_tmp52_ = geary_rf_c822_utils_create_to_addresses_for_reply (_data_->_tmp50_, _data_->_tmp51_);
							_data_->_tmp53_ = _data_->_tmp52_;
							_data_->_tmp54_ = geary_rf_c822_mailbox_addresses_merge_list (_data_->_tmp49_, _data_->_tmp53_);
							_g_object_unref0 (_data_->to_addresses);
							_data_->to_addresses = _data_->_tmp54_;
							_g_object_unref0 (_data_->_tmp53_);
							_data_->_tmp55_ = _data_->cc_addresses;
							_data_->_tmp56_ = _data_->candidate;
							_data_->_tmp57_ = _data_->sender_addresses;
							_data_->_tmp58_ = geary_rf_c822_utils_create_cc_addresses_for_reply_all (_data_->_tmp56_, _data_->_tmp57_);
							_data_->_tmp59_ = _data_->_tmp58_;
							_data_->_tmp60_ = geary_rf_c822_mailbox_addresses_merge_list (_data_->_tmp55_, _data_->_tmp59_);
							_g_object_unref0 (_data_->cc_addresses);
							_data_->cc_addresses = _data_->_tmp60_;
							_g_object_unref0 (_data_->_tmp59_);
							_data_->_tmp61_ = _data_->self->priv->referred_ids;
							_data_->_tmp62_ = _data_->candidate;
							_data_->_tmp63_ = geary_email_get_id (_data_->_tmp62_);
							_data_->_tmp64_ = _data_->_tmp63_;
							gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp61_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp64_);
							_data_->new_email = FALSE;
						}
						_g_object_unref0 (_data_->candidate);
					}
					_g_object_unref0 (_data_->_candidate_it);
				}
			}
			_g_object_unref0 (_data_->email_map);
			_g_object_unref0 (_data_->mid);
		}
	}
	if (!_data_->new_email) {
		_data_->_tmp65_ = composer_widget_get_cc (_data_->self);
		_data_->_tmp66_ = _data_->_tmp65_;
		if (g_strcmp0 (_data_->_tmp66_, "") == 0) {
			composer_widget_set_context_type (_data_->self, COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_SENDER);
		} else {
			composer_widget_set_context_type (_data_->self, COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_ALL);
		}
		_data_->_tmp67_ = _data_->self->priv->to_row;
		_data_->_tmp68_ = composer_widget_header_row_get_value (_data_->_tmp67_);
		_data_->_tmp69_ = _data_->_tmp68_;
		_data_->_tmp70_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _data_->_tmp69_);
		_data_->_tmp71_ = _data_->_tmp70_;
		_data_->_tmp72_ = _data_->to_addresses;
		if (!geary_rf_c822_mailbox_addresses_contains_all (_data_->_tmp71_, _data_->_tmp72_)) {
			_data_->_tmp73_ = _data_->self->priv->to_row;
			_data_->_tmp74_ = composer_widget_header_row_get_value (_data_->_tmp73_);
			_data_->_tmp75_ = _data_->_tmp74_;
			composer_email_entry_set_modified ((ComposerEmailEntry*) _data_->_tmp75_);
		}
		_data_->_tmp76_ = _data_->self->priv->cc_row;
		_data_->_tmp77_ = composer_widget_header_row_get_value (_data_->_tmp76_);
		_data_->_tmp78_ = _data_->_tmp77_;
		_data_->_tmp79_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _data_->_tmp78_);
		_data_->_tmp80_ = _data_->_tmp79_;
		_data_->_tmp81_ = _data_->cc_addresses;
		if (!geary_rf_c822_mailbox_addresses_contains_all (_data_->_tmp80_, _data_->_tmp81_)) {
			_data_->_tmp82_ = _data_->self->priv->cc_row;
			_data_->_tmp83_ = composer_widget_header_row_get_value (_data_->_tmp82_);
			_data_->_tmp84_ = _data_->_tmp83_;
			composer_email_entry_set_modified ((ComposerEmailEntry*) _data_->_tmp84_);
		}
		_data_->_tmp85_ = composer_widget_get_bcc (_data_->self);
		_data_->_tmp86_ = _data_->_tmp85_;
		if (g_strcmp0 (_data_->_tmp86_, "") != 0) {
			_data_->_tmp87_ = _data_->self->priv->bcc_row;
			_data_->_tmp88_ = composer_widget_header_row_get_value (_data_->_tmp87_);
			_data_->_tmp89_ = _data_->_tmp88_;
			composer_email_entry_set_modified ((ComposerEmailEntry*) _data_->_tmp89_);
		}
		_data_->_tmp91_ = _data_->self->priv->_current_mode;
		if (_data_->_tmp91_ == COMPOSER_WIDGET_PRESENTATION_MODE_INLINE_COMPACT) {
			_data_->_tmp95_ = _data_->self->priv->to_row;
			_data_->_tmp96_ = composer_widget_header_row_get_value (_data_->_tmp95_);
			_data_->_tmp97_ = _data_->_tmp96_;
			_data_->_tmp98_ = composer_email_entry_get_is_modified ((ComposerEmailEntry*) _data_->_tmp97_);
			_data_->_tmp99_ = _data_->_tmp98_;
			if (_data_->_tmp99_) {
				_data_->_tmp94_ = TRUE;
			} else {
				_data_->_tmp100_ = _data_->self->priv->cc_row;
				_data_->_tmp101_ = composer_widget_header_row_get_value (_data_->_tmp100_);
				_data_->_tmp102_ = _data_->_tmp101_;
				_data_->_tmp103_ = composer_email_entry_get_is_modified ((ComposerEmailEntry*) _data_->_tmp102_);
				_data_->_tmp104_ = _data_->_tmp103_;
				_data_->_tmp94_ = _data_->_tmp104_;
			}
			if (_data_->_tmp94_) {
				_data_->_tmp93_ = TRUE;
			} else {
				_data_->_tmp105_ = _data_->self->priv->bcc_row;
				_data_->_tmp106_ = composer_widget_header_row_get_value (_data_->_tmp105_);
				_data_->_tmp107_ = _data_->_tmp106_;
				_data_->_tmp108_ = composer_email_entry_get_is_modified ((ComposerEmailEntry*) _data_->_tmp107_);
				_data_->_tmp109_ = _data_->_tmp108_;
				_data_->_tmp93_ = _data_->_tmp109_;
			}
			if (_data_->_tmp93_) {
				_data_->_tmp92_ = TRUE;
			} else {
				_data_->_tmp110_ = _data_->self->priv->reply_to_row;
				_data_->_tmp111_ = composer_widget_header_row_get_value (_data_->_tmp110_);
				_data_->_tmp112_ = _data_->_tmp111_;
				_data_->_tmp113_ = composer_email_entry_get_is_modified ((ComposerEmailEntry*) _data_->_tmp112_);
				_data_->_tmp114_ = _data_->_tmp113_;
				_data_->_tmp92_ = _data_->_tmp114_;
			}
			_data_->_tmp90_ = _data_->_tmp92_;
		} else {
			_data_->_tmp90_ = FALSE;
		}
		if (_data_->_tmp90_) {
			composer_widget_set_mode (_data_->self, COMPOSER_WIDGET_PRESENTATION_MODE_INLINE);
		}
		_data_->_tmp116_ = _data_->self->priv->bcc_row;
		_data_->_tmp117_ = composer_widget_header_row_get_value (_data_->_tmp116_);
		_data_->_tmp118_ = _data_->_tmp117_;
		_data_->_tmp119_ = composer_email_entry_get_is_modified ((ComposerEmailEntry*) _data_->_tmp118_);
		_data_->_tmp120_ = _data_->_tmp119_;
		if (_data_->_tmp120_) {
			_data_->_tmp115_ = TRUE;
		} else {
			_data_->_tmp121_ = _data_->self->priv->reply_to_row;
			_data_->_tmp122_ = composer_widget_header_row_get_value (_data_->_tmp121_);
			_data_->_tmp123_ = _data_->_tmp122_;
			_data_->_tmp124_ = composer_email_entry_get_is_modified ((ComposerEmailEntry*) _data_->_tmp123_);
			_data_->_tmp125_ = _data_->_tmp124_;
			_data_->_tmp115_ = _data_->_tmp125_;
		}
		if (_data_->_tmp115_) {
			_data_->_tmp126_ = _data_->self->priv->actions;
			_data_->_tmp127_ = _variant_new23 (TRUE);
			g_action_group_change_action_state (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp126_, g_action_group_get_type (), GActionGroup), COMPOSER_WIDGET_ACTION_SHOW_EXTENDED_HEADERS, _data_->_tmp127_);
			_g_variant_unref0 (_data_->_tmp127_);
		}
	}
	_g_object_unref0 (_data_->cc_addresses);
	_g_object_unref0 (_data_->to_addresses);
	_g_object_unref0 (_data_->sender_addresses);
	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;
}

void
composer_widget_present (ComposerWidget* self)
{
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	composer_container_present (_tmp1_);
	composer_widget_set_focus (self);
}

static void
_____lambda49_ (ComposerWidget* self)
{
	ComposerEditor* _tmp0_;
	ComposerWebView* _tmp1_;
	ComposerWebView* _tmp2_;
	_tmp0_ = self->priv->_editor;
	_tmp1_ = composer_editor_get_body (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
}

static void
______lambda49__components_web_view_content_loaded (ComponentsWebView* _sender,
                                                    gpointer self)
{
	_____lambda49_ ((ComposerWidget*) self);
}

void
composer_widget_set_focus (ComposerWidget* self)
{
	gboolean _tmp0_ = FALSE;
	ComposerWidgetPresentationMode _tmp1_;
	gboolean not_inline = FALSE;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp1_ = self->priv->_current_mode;
	if (_tmp1_ != COMPOSER_WIDGET_PRESENTATION_MODE_INLINE) {
		ComposerWidgetPresentationMode _tmp2_;
		_tmp2_ = self->priv->_current_mode;
		_tmp0_ = _tmp2_ != COMPOSER_WIDGET_PRESENTATION_MODE_INLINE_COMPACT;
	} else {
		_tmp0_ = FALSE;
	}
	not_inline = _tmp0_;
	if (not_inline) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = composer_widget_get_to (self);
		_tmp5_ = _tmp4_;
		_tmp3_ = geary_string_is_empty (_tmp5_);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		ComposerWidgetHeaderRow* _tmp6_;
		gconstpointer _tmp7_;
		gconstpointer _tmp8_;
		_tmp6_ = self->priv->to_row;
		_tmp7_ = composer_widget_header_row_get_value (_tmp6_);
		_tmp8_ = _tmp7_;
		gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp8_, gtk_widget_get_type (), GtkWidget));
	} else {
		gboolean _tmp9_ = FALSE;
		if (not_inline) {
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_tmp10_ = composer_widget_get_subject (self);
			_tmp11_ = _tmp10_;
			_tmp9_ = geary_string_is_empty (_tmp11_);
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			ComposerWidgetHeaderRow* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp12_ = self->priv->subject_row;
			_tmp13_ = composer_widget_header_row_get_value (_tmp12_);
			_tmp14_ = _tmp13_;
			gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST ((GtkEntry*) _tmp14_, gtk_widget_get_type (), GtkWidget));
		} else {
			ComposerEditor* _tmp15_;
			ComposerWebView* _tmp16_;
			ComposerWebView* _tmp17_;
			gboolean _tmp18_;
			gboolean _tmp19_;
			_tmp15_ = self->priv->_editor;
			_tmp16_ = composer_editor_get_body (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = components_web_view_get_is_content_loaded (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
			_tmp19_ = _tmp18_;
			if (_tmp19_) {
				ComposerEditor* _tmp20_;
				ComposerWebView* _tmp21_;
				ComposerWebView* _tmp22_;
				_tmp20_ = self->priv->_editor;
				_tmp21_ = composer_editor_get_body (_tmp20_);
				_tmp22_ = _tmp21_;
				gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget));
			} else {
				ComposerEditor* _tmp23_;
				ComposerWebView* _tmp24_;
				ComposerWebView* _tmp25_;
				_tmp23_ = self->priv->_editor;
				_tmp24_ = composer_editor_get_body (_tmp23_);
				_tmp25_ = _tmp24_;
				g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), "content-loaded", (GCallback) ______lambda49__components_web_view_content_loaded, self, 0);
			}
		}
	}
}

static gboolean
composer_widget_update_from_address (ComposerWidget* self,
                                     GearyRFC822MailboxAddresses* referred_addresses)
{
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	g_return_val_if_fail ((referred_addresses == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (referred_addresses, GEARY_RF_C822_TYPE_MAILBOX_ADDRESSES), FALSE);
	if (referred_addresses != NULL) {
		GeeList* senders = NULL;
		ApplicationAccountContext* _tmp0_;
		GearyAccount* _tmp1_;
		GearyAccount* _tmp2_;
		GearyAccountInformation* _tmp3_;
		GearyAccountInformation* _tmp4_;
		GeeList* _tmp5_;
		GeeList* _tmp6_;
		GeeList* referred = NULL;
		GeeList* _tmp7_;
		_tmp0_ = self->priv->_sender_context;
		_tmp1_ = application_account_context_get_account (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = geary_account_get_information (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = geary_account_information_get_sender_mailboxes (_tmp4_);
		_tmp6_ = _tmp5_;
		senders = _tmp6_;
		_tmp7_ = geary_rf_c822_mailbox_addresses_get_all (referred_addresses);
		referred = _tmp7_;
		{
			GeeList* _address_list = NULL;
			GeeList* _tmp8_;
			gint _address_size = 0;
			GeeList* _tmp9_;
			gint _tmp10_;
			gint _tmp11_;
			gint _address_index = 0;
			_tmp8_ = senders;
			_address_list = _tmp8_;
			_tmp9_ = _address_list;
			_tmp10_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_COLLECTION, GeeCollection));
			_tmp11_ = _tmp10_;
			_address_size = _tmp11_;
			_address_index = -1;
			while (TRUE) {
				gint _tmp12_;
				gint _tmp13_;
				GearyRFC822MailboxAddress* address = NULL;
				GeeList* _tmp14_;
				gpointer _tmp15_;
				GeeList* _tmp16_;
				GearyRFC822MailboxAddress* _tmp17_;
				_address_index = _address_index + 1;
				_tmp12_ = _address_index;
				_tmp13_ = _address_size;
				if (!(_tmp12_ < _tmp13_)) {
					break;
				}
				_tmp14_ = _address_list;
				_tmp15_ = gee_list_get (_tmp14_, _address_index);
				address = (GearyRFC822MailboxAddress*) _tmp15_;
				_tmp16_ = referred;
				_tmp17_ = address;
				if (gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_COLLECTION, GeeCollection), _tmp17_)) {
					GearyRFC822MailboxAddress* _tmp18_;
					GearyRFC822MailboxAddresses* _tmp19_;
					GearyRFC822MailboxAddresses* _tmp20_;
					_tmp18_ = address;
					_tmp19_ = geary_rf_c822_mailbox_addresses_new_single (_tmp18_);
					_tmp20_ = _tmp19_;
					composer_widget_set_from (self, _tmp20_);
					_g_object_unref0 (_tmp20_);
					result = TRUE;
					_g_object_unref0 (address);
					_g_object_unref0 (referred);
					_g_object_unref0 (senders);
					return result;
				}
				_g_object_unref0 (address);
			}
		}
		_g_object_unref0 (referred);
		_g_object_unref0 (senders);
	}
	result = FALSE;
	return result;
}

static void
___lambda192_ (ComposerWidget* self)
{
	composer_widget_set_can_delete_quote (self, FALSE);
}

static void
____lambda192__g_object_notify (GObject* _sender,
                                GParamSpec* pspec,
                                gpointer self)
{
	___lambda192_ ((ComposerWidget*) self);
}

static void
composer_widget_on_content_loaded (ComposerWidget* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_update_signature (self, NULL, NULL, NULL);
	_tmp0_ = composer_widget_get_can_delete_quote (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		ComposerEditor* _tmp2_;
		ComposerWebView* _tmp3_;
		ComposerWebView* _tmp4_;
		_tmp2_ = self->priv->_editor;
		_tmp3_ = composer_editor_get_body (_tmp2_);
		_tmp4_ = _tmp3_;
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, G_TYPE_OBJECT, GObject), "notify::has-selection", (GCallback) ____lambda192__g_object_notify, self, 0);
	}
}

static void
composer_widget_show_attachment_overlay (ComposerWidget* self,
                                         gboolean visible)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	if (self->priv->is_attachment_overlay_visible == visible) {
		return;
	}
	self->priv->is_attachment_overlay_visible = visible;
	if (visible) {
		gint height = 0;
		GtkBox* _tmp0_;
		GtkBox* _tmp1_;
		GtkWidget* _tmp2_;
		GtkBox* _tmp3_;
		GtkWidget* _tmp4_;
		GtkBox* _tmp5_;
		_tmp0_ = self->priv->hidden_on_attachment_drag_over;
		height = gtk_widget_get_allocated_height (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
		_tmp1_ = self->priv->hidden_on_attachment_drag_over;
		_tmp2_ = self->priv->hidden_on_attachment_drag_over_child;
		gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_container_get_type (), GtkContainer), _tmp2_);
		_tmp3_ = self->priv->visible_on_attachment_drag_over;
		_tmp4_ = self->priv->visible_on_attachment_drag_over_child;
		gtk_box_pack_start (_tmp3_, _tmp4_, TRUE, TRUE, (guint) 0);
		_tmp5_ = self->priv->visible_on_attachment_drag_over;
		gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), -1, height);
	} else {
		GtkBox* _tmp6_;
		GtkWidget* _tmp7_;
		GtkBox* _tmp8_;
		GtkWidget* _tmp9_;
		GtkBox* _tmp10_;
		_tmp6_ = self->priv->hidden_on_attachment_drag_over;
		_tmp7_ = self->priv->hidden_on_attachment_drag_over_child;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_container_get_type (), GtkContainer), _tmp7_);
		_tmp8_ = self->priv->visible_on_attachment_drag_over;
		_tmp9_ = self->priv->visible_on_attachment_drag_over_child;
		gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_container_get_type (), GtkContainer), _tmp9_);
		_tmp10_ = self->priv->visible_on_attachment_drag_over;
		gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), -1, -1);
	}
}

static void
composer_widget_on_set_focus_child (ComposerWidget* self)
{
	GtkWindow* window = NULL;
	GtkWidget* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = gtk_widget_get_toplevel (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp0_) : NULL);
	window = _tmp1_;
	_tmp2_ = window;
	if (_tmp2_ != NULL) {
		GtkWidget* last_focused = NULL;
		GtkWindow* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp5_;
		gboolean _tmp6_ = FALSE;
		GtkWidget* _tmp7_;
		ComposerEditor* _tmp8_;
		ComposerWebView* _tmp9_;
		ComposerWebView* _tmp10_;
		_tmp3_ = window;
		_tmp4_ = gtk_window_get_focus (_tmp3_);
		_tmp5_ = _g_object_ref0 (_tmp4_);
		last_focused = _tmp5_;
		_tmp7_ = last_focused;
		_tmp8_ = self->priv->_editor;
		_tmp9_ = composer_editor_get_body (_tmp8_);
		_tmp10_ = _tmp9_;
		if (_tmp7_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget)) {
			_tmp6_ = TRUE;
		} else {
			gboolean _tmp11_ = FALSE;
			GtkWidget* _tmp12_;
			_tmp12_ = last_focused;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, gtk_entry_get_type ())) {
				GtkWidget* _tmp13_;
				_tmp13_ = last_focused;
				_tmp11_ = gtk_widget_is_ancestor (_tmp13_, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
			} else {
				_tmp11_ = FALSE;
			}
			_tmp6_ = _tmp11_;
		}
		if (_tmp6_) {
			GtkWidget* _tmp14_;
			_tmp14_ = last_focused;
			composer_widget_set_focused_input_widget (self, _tmp14_);
		}
		_g_object_unref0 (last_focused);
	}
	_g_object_unref0 (window);
}

static void
_composer_widget_on_set_focus_child_gtk_container_set_focus_child (GtkContainer* _sender,
                                                                   GtkWidget* child,
                                                                   gpointer self)
{
	composer_widget_on_set_focus_child ((ComposerWidget*) self);
}

static gboolean
composer_widget_on_drag_motion (ComposerWidget* self)
{
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	composer_widget_show_attachment_overlay (self, TRUE);
	result = FALSE;
	return result;
}

static gboolean
_composer_widget_on_drag_motion_gtk_widget_drag_motion (GtkWidget* _sender,
                                                        GdkDragContext* context,
                                                        gint x,
                                                        gint y,
                                                        guint time_,
                                                        gpointer self)
{
	gboolean result;
	result = composer_widget_on_drag_motion ((ComposerWidget*) self);
	return result;
}

static void
composer_widget_on_drag_leave (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_show_attachment_overlay (self, FALSE);
}

static void
_composer_widget_on_drag_leave_gtk_widget_drag_leave (GtkWidget* _sender,
                                                      GdkDragContext* context,
                                                      guint time_,
                                                      gpointer self)
{
	composer_widget_on_drag_leave ((ComposerWidget*) self);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
composer_widget_on_drag_data_received (ComposerWidget* self,
                                       GtkWidget* sender,
                                       GdkDragContext* context,
                                       gint x,
                                       gint y,
                                       GtkSelectionData* selection_data,
                                       guint info,
                                       guint time_)
{
	gboolean dnd_success = FALSE;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (sender, gtk_widget_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (context, gdk_drag_context_get_type ()));
	g_return_if_fail (selection_data != NULL);
	dnd_success = FALSE;
	if (gtk_selection_data_get_length (selection_data) >= 0) {
		gchar* uri_list = NULL;
		guint8* _tmp0_;
		gchar* _tmp1_;
		gchar** uris = NULL;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar** _tmp5_;
		gchar** _tmp6_;
		gchar** _tmp7_;
		gint _tmp7__length1;
		gint uris_length1;
		gint _uris_size_;
		gchar** _tmp8_;
		gint _tmp8__length1;
		dnd_success = TRUE;
		_tmp0_ = gtk_selection_data_get_data (selection_data);
		_tmp1_ = g_strdup ((const gchar*) _tmp0_);
		uri_list = _tmp1_;
		_tmp2_ = uri_list;
		_tmp3_ = string_strip (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp6_ = _tmp5_ = g_strsplit (_tmp4_, "\n", 0);
		_tmp7_ = _tmp6_;
		_tmp7__length1 = _vala_array_length (_tmp5_);
		_g_free0 (_tmp4_);
		uris = _tmp7_;
		uris_length1 = _tmp7__length1;
		_uris_size_ = uris_length1;
		_tmp8_ = uris;
		_tmp8__length1 = uris_length1;
		{
			gchar** uri_collection = NULL;
			gint uri_collection_length1 = 0;
			gint _uri_collection_size_ = 0;
			gint uri_it = 0;
			uri_collection = _tmp8_;
			uri_collection_length1 = _tmp8__length1;
			for (uri_it = 0; uri_it < uri_collection_length1; uri_it = uri_it + 1) {
				gchar* _tmp9_;
				gchar* uri = NULL;
				_tmp9_ = g_strdup (uri_collection[uri_it]);
				uri = _tmp9_;
				{
					const gchar* _tmp10_;
					_tmp10_ = uri;
					if (!g_str_has_prefix (_tmp10_, COMPOSER_WIDGET_FILE_URI_PREFIX)) {
						_g_free0 (uri);
						continue;
					}
					{
						const gchar* _tmp11_;
						gchar* _tmp12_;
						gchar* _tmp13_;
						GFile* _tmp14_;
						GFile* _tmp15_;
						_tmp11_ = uri;
						_tmp12_ = string_strip (_tmp11_);
						_tmp13_ = _tmp12_;
						_tmp14_ = g_file_new_for_uri (_tmp13_);
						_tmp15_ = _tmp14_;
						composer_widget_add_attachment_part (self, _tmp15_, &_inner_error0_);
						_g_object_unref0 (_tmp15_);
						_g_free0 (_tmp13_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						composer_widget_draft_changed (self);
					}
					goto __finally0;
					__catch0_g_error:
					{
						GError* err = NULL;
						GError* _tmp16_;
						const gchar* _tmp17_;
						err = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp16_ = err;
						_tmp17_ = _tmp16_->message;
						composer_widget_attachment_failed (self, _tmp17_);
						_g_error_free0 (err);
					}
					__finally0:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_free0 (uri);
						uris = (_vala_array_free (uris, uris_length1, (GDestroyNotify) g_free), NULL);
						_g_free0 (uri_list);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
					_g_free0 (uri);
				}
			}
		}
		uris = (_vala_array_free (uris, uris_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (uri_list);
	}
	gtk_drag_finish (context, dnd_success, FALSE, (guint32) time_);
}

static void
_composer_widget_on_drag_data_received_gtk_widget_drag_data_received (GtkWidget* _sender,
                                                                      GdkDragContext* context,
                                                                      gint x,
                                                                      gint y,
                                                                      GtkSelectionData* selection_data,
                                                                      guint info,
                                                                      guint time_,
                                                                      gpointer self)
{
	composer_widget_on_drag_data_received ((ComposerWidget*) self, _sender, context, x, y, selection_data, info, time_);
}

static GdkAtom*
_gdk_atom_dup (GdkAtom* self)
{
	GdkAtom* dup;
	dup = g_new0 (GdkAtom, 1);
	memcpy (dup, self, sizeof (GdkAtom));
	return dup;
}

static gpointer
__gdk_atom_dup0 (gpointer self)
{
	return self ? _gdk_atom_dup (self) : NULL;
}

static gboolean
composer_widget_on_drag_drop (ComposerWidget* self,
                              GtkWidget* sender,
                              GdkDragContext* context,
                              gint x,
                              gint y,
                              guint time_)
{
	GList* _tmp0_;
	guint length = 0U;
	GList* _tmp1_;
	GdkAtom* target_type = NULL;
	GdkAtom* _tmp10_;
	GdkAtom* _tmp11_;
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (sender, gtk_widget_get_type ()), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (context, gdk_drag_context_get_type ()), FALSE);
	_tmp0_ = gdk_drag_context_list_targets (context);
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = gdk_drag_context_list_targets (context);
	length = g_list_length (_tmp1_);
	target_type = NULL;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GdkAtom target = (GdkAtom) 0U;
				GList* _tmp4_;
				gconstpointer _tmp5_;
				gchar* _tmp6_;
				gchar* _tmp7_;
				gboolean _tmp8_;
				if (!_tmp2_) {
					guint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				if (!(i < length)) {
					break;
				}
				_tmp4_ = gdk_drag_context_list_targets (context);
				_tmp5_ = g_list_nth_data (_tmp4_, i);
				target = (GdkAtom) ((guintptr) _tmp5_);
				_tmp6_ = gdk_atom_name (target);
				_tmp7_ = _tmp6_;
				_tmp8_ = g_strcmp0 (_tmp7_, COMPOSER_WIDGET_URI_LIST_MIME_TYPE) == 0;
				_g_free0 (_tmp7_);
				if (_tmp8_) {
					GdkAtom* _tmp9_;
					_tmp9_ = __gdk_atom_dup0 (&target);
					_g_free0 (target_type);
					target_type = _tmp9_;
				}
			}
		}
	}
	_tmp10_ = target_type;
	if (_tmp10_ == NULL) {
		result = FALSE;
		_g_free0 (target_type);
		return result;
	}
	_tmp11_ = target_type;
	gtk_drag_get_data (sender, context, *_tmp11_, (guint32) time_);
	result = TRUE;
	_g_free0 (target_type);
	return result;
}

static gboolean
_composer_widget_on_drag_drop_gtk_widget_drag_drop (GtkWidget* _sender,
                                                    GdkDragContext* context,
                                                    gint x,
                                                    gint y,
                                                    guint time_,
                                                    gpointer self)
{
	gboolean result;
	result = composer_widget_on_drag_drop ((ComposerWidget*) self, _sender, context, x, y, time_);
	return result;
}

static void
composer_widget_to_composed_email_data_free (gpointer _data)
{
	ComposerWidgetToComposedEmailData* _data_;
	_data_ = _data;
	_g_date_time_unref0 (_data_->date_override);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetToComposedEmailData, _data_);
}

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

void
composer_widget_to_composed_email (ComposerWidget* self,
                                   GDateTime* date_override,
                                   gboolean for_draft,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	ComposerWidgetToComposedEmailData* _data_;
	ComposerWidget* _tmp0_;
	GDateTime* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetToComposedEmailData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_to_composed_email_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_date_time_ref0 (date_override);
	_g_date_time_unref0 (_data_->date_override);
	_data_->date_override = _tmp1_;
	_data_->for_draft = for_draft;
	composer_widget_to_composed_email_co (_data_);
}

GearyComposedEmail*
composer_widget_to_composed_email_finish (ComposerWidget* self,
                                          GAsyncResult* _res_)
{
	GearyComposedEmail* result;
	ComposerWidgetToComposedEmailData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

/** Returns a representation of the current message. */
static void
composer_widget_to_composed_email_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	ComposerWidgetToComposedEmailData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_to_composed_email_co (_data_);
}

static gboolean
composer_widget_to_composed_email_co (ComposerWidgetToComposedEmailData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _g_date_time_ref0 (_data_->date_override);
	_data_->_tmp0_ = _data_->_tmp1_;
	if (_data_->_tmp0_ == NULL) {
		_data_->_tmp2_ = g_date_time_new_now_local ();
		_g_date_time_unref0 (_data_->_tmp0_);
		_data_->_tmp0_ = _data_->_tmp2_;
	}
	_data_->_tmp3_ = _data_->self->priv->_from;
	_data_->_tmp4_ = geary_composed_email_new (_data_->_tmp0_, _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->self->priv->to_row;
	_data_->_tmp7_ = composer_widget_header_row_get_value (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = geary_composed_email_set_to (_data_->_tmp5_, _data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->self->priv->cc_row;
	_data_->_tmp14_ = composer_widget_header_row_get_value (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_tmp18_ = geary_composed_email_set_cc (_data_->_tmp12_, _data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->self->priv->bcc_row;
	_data_->_tmp21_ = composer_widget_header_row_get_value (_data_->_tmp20_);
	_data_->_tmp22_ = _data_->_tmp21_;
	_data_->_tmp23_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = geary_composed_email_set_bcc (_data_->_tmp19_, _data_->_tmp24_);
	_data_->_tmp26_ = _data_->_tmp25_;
	_data_->_tmp27_ = _data_->self->priv->reply_to_row;
	_data_->_tmp28_ = composer_widget_header_row_get_value (_data_->_tmp27_);
	_data_->_tmp29_ = _data_->_tmp28_;
	_data_->_tmp30_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _data_->_tmp29_);
	_data_->_tmp31_ = _data_->_tmp30_;
	_data_->_tmp32_ = geary_composed_email_set_reply_to (_data_->_tmp26_, _data_->_tmp31_);
	_data_->_tmp33_ = _data_->_tmp32_;
	_data_->_tmp34_ = composer_widget_get_subject (_data_->self);
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = geary_composed_email_set_subject (_data_->_tmp33_, _data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = _data_->self->priv->_in_reply_to;
	_data_->_tmp39_ = geary_composed_email_set_in_reply_to (_data_->_tmp37_, _data_->_tmp38_);
	_data_->_tmp40_ = _data_->_tmp39_;
	_data_->_tmp41_ = _data_->self->priv->_references;
	_data_->_tmp42_ = geary_composed_email_set_references (_data_->_tmp40_, _data_->_tmp41_);
	_data_->_tmp43_ = _data_->_tmp42_;
	_g_object_unref0 (_data_->_tmp40_);
	_g_object_unref0 (_data_->_tmp37_);
	_g_object_unref0 (_data_->_tmp33_);
	_g_object_unref0 (_data_->_tmp26_);
	_g_object_unref0 (_data_->_tmp19_);
	_g_object_unref0 (_data_->_tmp12_);
	_g_object_unref0 (_data_->_tmp5_);
	_data_->email = _data_->_tmp43_;
	_data_->_tmp44_ = _data_->email;
	_data_->_tmp45_ = geary_composed_email_get_attached_files (_data_->_tmp44_);
	_data_->_tmp46_ = _data_->_tmp45_;
	_data_->_tmp47_ = _data_->self->priv->attached_files;
	gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp46_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp47_, GEE_TYPE_COLLECTION, GeeCollection));
	_data_->_tmp48_ = _data_->email;
	_data_->_tmp49_ = geary_composed_email_get_inline_files (_data_->_tmp48_);
	_data_->_tmp50_ = _data_->_tmp49_;
	_data_->_tmp51_ = _data_->self->priv->inline_files;
	gee_map_set_all (_data_->_tmp50_, _data_->_tmp51_);
	_data_->_tmp52_ = _data_->email;
	_data_->_tmp53_ = geary_composed_email_get_cid_files (_data_->_tmp52_);
	_data_->_tmp54_ = _data_->_tmp53_;
	_data_->_tmp55_ = _data_->self->priv->cid_files;
	gee_map_set_all (_data_->_tmp54_, _data_->_tmp55_);
	_data_->_tmp56_ = _data_->email;
	geary_composed_email_set_img_src_prefix (_data_->_tmp56_, COMPONENTS_WEB_VIEW_INTERNAL_URL_PREFIX);
	{
		_data_->_tmp58_ = _data_->self->priv->_editor;
		_data_->_tmp59_ = composer_editor_get_body (_data_->_tmp58_);
		_data_->_tmp60_ = _data_->_tmp59_;
		_data_->_state_ = 1;
		composer_web_view_get_text (_data_->_tmp60_, composer_widget_to_composed_email_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp61_ = composer_web_view_get_text_finish (_data_->_tmp60_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp57_ = _data_->_tmp61_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp62_ = _data_->email;
		geary_composed_email_set_body_text (_data_->_tmp62_, _data_->_tmp57_);
		if (_data_->for_draft) {
			_data_->_tmp64_ = _data_->self->priv->_editor;
			_data_->_tmp65_ = composer_editor_get_body (_data_->_tmp64_);
			_data_->_tmp66_ = _data_->_tmp65_;
			_data_->_state_ = 2;
			composer_web_view_get_html_for_draft (_data_->_tmp66_, composer_widget_to_composed_email_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp67_ = composer_web_view_get_html_for_draft_finish (_data_->_tmp66_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp63_ = _data_->_tmp67_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_free0 (_data_->_tmp57_);
				goto __catch0_g_error;
			}
			_data_->_tmp68_ = _data_->email;
			geary_composed_email_set_body_html (_data_->_tmp68_, _data_->_tmp63_);
			_g_free0 (_data_->_tmp63_);
		} else {
			_data_->_tmp69_ = _data_->self->priv->_editor;
			_data_->_tmp70_ = composer_editor_get_body (_data_->_tmp69_);
			_data_->_tmp71_ = _data_->_tmp70_;
			_data_->_tmp72_ = composer_web_view_get_is_rich_text (_data_->_tmp71_);
			_data_->_tmp73_ = _data_->_tmp72_;
			if (_data_->_tmp73_) {
				_data_->_tmp75_ = _data_->self->priv->_editor;
				_data_->_tmp76_ = composer_editor_get_body (_data_->_tmp75_);
				_data_->_tmp77_ = _data_->_tmp76_;
				_data_->_state_ = 3;
				components_web_view_get_html (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp77_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), composer_widget_to_composed_email_ready, _data_);
				return FALSE;
				_state_3:
				_data_->_tmp78_ = components_web_view_get_html_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp77_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _data_->_res_, &_data_->_inner_error0_);
				_data_->_tmp74_ = _data_->_tmp78_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_free0 (_data_->_tmp57_);
					goto __catch0_g_error;
				}
				_data_->_tmp79_ = _data_->email;
				geary_composed_email_set_body_html (_data_->_tmp79_, _data_->_tmp74_);
				_g_free0 (_data_->_tmp74_);
			}
		}
		_g_free0 (_data_->_tmp57_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp80_ = _data_->_error_;
		_data_->_tmp81_ = _data_->_tmp80_->message;
		g_debug ("composer-widget.vala:1317: Error getting composer message body: %s", _data_->_tmp81_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->email);
		_g_date_time_unref0 (_data_->_tmp0_);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp82_ = _data_->email;
	_data_->_tmp83_ = g_get_prgname ();
	_data_->_tmp84_ = g_strconcat (_data_->_tmp83_, "/", NULL);
	_data_->_tmp85_ = _data_->_tmp84_;
	_data_->_tmp86_ = g_strconcat (_data_->_tmp85_, APPLICATION_CLIENT_VERSION, NULL);
	_data_->_tmp87_ = _data_->_tmp86_;
	geary_composed_email_set_mailer (_data_->_tmp82_, _data_->_tmp87_);
	_g_free0 (_data_->_tmp87_);
	_g_free0 (_data_->_tmp85_);
	_data_->result = _data_->email;
	_g_date_time_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;
}

/** Appends an email or fragment quoted into the composer. */
void
composer_widget_append_to_email (ComposerWidget* self,
                                 GearyEmail* referred,
                                 const gchar* to_quote,
                                 ComposerWidgetContextType type,
                                 GError** error)
{
	GearyEmailField _tmp0_;
	GearyEmailField _tmp1_;
	GeeSet* _tmp8_;
	GearyEmailIdentifier* _tmp9_;
	GearyEmailIdentifier* _tmp10_;
	ComposerEditor* _tmp11_;
	ComposerWebView* _tmp12_;
	ComposerWebView* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (referred, GEARY_TYPE_EMAIL));
	_tmp0_ = geary_email_get_fields (referred);
	_tmp1_ = _tmp0_;
	if (!geary_email_field_is_all_set (_tmp1_, COMPOSER_WIDGET_REQUIRED_FIELDS)) {
		GearyEmailField _tmp2_;
		GearyEmailField _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GError* _tmp6_;
		GError* _tmp7_;
		_tmp2_ = geary_email_get_fields (referred);
		_tmp3_ = _tmp2_;
		_tmp4_ = geary_email_field_to_string (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = g_error_new (GEARY_ENGINE_ERROR, GEARY_ENGINE_ERROR_INCOMPLETE_MESSAGE, "Required fields not met: %s", _tmp5_);
		_tmp7_ = _tmp6_;
		_g_free0 (_tmp5_);
		_inner_error0_ = _tmp7_;
		if (_inner_error0_->domain == GEARY_ENGINE_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp8_ = self->priv->referred_ids;
	_tmp9_ = geary_email_get_id (referred);
	_tmp10_ = _tmp9_;
	if (!gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection), _tmp10_)) {
		composer_widget_add_recipients_and_ids (self, type, referred);
	}
	_tmp11_ = self->priv->_editor;
	_tmp12_ = composer_editor_get_body (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = util_email_quote_email_for_reply (referred, to_quote, GEARY_RF_C822_TEXT_FORMAT_HTML);
	_tmp15_ = _tmp14_;
	composer_web_view_insert_html (_tmp13_, _tmp15_);
	_g_free0 (_tmp15_);
}

static void
composer_widget_add_recipients_and_ids (ComposerWidget* self,
                                        ComposerWidgetContextType type,
                                        GearyEmail* referred)
{
	GeeList* sender_addresses = NULL;
	ApplicationAccountContext* _tmp0_;
	GearyAccount* _tmp1_;
	GearyAccount* _tmp2_;
	GearyAccountInformation* _tmp3_;
	GearyAccountInformation* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	ComposerWidgetHeaderRow* _tmp7_;
	gconstpointer _tmp8_;
	gconstpointer _tmp9_;
	ComposerWidgetHeaderRow* _tmp10_;
	gconstpointer _tmp11_;
	gconstpointer _tmp12_;
	GearyRFC822MailboxAddresses* _tmp13_;
	GearyRFC822MailboxAddresses* _tmp14_;
	GeeList* _tmp15_;
	GearyRFC822MailboxAddresses* _tmp16_;
	GearyRFC822MailboxAddresses* _tmp17_;
	GearyRFC822MailboxAddresses* _tmp18_;
	GearyRFC822MailboxAddresses* _tmp19_;
	GearyRFC822MessageID* _tmp40_;
	GearyRFC822MessageID* _tmp41_;
	GearyRFC822MessageIDList* _tmp47_;
	GearyRFC822MessageIDList* _tmp48_;
	GearyRFC822MessageIDList* _tmp49_;
	GearyRFC822MessageIDList* _tmp50_;
	GearyRFC822MessageIDList* _tmp51_;
	GeeSet* _tmp52_;
	GearyEmailIdentifier* _tmp53_;
	GearyEmailIdentifier* _tmp54_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (referred, GEARY_TYPE_EMAIL));
	_tmp0_ = self->priv->_sender_context;
	_tmp1_ = application_account_context_get_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = geary_account_get_information (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = geary_account_information_get_sender_mailboxes (_tmp4_);
	_tmp6_ = _tmp5_;
	sender_addresses = _tmp6_;
	_tmp7_ = self->priv->to_row;
	_tmp8_ = composer_widget_header_row_get_value (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = self->priv->to_row;
	_tmp11_ = composer_widget_header_row_get_value (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = sender_addresses;
	_tmp16_ = geary_rf_c822_utils_create_to_addresses_for_reply (referred, _tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = geary_rf_c822_utils_merge_addresses (_tmp14_, _tmp17_);
	_tmp19_ = _tmp18_;
	composer_email_entry_set_addresses ((ComposerEmailEntry*) _tmp9_, _tmp19_);
	_g_object_unref0 (_tmp19_);
	_g_object_unref0 (_tmp17_);
	if (type == COMPOSER_WIDGET_CONTEXT_TYPE_REPLY_ALL) {
		ComposerWidgetHeaderRow* _tmp20_;
		gconstpointer _tmp21_;
		gconstpointer _tmp22_;
		ComposerWidgetHeaderRow* _tmp23_;
		gconstpointer _tmp24_;
		gconstpointer _tmp25_;
		GearyRFC822MailboxAddresses* _tmp26_;
		GearyRFC822MailboxAddresses* _tmp27_;
		GeeList* _tmp28_;
		GearyRFC822MailboxAddresses* _tmp29_;
		GearyRFC822MailboxAddresses* _tmp30_;
		GearyRFC822MailboxAddresses* _tmp31_;
		GearyRFC822MailboxAddresses* _tmp32_;
		ComposerWidgetHeaderRow* _tmp33_;
		gconstpointer _tmp34_;
		gconstpointer _tmp35_;
		GearyRFC822MailboxAddresses* _tmp36_;
		GearyRFC822MailboxAddresses* _tmp37_;
		GearyRFC822MailboxAddresses* _tmp38_;
		GearyRFC822MailboxAddresses* _tmp39_;
		_tmp20_ = self->priv->cc_row;
		_tmp21_ = composer_widget_header_row_get_value (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = self->priv->cc_row;
		_tmp24_ = composer_widget_header_row_get_value (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = sender_addresses;
		_tmp29_ = geary_rf_c822_utils_create_cc_addresses_for_reply_all (referred, _tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = geary_rf_c822_utils_merge_addresses (_tmp27_, _tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = self->priv->to_row;
		_tmp34_ = composer_widget_header_row_get_value (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = geary_rf_c822_utils_remove_addresses (_tmp32_, _tmp37_);
		_tmp39_ = _tmp38_;
		composer_email_entry_set_addresses ((ComposerEmailEntry*) _tmp22_, _tmp39_);
		_g_object_unref0 (_tmp39_);
		_g_object_unref0 (_tmp32_);
		_g_object_unref0 (_tmp30_);
	}
	_tmp40_ = geary_email_header_set_get_message_id (G_TYPE_CHECK_INSTANCE_CAST (referred, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
	_tmp41_ = _tmp40_;
	if (_tmp41_ != NULL) {
		GearyRFC822MessageIDList* _tmp42_;
		GearyRFC822MessageID* _tmp43_;
		GearyRFC822MessageID* _tmp44_;
		GearyRFC822MessageIDList* _tmp45_;
		GearyRFC822MessageIDList* _tmp46_;
		_tmp42_ = self->priv->_in_reply_to;
		_tmp43_ = geary_email_header_set_get_message_id (G_TYPE_CHECK_INSTANCE_CAST (referred, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
		_tmp44_ = _tmp43_;
		_tmp45_ = geary_rf_c822_message_id_list_merge_id (_tmp42_, _tmp44_);
		_tmp46_ = _tmp45_;
		composer_widget_set_in_reply_to (self, _tmp46_);
		_g_object_unref0 (_tmp46_);
	}
	_tmp47_ = self->priv->_references;
	_tmp48_ = geary_rf_c822_utils_reply_references (referred);
	_tmp49_ = _tmp48_;
	_tmp50_ = geary_rf_c822_message_id_list_merge_list (_tmp47_, _tmp49_);
	_tmp51_ = _tmp50_;
	composer_widget_set_references (self, _tmp51_);
	_g_object_unref0 (_tmp51_);
	_g_object_unref0 (_tmp49_);
	_tmp52_ = self->priv->referred_ids;
	_tmp53_ = geary_email_get_id (referred);
	_tmp54_ = _tmp53_;
	gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, GEE_TYPE_COLLECTION, GeeCollection), _tmp54_);
	_g_object_unref0 (sender_addresses);
}

static gboolean
composer_widget_real_key_press_event (GtkWidget* base,
                                      GdkEventKey* event)
{
	ComposerWidget * self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, COMPOSER_TYPE_WIDGET, ComposerWidget);
	g_return_val_if_fail (event != NULL, FALSE);
	if (composer_widget_check_send_on_return (self, event)) {
		_tmp0_ = GTK_WIDGET_CLASS (composer_widget_parent_class)->key_press_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_event_box_get_type (), GtkEventBox), gtk_widget_get_type (), GtkWidget), event);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

/** Updates the composer's top level window and headerbar title. */
void
composer_widget_update_window_title (ComposerWidget* self)
{
	gchar* subject = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	ComposerContainer* _tmp5_;
	ComposerContainer* _tmp6_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_subject (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_strip (_tmp1_);
	subject = _tmp2_;
	_tmp3_ = subject;
	if (geary_string_is_empty (_tmp3_)) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup (COMPOSER_WIDGET_DEFAULT_TITLE);
		_g_free0 (subject);
		subject = _tmp4_;
	}
	_tmp5_ = composer_widget_get_container (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		ComposerContainer* _tmp7_;
		ComposerContainer* _tmp8_;
		GtkApplicationWindow* _tmp9_;
		GtkApplicationWindow* _tmp10_;
		const gchar* _tmp11_;
		_tmp7_ = composer_widget_get_container (self);
		_tmp8_ = _tmp7_;
		_tmp9_ = composer_container_get_top_window (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = subject;
		gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_window_get_type (), GtkWindow), _tmp11_);
	}
	_g_free0 (subject);
}

void
composer_widget_activate_close_action (ComposerWidget* self)
{
	GSimpleActionGroup* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->actions;
	g_action_group_activate_action (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, g_action_group_get_type (), GActionGroup), COMPOSER_WIDGET_ACTION_CLOSE, NULL);
}

void
composer_widget_set_mode (ComposerWidget* self,
                          ComposerWidgetPresentationMode new_mode)
{
	ComposerHeaderbar* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_set_current_mode (self, new_mode);
	_tmp0_ = self->priv->_header;
	composer_headerbar_set_mode (_tmp0_, new_mode);
	switch (new_mode) {
		case COMPOSER_WIDGET_PRESENTATION_MODE_DETACHED:
		case COMPOSER_WIDGET_PRESENTATION_MODE_PANED:
		{
			GtkGrid* _tmp1_;
			ComposerWidgetHeaderRow* _tmp2_;
			_tmp1_ = self->priv->email_headers;
			gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), TRUE);
			_tmp2_ = self->priv->subject_row;
			gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), TRUE);
			break;
		}
		case COMPOSER_WIDGET_PRESENTATION_MODE_INLINE:
		{
			GtkGrid* _tmp3_;
			ComposerWidgetHeaderRow* _tmp4_;
			_tmp3_ = self->priv->email_headers;
			gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), TRUE);
			_tmp4_ = self->priv->subject_row;
			gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), FALSE);
			break;
		}
		case COMPOSER_WIDGET_PRESENTATION_MODE_INLINE_COMPACT:
		{
			GtkGrid* _tmp5_;
			ComposerWidgetHeaderRow* _tmp6_;
			_tmp5_ = self->priv->email_headers;
			gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), FALSE);
			_tmp6_ = self->priv->subject_row;
			gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), FALSE);
			composer_widget_set_compact_header_recipients (self);
			break;
		}
		case COMPOSER_WIDGET_PRESENTATION_MODE_CLOSED:
		case COMPOSER_WIDGET_PRESENTATION_MODE_NONE:
		{
			break;
		}
		default:
		break;
	}
	composer_widget_update_from_field (self);
}

void
composer_widget_embed_header (ComposerWidget* self)
{
	ComposerHeaderbar* _tmp0_;
	GtkContainer* _tmp1_;
	GtkContainer* _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->_header;
	_tmp1_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	_tmp2_ = _tmp1_;
	if (_tmp2_ == NULL) {
		GtkBox* _tmp3_;
		ComposerHeaderbar* _tmp4_;
		ComposerHeaderbar* _tmp5_;
		_tmp3_ = self->priv->header_container;
		_tmp4_ = self->priv->_header;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
		_tmp5_ = self->priv->_header;
		gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), TRUE);
	}
}

void
composer_widget_free_header (ComposerWidget* self)
{
	ComposerHeaderbar* _tmp0_;
	GtkContainer* _tmp1_;
	GtkContainer* _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->_header;
	_tmp1_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		ComposerHeaderbar* _tmp3_;
		GtkContainer* _tmp4_;
		GtkContainer* _tmp5_;
		ComposerHeaderbar* _tmp6_;
		_tmp3_ = self->priv->_header;
		_tmp4_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->_header;
		gtk_container_remove (_tmp5_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
	}
}

static void
composer_widget_finish_loading_data_free (gpointer _data)
{
	ComposerWidgetFinishLoadingData* _data_;
	_data_ = _data;
	_g_free0 (_data_->body);
	_g_free0 (_data_->quote);
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetFinishLoadingData, _data_);
}

static void
composer_widget_finish_loading (ComposerWidget* self,
                                const gchar* body,
                                const gchar* quote,
                                gboolean is_body_complete,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	ComposerWidgetFinishLoadingData* _data_;
	ComposerWidget* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (body != NULL);
	g_return_if_fail (quote != NULL);
	_data_ = g_slice_new0 (ComposerWidgetFinishLoadingData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_finish_loading_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (body);
	_g_free0 (_data_->body);
	_data_->body = _tmp1_;
	_tmp2_ = g_strdup (quote);
	_g_free0 (_data_->quote);
	_data_->quote = _tmp2_;
	_data_->is_body_complete = is_body_complete;
	composer_widget_finish_loading_co (_data_);
}

static void
composer_widget_finish_loading_finish (ComposerWidget* self,
                                       GAsyncResult* _res_)
{
	ComposerWidgetFinishLoadingData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block72Data*
block72_data_ref (Block72Data* _data72_)
{
	g_atomic_int_inc (&_data72_->_ref_count_);
	return _data72_;
}

static void
block72_data_unref (void * _userdata_)
{
	Block72Data* _data72_;
	_data72_ = (Block72Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data72_->_ref_count_)) {
		ComposerWidget* self;
		self = _data72_->self;
		_g_object_unref0 (_data72_->current_account);
		_g_object_unref0 (self);
		g_slice_free (Block72Data, _data72_);
	}
}

static void
__lambda79_ (Block72Data* _data72_,
             GObject* obj,
             GAsyncResult* res)
{
	ComposerWidget* self;
	GError* _inner_error0_ = NULL;
	self = _data72_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	{
		composer_widget_open_draft_manager_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		ComposerApplicationInterface* _tmp0_;
		GearyAccountInformation* _tmp1_;
		GearyAccountInformation* _tmp2_;
		GError* _tmp3_;
		GearyAccountProblemReport* _tmp4_;
		GearyAccountProblemReport* _tmp5_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = self->priv->application;
		_tmp1_ = geary_account_get_information (_data72_->current_account);
		_tmp2_ = _tmp1_;
		_tmp3_ = _error_;
		_tmp4_ = geary_account_problem_report_new (_tmp2_, _tmp3_);
		_tmp5_ = _tmp4_;
		composer_application_interface_report_problem (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
		_g_object_unref0 (_tmp5_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda79__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda79_ (self, source_object, res);
	block72_data_unref (self);
}

static gboolean
composer_widget_finish_loading_co (ComposerWidgetFinishLoadingData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data72_ = g_slice_new0 (Block72Data);
	_data_->_data72_->_ref_count_ = 1;
	_data_->_data72_->self = g_object_ref (_data_->self);
	_data_->_data72_->_async_data_ = _data_;
	composer_widget_update_attachments_view (_data_->self);
	composer_widget_update_pending_attachments (_data_->self, _data_->self->priv->pending_include, TRUE);
	_data_->_tmp0_ = _data_->self->priv->_editor;
	_data_->_tmp1_ = composer_editor_get_body (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	composer_web_view_load_html (_data_->_tmp2_, _data_->body, _data_->quote, _data_->self->priv->top_posting, _data_->is_body_complete);
	_data_->_tmp3_ = _data_->self->priv->_sender_context;
	_data_->_tmp4_ = application_account_context_get_account (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
	_data_->_data72_->current_account = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->self->priv->_saved_id;
	composer_widget_open_draft_manager (_data_->self, _data_->_tmp7_, ___lambda79__gasync_ready_callback, block72_data_ref (_data_->_data72_));
	block72_data_unref (_data_->_data72_);
	_data_->_data72_ = NULL;
	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
composer_widget_should_send_data_free (gpointer _data)
{
	ComposerWidgetShouldSendData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetShouldSendData, _data_);
}

static void
composer_widget_should_send (ComposerWidget* self,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	ComposerWidgetShouldSendData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetShouldSendData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_should_send_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_should_send_co (_data_);
}

static gboolean
composer_widget_should_send_finish (ComposerWidget* self,
                                    GAsyncResult* _res_)
{
	gboolean result;
	ComposerWidgetShouldSendData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
composer_widget_should_send_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	ComposerWidgetShouldSendData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_should_send_co (_data_);
}

static gboolean
composer_widget_should_send_co (ComposerWidgetShouldSendData* _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_->_tmp0_ = composer_widget_get_subject (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = string_strip (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = !geary_string_is_empty (_data_->_tmp3_);
	_g_free0 (_data_->_tmp3_);
	_data_->has_subject = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->self->priv->attached_files;
	_data_->_tmp6_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, GEE_TYPE_COLLECTION, GeeCollection));
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->has_attachment = _data_->_tmp7_ > 0;
	_data_->has_body = TRUE;
	{
		_data_->_tmp9_ = _data_->self->priv->_editor;
		_data_->_tmp10_ = composer_editor_get_body (_data_->_tmp9_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_state_ = 1;
		components_web_view_get_html (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), composer_widget_should_send_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp12_ = components_web_view_get_html_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp8_ = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->has_body = !geary_string_is_empty (_data_->_tmp8_);
		_g_free0 (_data_->_tmp8_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp13_ = _data_->err;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		g_debug ("composer-widget.vala:1498: Failed to get message body: %s", _data_->_tmp14_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->confirmation = NULL;
	if (!_data_->has_subject) {
		_data_->_tmp16_ = !_data_->has_body;
	} else {
		_data_->_tmp16_ = FALSE;
	}
	if (_data_->_tmp16_) {
		_data_->_tmp15_ = !_data_->has_attachment;
	} else {
		_data_->_tmp15_ = FALSE;
	}
	if (_data_->_tmp15_) {
		_data_->_tmp17_ = g_strdup (_ ("Send message with an empty subject and body?"));
		_g_free0 (_data_->confirmation);
		_data_->confirmation = _data_->_tmp17_;
	} else {
		if (!_data_->has_subject) {
			_data_->_tmp18_ = g_strdup (_ ("Send message with an empty subject?"));
			_g_free0 (_data_->confirmation);
			_data_->confirmation = _data_->_tmp18_;
		} else {
			if (!_data_->has_body) {
				_data_->_tmp19_ = !_data_->has_attachment;
			} else {
				_data_->_tmp19_ = FALSE;
			}
			if (_data_->_tmp19_) {
				_data_->_tmp20_ = g_strdup (_ ("Send message with an empty body?"));
				_g_free0 (_data_->confirmation);
				_data_->confirmation = _data_->_tmp20_;
			} else {
				if (!_data_->has_attachment) {
					_data_->_tmp21_ = g_strjoin ("|", COMPOSER_WIDGET_ATTACHMENT_KEYWORDS, COMPOSER_WIDGET_ATTACHMENT_KEYWORDS_LOCALISED, NULL);
					_data_->keywords = _data_->_tmp21_;
					_data_->_tmp22_ = _data_->self->priv->_editor;
					_data_->_tmp23_ = composer_editor_get_body (_data_->_tmp22_);
					_data_->_tmp24_ = _data_->_tmp23_;
					_data_->_tmp25_ = _data_->keywords;
					_data_->_tmp26_ = composer_widget_get_subject (_data_->self);
					_data_->_tmp27_ = _data_->_tmp26_;
					_data_->_state_ = 2;
					composer_web_view_contains_attachment_keywords (_data_->_tmp24_, _data_->_tmp25_, _data_->_tmp27_, composer_widget_should_send_ready, _data_);
					return FALSE;
					_state_2:
					_data_->_tmp28_ = composer_web_view_contains_attachment_keywords_finish (_data_->_tmp24_, _data_->_res_);
					_data_->contains = _data_->_tmp28_;
					_data_->_tmp30_ = _data_->contains;
					if (_data_->_tmp30_ != NULL) {
						_data_->_tmp31_ = _data_->contains;
						_data_->_tmp29_ = *_data_->_tmp31_;
					} else {
						_data_->_tmp29_ = FALSE;
					}
					if (_data_->_tmp29_) {
						_data_->_tmp32_ = g_strdup (_ ("Send message without an attachment?"));
						_g_free0 (_data_->confirmation);
						_data_->confirmation = _data_->_tmp32_;
					}
					_g_free0 (_data_->contains);
					_g_free0 (_data_->keywords);
				}
			}
		}
	}
	_data_->_tmp33_ = _data_->confirmation;
	if (_data_->_tmp33_ != NULL) {
		_data_->_tmp34_ = composer_widget_get_container (_data_->self);
		_data_->_tmp35_ = _data_->_tmp34_;
		_data_->_tmp36_ = composer_container_get_top_window (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		_data_->_tmp38_ = _data_->confirmation;
		_data_->_tmp39_ = confirmation_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp37_, gtk_window_get_type (), GtkWindow), _data_->_tmp38_, NULL, STOCK__OK, "suggested-action");
		_data_->dialog = _data_->_tmp39_;
		_data_->_tmp40_ = _data_->dialog;
		_data_->result = alert_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp40_, TYPE_ALERT_DIALOG, AlertDialog)) == GTK_RESPONSE_OK;
		_g_object_unref0 (_data_->dialog);
		_g_free0 (_data_->confirmation);
		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 = TRUE;
	_g_free0 (_data_->confirmation);
	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
__lambda187_ (ComposerWidget* self,
              GObject* obj,
              GAsyncResult* res)
{
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	if (composer_widget_should_send_finish (self, res)) {
		composer_widget_on_send_async (self, NULL, NULL);
	}
}

static void
___lambda187__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda187_ ((ComposerWidget*) self, source_object, res);
	g_object_unref (self);
}

static void
composer_widget_on_send (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_should_send (self, ___lambda187__gasync_ready_callback, g_object_ref (self));
}

static void
composer_widget_on_send_async_data_free (gpointer _data)
{
	ComposerWidgetOnSendAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetOnSendAsyncData, _data_);
}

static void
composer_widget_on_send_async (ComposerWidget* self,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	ComposerWidgetOnSendAsyncData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetOnSendAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_on_send_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_on_send_async_co (_data_);
}

static void
composer_widget_on_send_finish (ComposerWidget* self,
                                GAsyncResult* _res_)
{
	ComposerWidgetOnSendAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
composer_widget_on_send_async_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	ComposerWidgetOnSendAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_on_send_async_co (_data_);
}

static gboolean
composer_widget_on_send_async_co (ComposerWidgetOnSendAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	composer_widget_set_enabled (_data_->self, FALSE);
	{
		_data_->_tmp0_ = _data_->self->priv->_editor;
		_data_->_tmp1_ = composer_editor_get_body (_data_->_tmp0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_state_ = 1;
		composer_web_view_clean_content (_data_->_tmp2_, composer_widget_on_send_async_ready, _data_);
		return FALSE;
		_state_1:
		composer_web_view_clean_content_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp3_ = _data_->self->priv->application;
		_data_->_state_ = 2;
		composer_application_interface_send_composed_email (_data_->_tmp3_, _data_->self, composer_widget_on_send_async_ready, _data_);
		return FALSE;
		_state_2:
		composer_application_interface_send_composed_email_finish (_data_->_tmp3_, _data_->_res_);
		_data_->_state_ = 3;
		composer_widget_close_draft_manager (_data_->self, COMPOSER_WIDGET_DRAFT_POLICY_DISCARD, composer_widget_on_send_async_ready, _data_);
		return FALSE;
		_state_3:
		composer_widget_close_draft_manager_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp4_ = composer_widget_get_container (_data_->self);
		_data_->_tmp5_ = _data_->_tmp4_;
		if (_data_->_tmp5_ != NULL) {
			_data_->_tmp6_ = composer_widget_get_container (_data_->self);
			_data_->_tmp7_ = _data_->_tmp6_;
			composer_container_close (_data_->_tmp7_);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->self->priv->application;
		_data_->_tmp9_ = _data_->self->priv->_sender_context;
		_data_->_tmp10_ = application_account_context_get_account (_data_->_tmp9_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = geary_account_get_information (_data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = _data_->_error_;
		_data_->_tmp15_ = geary_account_problem_report_new (_data_->_tmp13_, _data_->_tmp14_);
		_data_->_tmp16_ = _data_->_tmp15_;
		composer_application_interface_report_problem (_data_->_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
		_g_object_unref0 (_data_->_tmp16_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_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
composer_widget_open_draft_manager_data_free (gpointer _data)
{
	ComposerWidgetOpenDraftManagerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->editing_draft_id);
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetOpenDraftManagerData, _data_);
}

static void
composer_widget_open_draft_manager (ComposerWidget* self,
                                    GearyEmailIdentifier* editing_draft_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	ComposerWidgetOpenDraftManagerData* _data_;
	ComposerWidget* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail ((editing_draft_id == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (editing_draft_id, GEARY_TYPE_EMAIL_IDENTIFIER));
	_data_ = g_slice_new0 (ComposerWidgetOpenDraftManagerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_open_draft_manager_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (editing_draft_id);
	_g_object_unref0 (_data_->editing_draft_id);
	_data_->editing_draft_id = _tmp1_;
	composer_widget_open_draft_manager_co (_data_);
}

static void
composer_widget_open_draft_manager_finish (ComposerWidget* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	ComposerWidgetOpenDraftManagerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
     * Creates and opens the composer's draft manager.
     *
     * Note that since the draft manager may block until a remote
     * connection is open, this method may likewise do so. Hence this
     * method typically needs to be called from the main loop as a
     * background async task using the `begin` async call form.
     */
static Block73Data*
block73_data_ref (Block73Data* _data73_)
{
	g_atomic_int_inc (&_data73_->_ref_count_);
	return _data73_;
}

static void
block73_data_unref (void * _userdata_)
{
	Block73Data* _data73_;
	_data73_ = (Block73Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data73_->_ref_count_)) {
		ComposerWidget* self;
		self = _data73_->self;
		_g_object_unref0 (_data73_->internal_cancellable);
		_g_object_unref0 (self);
		g_slice_free (Block73Data, _data73_);
	}
}

static void
__lambda19_ (Block73Data* _data73_)
{
	ComposerWidget* self;
	GCancellable* _tmp0_;
	self = _data73_->self;
	_tmp0_ = _data73_->internal_cancellable;
	g_cancellable_cancel (_tmp0_);
}

static void
___lambda19__g_cancellable_cancelled (GCancellable* _sender,
                                      gpointer self)
{
	__lambda19_ (self);
}

static void
composer_widget_open_draft_manager_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	ComposerWidgetOpenDraftManagerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_open_draft_manager_co (_data_);
}

static void
_composer_widget_on_draft_state_changed_g_object_notify (GObject* _sender,
                                                         GParamSpec* pspec,
                                                         gpointer self)
{
	composer_widget_on_draft_state_changed ((ComposerWidget*) self);
}

static void
_composer_widget_on_draft_id_changed_g_object_notify (GObject* _sender,
                                                      GParamSpec* pspec,
                                                      gpointer self)
{
	composer_widget_on_draft_id_changed ((ComposerWidget*) self);
}

static void
_composer_widget_on_draft_manager_fatal_geary_app_draft_manager_fatal (GearyAppDraftManager* _sender,
                                                                       GError* err,
                                                                       gpointer self)
{
	composer_widget_on_draft_manager_fatal ((ComposerWidget*) self, err);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
composer_widget_open_draft_manager_co (ComposerWidgetOpenDraftManagerData* _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_->_data73_ = g_slice_new0 (Block73Data);
	_data_->_data73_->_ref_count_ = 1;
	_data_->_data73_->self = g_object_ref (_data_->self);
	_data_->_data73_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->_sender_context;
	_data_->_tmp1_ = application_account_context_get_account (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = geary_account_get_information (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = geary_account_information_get_save_drafts (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (!_data_->_tmp6_) {
		_data_->_tmp7_ = _data_->self->priv->_header;
		composer_headerbar_set_show_save_and_close (_data_->_tmp7_, FALSE);
		block73_data_unref (_data_->_data73_);
		_data_->_data73_ = NULL;
		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_->_tmp8_ = _data_->self->priv->draft_manager_opening;
	if (_data_->_tmp8_ != NULL) {
		_data_->_tmp9_ = _data_->self->priv->draft_manager_opening;
		g_cancellable_cancel (_data_->_tmp9_);
	}
	_data_->_tmp10_ = g_cancellable_new ();
	_data_->_data73_->internal_cancellable = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->self->priv->_sender_context;
	_data_->_tmp12_ = application_account_context_get_cancellable (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	g_signal_connect_data (_data_->_tmp13_, "cancelled", (GCallback) ___lambda19__g_cancellable_cancelled, block73_data_ref (_data_->_data73_), (GClosureNotify) block73_data_unref, 0);
	_data_->_tmp14_ = _data_->_data73_->internal_cancellable;
	_data_->_tmp15_ = _g_object_ref0 (_data_->_tmp14_);
	_g_object_unref0 (_data_->self->priv->draft_manager_opening);
	_data_->self->priv->draft_manager_opening = _data_->_tmp15_;
	_data_->_tmp16_ = _data_->self->priv->_save_to;
	_data_->_tmp17_ = _g_object_ref0 (_data_->_tmp16_);
	_data_->target = _data_->_tmp17_;
	_data_->_tmp18_ = _data_->target;
	if (_data_->_tmp18_ == NULL) {
		_data_->_tmp20_ = _data_->self->priv->_sender_context;
		_data_->_tmp21_ = application_account_context_get_account (_data_->_tmp20_);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = _data_->_data73_->internal_cancellable;
		_data_->_state_ = 1;
		geary_account_get_required_special_folder_async (_data_->_tmp22_, GEARY_FOLDER_SPECIAL_USE_DRAFTS, _data_->_tmp23_, composer_widget_open_draft_manager_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp24_ = geary_account_get_required_special_folder_finish (_data_->_tmp22_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp19_ = _data_->_tmp24_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->target);
			block73_data_unref (_data_->_data73_);
			_data_->_data73_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp25_ = _data_->_tmp19_;
		_data_->_tmp19_ = NULL;
		_g_object_unref0 (_data_->target);
		_data_->target = _data_->_tmp25_;
		_g_object_unref0 (_data_->_tmp19_);
	}
	_data_->_tmp27_ = _data_->target;
	_data_->_tmp28_ = geary_folder_get_used_as (_data_->_tmp27_);
	_data_->_tmp29_ = _data_->_tmp28_;
	if (_data_->_tmp29_ == GEARY_FOLDER_SPECIAL_USE_DRAFTS) {
		_data_->_tmp30_ = geary_email_flags_get_DRAFT ();
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_tmp32_ = _data_->_tmp31_;
		_data_->_tmp33_ = geary_email_flags_new_with (_data_->_tmp32_, NULL);
		_g_object_unref0 (_data_->_tmp26_);
		_data_->_tmp26_ = _data_->_tmp33_;
		_g_object_unref0 (_data_->_tmp32_);
	} else {
		_data_->_tmp34_ = geary_email_flags_new ();
		_g_object_unref0 (_data_->_tmp26_);
		_data_->_tmp26_ = _data_->_tmp34_;
	}
	_data_->_tmp35_ = _data_->_tmp26_;
	_data_->_tmp26_ = NULL;
	_data_->flags = _data_->_tmp35_;
	_data_->opened = FALSE;
	{
		_data_->_tmp36_ = _data_->self->priv->_sender_context;
		_data_->_tmp37_ = application_account_context_get_account (_data_->_tmp36_);
		_data_->_tmp38_ = _data_->_tmp37_;
		_data_->_tmp39_ = _data_->target;
		_data_->_tmp40_ = _data_->flags;
		_data_->_tmp41_ = _data_->_data73_->internal_cancellable;
		_data_->_state_ = 2;
		geary_app_draft_manager_new (_data_->_tmp38_, _data_->_tmp39_, _data_->_tmp40_, _data_->editing_draft_id, _data_->_tmp41_, composer_widget_open_draft_manager_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp42_ = geary_app_draft_manager_new_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->new_manager = _data_->_tmp42_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, GEARY_ENGINE_ERROR, GEARY_ENGINE_ERROR_UNSUPPORTED)) {
				goto __catch0_geary_engine_error_unsupported;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp43_ = _data_->new_manager;
		_data_->_tmp44_ = g_strconcat ("notify::", GEARY_APP_DRAFT_MANAGER_PROP_DRAFT_STATE, NULL);
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp43_, G_TYPE_OBJECT, GObject), _data_->_tmp44_, (GCallback) _composer_widget_on_draft_state_changed_g_object_notify, _data_->self, 0);
		_g_free0 (_data_->_tmp44_);
		_data_->_tmp45_ = _data_->new_manager;
		_data_->_tmp46_ = g_strconcat ("notify::", GEARY_APP_DRAFT_MANAGER_PROP_CURRENT_DRAFT_ID, NULL);
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp45_, G_TYPE_OBJECT, GObject), _data_->_tmp46_, (GCallback) _composer_widget_on_draft_id_changed_g_object_notify, _data_->self, 0);
		_g_free0 (_data_->_tmp46_);
		_data_->_tmp47_ = _data_->new_manager;
		g_signal_connect_object (_data_->_tmp47_, "fatal", (GCallback) _composer_widget_on_draft_manager_fatal_geary_app_draft_manager_fatal, _data_->self, 0);
		_data_->_tmp48_ = _data_->new_manager;
		_data_->_tmp49_ = _g_object_ref0 (_data_->_tmp48_);
		_g_object_unref0 (_data_->self->priv->draft_manager);
		_data_->self->priv->draft_manager = _data_->_tmp49_;
		_data_->opened = TRUE;
		g_debug ("composer-widget.vala:1613: Draft manager opened");
		_g_object_unref0 (_data_->new_manager);
	}
	goto __finally0;
	__catch0_geary_engine_error_unsupported:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp50_ = _data_->err;
		_data_->_tmp51_ = _data_->_tmp50_->message;
		g_debug ("composer-widget.vala:1615: Drafts folder unsupported, no drafts will b" \
"e saved: %s", _data_->_tmp51_);
		_g_error_free0 (_data_->err);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_vala1_err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp52_ = _data_->self->priv->_header;
		composer_headerbar_set_show_save_and_close (_data_->_tmp52_, FALSE);
		_data_->_tmp53_ = _data_->_vala1_err;
		_data_->_tmp54_ = _g_error_copy0 (_data_->_tmp53_);
		_data_->_inner_error0_ = _data_->_tmp54_;
		_g_error_free0 (_data_->_vala1_err);
		goto __finally0;
	}
	__finally0:
	{
		_g_object_unref0 (_data_->self->priv->draft_manager_opening);
		_data_->self->priv->draft_manager_opening = NULL;
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->flags);
		_g_object_unref0 (_data_->_tmp26_);
		_g_object_unref0 (_data_->target);
		block73_data_unref (_data_->_data73_);
		_data_->_data73_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp55_ = _data_->self->priv->_header;
	composer_headerbar_set_show_save_and_close (_data_->_tmp55_, _data_->opened);
	if (_data_->opened) {
		composer_widget_update_draft_state (_data_->self);
	}
	_g_object_unref0 (_data_->flags);
	_g_object_unref0 (_data_->_tmp26_);
	_g_object_unref0 (_data_->target);
	block73_data_unref (_data_->_data73_);
	_data_->_data73_ = NULL;
	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
composer_widget_reopen_draft_manager_data_free (gpointer _data)
{
	ComposerWidgetReopenDraftManagerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetReopenDraftManagerData, _data_);
}

static void
composer_widget_reopen_draft_manager (ComposerWidget* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	ComposerWidgetReopenDraftManagerData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetReopenDraftManagerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_reopen_draft_manager_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_reopen_draft_manager_co (_data_);
}

static void
composer_widget_reopen_draft_manager_finish (ComposerWidget* self,
                                             GAsyncResult* _res_)
{
	ComposerWidgetReopenDraftManagerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Closes current draft manager, if any, then opens a new one.
     */
static void
composer_widget_reopen_draft_manager_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	ComposerWidgetReopenDraftManagerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_reopen_draft_manager_co (_data_);
}

static gboolean
composer_widget_reopen_draft_manager_co (ComposerWidgetReopenDraftManagerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_sender_context;
	_data_->_tmp1_ = application_account_context_get_account (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->current_account = _data_->_tmp3_;
	{
		_data_->_state_ = 1;
		composer_widget_close_draft_manager (_data_->self, COMPOSER_WIDGET_DRAFT_POLICY_DISCARD, composer_widget_reopen_draft_manager_ready, _data_);
		return FALSE;
		_state_1:
		composer_widget_close_draft_manager_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 2;
		composer_widget_open_draft_manager (_data_->self, NULL, composer_widget_reopen_draft_manager_ready, _data_);
		return FALSE;
		_state_2:
		composer_widget_open_draft_manager_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 3;
		composer_widget_save_draft (_data_->self, composer_widget_reopen_draft_manager_ready, _data_);
		return FALSE;
		_state_3:
		composer_widget_save_draft_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->self->priv->application;
		_data_->_tmp5_ = _data_->current_account;
		_data_->_tmp6_ = geary_account_get_information (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->_error_;
		_data_->_tmp9_ = geary_account_problem_report_new (_data_->_tmp7_, _data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		composer_application_interface_report_problem (_data_->_tmp4_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
		_g_object_unref0 (_data_->_tmp10_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->current_account);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->current_account);
	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
composer_widget_close_draft_manager_data_free (gpointer _data)
{
	ComposerWidgetCloseDraftManagerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetCloseDraftManagerData, _data_);
}

static void
composer_widget_close_draft_manager (ComposerWidget* self,
                                     ComposerWidgetDraftPolicy draft_policy,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	ComposerWidgetCloseDraftManagerData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetCloseDraftManagerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_close_draft_manager_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->draft_policy = draft_policy;
	composer_widget_close_draft_manager_co (_data_);
}

static void
composer_widget_close_draft_manager_finish (ComposerWidget* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	ComposerWidgetCloseDraftManagerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
composer_widget_close_draft_manager_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	ComposerWidgetCloseDraftManagerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_close_draft_manager_co (_data_);
}

static gboolean
composer_widget_close_draft_manager_co (ComposerWidgetCloseDraftManagerData* _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_->_tmp0_ = _data_->self->priv->draft_manager;
	_data_->_tmp1_ = _g_object_ref0 (_data_->_tmp0_);
	_data_->old_manager = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->old_manager;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->self->priv->draft_timer;
		geary_timeout_manager_reset (_data_->_tmp3_);
		_g_object_unref0 (_data_->self->priv->draft_manager);
		_data_->self->priv->draft_manager = NULL;
		composer_widget_set_saved_id (_data_->self, NULL);
		composer_widget_set_draft_status_text (_data_->self, "");
		_data_->_tmp4_ = _data_->old_manager;
		_data_->_tmp5_ = g_strconcat ("notify::", GEARY_APP_DRAFT_MANAGER_PROP_DRAFT_STATE, NULL);
		g_signal_parse_name (_data_->_tmp5_, G_TYPE_OBJECT, &_data_->_tmp6_, &_data_->_tmp7_, TRUE);
		g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, G_TYPE_OBJECT, GObject), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp6_, _data_->_tmp7_, NULL, (GCallback) _composer_widget_on_draft_state_changed_g_object_notify, _data_->self);
		_g_free0 (_data_->_tmp5_);
		_data_->_tmp8_ = _data_->old_manager;
		_data_->_tmp9_ = g_strconcat ("notify::", GEARY_APP_DRAFT_MANAGER_PROP_CURRENT_DRAFT_ID, NULL);
		g_signal_parse_name (_data_->_tmp9_, G_TYPE_OBJECT, &_data_->_tmp10_, &_data_->_tmp11_, TRUE);
		g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp8_, G_TYPE_OBJECT, GObject), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp10_, _data_->_tmp11_, NULL, (GCallback) _composer_widget_on_draft_id_changed_g_object_notify, _data_->self);
		_g_free0 (_data_->_tmp9_);
		_data_->_tmp12_ = _data_->old_manager;
		g_signal_parse_name ("fatal", GEARY_APP_TYPE_DRAFT_MANAGER, &_data_->_tmp13_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_data_->_tmp12_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp13_, 0, NULL, (GCallback) _composer_widget_on_draft_manager_fatal_geary_app_draft_manager_fatal, _data_->self);
		if (_data_->draft_policy == COMPOSER_WIDGET_DRAFT_POLICY_DISCARD) {
			g_debug ("composer-widget.vala:1669: Discarding draft");
			_data_->_tmp14_ = _data_->old_manager;
			_data_->_state_ = 1;
			geary_app_draft_manager_discard (_data_->_tmp14_, NULL, composer_widget_close_draft_manager_ready, _data_);
			return FALSE;
			_state_1:
			geary_app_draft_manager_discard_finish (_data_->_tmp14_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->old_manager);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp15_ = _data_->old_manager;
		_data_->_state_ = 2;
		geary_app_draft_manager_close_async (_data_->_tmp15_, NULL, composer_widget_close_draft_manager_ready, _data_);
		return FALSE;
		_state_2:
		geary_app_draft_manager_close_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->old_manager);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		g_debug ("composer-widget.vala:1674: Draft manager closed");
	}
	_g_object_unref0 (_data_->old_manager);
	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
composer_widget_update_draft_state (ComposerWidget* self)
{
	GearyAppDraftManager* _tmp0_;
	GearyAppDraftManagerDraftState _tmp1_;
	GearyAppDraftManagerDraftState _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->draft_manager;
	_tmp1_ = geary_app_draft_manager_get_draft_state (_tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case GEARY_APP_DRAFT_MANAGER_DRAFT_STATE_STORED:
		{
			composer_widget_set_draft_status_text (self, COMPOSER_WIDGET_DRAFT_SAVED_TEXT);
			self->priv->is_draft_saved = TRUE;
			break;
		}
		case GEARY_APP_DRAFT_MANAGER_DRAFT_STATE_STORING:
		{
			composer_widget_set_draft_status_text (self, COMPOSER_WIDGET_DRAFT_SAVING_TEXT);
			self->priv->is_draft_saved = TRUE;
			break;
		}
		case GEARY_APP_DRAFT_MANAGER_DRAFT_STATE_NOT_STORED:
		{
			composer_widget_set_draft_status_text (self, "");
			self->priv->is_draft_saved = FALSE;
			break;
		}
		case GEARY_APP_DRAFT_MANAGER_DRAFT_STATE_ERROR:
		{
			composer_widget_set_draft_status_text (self, COMPOSER_WIDGET_DRAFT_ERROR_TEXT);
			self->priv->is_draft_saved = FALSE;
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static inline void
composer_widget_draft_changed (ComposerWidget* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_should_save (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GearyTimeoutManager* _tmp2_;
		_tmp2_ = self->priv->draft_timer;
		geary_timeout_manager_start (_tmp2_);
	}
	composer_widget_set_draft_status_text (self, "");
	self->priv->is_draft_saved = FALSE;
}

static void
composer_widget_save_draft_data_free (gpointer _data)
{
	ComposerWidgetSaveDraftData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetSaveDraftData, _data_);
}

static void
composer_widget_save_draft (ComposerWidget* self,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	ComposerWidgetSaveDraftData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetSaveDraftData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_save_draft_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_save_draft_co (_data_);
}

static void
composer_widget_save_draft_finish (ComposerWidget* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	ComposerWidgetSaveDraftData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
composer_widget_save_draft_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	ComposerWidgetSaveDraftData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_save_draft_co (_data_);
}

static gboolean
composer_widget_save_draft_co (ComposerWidgetSaveDraftData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("composer-widget.vala:1717: Saving draft");
	_data_->_tmp0_ = _data_->self->priv->draft_timer;
	geary_timeout_manager_reset (_data_->_tmp0_);
	_data_->_tmp1_ = _data_->self->priv->draft_manager;
	if (_data_->_tmp1_ != NULL) {
		_data_->_state_ = 1;
		composer_widget_to_composed_email (_data_->self, NULL, TRUE, composer_widget_save_draft_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = composer_widget_to_composed_email_finish (_data_->self, _data_->_res_);
		_data_->draft = _data_->_tmp2_;
		_data_->_tmp4_ = _data_->draft;
		_data_->_state_ = 2;
		geary_rf_c822_message_new_from_composed_email (_data_->_tmp4_, NULL, NULL, composer_widget_save_draft_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp5_ = geary_rf_c822_message_new_from_composed_email_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp5_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->draft);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp6_ = _data_->self->priv->draft_manager;
		_data_->_state_ = 3;
		geary_app_draft_manager_update (_data_->_tmp6_, _data_->_tmp3_, NULL, NULL, composer_widget_save_draft_ready, _data_);
		return FALSE;
		_state_3:
		geary_app_draft_manager_update_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->_tmp3_);
			_g_object_unref0 (_data_->draft);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->_tmp3_);
		_g_object_unref0 (_data_->draft);
	}
	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
composer_widget_save_and_close_data_free (gpointer _data)
{
	ComposerWidgetSaveAndCloseData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetSaveAndCloseData, _data_);
}

static void
composer_widget_save_and_close (ComposerWidget* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	ComposerWidgetSaveAndCloseData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetSaveAndCloseData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_save_and_close_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_save_and_close_co (_data_);
}

static void
composer_widget_save_and_close_finish (ComposerWidget* self,
                                       GAsyncResult* _res_)
{
	ComposerWidgetSaveAndCloseData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
composer_widget_save_and_close_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	ComposerWidgetSaveAndCloseData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_save_and_close_co (_data_);
}

static gboolean
composer_widget_save_and_close_co (ComposerWidgetSaveAndCloseData* _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:
	composer_widget_set_enabled (_data_->self, FALSE);
	_data_->_tmp0_ = composer_widget_get_should_save (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_) {
		{
			_data_->_state_ = 1;
			composer_widget_save_draft (_data_->self, composer_widget_save_and_close_ready, _data_);
			return FALSE;
			_state_1:
			composer_widget_save_draft_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->_error_ = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp2_ = _data_->self->priv->application;
			_data_->_tmp3_ = _data_->self->priv->_sender_context;
			_data_->_tmp4_ = application_account_context_get_account (_data_->_tmp3_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_data_->_tmp6_ = geary_account_get_information (_data_->_tmp5_);
			_data_->_tmp7_ = _data_->_tmp6_;
			_data_->_tmp8_ = _data_->_error_;
			_data_->_tmp9_ = geary_account_problem_report_new (_data_->_tmp7_, _data_->_tmp8_);
			_data_->_tmp10_ = _data_->_tmp9_;
			composer_application_interface_report_problem (_data_->_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
			_g_object_unref0 (_data_->_tmp10_);
			_g_error_free0 (_data_->_error_);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp11_ = composer_widget_get_container (_data_->self);
	_data_->_tmp12_ = _data_->_tmp11_;
	if (_data_->_tmp12_ != NULL) {
		_data_->_tmp13_ = composer_widget_get_container (_data_->self);
		_data_->_tmp14_ = _data_->_tmp13_;
		composer_container_close (_data_->_tmp14_);
	}
	_data_->_tmp15_ = _data_->self->priv->application;
	_data_->_state_ = 2;
	composer_application_interface_save_composed_email (_data_->_tmp15_, _data_->self, composer_widget_save_and_close_ready, _data_);
	return FALSE;
	_state_2:
	composer_application_interface_save_composed_email_finish (_data_->_tmp15_, _data_->_res_);
	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
composer_widget_discard_and_close_data_free (gpointer _data)
{
	ComposerWidgetDiscardAndCloseData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ComposerWidgetDiscardAndCloseData, _data_);
}

static void
composer_widget_discard_and_close (ComposerWidget* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	ComposerWidgetDiscardAndCloseData* _data_;
	ComposerWidget* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data_ = g_slice_new0 (ComposerWidgetDiscardAndCloseData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_discard_and_close_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	composer_widget_discard_and_close_co (_data_);
}

static void
composer_widget_discard_and_close_finish (ComposerWidget* self,
                                          GAsyncResult* _res_)
{
	ComposerWidgetDiscardAndCloseData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
composer_widget_discard_and_close_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	ComposerWidgetDiscardAndCloseData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_discard_and_close_co (_data_);
}

static gboolean
composer_widget_discard_and_close_co (ComposerWidgetDiscardAndCloseData* _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:
	composer_widget_set_enabled (_data_->self, FALSE);
	_data_->_tmp0_ = _data_->self->priv->application;
	_data_->_state_ = 1;
	composer_application_interface_discard_composed_email (_data_->_tmp0_, _data_->self, composer_widget_discard_and_close_ready, _data_);
	return FALSE;
	_state_1:
	composer_application_interface_discard_composed_email_finish (_data_->_tmp0_, _data_->_res_);
	{
		_data_->_state_ = 2;
		composer_widget_close_draft_manager (_data_->self, COMPOSER_WIDGET_DRAFT_POLICY_DISCARD, composer_widget_discard_and_close_ready, _data_);
		return FALSE;
		_state_2:
		composer_widget_close_draft_manager_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp1_ = _data_->self->priv->application;
		_data_->_tmp2_ = _data_->self->priv->_sender_context;
		_data_->_tmp3_ = application_account_context_get_account (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = geary_account_get_information (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = _data_->_error_;
		_data_->_tmp8_ = geary_account_problem_report_new (_data_->_tmp6_, _data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		composer_application_interface_report_problem (_data_->_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
		_g_object_unref0 (_data_->_tmp9_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp10_ = composer_widget_get_container (_data_->self);
	_data_->_tmp11_ = _data_->_tmp10_;
	if (_data_->_tmp11_ != NULL) {
		_data_->_tmp12_ = composer_widget_get_container (_data_->self);
		_data_->_tmp13_ = _data_->_tmp12_;
		composer_container_close (_data_->_tmp13_);
	}
	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
composer_widget_update_attachments_view (ComposerWidget* self)
{
	GeeSet* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->attached_files;
	_tmp1_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp2_ = _tmp1_;
	if (_tmp2_ > 0) {
		GtkBox* _tmp3_;
		_tmp3_ = self->priv->attachments_box;
		gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
	} else {
		GtkBox* _tmp4_;
		_tmp4_ = self->priv->attachments_box;
		gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
	}
}

static GearyMimeDispositionType*
_geary_mime_disposition_type_dup (GearyMimeDispositionType* self)
{
	GearyMimeDispositionType* dup;
	dup = g_new0 (GearyMimeDispositionType, 1);
	memcpy (dup, self, sizeof (GearyMimeDispositionType));
	return dup;
}

static gpointer
__geary_mime_disposition_type_dup0 (gpointer self)
{
	return self ? _geary_mime_disposition_type_dup (self) : NULL;
}

static gboolean
_geary_mime_disposition_type_equal (const GearyMimeDispositionType * s1,
                                    const GearyMimeDispositionType * s2)
{
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	return (*s1) == (*s2);
}

static gboolean
composer_widget_update_pending_attachments (ComposerWidget* self,
                                            ComposerWidgetAttachPending include,
                                            gboolean do_add)
{
	gboolean have_added = FALSE;
	gboolean manual_enabled = FALSE;
	GeeList* _tmp0_;
	ComposerEditor* _tmp61_;
	GtkButton* _tmp62_;
	ComposerEditor* _tmp63_;
	GtkBox* _tmp64_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	have_added = FALSE;
	manual_enabled = FALSE;
	_tmp0_ = self->priv->pending_attachments;
	if (_tmp0_ != NULL) {
		{
			GeeList* _part_list = NULL;
			GeeList* _tmp1_;
			gint _part_size = 0;
			GeeList* _tmp2_;
			gint _tmp3_;
			gint _tmp4_;
			gint _part_index = 0;
			_tmp1_ = self->priv->pending_attachments;
			_part_list = _tmp1_;
			_tmp2_ = _part_list;
			_tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection));
			_tmp4_ = _tmp3_;
			_part_size = _tmp4_;
			_part_index = -1;
			while (TRUE) {
				gint _tmp5_;
				gint _tmp6_;
				GearyAttachment* part = NULL;
				GeeList* _tmp7_;
				gpointer _tmp8_;
				_part_index = _part_index + 1;
				_tmp5_ = _part_index;
				_tmp6_ = _part_size;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = _part_list;
				_tmp8_ = gee_list_get (_tmp7_, _part_index);
				part = (GearyAttachment*) _tmp8_;
				{
					gchar* content_id = NULL;
					GearyAttachment* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					gchar* _tmp12_;
					GearyMimeDispositionType* type = NULL;
					GearyAttachment* _tmp13_;
					GearyMimeContentDisposition* _tmp14_;
					GearyMimeContentDisposition* _tmp15_;
					GearyMimeDispositionType _tmp16_;
					GearyMimeDispositionType _tmp17_;
					GearyMimeDispositionType* _tmp18_;
					GFile* file = NULL;
					GearyAttachment* _tmp19_;
					GFile* _tmp20_;
					GFile* _tmp21_;
					GFile* _tmp22_;
					GearyMimeDispositionType* _tmp23_;
					GearyMimeDispositionType _tmp24_;
					gboolean _tmp38_ = FALSE;
					GearyMimeDispositionType* _tmp39_;
					GearyMimeDispositionType _tmp40_;
					_tmp9_ = part;
					_tmp10_ = geary_attachment_get_content_id (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = g_strdup (_tmp11_);
					content_id = _tmp12_;
					_tmp13_ = part;
					_tmp14_ = geary_attachment_get_content_disposition (_tmp13_);
					_tmp15_ = _tmp14_;
					_tmp16_ = geary_mime_content_disposition_get_disposition_type (_tmp15_);
					_tmp17_ = _tmp16_;
					_tmp18_ = __geary_mime_disposition_type_dup0 (&_tmp17_);
					type = _tmp18_;
					_tmp19_ = part;
					_tmp20_ = geary_attachment_get_file (_tmp19_);
					_tmp21_ = _tmp20_;
					_tmp22_ = _g_object_ref0 (_tmp21_);
					file = _tmp22_;
					_tmp23_ = type;
					_tmp24_ = GEARY_MIME_DISPOSITION_TYPE_INLINE;
					if (_geary_mime_disposition_type_equal (_tmp23_, &_tmp24_) == TRUE) {
						const gchar* _tmp25_;
						_tmp25_ = content_id;
						if (_tmp25_ != NULL) {
							GearyMemoryFileBuffer* file_buffer = NULL;
							GFile* _tmp26_;
							GearyMemoryFileBuffer* _tmp27_;
							GeeMap* _tmp28_;
							const gchar* _tmp29_;
							GearyMemoryFileBuffer* _tmp30_;
							ComposerEditor* _tmp31_;
							ComposerWebView* _tmp32_;
							ComposerWebView* _tmp33_;
							const gchar* _tmp34_;
							GearyMemoryFileBuffer* _tmp35_;
							_tmp26_ = file;
							_tmp27_ = geary_memory_file_buffer_new (_tmp26_, TRUE, &_inner_error0_);
							file_buffer = _tmp27_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_object_unref0 (file);
								_g_free0 (type);
								_g_free0 (content_id);
								goto __catch0_g_error;
							}
							_tmp28_ = self->priv->cid_files;
							_tmp29_ = content_id;
							_tmp30_ = file_buffer;
							gee_map_set (_tmp28_, _tmp29_, G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, GEARY_MEMORY_TYPE_BUFFER, GearyMemoryBuffer));
							_tmp31_ = self->priv->_editor;
							_tmp32_ = composer_editor_get_body (_tmp31_);
							_tmp33_ = _tmp32_;
							_tmp34_ = content_id;
							_tmp35_ = file_buffer;
							components_web_view_add_internal_resource (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _tmp34_, G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GEARY_MEMORY_TYPE_BUFFER, GearyMemoryBuffer));
							_g_object_unref0 (file_buffer);
						} else {
							GearyMimeDispositionType _tmp36_;
							GearyMimeDispositionType* _tmp37_;
							_tmp36_ = GEARY_MIME_DISPOSITION_TYPE_ATTACHMENT;
							_tmp37_ = __geary_mime_disposition_type_dup0 (&_tmp36_);
							_g_free0 (type);
							type = _tmp37_;
						}
					}
					_tmp39_ = type;
					_tmp40_ = GEARY_MIME_DISPOSITION_TYPE_INLINE;
					if (_geary_mime_disposition_type_equal (_tmp39_, &_tmp40_) == TRUE) {
						_tmp38_ = TRUE;
					} else {
						_tmp38_ = include == COMPOSER_WIDGET_ATTACH_PENDING_ALL;
					}
					if (_tmp38_) {
						gboolean _tmp41_ = FALSE;
						gboolean _tmp42_ = FALSE;
						if (do_add) {
							GeeSet* _tmp43_;
							GFile* _tmp44_;
							_tmp43_ = self->priv->attached_files;
							_tmp44_ = file;
							_tmp42_ = !gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, GEE_TYPE_COLLECTION, GeeCollection), _tmp44_);
						} else {
							_tmp42_ = FALSE;
						}
						if (_tmp42_) {
							GeeMap* _tmp45_;
							const gchar* _tmp46_;
							_tmp45_ = self->priv->inline_files;
							_tmp46_ = content_id;
							_tmp41_ = !gee_map_has_key (_tmp45_, _tmp46_);
						} else {
							_tmp41_ = FALSE;
						}
						if (_tmp41_) {
							GearyMimeDispositionType* _tmp47_;
							GearyMimeDispositionType _tmp48_;
							_tmp47_ = type;
							_tmp48_ = GEARY_MIME_DISPOSITION_TYPE_INLINE;
							if (_geary_mime_disposition_type_equal (_tmp47_, &_tmp48_) == TRUE) {
								GFile* _tmp49_;
								GFileInfo* _tmp50_;
								GFileInfo* _tmp51_;
								GearyMemoryFileBuffer* file_buffer = NULL;
								GFile* _tmp52_;
								GearyMemoryFileBuffer* _tmp53_;
								gchar* unused = NULL;
								GearyMemoryFileBuffer* _tmp54_;
								const gchar* _tmp55_;
								gchar* _tmp56_ = NULL;
								_tmp49_ = file;
								_tmp50_ = composer_widget_check_attachment_file (self, _tmp49_, &_inner_error0_);
								_tmp51_ = _tmp50_;
								_g_object_unref0 (_tmp51_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_object_unref0 (file);
									_g_free0 (type);
									_g_free0 (content_id);
									goto __catch0_g_error;
								}
								_tmp52_ = file;
								_tmp53_ = geary_memory_file_buffer_new (_tmp52_, TRUE, &_inner_error0_);
								file_buffer = _tmp53_;
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_object_unref0 (file);
									_g_free0 (type);
									_g_free0 (content_id);
									goto __catch0_g_error;
								}
								_tmp54_ = file_buffer;
								_tmp55_ = content_id;
								composer_widget_add_inline_part (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, GEARY_MEMORY_TYPE_BUFFER, GearyMemoryBuffer), _tmp55_, &_tmp56_, &_inner_error0_);
								_g_free0 (unused);
								unused = _tmp56_;
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_free0 (unused);
									_g_object_unref0 (file_buffer);
									_g_object_unref0 (file);
									_g_free0 (type);
									_g_free0 (content_id);
									goto __catch0_g_error;
								}
								_g_free0 (unused);
								_g_object_unref0 (file_buffer);
							} else {
								GFile* _tmp57_;
								_tmp57_ = file;
								composer_widget_add_attachment_part (self, _tmp57_, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_object_unref0 (file);
									_g_free0 (type);
									_g_free0 (content_id);
									goto __catch0_g_error;
								}
							}
							have_added = TRUE;
						}
					} else {
						manual_enabled = TRUE;
					}
					_g_object_unref0 (file);
					_g_free0 (type);
					_g_free0 (content_id);
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* err = NULL;
					GError* _tmp58_;
					const gchar* _tmp59_;
					err = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp58_ = err;
					_tmp59_ = _tmp58_->message;
					composer_widget_attachment_failed (self, _tmp59_);
					_g_error_free0 (err);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					gboolean _tmp60_ = FALSE;
					_g_object_unref0 (part);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return _tmp60_;
				}
				_g_object_unref0 (part);
			}
		}
	}
	_tmp61_ = self->priv->_editor;
	_tmp62_ = _tmp61_->new_message_attach_button;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_widget_get_type (), GtkWidget), !manual_enabled);
	_tmp63_ = self->priv->_editor;
	_tmp64_ = _tmp63_->conversation_attach_buttons;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget), manual_enabled);
	result = have_added;
	return result;
}

static Block74Data*
block74_data_ref (Block74Data* _data74_)
{
	g_atomic_int_inc (&_data74_->_ref_count_);
	return _data74_;
}

static void
block74_data_unref (void * _userdata_)
{
	Block74Data* _data74_;
	_data74_ = (Block74Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data74_->_ref_count_)) {
		ComposerWidget* self;
		self = _data74_->self;
		_g_object_unref0 (_data74_->wrapper_box);
		_g_object_unref0 (_data74_->target);
		_g_object_unref0 (self);
		g_slice_free (Block74Data, _data74_);
	}
}

static gboolean
_util_gtk_query_tooltip_label_gtk_widget_query_tooltip (GtkWidget* _sender,
                                                        gint x,
                                                        gint y,
                                                        gboolean keyboard_tooltip,
                                                        GtkTooltip* tooltip,
                                                        gpointer self)
{
	gboolean result;
	result = util_gtk_query_tooltip_label (_sender, x, y, keyboard_tooltip, tooltip);
	return result;
}

static void
__lambda78_ (Block74Data* _data74_)
{
	ComposerWidget* self;
	GtkBox* _tmp0_;
	self = _data74_->self;
	_tmp0_ = _data74_->wrapper_box;
	composer_widget_remove_attachment (self, _data74_->target, _tmp0_);
}

static void
___lambda78__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda78_ (self);
}

static void
composer_widget_add_attachment_part (ComposerWidget* self,
                                     GFile* target,
                                     GError** error)
{
	Block74Data* _data74_;
	GFile* _tmp0_;
	GFileInfo* target_info = NULL;
	GFileInfo* _tmp1_;
	GeeSet* _tmp2_;
	GtkBox* _tmp9_;
	GtkBox* _tmp10_;
	GtkBox* _tmp11_;
	GtkBox* _tmp12_;
	GtkSeparator* _tmp13_;
	GtkSeparator* _tmp14_;
	GtkBox* box = NULL;
	GtkBox* _tmp15_;
	GtkBox* _tmp16_;
	GtkBox* _tmp17_;
	gchar* label_text = NULL;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GFileInfo* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GtkLabel* label = NULL;
	const gchar* _tmp25_;
	GtkLabel* _tmp26_;
	GtkBox* _tmp27_;
	GtkLabel* _tmp28_;
	GtkLabel* _tmp29_;
	GtkLabel* _tmp30_;
	GtkLabel* _tmp31_;
	GtkLabel* _tmp32_;
	GtkButton* remove_button = NULL;
	GtkButton* _tmp33_;
	GtkBox* _tmp34_;
	GtkButton* _tmp35_;
	GtkButton* _tmp36_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (target, g_file_get_type ()));
	_data74_ = g_slice_new0 (Block74Data);
	_data74_->_ref_count_ = 1;
	_data74_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (target);
	_g_object_unref0 (_data74_->target);
	_data74_->target = _tmp0_;
	_tmp1_ = composer_widget_check_attachment_file (self, _data74_->target, &_inner_error0_);
	target_info = _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == ATTACHMENT_ERROR) {
			g_propagate_error (error, _inner_error0_);
			block74_data_unref (_data74_);
			_data74_ = NULL;
			return;
		} else {
			block74_data_unref (_data74_);
			_data74_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp2_ = self->priv->attached_files;
	if (!gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection), _data74_->target)) {
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		GError* _tmp7_;
		GError* _tmp8_;
		_tmp3_ = g_file_get_path (_data74_->target);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strdup_printf (_ ("“%s” already attached for delivery."), _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_error_new_literal (ATTACHMENT_ERROR, ATTACHMENT_ERROR_DUPLICATE, _tmp6_);
		_tmp8_ = _tmp7_;
		_g_free0 (_tmp6_);
		_g_free0 (_tmp4_);
		_inner_error0_ = _tmp8_;
		if (_inner_error0_->domain == ATTACHMENT_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (target_info);
			block74_data_unref (_data74_);
			_data74_ = NULL;
			return;
		} else {
			_g_object_unref0 (target_info);
			block74_data_unref (_data74_);
			_data74_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp9_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp9_);
	_data74_->wrapper_box = _tmp9_;
	_tmp10_ = self->priv->attachments_box;
	_tmp11_ = _data74_->wrapper_box;
	gtk_box_pack_start (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp12_ = _data74_->wrapper_box;
	_tmp13_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	gtk_box_pack_start (_tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp15_);
	box = _tmp15_;
	_tmp16_ = _data74_->wrapper_box;
	_tmp17_ = box;
	gtk_box_pack_start (_tmp16_, G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp18_ = g_file_get_basename (_data74_->target);
	_tmp19_ = _tmp18_;
	_tmp20_ = target_info;
	_tmp21_ = files_get_filesize_as_string (g_file_info_get_size (_tmp20_));
	_tmp22_ = _tmp21_;
	_tmp23_ = g_strdup_printf (_ ("%s (%s)"), _tmp19_, _tmp22_);
	_tmp24_ = _tmp23_;
	_g_free0 (_tmp22_);
	_g_free0 (_tmp19_);
	label_text = _tmp24_;
	_tmp25_ = label_text;
	_tmp26_ = (GtkLabel*) gtk_label_new (_tmp25_);
	g_object_ref_sink (_tmp26_);
	label = _tmp26_;
	_tmp27_ = box;
	_tmp28_ = label;
	gtk_box_pack_start (_tmp27_, G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp29_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	_tmp30_ = label;
	gtk_label_set_ellipsize (_tmp30_, PANGO_ELLIPSIZE_MIDDLE);
	_tmp31_ = label;
	gtk_widget_set_has_tooltip (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp32_ = label;
	g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_widget_get_type (), GtkWidget), "query-tooltip", (GCallback) _util_gtk_query_tooltip_label_gtk_widget_query_tooltip, NULL);
	_tmp33_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp33_);
	remove_button = _tmp33_;
	_tmp34_ = box;
	_tmp35_ = remove_button;
	gtk_box_pack_start (_tmp34_, G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
	_tmp36_ = remove_button;
	g_signal_connect_data (_tmp36_, "clicked", (GCallback) ___lambda78__gtk_button_clicked, block74_data_ref (_data74_), (GClosureNotify) block74_data_unref, 0);
	composer_widget_update_attachments_view (self);
	_g_object_unref0 (remove_button);
	_g_object_unref0 (label);
	_g_free0 (label_text);
	_g_object_unref0 (box);
	_g_object_unref0 (target_info);
	block74_data_unref (_data74_);
	_data74_ = NULL;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
composer_widget_add_inline_part (ComposerWidget* self,
                                 GearyMemoryBuffer* target,
                                 const gchar* content_id,
                                 gchar** unique_contentid,
                                 GError** error)
{
	gchar* _vala_unique_contentid = NULL;
	static const char UNIQUE_RENAME_TEMPLATE[] = "%s_%02u";
	gsize _tmp0_;
	gsize _tmp1_;
	gchar* _tmp6_;
	gint suffix_index = 0;
	gchar* unsuffixed_filename = NULL;
	gchar* _tmp7_;
	GeeMap* _tmp25_;
	const gchar* _tmp26_;
	ComposerEditor* _tmp27_;
	ComposerWebView* _tmp28_;
	ComposerWebView* _tmp29_;
	const gchar* _tmp30_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (target, GEARY_MEMORY_TYPE_BUFFER));
	g_return_if_fail (content_id != NULL);
	_tmp0_ = geary_memory_buffer_get_size (target);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == ((gsize) 0)) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		GError* _tmp4_;
		GError* _tmp5_;
		_tmp2_ = g_strdup_printf (_ ("“%s” is an empty file."), content_id);
		_tmp3_ = _tmp2_;
		_tmp4_ = g_error_new_literal (ATTACHMENT_ERROR, ATTACHMENT_ERROR_FILE, _tmp3_);
		_tmp5_ = _tmp4_;
		_g_free0 (_tmp3_);
		_inner_error0_ = _tmp5_;
		if (_inner_error0_->domain == ATTACHMENT_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (_vala_unique_contentid);
			return;
		} else {
			_g_free0 (_vala_unique_contentid);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp6_ = g_strdup (content_id);
	_g_free0 (_vala_unique_contentid);
	_vala_unique_contentid = _tmp6_;
	suffix_index = 0;
	_tmp7_ = g_strdup ("");
	unsuffixed_filename = _tmp7_;
	while (TRUE) {
		GeeMap* _tmp8_;
		const gchar* _tmp9_;
		gchar** filename_parts = NULL;
		const gchar* _tmp10_;
		gchar** _tmp11_;
		gchar** _tmp12_;
		gint filename_parts_length1;
		gint _filename_parts_size_;
		gint partindex = 0;
		gchar** _tmp13_;
		gint _tmp13__length1;
		const gchar* _tmp15_;
		gchar** _tmp19_;
		gint _tmp19__length1;
		const gchar* _tmp20_;
		gint _tmp21_;
		gchar* _tmp22_;
		gchar** _tmp23_;
		gint _tmp23__length1;
		gchar* _tmp24_;
		_tmp8_ = self->priv->inline_files;
		_tmp9_ = _vala_unique_contentid;
		if (!gee_map_has_key (_tmp8_, _tmp9_)) {
			break;
		}
		_tmp10_ = _vala_unique_contentid;
		_tmp12_ = _tmp11_ = g_strsplit (_tmp10_, ".", 0);
		filename_parts = _tmp12_;
		filename_parts_length1 = _vala_array_length (_tmp11_);
		_filename_parts_size_ = filename_parts_length1;
		_tmp13_ = filename_parts;
		_tmp13__length1 = filename_parts_length1;
		if (_tmp13__length1 > 1) {
			gchar** _tmp14_;
			gint _tmp14__length1;
			_tmp14_ = filename_parts;
			_tmp14__length1 = filename_parts_length1;
			partindex = _tmp14__length1 - 2;
		} else {
			partindex = 0;
		}
		_tmp15_ = unsuffixed_filename;
		if (g_strcmp0 (_tmp15_, "") == 0) {
			gchar** _tmp16_;
			gint _tmp16__length1;
			const gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp16_ = filename_parts;
			_tmp16__length1 = filename_parts_length1;
			_tmp17_ = _tmp16_[partindex];
			_tmp18_ = g_strdup (_tmp17_);
			_g_free0 (unsuffixed_filename);
			unsuffixed_filename = _tmp18_;
		}
		_tmp19_ = filename_parts;
		_tmp19__length1 = filename_parts_length1;
		_tmp20_ = unsuffixed_filename;
		_tmp21_ = suffix_index;
		suffix_index = _tmp21_ + 1;
		_tmp22_ = g_strdup_printf (UNIQUE_RENAME_TEMPLATE, _tmp20_, _tmp21_);
		_g_free0 (_tmp19_[partindex]);
		_tmp19_[partindex] = _tmp22_;
		_tmp23_ = filename_parts;
		_tmp23__length1 = filename_parts_length1;
		_tmp24_ = _vala_g_strjoinv (".", _tmp23_, (gint) _tmp23__length1);
		_g_free0 (_vala_unique_contentid);
		_vala_unique_contentid = _tmp24_;
		filename_parts = (_vala_array_free (filename_parts, filename_parts_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp25_ = self->priv->inline_files;
	_tmp26_ = _vala_unique_contentid;
	gee_map_set (_tmp25_, _tmp26_, target);
	_tmp27_ = self->priv->_editor;
	_tmp28_ = composer_editor_get_body (_tmp27_);
	_tmp29_ = _tmp28_;
	_tmp30_ = _vala_unique_contentid;
	components_web_view_add_internal_resource (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _tmp30_, target);
	_g_free0 (unsuffixed_filename);
	if (unique_contentid) {
		*unique_contentid = _vala_unique_contentid;
	} else {
		_g_free0 (_vala_unique_contentid);
	}
}

static GFileInfo*
composer_widget_check_attachment_file (ComposerWidget* self,
                                       GFile* target,
                                       GError** error)
{
	GFileInfo* target_info = NULL;
	GFileInfo* _tmp9_;
	GFileInfo* _tmp16_;
	GError* _inner_error0_ = NULL;
	GFileInfo* result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (target, g_file_get_type ()), NULL);
	{
		GFileInfo* _tmp0_ = NULL;
		GFileInfo* _tmp1_;
		GFileInfo* _tmp2_;
		_tmp1_ = g_file_query_info (target, "standard::size,standard::type", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (target_info);
		target_info = _tmp2_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		GError* _tmp7_;
		GError* _tmp8_;
		g_clear_error (&_inner_error0_);
		_tmp3_ = g_file_get_path (target);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strdup_printf (_ ("“%s” could not be found."), _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_error_new_literal (ATTACHMENT_ERROR, ATTACHMENT_ERROR_FILE, _tmp6_);
		_tmp8_ = _tmp7_;
		_g_free0 (_tmp6_);
		_g_free0 (_tmp4_);
		_inner_error0_ = _tmp8_;
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == ATTACHMENT_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (target_info);
			return NULL;
		} else {
			_g_object_unref0 (target_info);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp9_ = target_info;
	if (g_file_info_get_file_type (_tmp9_) == G_FILE_TYPE_DIRECTORY) {
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		GError* _tmp14_;
		GError* _tmp15_;
		_tmp10_ = g_file_get_path (target);
		_tmp11_ = _tmp10_;
		_tmp12_ = g_strdup_printf (_ ("“%s” is a folder."), _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = g_error_new_literal (ATTACHMENT_ERROR, ATTACHMENT_ERROR_FILE, _tmp13_);
		_tmp15_ = _tmp14_;
		_g_free0 (_tmp13_);
		_g_free0 (_tmp11_);
		_inner_error0_ = _tmp15_;
		if (_inner_error0_->domain == ATTACHMENT_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (target_info);
			return NULL;
		} else {
			_g_object_unref0 (target_info);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp16_ = target_info;
	if (g_file_info_get_size (_tmp16_) == ((gint64) 0)) {
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		GError* _tmp21_;
		GError* _tmp22_;
		_tmp17_ = g_file_get_path (target);
		_tmp18_ = _tmp17_;
		_tmp19_ = g_strdup_printf (_ ("“%s” is an empty file."), _tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = g_error_new_literal (ATTACHMENT_ERROR, ATTACHMENT_ERROR_FILE, _tmp20_);
		_tmp22_ = _tmp21_;
		_g_free0 (_tmp20_);
		_g_free0 (_tmp18_);
		_inner_error0_ = _tmp22_;
		if (_inner_error0_->domain == ATTACHMENT_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (target_info);
			return NULL;
		} else {
			_g_object_unref0 (target_info);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	{
		GFileInputStream* stream = NULL;
		GFileInputStream* _tmp23_;
		GFileInputStream* _tmp24_;
		_tmp23_ = g_file_read (target, NULL, &_inner_error0_);
		stream = _tmp23_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		_tmp24_ = stream;
		if (_tmp24_ != NULL) {
			GFileInputStream* _tmp25_;
			_tmp25_ = stream;
			g_input_stream_close (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, g_input_stream_get_type (), GInputStream), NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (stream);
				goto __catch1_g_error;
			}
		}
		_g_object_unref0 (stream);
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		gchar* _tmp26_;
		gchar* _tmp27_;
		GError* _tmp28_;
		const gchar* _tmp29_;
		gchar* _tmp30_;
		gchar* _tmp31_;
		gchar* _tmp32_;
		gchar* _tmp33_;
		GError* _tmp34_;
		GError* _tmp35_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp26_ = g_file_get_path (target);
		_tmp27_ = _tmp26_;
		_tmp28_ = e;
		_tmp29_ = _tmp28_->message;
		g_debug ("composer-widget.vala:1952: File '%s' could not be opened for reading. " \
"Error: %s", _tmp27_, _tmp29_);
		_g_free0 (_tmp27_);
		_tmp30_ = g_file_get_path (target);
		_tmp31_ = _tmp30_;
		_tmp32_ = g_strdup_printf (_ ("“%s” could not be opened for reading."), _tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = g_error_new_literal (ATTACHMENT_ERROR, ATTACHMENT_ERROR_FILE, _tmp33_);
		_tmp35_ = _tmp34_;
		_g_free0 (_tmp33_);
		_g_free0 (_tmp31_);
		_inner_error0_ = _tmp35_;
		_g_error_free0 (e);
		goto __finally1;
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == ATTACHMENT_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (target_info);
			return NULL;
		} else {
			_g_object_unref0 (target_info);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = target_info;
	return result;
}

static void
composer_widget_attachment_failed (ComposerWidget* self,
                                   const gchar* msg)
{
	ErrorDialog* dialog = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkApplicationWindow* _tmp2_;
	GtkApplicationWindow* _tmp3_;
	ErrorDialog* _tmp4_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (msg != NULL);
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_top_window (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = error_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_window_get_type (), GtkWindow), _ ("Cannot add attachment"), msg);
	dialog = _tmp4_;
	alert_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (dialog, TYPE_ALERT_DIALOG, AlertDialog));
	_g_object_unref0 (dialog);
}

static void
composer_widget_remove_attachment (ComposerWidget* self,
                                   GFile* file,
                                   GtkBox* box)
{
	GeeSet* _tmp0_;
	GtkBox* _tmp1_;
	GList* _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (file, g_file_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (box, gtk_box_get_type ()));
	_tmp0_ = self->priv->attached_files;
	if (!gee_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), file)) {
		return;
	}
	_tmp1_ = self->priv->attachments_box;
	_tmp2_ = gtk_container_get_children (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_container_get_type (), GtkContainer));
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp2_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GtkWidget* _tmp3_;
				_tmp3_ = child;
				if (_tmp3_ == G_TYPE_CHECK_INSTANCE_CAST (box, gtk_widget_get_type (), GtkWidget)) {
					GtkBox* _tmp4_;
					_tmp4_ = self->priv->attachments_box;
					gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (box, gtk_widget_get_type (), GtkWidget));
					break;
				}
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
	}
	composer_widget_update_attachments_view (self);
	composer_widget_update_pending_attachments (self, self->priv->pending_include, FALSE);
	composer_widget_draft_changed (self);
}

/**
     * Handle a pasted image, adding it as an inline attachment
     */
static Block75Data*
block75_data_ref (Block75Data* _data75_)
{
	g_atomic_int_inc (&_data75_->_ref_count_);
	return _data75_;
}

static void
block75_data_unref (void * _userdata_)
{
	Block75Data* _data75_;
	_data75_ = (Block75Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data75_->_ref_count_)) {
		ComposerWidget* self;
		self = _data75_->self;
		_g_object_unref0 (_data75_->pixbuf);
		_g_object_unref0 (self);
		g_slice_free (Block75Data, _data75_);
	}
}

static Block76Data*
block76_data_ref (Block76Data* _data76_)
{
	g_atomic_int_inc (&_data76_->_ref_count_);
	return _data76_;
}

static void
block76_data_unref (void * _userdata_)
{
	Block76Data* _data76_;
	_data76_ = (Block76Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data76_->_ref_count_)) {
		ComposerWidget* self;
		self = _data76_->_data75_->self;
		_g_object_unref0 (_data76_->os);
		block75_data_unref (_data76_->_data75_);
		_data76_->_data75_ = NULL;
		g_slice_free (Block76Data, _data76_);
	}
}

static void
___lambda191_ (Block76Data* _data76_,
               GObject* obj,
               GAsyncResult* res)
{
	Block75Data* _data75_;
	ComposerWidget* self;
	ComposerEditor* _tmp22_;
	GError* _inner_error0_ = NULL;
	_data75_ = _data76_->_data75_;
	self = _data75_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	{
		GMemoryOutputStream* _tmp0_;
		GearyMemoryByteBuffer* byte_buffer = NULL;
		GMemoryOutputStream* _tmp1_;
		GearyMemoryByteBuffer* _tmp2_;
		GDateTime* time_now = NULL;
		GTimeZone* _tmp3_;
		GTimeZone* _tmp4_;
		GDateTime* _tmp5_;
		GDateTime* _tmp6_;
		gchar* filename = NULL;
		GDateTime* _tmp7_;
		gchar* _tmp8_;
		gchar* unique_filename = NULL;
		GearyMemoryByteBuffer* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_ = NULL;
		ComposerEditor* _tmp12_;
		ComposerWebView* _tmp13_;
		ComposerWebView* _tmp14_;
		const gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gdk_pixbuf_save_to_stream_finish (res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp0_ = _data76_->os;
		g_output_stream_close (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, g_output_stream_get_type (), GOutputStream), NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = _data76_->os;
		_tmp2_ = geary_memory_byte_buffer_new_from_memory_output_stream (_tmp1_);
		byte_buffer = _tmp2_;
		_tmp3_ = g_time_zone_new_local ();
		_tmp4_ = _tmp3_;
		_tmp5_ = g_date_time_new_now (_tmp4_);
		_tmp6_ = _tmp5_;
		_g_time_zone_unref0 (_tmp4_);
		time_now = _tmp6_;
		_tmp7_ = time_now;
		_tmp8_ = g_strdup_printf (COMPOSER_WIDGET_PASTED_IMAGE_FILENAME_TEMPLATE, g_date_time_hash (_tmp7_));
		filename = _tmp8_;
		_tmp9_ = byte_buffer;
		_tmp10_ = filename;
		composer_widget_add_inline_part (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEARY_MEMORY_TYPE_BUFFER, GearyMemoryBuffer), _tmp10_, &_tmp11_, &_inner_error0_);
		_g_free0 (unique_filename);
		unique_filename = _tmp11_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (unique_filename);
			_g_free0 (filename);
			_g_date_time_unref0 (time_now);
			_g_object_unref0 (byte_buffer);
			goto __catch0_g_error;
		}
		_tmp12_ = self->priv->_editor;
		_tmp13_ = composer_editor_get_body (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = unique_filename;
		_tmp16_ = g_strconcat (COMPONENTS_WEB_VIEW_INTERNAL_URL_PREFIX, _tmp15_, NULL);
		_tmp17_ = _tmp16_;
		composer_web_view_insert_image (_tmp14_, _tmp17_);
		_g_free0 (_tmp17_);
		_g_free0 (unique_filename);
		_g_free0 (filename);
		_g_date_time_unref0 (time_now);
		_g_object_unref0 (byte_buffer);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		ComposerApplicationInterface* _tmp18_;
		GError* _tmp19_;
		GearyProblemReport* _tmp20_;
		GearyProblemReport* _tmp21_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp18_ = self->priv->application;
		_tmp19_ = _error_;
		_tmp20_ = geary_problem_report_new (_tmp19_);
		_tmp21_ = _tmp20_;
		composer_application_interface_report_problem (_tmp18_, _tmp21_);
		_g_object_unref0 (_tmp21_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp22_ = self->priv->_editor;
	composer_editor_stop_background_work_pulse (_tmp22_);
}

static void
____lambda191__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda191_ (self, source_object, res);
	block76_data_unref (self);
}

static void
__lambda190_ (ComposerWidget* self,
              GtkClipboard* clipboard,
              GdkPixbuf* pixbuf)
{
	Block75Data* _data75_;
	GdkPixbuf* _tmp0_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (clipboard, gtk_clipboard_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (pixbuf, gdk_pixbuf_get_type ()));
	_data75_ = g_slice_new0 (Block75Data);
	_data75_->_ref_count_ = 1;
	_data75_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (pixbuf);
	_g_object_unref0 (_data75_->pixbuf);
	_data75_->pixbuf = _tmp0_;
	if (_data75_->pixbuf != NULL) {
		Block76Data* _data76_;
		GReallocFunc _tmp1_;
		GDestroyNotify _tmp2_;
		GMemoryOutputStream* _tmp3_;
		GMemoryOutputStream* _tmp4_;
		_data76_ = g_slice_new0 (Block76Data);
		_data76_->_ref_count_ = 1;
		_data76_->_data75_ = block75_data_ref (_data75_);
		_tmp1_ = g_realloc;
		_tmp2_ = g_free;
		_tmp3_ = (GMemoryOutputStream*) g_memory_output_stream_new (NULL, 0, _tmp1_, _tmp2_);
		_data76_->os = _tmp3_;
		_tmp4_ = _data76_->os;
		gdk_pixbuf_save_to_stream_async (_data75_->pixbuf, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, g_output_stream_get_type (), GOutputStream), "png", NULL, ____lambda191__gasync_ready_callback, block76_data_ref (_data76_), NULL);
		block76_data_unref (_data76_);
		_data76_ = NULL;
	} else {
		ComposerEditor* _tmp5_;
		g_warning ("composer-widget.vala:2019: Failed to get image from clipboard");
		_tmp5_ = self->priv->_editor;
		composer_editor_stop_background_work_pulse (_tmp5_);
	}
	block75_data_unref (_data75_);
	_data75_ = NULL;
}

static void
___lambda190__gtk_clipboard_image_received_func (GtkClipboard* clipboard,
                                                 GdkPixbuf* pixbuf,
                                                 gpointer self)
{
	__lambda190_ ((ComposerWidget*) self, clipboard, pixbuf);
	g_object_unref (self);
}

static void
composer_widget_paste_image (ComposerWidget* self)
{
	ComposerEditor* _tmp0_;
	GtkClipboard* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->_editor;
	composer_editor_start_background_work_pulse (_tmp0_);
	_tmp1_ = gtk_widget_get_clipboard (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GDK_SELECTION_CLIPBOARD);
	gtk_clipboard_request_image (_tmp1_, ___lambda190__gtk_clipboard_image_received_func, g_object_ref (self));
}

/**
     * Handle prompting for an inserting images as inline attachments
     */
static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_slist_free__g_object_unref0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
composer_widget_insert_image (ComposerWidget* self)
{
	AttachmentDialog* dialog = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkApplicationWindow* _tmp2_;
	GtkApplicationWindow* _tmp3_;
	ApplicationConfiguration* _tmp4_;
	AttachmentDialog* _tmp5_;
	GtkFileFilter* filter = NULL;
	GtkFileFilter* _tmp6_;
	GtkFileFilter* _tmp7_;
	GtkFileFilter* _tmp8_;
	AttachmentDialog* _tmp9_;
	GtkFileFilter* _tmp10_;
	GtkFileFilter* _tmp11_;
	AttachmentDialog* _tmp12_;
	AttachmentDialog* _tmp35_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_top_window (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->config;
	_tmp5_ = attachment_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_window_get_type (), GtkWindow), _tmp4_);
	dialog = _tmp5_;
	_tmp6_ = gtk_file_filter_new ();
	g_object_ref_sink (_tmp6_);
	filter = _tmp6_;
	_tmp7_ = filter;
	gtk_buildable_set_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_buildable_get_type (), GtkBuildable), _ ("Images"));
	_tmp8_ = filter;
	gtk_file_filter_add_mime_type (_tmp8_, "image/*");
	_tmp9_ = dialog;
	_tmp10_ = filter;
	_tmp11_ = _g_object_ref0 (_tmp10_);
	attachment_dialog_add_filter (_tmp9_, _tmp11_);
	_tmp12_ = dialog;
	if (attachment_dialog_run (_tmp12_) == ((gint) GTK_RESPONSE_ACCEPT)) {
		AttachmentDialog* _tmp13_;
		AttachmentDialog* _tmp14_;
		GSList* _tmp15_;
		_tmp13_ = dialog;
		attachment_dialog_hide (_tmp13_);
		_tmp14_ = dialog;
		_tmp15_ = attachment_dialog_get_files (_tmp14_);
		{
			GSList* file_collection = NULL;
			GSList* file_it = NULL;
			file_collection = _tmp15_;
			for (file_it = file_collection; file_it != NULL; file_it = file_it->next) {
				GFile* _tmp16_;
				GFile* file = NULL;
				_tmp16_ = _g_object_ref0 ((GFile*) file_it->data);
				file = _tmp16_;
				{
					{
						GFile* _tmp17_;
						GFileInfo* _tmp18_;
						GFileInfo* _tmp19_;
						GearyMemoryFileBuffer* file_buffer = NULL;
						GFile* _tmp20_;
						GearyMemoryFileBuffer* _tmp21_;
						gchar* path = NULL;
						GFile* _tmp22_;
						gchar* _tmp23_;
						gchar* unique_filename = NULL;
						GearyMemoryFileBuffer* _tmp24_;
						const gchar* _tmp25_;
						gchar* _tmp26_ = NULL;
						ComposerEditor* _tmp27_;
						ComposerWebView* _tmp28_;
						ComposerWebView* _tmp29_;
						const gchar* _tmp30_;
						gchar* _tmp31_;
						gchar* _tmp32_;
						_tmp17_ = file;
						_tmp18_ = composer_widget_check_attachment_file (self, _tmp17_, &_inner_error0_);
						_tmp19_ = _tmp18_;
						_g_object_unref0 (_tmp19_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						_tmp20_ = file;
						_tmp21_ = geary_memory_file_buffer_new (_tmp20_, TRUE, &_inner_error0_);
						file_buffer = _tmp21_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						_tmp22_ = file;
						_tmp23_ = g_file_get_path (_tmp22_);
						path = _tmp23_;
						_tmp24_ = file_buffer;
						_tmp25_ = path;
						composer_widget_add_inline_part (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GEARY_MEMORY_TYPE_BUFFER, GearyMemoryBuffer), _tmp25_, &_tmp26_, &_inner_error0_);
						_g_free0 (unique_filename);
						unique_filename = _tmp26_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_free0 (unique_filename);
							_g_free0 (path);
							_g_object_unref0 (file_buffer);
							goto __catch0_g_error;
						}
						_tmp27_ = self->priv->_editor;
						_tmp28_ = composer_editor_get_body (_tmp27_);
						_tmp29_ = _tmp28_;
						_tmp30_ = unique_filename;
						_tmp31_ = g_strconcat (COMPONENTS_WEB_VIEW_INTERNAL_URL_PREFIX, _tmp30_, NULL);
						_tmp32_ = _tmp31_;
						composer_web_view_insert_image (_tmp29_, _tmp32_);
						_g_free0 (_tmp32_);
						_g_free0 (unique_filename);
						_g_free0 (path);
						_g_object_unref0 (file_buffer);
					}
					goto __finally0;
					__catch0_g_error:
					{
						GError* err = NULL;
						GError* _tmp33_;
						const gchar* _tmp34_;
						err = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp33_ = err;
						_tmp34_ = _tmp33_->message;
						composer_widget_attachment_failed (self, _tmp34_);
						_g_error_free0 (err);
						_g_object_unref0 (file);
						break;
					}
					__finally0:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (file);
						(file_collection == NULL) ? NULL : (file_collection = (_g_slist_free__g_object_unref0_ (file_collection), NULL));
						_g_object_unref0 (filter);
						_g_object_unref0 (dialog);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
					_g_object_unref0 (file);
				}
			}
			(file_collection == NULL) ? NULL : (file_collection = (_g_slist_free__g_object_unref0_ (file_collection), NULL));
		}
	}
	_tmp35_ = dialog;
	attachment_dialog_destroy (_tmp35_);
	_g_object_unref0 (filter);
	_g_object_unref0 (dialog);
}

static gboolean
composer_widget_check_send_on_return (ComposerWidget* self,
                                      GdkEventKey* event)
{
	gboolean ret = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	ret = GDK_EVENT_PROPAGATE;
	_tmp0_ = gdk_keyval_name (event->keyval);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if ((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("Return")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("KP_Enter"))))) {
		switch (0) {
			default:
			{
				if ((event->state & GDK_CONTROL_MASK) != 0) {
					GSimpleActionGroup* _tmp4_;
					_tmp4_ = self->priv->actions;
					g_action_group_activate_action (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, g_action_group_get_type (), GActionGroup), COMPOSER_WIDGET_ACTION_SEND, NULL);
					ret = GDK_EVENT_STOP;
				}
				break;
			}
		}
	}
	result = ret;
	return result;
}

static void
composer_widget_validate_send_button (ComposerWidget* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GSimpleAction* _tmp44_;
	GSimpleAction* _tmp45_;
	ComposerHeaderbar* _tmp46_;
	gboolean _tmp47_;
	gboolean _tmp48_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp4_ = composer_widget_get_can_send (self);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		ComposerWidgetHeaderRow* _tmp6_;
		gconstpointer _tmp7_;
		gconstpointer _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp6_ = self->priv->to_row;
		_tmp7_ = composer_widget_header_row_get_value (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = composer_email_entry_get_is_valid ((ComposerEmailEntry*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp3_ = _tmp10_;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		gboolean _tmp11_ = FALSE;
		ComposerWidgetHeaderRow* _tmp12_;
		gconstpointer _tmp13_;
		gconstpointer _tmp14_;
		gboolean _tmp15_;
		gboolean _tmp16_;
		_tmp12_ = self->priv->cc_row;
		_tmp13_ = composer_widget_header_row_get_value (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp14_);
		_tmp16_ = _tmp15_;
		if (_tmp16_) {
			_tmp11_ = TRUE;
		} else {
			ComposerWidgetHeaderRow* _tmp17_;
			gconstpointer _tmp18_;
			gconstpointer _tmp19_;
			gboolean _tmp20_;
			gboolean _tmp21_;
			_tmp17_ = self->priv->cc_row;
			_tmp18_ = composer_widget_header_row_get_value (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = composer_email_entry_get_is_valid ((ComposerEmailEntry*) _tmp19_);
			_tmp21_ = _tmp20_;
			_tmp11_ = _tmp21_;
		}
		_tmp2_ = _tmp11_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gboolean _tmp22_ = FALSE;
		ComposerWidgetHeaderRow* _tmp23_;
		gconstpointer _tmp24_;
		gconstpointer _tmp25_;
		gboolean _tmp26_;
		gboolean _tmp27_;
		_tmp23_ = self->priv->bcc_row;
		_tmp24_ = composer_widget_header_row_get_value (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp25_);
		_tmp27_ = _tmp26_;
		if (_tmp27_) {
			_tmp22_ = TRUE;
		} else {
			ComposerWidgetHeaderRow* _tmp28_;
			gconstpointer _tmp29_;
			gconstpointer _tmp30_;
			gboolean _tmp31_;
			gboolean _tmp32_;
			_tmp28_ = self->priv->bcc_row;
			_tmp29_ = composer_widget_header_row_get_value (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = composer_email_entry_get_is_valid ((ComposerEmailEntry*) _tmp30_);
			_tmp32_ = _tmp31_;
			_tmp22_ = _tmp32_;
		}
		_tmp1_ = _tmp22_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gboolean _tmp33_ = FALSE;
		ComposerWidgetHeaderRow* _tmp34_;
		gconstpointer _tmp35_;
		gconstpointer _tmp36_;
		gboolean _tmp37_;
		gboolean _tmp38_;
		_tmp34_ = self->priv->reply_to_row;
		_tmp35_ = composer_widget_header_row_get_value (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp36_);
		_tmp38_ = _tmp37_;
		if (_tmp38_) {
			_tmp33_ = TRUE;
		} else {
			ComposerWidgetHeaderRow* _tmp39_;
			gconstpointer _tmp40_;
			gconstpointer _tmp41_;
			gboolean _tmp42_;
			gboolean _tmp43_;
			_tmp39_ = self->priv->reply_to_row;
			_tmp40_ = composer_widget_header_row_get_value (_tmp39_);
			_tmp41_ = _tmp40_;
			_tmp42_ = composer_email_entry_get_is_valid ((ComposerEmailEntry*) _tmp41_);
			_tmp43_ = _tmp42_;
			_tmp33_ = _tmp43_;
		}
		_tmp0_ = _tmp33_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp44_ = composer_widget_get_action (self, COMPOSER_WIDGET_ACTION_SEND);
	_tmp45_ = _tmp44_;
	g_simple_action_set_enabled (_tmp45_, _tmp0_);
	_g_object_unref0 (_tmp45_);
	_tmp46_ = self->priv->_header;
	_tmp47_ = composer_widget_get_can_send (self);
	_tmp48_ = _tmp47_;
	composer_headerbar_set_show_send (_tmp46_, _tmp48_);
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static void
composer_widget_set_compact_header_recipients (ComposerWidget* self)
{
	gboolean _tmp0_ = FALSE;
	ComposerWidgetHeaderRow* _tmp1_;
	gconstpointer _tmp2_;
	gconstpointer _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gboolean tocc = FALSE;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
	ComposerWidgetHeaderRow* _tmp13_;
	gconstpointer _tmp14_;
	gconstpointer _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	gboolean ccbcc = FALSE;
	const gchar* _tmp28_ = NULL;
	const gchar* _tmp29_ = NULL;
	gchar* label = NULL;
	ComposerWidgetHeaderRow* _tmp30_;
	gconstpointer _tmp31_;
	gconstpointer _tmp32_;
	GtkEntryBuffer* _tmp33_;
	GtkEntryBuffer* _tmp34_;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	ComposerWidgetHeaderRow* _tmp39_;
	gconstpointer _tmp40_;
	gconstpointer _tmp41_;
	GtkEntryBuffer* _tmp42_;
	GtkEntryBuffer* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	ComposerWidgetHeaderRow* _tmp50_;
	gconstpointer _tmp51_;
	gconstpointer _tmp52_;
	GtkEntryBuffer* _tmp53_;
	GtkEntryBuffer* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	gchar* _tmp57_;
	gchar* _tmp58_;
	GString* tooltip = NULL;
	GString* _tmp59_;
	ComposerWidgetHeaderRow* _tmp60_;
	gconstpointer _tmp61_;
	gconstpointer _tmp62_;
	GearyRFC822MailboxAddresses* _tmp63_;
	GearyRFC822MailboxAddresses* _tmp64_;
	ComposerWidgetHeaderRow* _tmp83_;
	gconstpointer _tmp84_;
	gconstpointer _tmp85_;
	GearyRFC822MailboxAddresses* _tmp86_;
	GearyRFC822MailboxAddresses* _tmp87_;
	ComposerWidgetHeaderRow* _tmp106_;
	gconstpointer _tmp107_;
	gconstpointer _tmp108_;
	GearyRFC822MailboxAddresses* _tmp109_;
	GearyRFC822MailboxAddresses* _tmp110_;
	ComposerWidgetHeaderRow* _tmp129_;
	gconstpointer _tmp130_;
	gconstpointer _tmp131_;
	GearyRFC822MailboxAddresses* _tmp132_;
	GearyRFC822MailboxAddresses* _tmp133_;
	ComposerHeaderbar* _tmp152_;
	const gchar* _tmp153_;
	GString* _tmp154_;
	const gchar* _tmp155_;
	gchar* _tmp156_;
	gchar* _tmp157_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp1_ = self->priv->to_row;
	_tmp2_ = composer_widget_header_row_get_value (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp3_);
	_tmp5_ = _tmp4_;
	if (!_tmp5_) {
		ComposerWidgetHeaderRow* _tmp6_;
		gconstpointer _tmp7_;
		gconstpointer _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp6_ = self->priv->cc_row;
		_tmp7_ = composer_widget_header_row_get_value (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = !_tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	tocc = _tmp0_;
	_tmp13_ = self->priv->to_row;
	_tmp14_ = composer_widget_header_row_get_value (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_) {
		ComposerWidgetHeaderRow* _tmp18_;
		gconstpointer _tmp19_;
		gconstpointer _tmp20_;
		gboolean _tmp21_;
		gboolean _tmp22_;
		_tmp18_ = self->priv->cc_row;
		_tmp19_ = composer_widget_header_row_get_value (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp20_);
		_tmp22_ = _tmp21_;
		_tmp12_ = _tmp22_;
	} else {
		_tmp12_ = FALSE;
	}
	if (!_tmp12_) {
		ComposerWidgetHeaderRow* _tmp23_;
		gconstpointer _tmp24_;
		gconstpointer _tmp25_;
		gboolean _tmp26_;
		gboolean _tmp27_;
		_tmp23_ = self->priv->bcc_row;
		_tmp24_ = composer_widget_header_row_get_value (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp25_);
		_tmp27_ = _tmp26_;
		_tmp11_ = !_tmp27_;
	} else {
		_tmp11_ = FALSE;
	}
	ccbcc = _tmp11_;
	if (tocc) {
		_tmp28_ = ", ";
	} else {
		_tmp28_ = "";
	}
	if (ccbcc) {
		_tmp29_ = ", ";
	} else {
		_tmp29_ = "";
	}
	_tmp30_ = self->priv->to_row;
	_tmp31_ = composer_widget_header_row_get_value (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = gtk_entry_get_buffer (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp32_, gtk_entry_get_type (), GtkEntry));
	_tmp34_ = _tmp33_;
	_tmp35_ = gtk_entry_buffer_get_text (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = g_strconcat (_tmp36_, _tmp28_, NULL);
	_tmp38_ = _tmp37_;
	_tmp39_ = self->priv->cc_row;
	_tmp40_ = composer_widget_header_row_get_value (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = gtk_entry_get_buffer (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp41_, gtk_entry_get_type (), GtkEntry));
	_tmp43_ = _tmp42_;
	_tmp44_ = gtk_entry_buffer_get_text (_tmp43_);
	_tmp45_ = _tmp44_;
	_tmp46_ = g_strconcat (_tmp38_, _tmp45_, NULL);
	_tmp47_ = _tmp46_;
	_tmp48_ = g_strconcat (_tmp47_, _tmp29_, NULL);
	_tmp49_ = _tmp48_;
	_tmp50_ = self->priv->bcc_row;
	_tmp51_ = composer_widget_header_row_get_value (_tmp50_);
	_tmp52_ = _tmp51_;
	_tmp53_ = gtk_entry_get_buffer (G_TYPE_CHECK_INSTANCE_CAST ((ComposerEmailEntry*) _tmp52_, gtk_entry_get_type (), GtkEntry));
	_tmp54_ = _tmp53_;
	_tmp55_ = gtk_entry_buffer_get_text (_tmp54_);
	_tmp56_ = _tmp55_;
	_tmp57_ = g_strconcat (_tmp49_, _tmp56_, NULL);
	_tmp58_ = _tmp57_;
	_g_free0 (_tmp49_);
	_g_free0 (_tmp47_);
	_g_free0 (_tmp38_);
	label = _tmp58_;
	_tmp59_ = g_string_new ("");
	tooltip = _tmp59_;
	_tmp60_ = self->priv->to_row;
	_tmp61_ = composer_widget_header_row_get_value (_tmp60_);
	_tmp62_ = _tmp61_;
	_tmp63_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp62_);
	_tmp64_ = _tmp63_;
	if (_tmp64_ != NULL) {
		{
			GearyRFC822MailboxAddresses* _addr_list = NULL;
			ComposerWidgetHeaderRow* _tmp65_;
			gconstpointer _tmp66_;
			gconstpointer _tmp67_;
			GearyRFC822MailboxAddresses* _tmp68_;
			GearyRFC822MailboxAddresses* _tmp69_;
			gint _addr_size = 0;
			GearyRFC822MailboxAddresses* _tmp70_;
			gint _tmp71_;
			gint _tmp72_;
			gint _addr_index = 0;
			_tmp65_ = self->priv->to_row;
			_tmp66_ = composer_widget_header_row_get_value (_tmp65_);
			_tmp67_ = _tmp66_;
			_tmp68_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp67_);
			_tmp69_ = _tmp68_;
			_addr_list = _tmp69_;
			_tmp70_ = _addr_list;
			_tmp71_ = geary_rf_c822_mailbox_addresses_get_size (_tmp70_);
			_tmp72_ = _tmp71_;
			_addr_size = _tmp72_;
			_addr_index = -1;
			while (TRUE) {
				gint _tmp73_;
				gint _tmp74_;
				GearyRFC822MailboxAddress* addr = NULL;
				GearyRFC822MailboxAddresses* _tmp75_;
				GearyRFC822MailboxAddress* _tmp76_;
				GString* _tmp77_;
				GearyRFC822MailboxAddress* _tmp78_;
				gchar* _tmp79_;
				gchar* _tmp80_;
				gchar* _tmp81_;
				gchar* _tmp82_;
				_addr_index = _addr_index + 1;
				_tmp73_ = _addr_index;
				_tmp74_ = _addr_size;
				if (!(_tmp73_ < _tmp74_)) {
					break;
				}
				_tmp75_ = _addr_list;
				_tmp76_ = geary_rf_c822_mailbox_addresses_get (_tmp75_, _addr_index);
				addr = _tmp76_;
				_tmp77_ = tooltip;
				_tmp78_ = addr;
				_tmp79_ = geary_rf_c822_mailbox_address_to_full_display (_tmp78_, "<", ">");
				_tmp80_ = _tmp79_;
				_tmp81_ = g_strdup_printf ("%s %s\n", _ ("To:"), _tmp80_);
				_tmp82_ = _tmp81_;
				g_string_append (_tmp77_, _tmp82_);
				_g_free0 (_tmp82_);
				_g_free0 (_tmp80_);
				_g_object_unref0 (addr);
			}
		}
	}
	_tmp83_ = self->priv->cc_row;
	_tmp84_ = composer_widget_header_row_get_value (_tmp83_);
	_tmp85_ = _tmp84_;
	_tmp86_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp85_);
	_tmp87_ = _tmp86_;
	if (_tmp87_ != NULL) {
		{
			GearyRFC822MailboxAddresses* _addr_list = NULL;
			ComposerWidgetHeaderRow* _tmp88_;
			gconstpointer _tmp89_;
			gconstpointer _tmp90_;
			GearyRFC822MailboxAddresses* _tmp91_;
			GearyRFC822MailboxAddresses* _tmp92_;
			gint _addr_size = 0;
			GearyRFC822MailboxAddresses* _tmp93_;
			gint _tmp94_;
			gint _tmp95_;
			gint _addr_index = 0;
			_tmp88_ = self->priv->cc_row;
			_tmp89_ = composer_widget_header_row_get_value (_tmp88_);
			_tmp90_ = _tmp89_;
			_tmp91_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp90_);
			_tmp92_ = _tmp91_;
			_addr_list = _tmp92_;
			_tmp93_ = _addr_list;
			_tmp94_ = geary_rf_c822_mailbox_addresses_get_size (_tmp93_);
			_tmp95_ = _tmp94_;
			_addr_size = _tmp95_;
			_addr_index = -1;
			while (TRUE) {
				gint _tmp96_;
				gint _tmp97_;
				GearyRFC822MailboxAddress* addr = NULL;
				GearyRFC822MailboxAddresses* _tmp98_;
				GearyRFC822MailboxAddress* _tmp99_;
				GString* _tmp100_;
				GearyRFC822MailboxAddress* _tmp101_;
				gchar* _tmp102_;
				gchar* _tmp103_;
				gchar* _tmp104_;
				gchar* _tmp105_;
				_addr_index = _addr_index + 1;
				_tmp96_ = _addr_index;
				_tmp97_ = _addr_size;
				if (!(_tmp96_ < _tmp97_)) {
					break;
				}
				_tmp98_ = _addr_list;
				_tmp99_ = geary_rf_c822_mailbox_addresses_get (_tmp98_, _addr_index);
				addr = _tmp99_;
				_tmp100_ = tooltip;
				_tmp101_ = addr;
				_tmp102_ = geary_rf_c822_mailbox_address_to_full_display (_tmp101_, "<", ">");
				_tmp103_ = _tmp102_;
				_tmp104_ = g_strdup_printf ("%s %s\n", _ ("Cc:"), _tmp103_);
				_tmp105_ = _tmp104_;
				g_string_append (_tmp100_, _tmp105_);
				_g_free0 (_tmp105_);
				_g_free0 (_tmp103_);
				_g_object_unref0 (addr);
			}
		}
	}
	_tmp106_ = self->priv->bcc_row;
	_tmp107_ = composer_widget_header_row_get_value (_tmp106_);
	_tmp108_ = _tmp107_;
	_tmp109_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp108_);
	_tmp110_ = _tmp109_;
	if (_tmp110_ != NULL) {
		{
			GearyRFC822MailboxAddresses* _addr_list = NULL;
			ComposerWidgetHeaderRow* _tmp111_;
			gconstpointer _tmp112_;
			gconstpointer _tmp113_;
			GearyRFC822MailboxAddresses* _tmp114_;
			GearyRFC822MailboxAddresses* _tmp115_;
			gint _addr_size = 0;
			GearyRFC822MailboxAddresses* _tmp116_;
			gint _tmp117_;
			gint _tmp118_;
			gint _addr_index = 0;
			_tmp111_ = self->priv->bcc_row;
			_tmp112_ = composer_widget_header_row_get_value (_tmp111_);
			_tmp113_ = _tmp112_;
			_tmp114_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp113_);
			_tmp115_ = _tmp114_;
			_addr_list = _tmp115_;
			_tmp116_ = _addr_list;
			_tmp117_ = geary_rf_c822_mailbox_addresses_get_size (_tmp116_);
			_tmp118_ = _tmp117_;
			_addr_size = _tmp118_;
			_addr_index = -1;
			while (TRUE) {
				gint _tmp119_;
				gint _tmp120_;
				GearyRFC822MailboxAddress* addr = NULL;
				GearyRFC822MailboxAddresses* _tmp121_;
				GearyRFC822MailboxAddress* _tmp122_;
				GString* _tmp123_;
				GearyRFC822MailboxAddress* _tmp124_;
				gchar* _tmp125_;
				gchar* _tmp126_;
				gchar* _tmp127_;
				gchar* _tmp128_;
				_addr_index = _addr_index + 1;
				_tmp119_ = _addr_index;
				_tmp120_ = _addr_size;
				if (!(_tmp119_ < _tmp120_)) {
					break;
				}
				_tmp121_ = _addr_list;
				_tmp122_ = geary_rf_c822_mailbox_addresses_get (_tmp121_, _addr_index);
				addr = _tmp122_;
				_tmp123_ = tooltip;
				_tmp124_ = addr;
				_tmp125_ = geary_rf_c822_mailbox_address_to_full_display (_tmp124_, "<", ">");
				_tmp126_ = _tmp125_;
				_tmp127_ = g_strdup_printf ("%s %s\n", _ ("Bcc:"), _tmp126_);
				_tmp128_ = _tmp127_;
				g_string_append (_tmp123_, _tmp128_);
				_g_free0 (_tmp128_);
				_g_free0 (_tmp126_);
				_g_object_unref0 (addr);
			}
		}
	}
	_tmp129_ = self->priv->reply_to_row;
	_tmp130_ = composer_widget_header_row_get_value (_tmp129_);
	_tmp131_ = _tmp130_;
	_tmp132_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp131_);
	_tmp133_ = _tmp132_;
	if (_tmp133_ != NULL) {
		{
			GearyRFC822MailboxAddresses* _addr_list = NULL;
			ComposerWidgetHeaderRow* _tmp134_;
			gconstpointer _tmp135_;
			gconstpointer _tmp136_;
			GearyRFC822MailboxAddresses* _tmp137_;
			GearyRFC822MailboxAddresses* _tmp138_;
			gint _addr_size = 0;
			GearyRFC822MailboxAddresses* _tmp139_;
			gint _tmp140_;
			gint _tmp141_;
			gint _addr_index = 0;
			_tmp134_ = self->priv->reply_to_row;
			_tmp135_ = composer_widget_header_row_get_value (_tmp134_);
			_tmp136_ = _tmp135_;
			_tmp137_ = composer_email_entry_get_addresses ((ComposerEmailEntry*) _tmp136_);
			_tmp138_ = _tmp137_;
			_addr_list = _tmp138_;
			_tmp139_ = _addr_list;
			_tmp140_ = geary_rf_c822_mailbox_addresses_get_size (_tmp139_);
			_tmp141_ = _tmp140_;
			_addr_size = _tmp141_;
			_addr_index = -1;
			while (TRUE) {
				gint _tmp142_;
				gint _tmp143_;
				GearyRFC822MailboxAddress* addr = NULL;
				GearyRFC822MailboxAddresses* _tmp144_;
				GearyRFC822MailboxAddress* _tmp145_;
				GString* _tmp146_;
				GearyRFC822MailboxAddress* _tmp147_;
				gchar* _tmp148_;
				gchar* _tmp149_;
				gchar* _tmp150_;
				gchar* _tmp151_;
				_addr_index = _addr_index + 1;
				_tmp142_ = _addr_index;
				_tmp143_ = _addr_size;
				if (!(_tmp142_ < _tmp143_)) {
					break;
				}
				_tmp144_ = _addr_list;
				_tmp145_ = geary_rf_c822_mailbox_addresses_get (_tmp144_, _addr_index);
				addr = _tmp145_;
				_tmp146_ = tooltip;
				_tmp147_ = addr;
				_tmp148_ = geary_rf_c822_mailbox_address_to_full_display (_tmp147_, "<", ">");
				_tmp149_ = _tmp148_;
				_tmp150_ = g_strdup_printf ("%s%s\n", _ ("Reply-To: "), _tmp149_);
				_tmp151_ = _tmp150_;
				g_string_append (_tmp146_, _tmp151_);
				_g_free0 (_tmp151_);
				_g_free0 (_tmp149_);
				_g_object_unref0 (addr);
			}
		}
	}
	_tmp152_ = self->priv->_header;
	_tmp153_ = label;
	_tmp154_ = tooltip;
	_tmp155_ = _tmp154_->str;
	_tmp156_ = string_slice (_tmp155_, (glong) 0, (glong) -1);
	_tmp157_ = _tmp156_;
	composer_headerbar_set_recipients (_tmp152_, _tmp153_, _tmp157_);
	_g_free0 (_tmp157_);
	_g_string_free0 (tooltip);
	_g_free0 (label);
}

static void
composer_widget_on_cut (ComposerWidget* self,
                        GSimpleAction* action,
                        GVariant* param)
{
	GtkEditable* editable = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkWidget* _tmp2_;
	GtkEditable* _tmp3_;
	GtkEditable* _tmp4_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_focus (_tmp1_);
	_tmp3_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_editable_get_type ()) ? ((GtkEditable*) _tmp2_) : NULL;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (_tmp2_);
	}
	editable = _tmp3_;
	_tmp4_ = editable;
	if (_tmp4_ != NULL) {
		GtkEditable* _tmp5_;
		_tmp5_ = editable;
		gtk_editable_cut_clipboard (_tmp5_);
	}
	_g_object_unref0 (editable);
}

static void
composer_widget_on_copy (ComposerWidget* self,
                         GSimpleAction* action,
                         GVariant* param)
{
	GtkEditable* editable = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkWidget* _tmp2_;
	GtkEditable* _tmp3_;
	GtkEditable* _tmp4_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_focus (_tmp1_);
	_tmp3_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_editable_get_type ()) ? ((GtkEditable*) _tmp2_) : NULL;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (_tmp2_);
	}
	editable = _tmp3_;
	_tmp4_ = editable;
	if (_tmp4_ != NULL) {
		GtkEditable* _tmp5_;
		_tmp5_ = editable;
		gtk_editable_copy_clipboard (_tmp5_);
	}
	_g_object_unref0 (editable);
}

static void
composer_widget_on_paste (ComposerWidget* self,
                          GSimpleAction* action,
                          GVariant* param)
{
	GtkEditable* editable = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkWidget* _tmp2_;
	GtkEditable* _tmp3_;
	GtkEditable* _tmp4_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_focus (_tmp1_);
	_tmp3_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_editable_get_type ()) ? ((GtkEditable*) _tmp2_) : NULL;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (_tmp2_);
	}
	editable = _tmp3_;
	_tmp4_ = editable;
	if (_tmp4_ != NULL) {
		GtkEditable* _tmp5_;
		_tmp5_ = editable;
		gtk_editable_paste_clipboard (_tmp5_);
	}
	_g_object_unref0 (editable);
}

static GVariant*
_variant_new24 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static void
composer_widget_on_toggle_action (ComposerWidget* self,
                                  GSimpleAction* action,
                                  GVariant* param)
{
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail ((action == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = g_action_get_state (G_TYPE_CHECK_INSTANCE_CAST (action, g_action_get_type (), GAction));
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = _variant_new24 (!g_variant_get_boolean (_tmp2_));
	g_signal_emit_by_name (action, "change-state", _tmp3_);
	_g_variant_unref0 (_tmp3_);
	_g_variant_unref0 (_tmp2_);
}

static void
composer_widget_reparent_widget (ComposerWidget* self,
                                 GtkWidget* child,
                                 GtkContainer* new_parent)
{
	GtkContainer* _tmp0_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (new_parent, gtk_container_get_type ()));
	_tmp0_ = gtk_widget_get_parent (child);
	gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_container_get_type (), GtkContainer), child);
	gtk_container_add (new_parent, child);
}

static void
composer_widget_update_extended_headers (ComposerWidget* self,
                                         gboolean reorder)
{
	gboolean cc = FALSE;
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean bcc = FALSE;
	ComposerWidgetHeaderRow* _tmp5_;
	gconstpointer _tmp6_;
	gconstpointer _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	gboolean reply_to = FALSE;
	ComposerWidgetHeaderRow* _tmp10_;
	gconstpointer _tmp11_;
	gconstpointer _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp27_ = FALSE;
	gboolean _tmp28_ = FALSE;
	GtkToggleButton* _tmp29_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->cc_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp2_);
	_tmp4_ = _tmp3_;
	cc = !_tmp4_;
	_tmp5_ = self->priv->bcc_row;
	_tmp6_ = composer_widget_header_row_get_value (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp7_);
	_tmp9_ = _tmp8_;
	bcc = !_tmp9_;
	_tmp10_ = self->priv->reply_to_row;
	_tmp11_ = composer_widget_header_row_get_value (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = composer_email_entry_get_is_empty ((ComposerEmailEntry*) _tmp12_);
	_tmp14_ = _tmp13_;
	reply_to = !_tmp14_;
	if (reorder) {
		if (cc) {
			ComposerWidgetHeaderRow* _tmp15_;
			GtkBox* _tmp16_;
			_tmp15_ = self->priv->cc_row;
			_tmp16_ = self->priv->filled_headers;
			composer_widget_reparent_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_container_get_type (), GtkContainer));
		} else {
			ComposerWidgetHeaderRow* _tmp17_;
			GtkBox* _tmp18_;
			_tmp17_ = self->priv->cc_row;
			_tmp18_ = self->priv->extended_headers;
			composer_widget_reparent_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_container_get_type (), GtkContainer));
		}
		if (bcc) {
			ComposerWidgetHeaderRow* _tmp19_;
			GtkBox* _tmp20_;
			_tmp19_ = self->priv->bcc_row;
			_tmp20_ = self->priv->filled_headers;
			composer_widget_reparent_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_container_get_type (), GtkContainer));
		} else {
			ComposerWidgetHeaderRow* _tmp21_;
			GtkBox* _tmp22_;
			_tmp21_ = self->priv->bcc_row;
			_tmp22_ = self->priv->extended_headers;
			composer_widget_reparent_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_container_get_type (), GtkContainer));
		}
		if (reply_to) {
			ComposerWidgetHeaderRow* _tmp23_;
			GtkBox* _tmp24_;
			_tmp23_ = self->priv->reply_to_row;
			_tmp24_ = self->priv->filled_headers;
			composer_widget_reparent_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_container_get_type (), GtkContainer));
		} else {
			ComposerWidgetHeaderRow* _tmp25_;
			GtkBox* _tmp26_;
			_tmp25_ = self->priv->reply_to_row;
			_tmp26_ = self->priv->extended_headers;
			composer_widget_reparent_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_container_get_type (), GtkContainer));
		}
	}
	if (cc) {
		_tmp28_ = bcc;
	} else {
		_tmp28_ = FALSE;
	}
	if (_tmp28_) {
		_tmp27_ = reply_to;
	} else {
		_tmp27_ = FALSE;
	}
	_tmp29_ = self->priv->show_extended_headers;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_widget_get_type (), GtkWidget), !_tmp27_);
}

static GVariant*
_variant_new25 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static void
composer_widget_on_show_extended_headers_toggled (ComposerWidget* self,
                                                  GSimpleAction* action,
                                                  GVariant* new_state)
{
	gboolean show_extended = FALSE;
	GVariant* _tmp0_;
	GtkRevealer* _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail ((action == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	show_extended = g_variant_get_boolean (new_state);
	_tmp0_ = _variant_new25 (show_extended);
	g_simple_action_set_state (action, _tmp0_);
	_g_variant_unref0 (_tmp0_);
	composer_widget_update_extended_headers (self, TRUE);
	_tmp1_ = self->priv->extended_headers_revealer;
	gtk_revealer_set_reveal_child (_tmp1_, show_extended);
	if (show_extended) {
		ComposerWidgetPresentationMode _tmp3_;
		_tmp3_ = self->priv->_current_mode;
		_tmp2_ = _tmp3_ == COMPOSER_WIDGET_PRESENTATION_MODE_INLINE_COMPACT;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		composer_widget_set_mode (self, COMPOSER_WIDGET_PRESENTATION_MODE_INLINE);
	}
}

static gboolean
composer_widget_on_editor_key_press_event (ComposerWidget* self,
                                           GdkEventKey* event)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->is_modifier == ((guint) 0)) {
		if (composer_widget_check_send_on_return (self, event) == GDK_EVENT_STOP) {
			result = GDK_EVENT_STOP;
			return result;
		}
	}
	_tmp0_ = composer_widget_get_can_delete_quote (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_ = FALSE;
		composer_widget_set_can_delete_quote (self, FALSE);
		if (event->is_modifier == ((guint) 0)) {
			_tmp2_ = event->keyval == GDK_KEY_BackSpace;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			ComposerEditor* _tmp3_;
			ComposerWebView* _tmp4_;
			ComposerWebView* _tmp5_;
			_tmp3_ = self->priv->_editor;
			_tmp4_ = composer_editor_get_body (_tmp3_);
			_tmp5_ = _tmp4_;
			composer_web_view_delete_quoted_message (_tmp5_);
			result = GDK_EVENT_STOP;
			return result;
		}
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static GSimpleAction*
composer_widget_get_action (ComposerWidget* self,
                            const gchar* action_name)
{
	GSimpleActionGroup* _tmp0_;
	GAction* _tmp1_;
	GSimpleAction* _tmp2_;
	GSimpleAction* result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), NULL);
	g_return_val_if_fail (action_name != NULL, NULL);
	_tmp0_ = self->priv->actions;
	_tmp1_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, g_action_map_get_type (), GActionMap), action_name);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp1_) : NULL);
	result = _tmp2_;
	return result;
}

static gboolean
composer_widget_add_account_emails_to_from_list (ComposerWidget* self,
                                                 ApplicationAccountContext* other_account,
                                                 gboolean set_active)
{
	gboolean is_primary = FALSE;
	GearyAccountInformation* info = NULL;
	GearyAccount* _tmp0_;
	GearyAccount* _tmp1_;
	GearyAccountInformation* _tmp2_;
	GearyAccountInformation* _tmp3_;
	GearyAccountInformation* _tmp4_;
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	g_return_val_if_fail (APPLICATION_IS_ACCOUNT_CONTEXT (other_account), FALSE);
	is_primary = TRUE;
	_tmp0_ = application_account_context_get_account (other_account);
	_tmp1_ = _tmp0_;
	_tmp2_ = geary_account_get_information (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	info = _tmp4_;
	{
		GeeList* _mailbox_list = NULL;
		GearyAccountInformation* _tmp5_;
		GeeList* _tmp6_;
		GeeList* _tmp7_;
		gint _mailbox_size = 0;
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _mailbox_index = 0;
		_tmp5_ = info;
		_tmp6_ = geary_account_information_get_sender_mailboxes (_tmp5_);
		_tmp7_ = _tmp6_;
		_mailbox_list = _tmp7_;
		_tmp8_ = _mailbox_list;
		_tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp10_ = _tmp9_;
		_mailbox_size = _tmp10_;
		_mailbox_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			GearyRFC822MailboxAddress* mailbox = NULL;
			GeeList* _tmp13_;
			gpointer _tmp14_;
			GearyRFC822MailboxAddresses* addresses = NULL;
			GearyRFC822MailboxAddress* _tmp15_;
			GearyRFC822MailboxAddresses* _tmp16_;
			gchar* display = NULL;
			GearyRFC822MailboxAddress* _tmp17_;
			gchar* _tmp18_;
			ComposerWidgetHeaderRow* _tmp24_;
			gconstpointer _tmp25_;
			gconstpointer _tmp26_;
			const gchar* _tmp27_;
			GeeArrayList* _tmp28_;
			GearyRFC822MailboxAddresses* _tmp29_;
			ComposerWidgetFromAddressMap* _tmp30_;
			ComposerWidgetFromAddressMap* _tmp31_;
			gboolean _tmp32_ = FALSE;
			_mailbox_index = _mailbox_index + 1;
			_tmp11_ = _mailbox_index;
			_tmp12_ = _mailbox_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _mailbox_list;
			_tmp14_ = gee_list_get (_tmp13_, _mailbox_index);
			mailbox = (GearyRFC822MailboxAddress*) _tmp14_;
			_tmp15_ = mailbox;
			_tmp16_ = geary_rf_c822_mailbox_addresses_new_single (_tmp15_);
			addresses = _tmp16_;
			_tmp17_ = mailbox;
			_tmp18_ = geary_rf_c822_mailbox_address_to_full_display (_tmp17_, "<", ">");
			display = _tmp18_;
			if (!is_primary) {
				const gchar* _tmp19_;
				GearyAccountInformation* _tmp20_;
				const gchar* _tmp21_;
				const gchar* _tmp22_;
				gchar* _tmp23_;
				_tmp19_ = display;
				_tmp20_ = info;
				_tmp21_ = geary_account_information_get_display_name (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp23_ = g_strdup_printf (_ ("%1$s via %2$s"), _tmp19_, _tmp22_);
				_g_free0 (display);
				display = _tmp23_;
			}
			is_primary = FALSE;
			_tmp24_ = self->priv->from_row;
			_tmp25_ = composer_widget_header_row_get_value (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = display;
			gtk_combo_box_text_append_text ((GtkComboBoxText*) _tmp26_, _tmp27_);
			_tmp28_ = self->priv->from_list;
			_tmp29_ = addresses;
			_tmp30_ = composer_widget_from_address_map_new (other_account, _tmp29_);
			_tmp31_ = _tmp30_;
			gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp31_);
			_composer_widget_from_address_map_unref0 (_tmp31_);
			if (!set_active) {
				GearyRFC822MailboxAddresses* _tmp33_;
				GearyRFC822MailboxAddresses* _tmp34_;
				_tmp33_ = self->priv->_from;
				_tmp34_ = addresses;
				_tmp32_ = gee_hashable_equal_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, GEE_TYPE_HASHABLE, GeeHashable), _tmp34_);
			} else {
				_tmp32_ = FALSE;
			}
			if (_tmp32_) {
				ComposerWidgetHeaderRow* _tmp35_;
				gconstpointer _tmp36_;
				gconstpointer _tmp37_;
				GeeArrayList* _tmp38_;
				gint _tmp39_;
				gint _tmp40_;
				_tmp35_ = self->priv->from_row;
				_tmp36_ = composer_widget_header_row_get_value (_tmp35_);
				_tmp37_ = _tmp36_;
				_tmp38_ = self->priv->from_list;
				_tmp39_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
				_tmp40_ = _tmp39_;
				gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST ((GtkComboBoxText*) _tmp37_, gtk_combo_box_get_type (), GtkComboBox), _tmp40_ - 1);
				set_active = TRUE;
			}
			_g_free0 (display);
			_g_object_unref0 (addresses);
			_g_object_unref0 (mailbox);
		}
		_g_object_unref0 (_mailbox_list);
	}
	result = set_active;
	_g_object_unref0 (info);
	return result;
}

static void
composer_widget_update_info_label (ComposerWidget* self)
{
	gchar* text = NULL;
	gchar* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ComposerEditor* _tmp7_;
	const gchar* _tmp8_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = g_strdup ("");
	text = _tmp0_;
	_tmp1_ = composer_widget_get_can_delete_quote (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gchar* _tmp3_;
		_tmp3_ = g_strdup (COMPOSER_WIDGET_BACKSPACE_TEXT);
		_g_free0 (text);
		text = _tmp3_;
	} else {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp4_ = composer_widget_get_draft_status_text (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = g_strdup (_tmp5_);
		_g_free0 (text);
		text = _tmp6_;
	}
	_tmp7_ = self->priv->_editor;
	_tmp8_ = text;
	composer_editor_set_info_label (_tmp7_, _tmp8_);
	_g_free0 (text);
}

static void
_composer_widget_on_from_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                        gpointer self)
{
	composer_widget_on_from_changed ((ComposerWidget*) self);
}

static gboolean
composer_widget_update_from_field (ComposerWidget* self)
{
	ComposerWidgetHeaderRow* _tmp0_;
	ComposerWidgetHeaderRow* _tmp1_;
	gconstpointer _tmp2_;
	gconstpointer _tmp3_;
	guint _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	ComposerWidgetPresentationMode _tmp7_;
	GeeCollection* accounts = NULL;
	ComposerApplicationInterface* _tmp11_;
	GeeCollection* _tmp12_;
	gboolean _tmp13_ = FALSE;
	GeeCollection* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	ComposerWidgetHeaderRow* _tmp30_;
	ComposerWidgetHeaderRow* _tmp31_;
	gconstpointer _tmp32_;
	gconstpointer _tmp33_;
	GeeArrayList* _tmp34_;
	gboolean set_active = FALSE;
	ApplicationAccountContext* _tmp35_;
	ComposerWidgetHeaderRow* _tmp47_;
	gconstpointer _tmp48_;
	gconstpointer _tmp49_;
	gboolean result;
	g_return_val_if_fail (COMPOSER_IS_WIDGET (self), FALSE);
	_tmp0_ = self->priv->from_row;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp1_ = self->priv->from_row;
	_tmp2_ = composer_widget_header_row_get_value (_tmp1_);
	_tmp3_ = _tmp2_;
	g_signal_parse_name ("changed", gtk_combo_box_get_type (), &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST ((GtkComboBoxText*) _tmp3_, gtk_combo_box_get_type (), GtkComboBox), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _composer_widget_on_from_changed_gtk_combo_box_changed, self);
	_tmp7_ = self->priv->_current_mode;
	if (_tmp7_ == COMPOSER_WIDGET_PRESENTATION_MODE_INLINE) {
		_tmp6_ = TRUE;
	} else {
		ComposerWidgetPresentationMode _tmp8_;
		_tmp8_ = self->priv->_current_mode;
		_tmp6_ = _tmp8_ == COMPOSER_WIDGET_PRESENTATION_MODE_INLINE_COMPACT;
	}
	if (_tmp6_) {
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp9_ = composer_widget_get_has_multiple_from_addresses (self);
		_tmp10_ = _tmp9_;
		_tmp5_ = !_tmp10_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		result = FALSE;
		return result;
	}
	_tmp11_ = self->priv->application;
	_tmp12_ = application_account_interface_get_account_contexts (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, APPLICATION_TYPE_ACCOUNT_INTERFACE, ApplicationAccountInterface));
	accounts = _tmp12_;
	_tmp14_ = accounts;
	_tmp15_ = gee_collection_get_size (_tmp14_);
	_tmp16_ = _tmp15_;
	if (_tmp16_ < 1) {
		_tmp13_ = TRUE;
	} else {
		gboolean _tmp17_ = FALSE;
		GeeCollection* _tmp18_;
		gint _tmp19_;
		gint _tmp20_;
		_tmp18_ = accounts;
		_tmp19_ = gee_collection_get_size (_tmp18_);
		_tmp20_ = _tmp19_;
		if (_tmp20_ == 1) {
			GeeCollection* _tmp21_;
			gpointer _tmp22_;
			ApplicationAccountContext* _tmp23_;
			GearyAccount* _tmp24_;
			GearyAccount* _tmp25_;
			GearyAccountInformation* _tmp26_;
			GearyAccountInformation* _tmp27_;
			gboolean _tmp28_;
			gboolean _tmp29_;
			_tmp21_ = accounts;
			_tmp22_ = geary_collection_first (APPLICATION_TYPE_ACCOUNT_CONTEXT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp21_);
			_tmp23_ = (ApplicationAccountContext*) _tmp22_;
			_tmp24_ = application_account_context_get_account (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = geary_account_get_information (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = geary_account_information_get_has_sender_aliases (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp17_ = !_tmp29_;
			_g_object_unref0 (_tmp23_);
		} else {
			_tmp17_ = FALSE;
		}
		_tmp13_ = _tmp17_;
	}
	if (_tmp13_) {
		result = FALSE;
		_g_object_unref0 (accounts);
		return result;
	}
	_tmp30_ = self->priv->from_row;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp31_ = self->priv->from_row;
	_tmp32_ = composer_widget_header_row_get_value (_tmp31_);
	_tmp33_ = _tmp32_;
	gtk_combo_box_text_remove_all ((GtkComboBoxText*) _tmp33_);
	_tmp34_ = gee_array_list_new (COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP, (GBoxedCopyFunc) composer_widget_from_address_map_ref, (GDestroyNotify) composer_widget_from_address_map_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->from_list);
	self->priv->from_list = _tmp34_;
	_tmp35_ = self->priv->_sender_context;
	set_active = composer_widget_add_account_emails_to_from_list (self, _tmp35_, FALSE);
	{
		GeeIterator* _account_it = NULL;
		GeeCollection* _tmp36_;
		GeeIterator* _tmp37_;
		_tmp36_ = accounts;
		_tmp37_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_ITERABLE, GeeIterable));
		_account_it = _tmp37_;
		while (TRUE) {
			GeeIterator* _tmp38_;
			ApplicationAccountContext* account = NULL;
			GeeIterator* _tmp39_;
			gpointer _tmp40_;
			ApplicationAccountContext* _tmp41_;
			ApplicationAccountContext* _tmp42_;
			_tmp38_ = _account_it;
			if (!gee_iterator_next (_tmp38_)) {
				break;
			}
			_tmp39_ = _account_it;
			_tmp40_ = gee_iterator_get (_tmp39_);
			account = (ApplicationAccountContext*) _tmp40_;
			_tmp41_ = account;
			_tmp42_ = self->priv->_sender_context;
			if (_tmp41_ != _tmp42_) {
				ApplicationAccountContext* _tmp43_;
				_tmp43_ = account;
				set_active = composer_widget_add_account_emails_to_from_list (self, _tmp43_, set_active);
			}
			_g_object_unref0 (account);
		}
		_g_object_unref0 (_account_it);
	}
	if (!set_active) {
		ComposerWidgetHeaderRow* _tmp44_;
		gconstpointer _tmp45_;
		gconstpointer _tmp46_;
		_tmp44_ = self->priv->from_row;
		_tmp45_ = composer_widget_header_row_get_value (_tmp44_);
		_tmp46_ = _tmp45_;
		gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST ((GtkComboBoxText*) _tmp46_, gtk_combo_box_get_type (), GtkComboBox), 0);
	}
	_tmp47_ = self->priv->from_row;
	_tmp48_ = composer_widget_header_row_get_value (_tmp47_);
	_tmp49_ = _tmp48_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST ((GtkComboBoxText*) _tmp49_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _composer_widget_on_from_changed_gtk_combo_box_changed, self, 0);
	result = !set_active;
	_g_object_unref0 (accounts);
	return result;
}

static void
composer_widget_update_from (ComposerWidget* self,
                             GError** error)
{
	gint index = 0;
	ComposerWidgetHeaderRow* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->from_row;
	_tmp1_ = composer_widget_header_row_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	index = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST ((GtkComboBoxText*) _tmp2_, gtk_combo_box_get_type (), GtkComboBox));
	if (index >= 0) {
		ComposerWidgetFromAddressMap* selected = NULL;
		GeeArrayList* _tmp3_;
		gpointer _tmp4_;
		ComposerWidgetFromAddressMap* _tmp5_;
		GearyRFC822MailboxAddresses* _tmp6_;
		ComposerWidgetFromAddressMap* _tmp7_;
		ApplicationAccountContext* _tmp8_;
		ApplicationAccountContext* _tmp9_;
		_tmp3_ = self->priv->from_list;
		_tmp4_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), index);
		selected = (ComposerWidgetFromAddressMap*) _tmp4_;
		_tmp5_ = selected;
		_tmp6_ = _tmp5_->from;
		composer_widget_set_from (self, _tmp6_);
		_tmp7_ = selected;
		_tmp8_ = _tmp7_->account;
		_tmp9_ = self->priv->_sender_context;
		if (_tmp8_ != _tmp9_) {
			ComposerWidgetFromAddressMap* _tmp10_;
			ApplicationAccountContext* _tmp11_;
			_tmp10_ = selected;
			_tmp11_ = _tmp10_->account;
			composer_widget_set_sender_context (self, _tmp11_);
			composer_widget_update_signature (self, NULL, NULL, NULL);
			composer_widget_load_entry_completions (self);
			composer_widget_reopen_draft_manager (self, NULL, NULL);
		}
		_composer_widget_from_address_map_unref0 (selected);
	}
}

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

static void
composer_widget_update_signature (ComposerWidget* self,
                                  GCancellable* cancellable,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	ComposerWidgetUpdateSignatureData* _data_;
	ComposerWidget* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ComposerWidgetUpdateSignatureData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, composer_widget_update_signature_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	composer_widget_update_signature_co (_data_);
}

static void
composer_widget_update_signature_finish (ComposerWidget* self,
                                         GAsyncResult* _res_)
{
	ComposerWidgetUpdateSignatureData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return;
	}
}

static void
composer_widget_update_signature_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	ComposerWidgetUpdateSignatureData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	composer_widget_update_signature_co (_data_);
}

static gboolean
composer_widget_update_signature_co (ComposerWidgetUpdateSignatureData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup ("");
	_data_->sig = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_sender_context;
	_data_->_tmp2_ = application_account_context_get_account (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = geary_account_get_information (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
	_data_->account = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->account;
	_data_->_tmp8_ = geary_account_information_get_use_signature (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	if (_data_->_tmp9_) {
		_data_->_tmp10_ = _data_->account;
		_data_->_tmp11_ = geary_account_information_get_signature (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = g_strdup (_data_->_tmp12_);
		_g_free0 (_data_->sig);
		_data_->sig = _data_->_tmp13_;
		_data_->_tmp14_ = _data_->sig;
		if (geary_string_is_empty_or_whitespace (_data_->_tmp14_)) {
			_data_->_tmp15_ = g_get_home_dir ();
			_data_->_tmp16_ = g_file_new_for_path (_data_->_tmp15_);
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = g_file_get_child (_data_->_tmp17_, ".signature");
			_data_->_tmp19_ = _data_->_tmp18_;
			_g_object_unref0 (_data_->_tmp17_);
			_data_->signature_file = _data_->_tmp19_;
			{
				_data_->data_length1 = 0;
				_data_->_data_size_ = 0;
				_data_->_tmp20_ = _data_->signature_file;
				_data_->_tmp21_ = NULL;
				_data_->_tmp22_ = 0;
				_data_->_state_ = 1;
				g_file_load_contents_async (_data_->_tmp20_, _data_->cancellable, composer_widget_update_signature_ready, _data_);
				return FALSE;
				_state_1:
				g_file_load_contents_finish (_data_->_tmp20_, _data_->_res_, &_data_->_tmp21_, &_data_->_tmp22_, NULL, &_data_->_inner_error0_);
				_data_->data = (g_free (_data_->data), NULL);
				_data_->data = _data_->_tmp21_;
				_data_->data_length1 = _data_->_tmp22_;
				_data_->_data_size_ = _data_->data_length1;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_data_->data = (g_free (_data_->data), NULL);
					goto __catch0_g_error;
				}
				_data_->_tmp23_ = _data_->data;
				_data_->_tmp23__length1 = _data_->data_length1;
				_data_->_tmp24_ = g_strdup ((const gchar*) _data_->_tmp23_);
				_g_free0 (_data_->sig);
				_data_->sig = _data_->_tmp24_;
				_data_->data = (g_free (_data_->data), NULL);
			}
			goto __finally0;
			__catch0_g_error:
			{
				_data_->_error_ = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp25_ = _data_->_error_;
				if (!g_error_matches (_data_->_tmp25_, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
					_data_->_tmp26_ = _data_->signature_file;
					_data_->_tmp27_ = g_file_get_path (_data_->_tmp26_);
					_data_->_tmp28_ = _data_->_tmp27_;
					_data_->_tmp29_ = _data_->_error_;
					_data_->_tmp30_ = _data_->_tmp29_->message;
					g_debug ("composer-widget.vala:2346: Error reading signature file %s: %s", _data_->_tmp28_, _data_->_tmp30_);
					_g_free0 (_data_->_tmp28_);
				}
				_g_error_free0 (_data_->_error_);
			}
			__finally0:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->signature_file);
				_g_object_unref0 (_data_->account);
				_g_free0 (_data_->sig);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->signature_file);
		}
	}
	_data_->_tmp31_ = _data_->sig;
	if (geary_string_is_empty_or_whitespace (_data_->_tmp31_)) {
		_data_->_tmp32_ = g_strdup ("");
		_g_free0 (_data_->sig);
		_data_->sig = _data_->_tmp32_;
	}
	_data_->_tmp33_ = _data_->self->priv->_editor;
	_data_->_tmp34_ = composer_editor_get_body (_data_->_tmp33_);
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = _data_->sig;
	_data_->_tmp37_ = geary_html_smart_escape (_data_->_tmp36_);
	_data_->_tmp38_ = _data_->_tmp37_;
	composer_web_view_update_signature (_data_->_tmp35_, _data_->_tmp38_);
	_g_free0 (_data_->_tmp38_);
	_g_object_unref0 (_data_->account);
	_g_free0 (_data_->sig);
	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 GspellLanguage*
_vala_GspellLanguage_copy (GspellLanguage* self)
{
	return g_boxed_copy (gspell_language_get_type (), self);
}

static gpointer
__vala_GspellLanguage_copy0 (gpointer self)
{
	return self ? _vala_GspellLanguage_copy (self) : NULL;
}

static void
_vala_GspellLanguage_free (GspellLanguage* self)
{
	g_boxed_free (gspell_language_get_type (), self);
}

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static void
composer_widget_update_subject_spell_checker (ComposerWidget* self)
{
	GspellLanguage* lang = NULL;
	gchar** langs = NULL;
	ApplicationConfiguration* _tmp0_;
	gint _tmp1_ = 0;
	gchar** _tmp2_;
	gint langs_length1;
	gint _langs_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GspellEntryBuffer* buffer = NULL;
	ComposerWidgetHeaderRow* _tmp24_;
	gconstpointer _tmp25_;
	gconstpointer _tmp26_;
	GtkEntryBuffer* _tmp27_;
	GtkEntryBuffer* _tmp28_;
	GspellEntryBuffer* _tmp29_;
	GspellEntryBuffer* _tmp30_;
	GspellChecker* checker = NULL;
	GspellLanguage* _tmp31_;
	GspellEntry* _tmp36_;
	GspellChecker* _tmp37_;
	GspellEntryBuffer* _tmp38_;
	GspellChecker* _tmp39_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	lang = NULL;
	_tmp0_ = self->priv->config;
	_tmp2_ = application_configuration_get_spell_check_languages (_tmp0_, &_tmp1_);
	langs = _tmp2_;
	langs_length1 = _tmp1_;
	_langs_size_ = langs_length1;
	_tmp3_ = langs;
	_tmp3__length1 = langs_length1;
	if (_tmp3__length1 == 1) {
		gchar** _tmp4_;
		gint _tmp4__length1;
		const gchar* _tmp5_;
		GspellLanguage* _tmp6_;
		GspellLanguage* _tmp7_;
		_tmp4_ = langs;
		_tmp4__length1 = langs_length1;
		_tmp5_ = _tmp4_[0];
		_tmp6_ = gspell_language_lookup (_tmp5_);
		_tmp7_ = __vala_GspellLanguage_copy0 (_tmp6_);
		__vala_GspellLanguage_free0 (lang);
		lang = _tmp7_;
	} else {
		gint _tmp8_ = 0;
		gchar** _tmp9_;
		GspellLanguage* _tmp17_;
		_tmp9_ = util_i18n_get_user_preferred_languages (&_tmp8_);
		{
			gchar** pref_collection = NULL;
			gint pref_collection_length1 = 0;
			gint _pref_collection_size_ = 0;
			gint pref_it = 0;
			pref_collection = _tmp9_;
			pref_collection_length1 = _tmp8_;
			for (pref_it = 0; pref_it < pref_collection_length1; pref_it = pref_it + 1) {
				gchar* _tmp10_;
				gchar* pref = NULL;
				_tmp10_ = g_strdup (pref_collection[pref_it]);
				pref = _tmp10_;
				{
					const gchar* _tmp11_;
					gchar** _tmp12_;
					gint _tmp12__length1;
					_tmp11_ = pref;
					_tmp12_ = langs;
					_tmp12__length1 = langs_length1;
					if (_vala_string_array_contains (_tmp12_, _tmp12__length1, _tmp11_)) {
						const gchar* _tmp13_;
						GspellLanguage* _tmp14_;
						GspellLanguage* _tmp15_;
						GspellLanguage* _tmp16_;
						_tmp13_ = pref;
						_tmp14_ = gspell_language_lookup (_tmp13_);
						_tmp15_ = __vala_GspellLanguage_copy0 (_tmp14_);
						__vala_GspellLanguage_free0 (lang);
						lang = _tmp15_;
						_tmp16_ = lang;
						if (_tmp16_ != NULL) {
							_g_free0 (pref);
							break;
						}
					}
					_g_free0 (pref);
				}
			}
			pref_collection = (_vala_array_free (pref_collection, pref_collection_length1, (GDestroyNotify) g_free), NULL);
		}
		_tmp17_ = lang;
		if (_tmp17_ == NULL) {
			gchar** _tmp18_;
			gint _tmp18__length1;
			_tmp18_ = langs;
			_tmp18__length1 = langs_length1;
			{
				gchar** pref_collection = NULL;
				gint pref_collection_length1 = 0;
				gint _pref_collection_size_ = 0;
				gint pref_it = 0;
				pref_collection = _tmp18_;
				pref_collection_length1 = _tmp18__length1;
				for (pref_it = 0; pref_it < pref_collection_length1; pref_it = pref_it + 1) {
					gchar* _tmp19_;
					gchar* pref = NULL;
					_tmp19_ = g_strdup (pref_collection[pref_it]);
					pref = _tmp19_;
					{
						const gchar* _tmp20_;
						GspellLanguage* _tmp21_;
						GspellLanguage* _tmp22_;
						GspellLanguage* _tmp23_;
						_tmp20_ = pref;
						_tmp21_ = gspell_language_lookup (_tmp20_);
						_tmp22_ = __vala_GspellLanguage_copy0 (_tmp21_);
						__vala_GspellLanguage_free0 (lang);
						lang = _tmp22_;
						_tmp23_ = lang;
						if (_tmp23_ != NULL) {
							_g_free0 (pref);
							break;
						}
						_g_free0 (pref);
					}
				}
			}
		}
	}
	_tmp24_ = self->priv->subject_row;
	_tmp25_ = composer_widget_header_row_get_value (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = gtk_entry_get_buffer ((GtkEntry*) _tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = gspell_entry_buffer_get_from_gtk_entry_buffer (_tmp28_);
	_tmp30_ = _g_object_ref0 (_tmp29_);
	buffer = _tmp30_;
	checker = NULL;
	_tmp31_ = lang;
	if (_tmp31_ != NULL) {
		GspellChecker* _tmp32_;
		GspellChecker* _tmp33_;
		GspellChecker* _tmp34_;
		GspellLanguage* _tmp35_;
		_tmp32_ = self->priv->subject_spell_checker;
		_tmp33_ = _g_object_ref0 (_tmp32_);
		_g_object_unref0 (checker);
		checker = _tmp33_;
		_tmp34_ = checker;
		_tmp35_ = lang;
		gspell_checker_set_language (_tmp34_, _tmp35_);
	}
	_tmp36_ = self->priv->subject_spell_entry;
	_tmp37_ = checker;
	gspell_entry_set_inline_spell_checking (_tmp36_, _tmp37_ != NULL);
	_tmp38_ = buffer;
	_tmp39_ = checker;
	gspell_entry_buffer_set_spell_checker (_tmp38_, _tmp39_);
	_g_object_unref0 (checker);
	_g_object_unref0 (buffer);
	langs = (_vala_array_free (langs, langs_length1, (GDestroyNotify) g_free), NULL);
	__vala_GspellLanguage_free0 (lang);
}

static void
composer_widget_on_draft_id_changed (ComposerWidget* self)
{
	GearyAppDraftManager* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = self->priv->draft_manager;
	_tmp1_ = geary_app_draft_manager_get_current_draft_id (_tmp0_);
	_tmp2_ = _tmp1_;
	composer_widget_set_saved_id (self, _tmp2_);
}

static void
composer_widget_on_draft_manager_fatal (ComposerWidget* self,
                                        GError* err)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (err != NULL);
	composer_widget_set_draft_status_text (self, COMPOSER_WIDGET_DRAFT_ERROR_TEXT);
}

static void
composer_widget_on_draft_state_changed (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_update_draft_state (self);
}

static void
composer_widget_on_subject_changed (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_draft_changed (self);
	composer_widget_update_window_title (self);
}

static void
composer_widget_on_envelope_changed (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_draft_changed (self);
	composer_widget_update_extended_headers (self, FALSE);
	composer_widget_validate_send_button (self);
}

static void
composer_widget_on_from_changed (ComposerWidget* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	{
		composer_widget_update_from (self, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = err;
		_tmp1_ = _tmp0_->message;
		g_debug ("composer-widget.vala:2434: Error updating from address: %s", _tmp1_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
composer_widget_on_expand_compact_headers (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_set_mode (self, COMPOSER_WIDGET_PRESENTATION_MODE_INLINE);
}

static void
composer_widget_on_detach (ComposerWidget* self)
{
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkApplicationWindow* _tmp2_;
	GtkApplicationWindow* _tmp3_;
	GtkApplication* _tmp4_;
	GtkApplication* _tmp5_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_top_window (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_window_get_application (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_window_get_type (), GtkWindow));
	_tmp5_ = _tmp4_;
	composer_widget_detach (self, APPLICATION_IS_CLIENT (_tmp5_) ? ((ApplicationClient*) _tmp5_) : NULL);
}

static void
composer_widget_on_add_attachment (ComposerWidget* self)
{
	AttachmentDialog* dialog = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkApplicationWindow* _tmp2_;
	GtkApplicationWindow* _tmp3_;
	ApplicationConfiguration* _tmp4_;
	AttachmentDialog* _tmp5_;
	AttachmentDialog* _tmp6_;
	AttachmentDialog* _tmp14_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_top_window (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->config;
	_tmp5_ = attachment_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_window_get_type (), GtkWindow), _tmp4_);
	dialog = _tmp5_;
	_tmp6_ = dialog;
	if (attachment_dialog_run (_tmp6_) == ((gint) GTK_RESPONSE_ACCEPT)) {
		AttachmentDialog* _tmp7_;
		AttachmentDialog* _tmp8_;
		GSList* _tmp9_;
		_tmp7_ = dialog;
		attachment_dialog_hide (_tmp7_);
		_tmp8_ = dialog;
		_tmp9_ = attachment_dialog_get_files (_tmp8_);
		{
			GSList* file_collection = NULL;
			GSList* file_it = NULL;
			file_collection = _tmp9_;
			for (file_it = file_collection; file_it != NULL; file_it = file_it->next) {
				GFile* _tmp10_;
				GFile* file = NULL;
				_tmp10_ = _g_object_ref0 ((GFile*) file_it->data);
				file = _tmp10_;
				{
					{
						GFile* _tmp11_;
						_tmp11_ = file;
						composer_widget_add_attachment_part (self, _tmp11_, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						composer_widget_draft_changed (self);
					}
					goto __finally0;
					__catch0_g_error:
					{
						GError* err = NULL;
						GError* _tmp12_;
						const gchar* _tmp13_;
						err = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp12_ = err;
						_tmp13_ = _tmp12_->message;
						composer_widget_attachment_failed (self, _tmp13_);
						_g_error_free0 (err);
						_g_object_unref0 (file);
						break;
					}
					__finally0:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (file);
						(file_collection == NULL) ? NULL : (file_collection = (_g_slist_free__g_object_unref0_ (file_collection), NULL));
						_g_object_unref0 (dialog);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
					_g_object_unref0 (file);
				}
			}
			(file_collection == NULL) ? NULL : (file_collection = (_g_slist_free__g_object_unref0_ (file_collection), NULL));
		}
	}
	_tmp14_ = dialog;
	attachment_dialog_destroy (_tmp14_);
	_g_object_unref0 (dialog);
}

static void
composer_widget_on_pending_attachments (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	if (composer_widget_update_pending_attachments (self, COMPOSER_WIDGET_ATTACH_PENDING_ALL, TRUE)) {
		composer_widget_draft_changed (self);
	}
}

static void
composer_widget_on_close (ComposerWidget* self)
{
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	composer_widget_conditional_close (self, COMPOSER_IS_WINDOW (_tmp1_), FALSE);
}

static void
composer_widget_on_show_window_menu (ComposerWidget* self)
{
	ApplicationMainWindow* main = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	ApplicationMainWindow* _tmp7_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	main = NULL;
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ComposerContainer* _tmp2_;
		ComposerContainer* _tmp3_;
		GtkApplicationWindow* _tmp4_;
		GtkApplicationWindow* _tmp5_;
		ApplicationMainWindow* _tmp6_;
		_tmp2_ = composer_widget_get_container (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = composer_container_get_top_window (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _g_object_ref0 (APPLICATION_IS_MAIN_WINDOW (_tmp5_) ? ((ApplicationMainWindow*) _tmp5_) : NULL);
		_g_object_unref0 (main);
		main = _tmp6_;
	}
	_tmp7_ = main;
	if (_tmp7_ != NULL) {
		ApplicationMainWindow* _tmp8_;
		_tmp8_ = main;
		application_main_window_show_window_menu (_tmp8_);
	}
	_g_object_unref0 (main);
}

static void
composer_widget_on_show_help_overlay (ComposerWidget* self)
{
	GtkShortcutsWindow* overlay = NULL;
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	GtkApplicationWindow* _tmp2_;
	GtkApplicationWindow* _tmp3_;
	GtkShortcutsWindow* _tmp4_;
	GtkShortcutsWindow* _tmp5_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_container_get_top_window (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_application_window_get_help_overlay (_tmp3_);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	overlay = _tmp5_;
	g_object_set (overlay, "section-name", "composer", NULL);
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (overlay, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (overlay);
}

static void
composer_widget_on_discard (ComposerWidget* self)
{
	ComposerContainer* _tmp0_;
	ComposerContainer* _tmp1_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_tmp0_ = composer_widget_get_container (self);
	_tmp1_ = _tmp0_;
	if (COMPOSER_IS_WINDOW (_tmp1_)) {
		composer_widget_conditional_close (self, TRUE, FALSE);
	} else {
		composer_widget_discard_and_close (self, NULL, NULL);
	}
}

static Block77Data*
block77_data_ref (Block77Data* _data77_)
{
	g_atomic_int_inc (&_data77_->_ref_count_);
	return _data77_;
}

static void
block77_data_unref (void * _userdata_)
{
	Block77Data* _data77_;
	_data77_ = (Block77Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data77_->_ref_count_)) {
		ComposerWidget* self;
		self = _data77_->self;
		_g_object_unref0 (_data77_->current_account);
		_g_object_unref0 (self);
		g_slice_free (Block77Data, _data77_);
	}
}

static void
__lambda194_ (Block77Data* _data77_,
              GObject* obj,
              GAsyncResult* res)
{
	ComposerWidget* self;
	GError* _inner_error0_ = NULL;
	self = _data77_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	{
		composer_widget_save_draft_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		ComposerApplicationInterface* _tmp0_;
		GearyAccountInformation* _tmp1_;
		GearyAccountInformation* _tmp2_;
		GError* _tmp3_;
		GearyAccountProblemReport* _tmp4_;
		GearyAccountProblemReport* _tmp5_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = self->priv->application;
		_tmp1_ = geary_account_get_information (_data77_->current_account);
		_tmp2_ = _tmp1_;
		_tmp3_ = _error_;
		_tmp4_ = geary_account_problem_report_new (_tmp2_, _tmp3_);
		_tmp5_ = _tmp4_;
		composer_application_interface_report_problem (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEARY_TYPE_PROBLEM_REPORT, GearyProblemReport));
		_g_object_unref0 (_tmp5_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda194__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda194_ (self, source_object, res);
	block77_data_unref (self);
}

static void
composer_widget_on_draft_timeout (ComposerWidget* self)
{
	Block77Data* _data77_;
	ApplicationAccountContext* _tmp0_;
	GearyAccount* _tmp1_;
	GearyAccount* _tmp2_;
	GearyAccount* _tmp3_;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	_data77_ = g_slice_new0 (Block77Data);
	_data77_->_ref_count_ = 1;
	_data77_->self = g_object_ref (self);
	_tmp0_ = self->priv->_sender_context;
	_tmp1_ = application_account_context_get_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data77_->current_account = _tmp3_;
	composer_widget_save_draft (self, ___lambda194__gasync_ready_callback, block77_data_ref (_data77_));
	block77_data_unref (_data77_);
	_data77_ = NULL;
}

static void
composer_widget_on_account_available (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	composer_widget_update_from_field (self);
}

static void
composer_widget_on_account_unavailable (ComposerWidget* self)
{
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	if (composer_widget_update_from_field (self)) {
		composer_widget_on_from_changed (self);
	}
}

/**
     * Handle a dropped image file, adding it as an inline attachment
     */
static void
composer_widget_on_image_file_dropped (ComposerWidget* self,
                                       const gchar* filename,
                                       const gchar* file_type,
                                       guint8* contents,
                                       gint contents_length1)
{
	GearyMemoryByteBuffer* buffer = NULL;
	GearyMemoryByteBuffer* _tmp0_;
	gchar* unique_filename = NULL;
	ComposerEditor* _tmp3_;
	ComposerWebView* _tmp4_;
	ComposerWebView* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPOSER_IS_WIDGET (self));
	g_return_if_fail (filename != NULL);
	g_return_if_fail (file_type != NULL);
	_tmp0_ = geary_memory_byte_buffer_new (contents, contents_length1, (gsize) contents_length1);
	buffer = _tmp0_;
	{
		GearyMemoryByteBuffer* _tmp1_;
		gchar* _tmp2_ = NULL;
		_tmp1_ = buffer;
		composer_widget_add_inline_part (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEARY_MEMORY_TYPE_BUFFER, GearyMemoryBuffer), filename, &_tmp2_, &_inner_error0_);
		_g_free0 (unique_filename);
		unique_filename = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == ATTACHMENT_ERROR) {
				goto __catch0_attachment_error;
			}
			_g_free0 (unique_filename);
			_g_object_unref0 (buffer);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	goto __finally0;
	__catch0_attachment_error:
	{
		g_clear_error (&_inner_error0_);
		g_warning ("composer-widget.vala:2536: Couldn't attach dropped empty file %s", filename);
		_g_free0 (unique_filename);
		_g_object_unref0 (buffer);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (unique_filename);
		_g_object_unref0 (buffer);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp3_ = self->priv->_editor;
	_tmp4_ = composer_editor_get_body (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = unique_filename;
	_tmp7_ = g_strconcat (COMPONENTS_WEB_VIEW_INTERNAL_URL_PREFIX, _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	composer_web_view_insert_image (_tmp5_, _tmp8_);
	_g_free0 (_tmp8_);
	_g_free0 (unique_filename);
	_g_object_unref0 (buffer);
}

static inline gpointer
composer_widget_header_row_get_instance_private (ComposerWidgetHeaderRow* self)
{
	return G_STRUCT_MEMBER_P (self, ComposerWidgetHeaderRow_private_offset);
}

static GtkLabel*
composer_widget_header_row_get_label (ComposerWidgetHeaderRow* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (COMPOSER_WIDGET_IS_HEADER_ROW (self), NULL);
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}

static void
composer_widget_header_row_set_label (ComposerWidgetHeaderRow* self,
                                      GtkLabel* value)
{
	GtkLabel* old_value;
	g_return_if_fail (COMPOSER_WIDGET_IS_HEADER_ROW (self));
	old_value = composer_widget_header_row_get_label (self);
	if (old_value != value) {
		GtkLabel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_label);
		self->priv->_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_header_row_properties[COMPOSER_WIDGET_HEADER_ROW_LABEL_PROPERTY]);
	}
}

static GtkBox*
composer_widget_header_row_get_value_container (ComposerWidgetHeaderRow* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (COMPOSER_WIDGET_IS_HEADER_ROW (self), NULL);
	_tmp0_ = self->priv->_value_container;
	result = _tmp0_;
	return result;
}

static void
composer_widget_header_row_set_value_container (ComposerWidgetHeaderRow* self,
                                                GtkBox* value)
{
	GtkBox* old_value;
	g_return_if_fail (COMPOSER_WIDGET_IS_HEADER_ROW (self));
	old_value = composer_widget_header_row_get_value_container (self);
	if (old_value != value) {
		GtkBox* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_value_container);
		self->priv->_value_container = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_header_row_properties[COMPOSER_WIDGET_HEADER_ROW_VALUE_CONTAINER_PROPERTY]);
	}
}

static gconstpointer
composer_widget_header_row_get_value (ComposerWidgetHeaderRow* self)
{
	gconstpointer result;
	gconstpointer _tmp0_;
	g_return_val_if_fail (COMPOSER_WIDGET_IS_HEADER_ROW (self), NULL);
	_tmp0_ = self->priv->_value;
	result = _tmp0_;
	return result;
}

static void
composer_widget_header_row_set_value (ComposerWidgetHeaderRow* self,
                                      gconstpointer value)
{
	gpointer old_value;
	g_return_if_fail (COMPOSER_WIDGET_IS_HEADER_ROW (self));
	old_value = composer_widget_header_row_get_value (self);
	if (old_value != value) {
		gpointer _tmp0_;
		_tmp0_ = ((value != NULL) && (self->priv->t_dup_func != NULL)) ? self->priv->t_dup_func ((gpointer) value) : ((gpointer) value);
		((self->priv->_value == NULL) || (self->priv->t_destroy_func == NULL)) ? NULL : (self->priv->_value = (self->priv->t_destroy_func (self->priv->_value), NULL));
		self->priv->_value = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_header_row_properties[COMPOSER_WIDGET_HEADER_ROW_VALUE_PROPERTY]);
	}
}

static ComposerWidgetHeaderRow*
composer_widget_header_row_construct (GType object_type,
                                      GType t_type,
                                      GBoxedCopyFunc t_dup_func,
                                      GDestroyNotify t_destroy_func,
                                      const gchar* label,
                                      gconstpointer value)
{
	ComposerWidgetHeaderRow * self = NULL;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkBox* _tmp5_;
	GtkBox* _tmp6_;
	GtkBox* _tmp7_;
	GtkStyleContext* _tmp8_;
	GtkBox* _tmp9_;
	GtkWidget* value_widget = NULL;
	GtkWidget* _tmp10_;
	GtkWidget* _tmp11_;
	g_return_val_if_fail (label != NULL, NULL);
	self = (ComposerWidgetHeaderRow*) g_object_new (object_type, "t-type", t_type, "t-dup-func", t_dup_func, "t-destroy-func", t_destroy_func, "orientation", GTK_ORIENTATION_HORIZONTAL, NULL);
	self->priv->t_type = t_type;
	self->priv->t_dup_func = t_dup_func;
	self->priv->t_destroy_func = t_destroy_func;
	geary_base_interface_base_ref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_tmp0_ = (GtkLabel*) gtk_label_new (label);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	composer_widget_header_row_set_label (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_label;
	gtk_label_set_use_underline (_tmp2_, TRUE);
	_tmp3_ = self->priv->_label;
	gtk_label_set_xalign (_tmp3_, 1.0f);
	_tmp4_ = self->priv->_label;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp5_);
	_tmp6_ = _tmp5_;
	composer_widget_header_row_set_value_container (self, _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = self->priv->_value_container;
	_tmp8_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp8_, "linked");
	_tmp9_ = self->priv->_value_container;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
	composer_widget_header_row_set_value (self, value);
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (value, gtk_widget_get_type ()) ? ((GtkWidget*) value) : NULL);
	value_widget = _tmp10_;
	_tmp11_ = value_widget;
	if (_tmp11_ != NULL) {
		GtkWidget* _tmp12_;
		GtkBox* _tmp13_;
		GtkWidget* _tmp14_;
		GtkLabel* _tmp15_;
		GtkWidget* _tmp16_;
		_tmp12_ = value_widget;
		gtk_widget_set_hexpand (_tmp12_, TRUE);
		_tmp13_ = self->priv->_value_container;
		_tmp14_ = value_widget;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_container_get_type (), GtkContainer), _tmp14_);
		_tmp15_ = self->priv->_label;
		_tmp16_ = value_widget;
		gtk_label_set_mnemonic_widget (_tmp15_, _tmp16_);
	}
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (value_widget);
	return self;
}

static ComposerWidgetHeaderRow*
composer_widget_header_row_new (GType t_type,
                                GBoxedCopyFunc t_dup_func,
                                GDestroyNotify t_destroy_func,
                                const gchar* label,
                                gconstpointer value)
{
	return composer_widget_header_row_construct (COMPOSER_WIDGET_TYPE_HEADER_ROW, t_type, t_dup_func, t_destroy_func, label, value);
}

static void
composer_widget_header_row_class_init (ComposerWidgetHeaderRowClass * klass,
                                       gpointer klass_data)
{
	composer_widget_header_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ComposerWidgetHeaderRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_composer_widget_header_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_composer_widget_header_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = composer_widget_header_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HEADER_ROW_T_TYPE, g_param_spec_gtype ("t-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HEADER_ROW_T_DUP_FUNC, g_param_spec_pointer ("t-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HEADER_ROW_T_DESTROY_FUNC, g_param_spec_pointer ("t-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HEADER_ROW_LABEL_PROPERTY, composer_widget_header_row_properties[COMPOSER_WIDGET_HEADER_ROW_LABEL_PROPERTY] = g_param_spec_object ("label", "label", "label", gtk_label_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HEADER_ROW_VALUE_CONTAINER_PROPERTY, composer_widget_header_row_properties[COMPOSER_WIDGET_HEADER_ROW_VALUE_CONTAINER_PROPERTY] = g_param_spec_object ("value-container", "value-container", "value-container", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HEADER_ROW_VALUE_PROPERTY, composer_widget_header_row_properties[COMPOSER_WIDGET_HEADER_ROW_VALUE_PROPERTY] = g_param_spec_pointer ("value", "value", "value", G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "geary-composer-widget-header-row");
}

static void
composer_widget_header_row_geary_base_interface_interface_init (GearyBaseInterfaceIface * iface,
                                                                gpointer iface_data)
{
	composer_widget_header_row_geary_base_interface_parent_iface = g_type_interface_peek_parent (iface);
}

static void
composer_widget_header_row_instance_init (ComposerWidgetHeaderRow * self,
                                          gpointer klass)
{
	self->priv = composer_widget_header_row_get_instance_private (self);
}

static void
composer_widget_header_row_finalize (GObject * obj)
{
	ComposerWidgetHeaderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	geary_base_interface_base_unref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_g_object_unref0 (self->priv->_label);
	_g_object_unref0 (self->priv->_value_container);
	((self->priv->_value == NULL) || (self->priv->t_destroy_func == NULL)) ? NULL : (self->priv->_value = (self->priv->t_destroy_func (self->priv->_value), NULL));
	G_OBJECT_CLASS (composer_widget_header_row_parent_class)->finalize (obj);
}

static GType
composer_widget_header_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ComposerWidgetHeaderRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) composer_widget_header_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComposerWidgetHeaderRow), 0, (GInstanceInitFunc) composer_widget_header_row_instance_init, NULL };
	static const GInterfaceInfo geary_base_interface_info = { (GInterfaceInitFunc) composer_widget_header_row_geary_base_interface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType composer_widget_header_row_type_id;
	composer_widget_header_row_type_id = g_type_register_static (gtk_box_get_type (), "ComposerWidgetHeaderRow", &g_define_type_info, 0);
	g_type_add_interface_static (composer_widget_header_row_type_id, GEARY_TYPE_BASE_INTERFACE, &geary_base_interface_info);
	ComposerWidgetHeaderRow_private_offset = g_type_add_instance_private (composer_widget_header_row_type_id, sizeof (ComposerWidgetHeaderRowPrivate));
	return composer_widget_header_row_type_id;
}

static GType
composer_widget_header_row_get_type (void)
{
	static volatile gsize composer_widget_header_row_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_header_row_type_id__once)) {
		GType composer_widget_header_row_type_id;
		composer_widget_header_row_type_id = composer_widget_header_row_get_type_once ();
		g_once_init_leave (&composer_widget_header_row_type_id__once, composer_widget_header_row_type_id);
	}
	return composer_widget_header_row_type_id__once;
}

static void
_vala_composer_widget_header_row_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	ComposerWidgetHeaderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	switch (property_id) {
		case COMPOSER_WIDGET_HEADER_ROW_LABEL_PROPERTY:
		g_value_set_object (value, composer_widget_header_row_get_label (self));
		break;
		case COMPOSER_WIDGET_HEADER_ROW_VALUE_CONTAINER_PROPERTY:
		g_value_set_object (value, composer_widget_header_row_get_value_container (self));
		break;
		case COMPOSER_WIDGET_HEADER_ROW_VALUE_PROPERTY:
		g_value_set_pointer (value, composer_widget_header_row_get_value (self));
		break;
		case COMPOSER_WIDGET_HEADER_ROW_T_TYPE:
		g_value_set_gtype (value, self->priv->t_type);
		break;
		case COMPOSER_WIDGET_HEADER_ROW_T_DUP_FUNC:
		g_value_set_pointer (value, self->priv->t_dup_func);
		break;
		case COMPOSER_WIDGET_HEADER_ROW_T_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->t_destroy_func);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_composer_widget_header_row_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	ComposerWidgetHeaderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPOSER_WIDGET_TYPE_HEADER_ROW, ComposerWidgetHeaderRow);
	switch (property_id) {
		case COMPOSER_WIDGET_HEADER_ROW_LABEL_PROPERTY:
		composer_widget_header_row_set_label (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_HEADER_ROW_VALUE_CONTAINER_PROPERTY:
		composer_widget_header_row_set_value_container (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_HEADER_ROW_VALUE_PROPERTY:
		composer_widget_header_row_set_value (self, g_value_get_pointer (value));
		break;
		case COMPOSER_WIDGET_HEADER_ROW_T_TYPE:
		self->priv->t_type = g_value_get_gtype (value);
		break;
		case COMPOSER_WIDGET_HEADER_ROW_T_DUP_FUNC:
		self->priv->t_dup_func = g_value_get_pointer (value);
		break;
		case COMPOSER_WIDGET_HEADER_ROW_T_DESTROY_FUNC:
		self->priv->t_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
composer_widget_entry_header_row_get_instance_private (ComposerWidgetEntryHeaderRow* self)
{
	return G_STRUCT_MEMBER_P (self, ComposerWidgetEntryHeaderRow_private_offset);
}

static ComponentsEntryUndo*
composer_widget_entry_header_row_get_undo (ComposerWidgetEntryHeaderRow* self)
{
	ComponentsEntryUndo* result;
	ComponentsEntryUndo* _tmp0_;
	g_return_val_if_fail (COMPOSER_WIDGET_IS_ENTRY_HEADER_ROW (self), NULL);
	_tmp0_ = self->priv->_undo;
	result = _tmp0_;
	return result;
}

static void
composer_widget_entry_header_row_set_undo (ComposerWidgetEntryHeaderRow* self,
                                           ComponentsEntryUndo* value)
{
	ComponentsEntryUndo* old_value;
	g_return_if_fail (COMPOSER_WIDGET_IS_ENTRY_HEADER_ROW (self));
	old_value = composer_widget_entry_header_row_get_undo (self);
	if (old_value != value) {
		ComponentsEntryUndo* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_undo);
		self->priv->_undo = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, composer_widget_entry_header_row_properties[COMPOSER_WIDGET_ENTRY_HEADER_ROW_UNDO_PROPERTY]);
	}
}

static ComposerWidgetEntryHeaderRow*
composer_widget_entry_header_row_construct (GType object_type,
                                            GType t_type,
                                            GBoxedCopyFunc t_dup_func,
                                            GDestroyNotify t_destroy_func,
                                            const gchar* label,
                                            gconstpointer value)
{
	ComposerWidgetEntryHeaderRow * self = NULL;
	GtkEntry* value_entry = NULL;
	GtkEntry* _tmp0_;
	GtkEntry* _tmp1_;
	g_return_val_if_fail (label != NULL, NULL);
	self = (ComposerWidgetEntryHeaderRow*) composer_widget_header_row_construct (object_type, t_type, (GBoxedCopyFunc) t_dup_func, (GDestroyNotify) t_destroy_func, label, value);
	self->priv->t_type = t_type;
	self->priv->t_dup_func = t_dup_func;
	self->priv->t_destroy_func = t_destroy_func;
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (value, gtk_entry_get_type ()) ? ((GtkEntry*) value) : NULL);
	value_entry = _tmp0_;
	_tmp1_ = value_entry;
	if (_tmp1_ != NULL) {
		GtkEntry* _tmp2_;
		ComponentsEntryUndo* _tmp3_;
		ComponentsEntryUndo* _tmp4_;
		_tmp2_ = value_entry;
		_tmp3_ = components_entry_undo_new (_tmp2_);
		_tmp4_ = _tmp3_;
		composer_widget_entry_header_row_set_undo (self, _tmp4_);
		_g_object_unref0 (_tmp4_);
	}
	_g_object_unref0 (value_entry);
	return self;
}

static ComposerWidgetEntryHeaderRow*
composer_widget_entry_header_row_new (GType t_type,
                                      GBoxedCopyFunc t_dup_func,
                                      GDestroyNotify t_destroy_func,
                                      const gchar* label,
                                      gconstpointer value)
{
	return composer_widget_entry_header_row_construct (COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW, t_type, t_dup_func, t_destroy_func, label, value);
}

static void
composer_widget_entry_header_row_class_init (ComposerWidgetEntryHeaderRowClass * klass,
                                             gpointer klass_data)
{
	composer_widget_entry_header_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ComposerWidgetEntryHeaderRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_composer_widget_entry_header_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_composer_widget_entry_header_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = composer_widget_entry_header_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_TYPE, g_param_spec_gtype ("t-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DUP_FUNC, g_param_spec_pointer ("t-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DESTROY_FUNC, g_param_spec_pointer ("t-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_ENTRY_HEADER_ROW_UNDO_PROPERTY, composer_widget_entry_header_row_properties[COMPOSER_WIDGET_ENTRY_HEADER_ROW_UNDO_PROPERTY] = g_param_spec_object ("undo", "undo", "undo", COMPONENTS_TYPE_ENTRY_UNDO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
composer_widget_entry_header_row_instance_init (ComposerWidgetEntryHeaderRow * self,
                                                gpointer klass)
{
	self->priv = composer_widget_entry_header_row_get_instance_private (self);
}

static void
composer_widget_entry_header_row_finalize (GObject * obj)
{
	ComposerWidgetEntryHeaderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW, ComposerWidgetEntryHeaderRow);
	_g_object_unref0 (self->priv->_undo);
	G_OBJECT_CLASS (composer_widget_entry_header_row_parent_class)->finalize (obj);
}

static GType
composer_widget_entry_header_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ComposerWidgetEntryHeaderRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) composer_widget_entry_header_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComposerWidgetEntryHeaderRow), 0, (GInstanceInitFunc) composer_widget_entry_header_row_instance_init, NULL };
	GType composer_widget_entry_header_row_type_id;
	composer_widget_entry_header_row_type_id = g_type_register_static (COMPOSER_WIDGET_TYPE_HEADER_ROW, "ComposerWidgetEntryHeaderRow", &g_define_type_info, 0);
	ComposerWidgetEntryHeaderRow_private_offset = g_type_add_instance_private (composer_widget_entry_header_row_type_id, sizeof (ComposerWidgetEntryHeaderRowPrivate));
	return composer_widget_entry_header_row_type_id;
}

static GType
composer_widget_entry_header_row_get_type (void)
{
	static volatile gsize composer_widget_entry_header_row_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_entry_header_row_type_id__once)) {
		GType composer_widget_entry_header_row_type_id;
		composer_widget_entry_header_row_type_id = composer_widget_entry_header_row_get_type_once ();
		g_once_init_leave (&composer_widget_entry_header_row_type_id__once, composer_widget_entry_header_row_type_id);
	}
	return composer_widget_entry_header_row_type_id__once;
}

static void
_vala_composer_widget_entry_header_row_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	ComposerWidgetEntryHeaderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW, ComposerWidgetEntryHeaderRow);
	switch (property_id) {
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_UNDO_PROPERTY:
		g_value_set_object (value, composer_widget_entry_header_row_get_undo (self));
		break;
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_TYPE:
		g_value_set_gtype (value, self->priv->t_type);
		break;
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DUP_FUNC:
		g_value_set_pointer (value, self->priv->t_dup_func);
		break;
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->t_destroy_func);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_composer_widget_entry_header_row_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	ComposerWidgetEntryHeaderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPOSER_WIDGET_TYPE_ENTRY_HEADER_ROW, ComposerWidgetEntryHeaderRow);
	switch (property_id) {
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_UNDO_PROPERTY:
		composer_widget_entry_header_row_set_undo (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_TYPE:
		self->priv->t_type = g_value_get_gtype (value);
		break;
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DUP_FUNC:
		self->priv->t_dup_func = g_value_get_pointer (value);
		break;
		case COMPOSER_WIDGET_ENTRY_HEADER_ROW_T_DESTROY_FUNC:
		self->priv->t_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static ComposerWidgetFromAddressMap*
composer_widget_from_address_map_construct (GType object_type,
                                            ApplicationAccountContext* account,
                                            GearyRFC822MailboxAddresses* from)
{
	ComposerWidgetFromAddressMap* self = NULL;
	ApplicationAccountContext* _tmp0_;
	GearyRFC822MailboxAddresses* _tmp1_;
	g_return_val_if_fail (APPLICATION_IS_ACCOUNT_CONTEXT (account), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (from, GEARY_RF_C822_TYPE_MAILBOX_ADDRESSES), NULL);
	self = (ComposerWidgetFromAddressMap*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (self->account);
	self->account = _tmp0_;
	_tmp1_ = _g_object_ref0 (from);
	_g_object_unref0 (self->from);
	self->from = _tmp1_;
	return self;
}

static ComposerWidgetFromAddressMap*
composer_widget_from_address_map_new (ApplicationAccountContext* account,
                                      GearyRFC822MailboxAddresses* from)
{
	return composer_widget_from_address_map_construct (COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP, account, from);
}

static void
composer_widget_value_from_address_map_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
composer_widget_value_from_address_map_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		composer_widget_from_address_map_unref (value->data[0].v_pointer);
	}
}

static void
composer_widget_value_from_address_map_copy_value (const GValue* src_value,
                                                   GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = composer_widget_from_address_map_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
composer_widget_value_from_address_map_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
composer_widget_value_from_address_map_collect_value (GValue* value,
                                                      guint n_collect_values,
                                                      GTypeCValue* collect_values,
                                                      guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ComposerWidgetFromAddressMap * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = composer_widget_from_address_map_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
composer_widget_value_from_address_map_lcopy_value (const GValue* value,
                                                    guint n_collect_values,
                                                    GTypeCValue* collect_values,
                                                    guint collect_flags)
{
	ComposerWidgetFromAddressMap ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = composer_widget_from_address_map_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
composer_widget_param_spec_from_address_map (const gchar* name,
                                             const gchar* nick,
                                             const gchar* blurb,
                                             GType object_type,
                                             GParamFlags flags)
{
	ComposerWidgetParamSpecFromAddressMap* spec;
	g_return_val_if_fail (g_type_is_a (object_type, COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
composer_widget_value_get_from_address_map (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP), NULL);
	return value->data[0].v_pointer;
}

static void
composer_widget_value_set_from_address_map (GValue* value,
                                            gpointer v_object)
{
	ComposerWidgetFromAddressMap * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		composer_widget_from_address_map_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		composer_widget_from_address_map_unref (old);
	}
}

static void
composer_widget_value_take_from_address_map (GValue* value,
                                             gpointer v_object)
{
	ComposerWidgetFromAddressMap * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		composer_widget_from_address_map_unref (old);
	}
}

static void
composer_widget_from_address_map_class_init (ComposerWidgetFromAddressMapClass * klass,
                                             gpointer klass_data)
{
	composer_widget_from_address_map_parent_class = g_type_class_peek_parent (klass);
	((ComposerWidgetFromAddressMapClass *) klass)->finalize = composer_widget_from_address_map_finalize;
}

static void
composer_widget_from_address_map_instance_init (ComposerWidgetFromAddressMap * self,
                                                gpointer klass)
{
	self->ref_count = 1;
}

static void
composer_widget_from_address_map_finalize (ComposerWidgetFromAddressMap * obj)
{
	ComposerWidgetFromAddressMap * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP, ComposerWidgetFromAddressMap);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->account);
	_g_object_unref0 (self->from);
}

static GType
composer_widget_from_address_map_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { composer_widget_value_from_address_map_init, composer_widget_value_from_address_map_free_value, composer_widget_value_from_address_map_copy_value, composer_widget_value_from_address_map_peek_pointer, "p", composer_widget_value_from_address_map_collect_value, "p", composer_widget_value_from_address_map_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ComposerWidgetFromAddressMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) composer_widget_from_address_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComposerWidgetFromAddressMap), 0, (GInstanceInitFunc) composer_widget_from_address_map_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType composer_widget_from_address_map_type_id;
	composer_widget_from_address_map_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ComposerWidgetFromAddressMap", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return composer_widget_from_address_map_type_id;
}

static GType
composer_widget_from_address_map_get_type (void)
{
	static volatile gsize composer_widget_from_address_map_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_from_address_map_type_id__once)) {
		GType composer_widget_from_address_map_type_id;
		composer_widget_from_address_map_type_id = composer_widget_from_address_map_get_type_once ();
		g_once_init_leave (&composer_widget_from_address_map_type_id__once, composer_widget_from_address_map_type_id);
	}
	return composer_widget_from_address_map_type_id__once;
}

static gpointer
composer_widget_from_address_map_ref (gpointer instance)
{
	ComposerWidgetFromAddressMap * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
composer_widget_from_address_map_unref (gpointer instance)
{
	ComposerWidgetFromAddressMap * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		COMPOSER_WIDGET_FROM_ADDRESS_MAP_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
composer_widget_class_init (ComposerWidgetClass * klass,
                            gpointer klass_data)
{
	composer_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ComposerWidget_private_offset);
	((GtkWidgetClass *) klass)->destroy = (void (*) (GtkWidget*)) composer_widget_real_destroy;
	((GtkWidgetClass *) klass)->key_press_event = (gboolean (*) (GtkWidget*, GdkEventKey*)) composer_widget_real_key_press_event;
	G_OBJECT_CLASS (klass)->get_property = _vala_composer_widget_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_composer_widget_set_property;
	G_OBJECT_CLASS (klass)->finalize = composer_widget_finalize;
	/** The account the email is being sent from. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_SENDER_CONTEXT_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_SENDER_CONTEXT_PROPERTY] = g_param_spec_object ("sender-context", "sender-context", "sender-context", APPLICATION_TYPE_ACCOUNT_CONTEXT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** The identifier of the saved email this composer holds, if any. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_SAVED_ID_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_SAVED_ID_PROPERTY] = g_param_spec_object ("saved-id", "saved-id", "saved-id", GEARY_TYPE_EMAIL_IDENTIFIER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Determines the type of the context email. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_CONTEXT_TYPE_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_CONTEXT_TYPE_PROPERTY] = g_param_spec_enum ("context-type", "context-type", "context-type", COMPOSER_WIDGET_TYPE_CONTEXT_TYPE, COMPOSER_WIDGET_CONTEXT_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Determines the composer's current presentation mode. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_CURRENT_MODE_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_CURRENT_MODE_PROPERTY] = g_param_spec_enum ("current-mode", "current-mode", "current-mode", COMPOSER_WIDGET_TYPE_PRESENTATION_MODE, COMPOSER_WIDGET_PRESENTATION_MODE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/** Determines if the composer is completely empty. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_IS_BLANK_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_IS_BLANK_PROPERTY] = g_param_spec_boolean ("is-blank", "is-blank", "is-blank", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** The email body editor widget. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_EDITOR_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_EDITOR_PROPERTY] = g_param_spec_object ("editor", "editor", "editor", COMPOSER_TYPE_EDITOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	     * The last focused text input widget.
	     *
	     * This may be a Gtk.Entry if an address field or the subject was
	     * most recently focused, or the {@link editor} if the body was
	     * most recently focused.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_FOCUSED_INPUT_WIDGET_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_FOCUSED_INPUT_WIDGET_PROPERTY] = g_param_spec_object ("focused-input-widget", "focused-input-widget", "focused-input-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Determines if the composer can send the message. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_CAN_SEND_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_CAN_SEND_PROPERTY] = g_param_spec_boolean ("can-send", "can-send", "can-send", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/** Currently selected sender mailbox. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_FROM_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_FROM_PROPERTY] = g_param_spec_object ("from", "from", "from", GEARY_RF_C822_TYPE_MAILBOX_ADDRESSES, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Current text of the `to` entry. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_TO_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_TO_PROPERTY] = g_param_spec_string ("to", "to", "to", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Current text of the `cc` entry. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_CC_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_CC_PROPERTY] = g_param_spec_string ("cc", "cc", "cc", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Current text of the `bcc` entry. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_BCC_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_BCC_PROPERTY] = g_param_spec_string ("bcc", "bcc", "bcc", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Current text of the `reply-to` entry. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_REPLY_TO_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_REPLY_TO_PROPERTY] = g_param_spec_string ("reply-to", "reply-to", "reply-to", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Current text of the `sender` entry. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_SUBJECT_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_SUBJECT_PROPERTY] = g_param_spec_string ("subject", "subject", "subject", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** The In-Reply-To header value for the composed email, if any. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_IN_REPLY_TO_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_IN_REPLY_TO_PROPERTY] = g_param_spec_object ("in-reply-to", "in-reply-to", "in-reply-to", GEARY_RF_C822_TYPE_MESSAGE_ID_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** The References header value for the composed email, if any. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_REFERENCES_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_REFERENCES_PROPERTY] = g_param_spec_object ("references", "references", "references", GEARY_RF_C822_TYPE_MESSAGE_ID_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Overrides for the draft folder as save destination, if any. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_SAVE_TO_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_SAVE_TO_PROPERTY] = g_param_spec_object ("save-to", "save-to", "save-to", GEARY_TYPE_FOLDER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HEADER_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_HEADER_PROPERTY] = g_param_spec_object ("header", "header", "header", COMPOSER_TYPE_HEADERBAR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPOSER_WIDGET_HAS_MULTIPLE_FROM_ADDRESSES_PROPERTY, composer_widget_properties[COMPOSER_WIDGET_HAS_MULTIPLE_FROM_ADDRESSES_PROPERTY] = g_param_spec_boolean ("has-multiple-from-addresses", "has-multiple-from-addresses", "has-multiple-from-addresses", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Geary/composer-widget.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "header_container", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, header_container));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "editor_container", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, editor_container));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "email_headers", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, email_headers));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filled_headers", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, filled_headers));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "extended_headers_revealer", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, extended_headers_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "extended_headers", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, extended_headers));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "show_extended_headers", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, show_extended_headers));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "attachments_box", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, attachments_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "hidden_on_attachment_drag_over", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, hidden_on_attachment_drag_over));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "visible_on_attachment_drag_over", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, visible_on_attachment_drag_over));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "hidden_on_attachment_drag_over_child", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, hidden_on_attachment_drag_over_child));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "visible_on_attachment_drag_over_child", FALSE, ComposerWidget_private_offset + G_STRUCT_OFFSET (ComposerWidgetPrivate, visible_on_attachment_drag_over_child));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_set_focus_child", G_CALLBACK(_composer_widget_on_set_focus_child_gtk_container_set_focus_child));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_drag_motion", G_CALLBACK(_composer_widget_on_drag_motion_gtk_widget_drag_motion));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_drag_leave", G_CALLBACK(_composer_widget_on_drag_leave_gtk_widget_drag_leave));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_drag_data_received", G_CALLBACK(_composer_widget_on_drag_data_received_gtk_widget_drag_data_received));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_drag_drop", G_CALLBACK(_composer_widget_on_drag_drop_gtk_widget_drag_drop));
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "geary-composer-widget");
}

static void
composer_widget_geary_base_interface_interface_init (GearyBaseInterfaceIface * iface,
                                                     gpointer iface_data)
{
	composer_widget_geary_base_interface_parent_iface = g_type_interface_peek_parent (iface);
}

static void
composer_widget_instance_init (ComposerWidget * self,
                               gpointer klass)
{
	GearyRFC822MessageIDList* _tmp0_;
	GearyRFC822MessageIDList* _tmp1_;
	GeeArrayList* _tmp2_;
	GtkSizeGroup* _tmp3_;
	GspellChecker* _tmp4_;
	GSimpleActionGroup* _tmp5_;
	GeeHashSet* _tmp6_;
	GeeHashSet* _tmp7_;
	GeeHashMap* _tmp8_;
	GeeHashMap* _tmp9_;
	gchar* _tmp10_;
	self->priv = composer_widget_get_instance_private (self);
	self->priv->_saved_id = NULL;
	self->priv->_context_type = COMPOSER_WIDGET_CONTEXT_TYPE_NONE;
	self->priv->_current_mode = COMPOSER_WIDGET_PRESENTATION_MODE_NONE;
	self->priv->_focused_input_widget = NULL;
	self->priv->_can_send = TRUE;
	_tmp0_ = geary_rf_c822_message_id_list_new (NULL);
	self->priv->_in_reply_to = _tmp0_;
	_tmp1_ = geary_rf_c822_message_id_list_new (NULL);
	self->priv->_references = _tmp1_;
	self->priv->_save_to = NULL;
	_tmp2_ = gee_array_list_new (COMPOSER_WIDGET_TYPE_FROM_ADDRESS_MAP, (GBoxedCopyFunc) composer_widget_from_address_map_ref, (GDestroyNotify) composer_widget_from_address_map_unref, NULL, NULL, NULL);
	self->priv->from_list = _tmp2_;
	_tmp3_ = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	self->priv->header_labels_group = _tmp3_;
	_tmp4_ = gspell_checker_new (NULL);
	self->priv->subject_spell_checker = _tmp4_;
	_tmp5_ = g_simple_action_group_new ();
	self->priv->actions = _tmp5_;
	self->priv->is_attachment_overlay_visible = FALSE;
	self->priv->top_posting = TRUE;
	_tmp6_ = gee_hash_set_new (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->referred_ids = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_SET, GeeSet);
	self->priv->pending_attachments = NULL;
	self->priv->pending_include = COMPOSER_WIDGET_ATTACH_PENDING_INLINE_ONLY;
	_tmp7_ = gee_hash_set_new (g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _geary_files_nullable_hash_gee_hash_data_func, NULL, NULL, _geary_files_nullable_equal_gee_equal_data_func, NULL, NULL);
	self->priv->attached_files = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_SET, GeeSet);
	_tmp8_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GEARY_MEMORY_TYPE_BUFFER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->inline_files = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_MAP, GeeMap);
	_tmp9_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GEARY_MEMORY_TYPE_BUFFER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->cid_files = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_MAP, GeeMap);
	self->priv->draft_manager = NULL;
	self->priv->draft_manager_opening = NULL;
	self->priv->is_draft_saved = FALSE;
	_tmp10_ = g_strdup ("");
	self->priv->_draft_status_text = _tmp10_;
	self->priv->_can_delete_quote = FALSE;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
composer_widget_finalize (GObject * obj)
{
	ComposerWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, COMPOSER_TYPE_WIDGET, ComposerWidget);
	geary_base_interface_base_unref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_g_object_unref0 (self->priv->_sender_context);
	_g_object_unref0 (self->priv->_saved_id);
	_g_object_unref0 (self->priv->_editor);
	_g_object_unref0 (self->priv->_focused_input_widget);
	_g_object_unref0 (self->priv->_from);
	_g_object_unref0 (self->priv->_in_reply_to);
	_g_object_unref0 (self->priv->_references);
	_g_object_unref0 (self->priv->_save_to);
	_g_object_unref0 (self->priv->_header);
	_g_object_unref0 (self->priv->from_list);
	_g_object_unref0 (self->priv->header_labels_group);
	_g_object_unref0 (self->priv->from_row);
	_g_object_unref0 (self->priv->to_row);
	_g_object_unref0 (self->priv->cc_row);
	_g_object_unref0 (self->priv->bcc_row);
	_g_object_unref0 (self->priv->reply_to_row);
	_g_object_unref0 (self->priv->subject_row);
	_g_object_unref0 (self->priv->subject_spell_checker);
	_g_object_unref0 (self->priv->subject_spell_entry);
	_g_object_unref0 (self->priv->actions);
	_g_object_unref0 (self->priv->referred_ids);
	_g_object_unref0 (self->priv->pending_attachments);
	_g_object_unref0 (self->priv->attached_files);
	_g_object_unref0 (self->priv->inline_files);
	_g_object_unref0 (self->priv->cid_files);
	_g_object_unref0 (self->priv->draft_manager);
	_g_object_unref0 (self->priv->draft_manager_opening);
	_g_object_unref0 (self->priv->draft_timer);
	_g_free0 (self->priv->_draft_status_text);
	_g_object_unref0 (self->priv->application);
	_g_object_unref0 (self->priv->config);
	G_OBJECT_CLASS (composer_widget_parent_class)->finalize (obj);
}

/**
 * A widget for editing an email message.
 *
 * Composers must always be placed in an instance of {@link
 * Container}.
 */
static GType
composer_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ComposerWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) composer_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComposerWidget), 0, (GInstanceInitFunc) composer_widget_instance_init, NULL };
	static const GInterfaceInfo geary_base_interface_info = { (GInterfaceInitFunc) composer_widget_geary_base_interface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType composer_widget_type_id;
	composer_widget_type_id = g_type_register_static (gtk_event_box_get_type (), "ComposerWidget", &g_define_type_info, 0);
	g_type_add_interface_static (composer_widget_type_id, GEARY_TYPE_BASE_INTERFACE, &geary_base_interface_info);
	ComposerWidget_private_offset = g_type_add_instance_private (composer_widget_type_id, sizeof (ComposerWidgetPrivate));
	return composer_widget_type_id;
}

GType
composer_widget_get_type (void)
{
	static volatile gsize composer_widget_type_id__once = 0;
	if (g_once_init_enter (&composer_widget_type_id__once)) {
		GType composer_widget_type_id;
		composer_widget_type_id = composer_widget_get_type_once ();
		g_once_init_leave (&composer_widget_type_id__once, composer_widget_type_id);
	}
	return composer_widget_type_id__once;
}

static void
_vala_composer_widget_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	ComposerWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPOSER_TYPE_WIDGET, ComposerWidget);
	switch (property_id) {
		case COMPOSER_WIDGET_SENDER_CONTEXT_PROPERTY:
		g_value_set_object (value, composer_widget_get_sender_context (self));
		break;
		case COMPOSER_WIDGET_SAVED_ID_PROPERTY:
		g_value_set_object (value, composer_widget_get_saved_id (self));
		break;
		case COMPOSER_WIDGET_CONTEXT_TYPE_PROPERTY:
		g_value_set_enum (value, composer_widget_get_context_type (self));
		break;
		case COMPOSER_WIDGET_CURRENT_MODE_PROPERTY:
		g_value_set_enum (value, composer_widget_get_current_mode (self));
		break;
		case COMPOSER_WIDGET_IS_BLANK_PROPERTY:
		g_value_set_boolean (value, composer_widget_get_is_blank (self));
		break;
		case COMPOSER_WIDGET_EDITOR_PROPERTY:
		g_value_set_object (value, composer_widget_get_editor (self));
		break;
		case COMPOSER_WIDGET_FOCUSED_INPUT_WIDGET_PROPERTY:
		g_value_set_object (value, composer_widget_get_focused_input_widget (self));
		break;
		case COMPOSER_WIDGET_CAN_SEND_PROPERTY:
		g_value_set_boolean (value, composer_widget_get_can_send (self));
		break;
		case COMPOSER_WIDGET_FROM_PROPERTY:
		g_value_set_object (value, composer_widget_get_from (self));
		break;
		case COMPOSER_WIDGET_TO_PROPERTY:
		g_value_set_string (value, composer_widget_get_to (self));
		break;
		case COMPOSER_WIDGET_CC_PROPERTY:
		g_value_set_string (value, composer_widget_get_cc (self));
		break;
		case COMPOSER_WIDGET_BCC_PROPERTY:
		g_value_set_string (value, composer_widget_get_bcc (self));
		break;
		case COMPOSER_WIDGET_REPLY_TO_PROPERTY:
		g_value_set_string (value, composer_widget_get_reply_to (self));
		break;
		case COMPOSER_WIDGET_SUBJECT_PROPERTY:
		g_value_set_string (value, composer_widget_get_subject (self));
		break;
		case COMPOSER_WIDGET_IN_REPLY_TO_PROPERTY:
		g_value_set_object (value, composer_widget_get_in_reply_to (self));
		break;
		case COMPOSER_WIDGET_REFERENCES_PROPERTY:
		g_value_set_object (value, composer_widget_get_references (self));
		break;
		case COMPOSER_WIDGET_SAVE_TO_PROPERTY:
		g_value_set_object (value, composer_widget_get_save_to (self));
		break;
		case COMPOSER_WIDGET_HEADER_PROPERTY:
		g_value_set_object (value, composer_widget_get_header (self));
		break;
		case COMPOSER_WIDGET_HAS_MULTIPLE_FROM_ADDRESSES_PROPERTY:
		g_value_set_boolean (value, composer_widget_get_has_multiple_from_addresses (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_composer_widget_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	ComposerWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPOSER_TYPE_WIDGET, ComposerWidget);
	switch (property_id) {
		case COMPOSER_WIDGET_SENDER_CONTEXT_PROPERTY:
		composer_widget_set_sender_context (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_SAVED_ID_PROPERTY:
		composer_widget_set_saved_id (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_CONTEXT_TYPE_PROPERTY:
		composer_widget_set_context_type (self, g_value_get_enum (value));
		break;
		case COMPOSER_WIDGET_CURRENT_MODE_PROPERTY:
		composer_widget_set_current_mode (self, g_value_get_enum (value));
		break;
		case COMPOSER_WIDGET_EDITOR_PROPERTY:
		composer_widget_set_editor (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_FOCUSED_INPUT_WIDGET_PROPERTY:
		composer_widget_set_focused_input_widget (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_CAN_SEND_PROPERTY:
		composer_widget_set_can_send (self, g_value_get_boolean (value));
		break;
		case COMPOSER_WIDGET_FROM_PROPERTY:
		composer_widget_set_from (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_TO_PROPERTY:
		composer_widget_set_to (self, g_value_get_string (value));
		break;
		case COMPOSER_WIDGET_CC_PROPERTY:
		composer_widget_set_cc (self, g_value_get_string (value));
		break;
		case COMPOSER_WIDGET_BCC_PROPERTY:
		composer_widget_set_bcc (self, g_value_get_string (value));
		break;
		case COMPOSER_WIDGET_REPLY_TO_PROPERTY:
		composer_widget_set_reply_to (self, g_value_get_string (value));
		break;
		case COMPOSER_WIDGET_SUBJECT_PROPERTY:
		composer_widget_set_subject (self, g_value_get_string (value));
		break;
		case COMPOSER_WIDGET_IN_REPLY_TO_PROPERTY:
		composer_widget_set_in_reply_to (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_REFERENCES_PROPERTY:
		composer_widget_set_references (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_SAVE_TO_PROPERTY:
		composer_widget_set_save_to (self, g_value_get_object (value));
		break;
		case COMPOSER_WIDGET_HEADER_PROPERTY:
		composer_widget_set_header (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

