/* seahorse-deleter.c generated by valac 0.20.1, the Vala compiler
 * generated from seahorse-deleter.vala, do not modify */

/*
 * Seahorse
 *
 * Copyright (C) 2011 Collabora Ltd.
 * Copyright (C) 2012 Stefan Walter
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the
 * Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: Stef Walter <stefw@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include "seahorse-common.h"
#include <gtk/gtk.h>
#include <gio/gio.h>

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))


static gpointer seahorse_deleter_parent_class = NULL;

enum  {
	SEAHORSE_DELETER_DUMMY_PROPERTY
};
static GtkDialog* seahorse_deleter_real_create_confirm (SeahorseDeleter* self, GtkWindow* parent);
static GList* seahorse_deleter_real_get_objects (SeahorseDeleter* self);
static gboolean seahorse_deleter_real_add_object (SeahorseDeleter* self, GObject* obj);


static GtkDialog* seahorse_deleter_real_create_confirm (SeahorseDeleter* self, GtkWindow* parent) {
#line 28 "/data/projects/seahorse/common/seahorse-deleter.vala"
	g_critical ("Type `%s' does not implement abstract method `seahorse_deleter_create_confirm'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 28 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return NULL;
#line 53 "seahorse-deleter.c"
}


GtkDialog* seahorse_deleter_create_confirm (SeahorseDeleter* self, GtkWindow* parent) {
#line 28 "/data/projects/seahorse/common/seahorse-deleter.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 28 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return SEAHORSE_DELETER_GET_CLASS (self)->create_confirm (self, parent);
#line 62 "seahorse-deleter.c"
}


static GList* seahorse_deleter_real_get_objects (SeahorseDeleter* self) {
#line 30 "/data/projects/seahorse/common/seahorse-deleter.vala"
	g_critical ("Type `%s' does not implement abstract method `seahorse_deleter_get_objects'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 30 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return NULL;
#line 71 "seahorse-deleter.c"
}


GList* seahorse_deleter_get_objects (SeahorseDeleter* self) {
#line 30 "/data/projects/seahorse/common/seahorse-deleter.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 30 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return SEAHORSE_DELETER_GET_CLASS (self)->get_objects (self);
#line 80 "seahorse-deleter.c"
}


static gboolean seahorse_deleter_real_add_object (SeahorseDeleter* self, GObject* obj) {
#line 32 "/data/projects/seahorse/common/seahorse-deleter.vala"
	g_critical ("Type `%s' does not implement abstract method `seahorse_deleter_add_object'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 32 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return FALSE;
#line 89 "seahorse-deleter.c"
}


gboolean seahorse_deleter_add_object (SeahorseDeleter* self, GObject* obj) {
#line 32 "/data/projects/seahorse/common/seahorse-deleter.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 32 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return SEAHORSE_DELETER_GET_CLASS (self)->add_object (self, obj);
#line 98 "seahorse-deleter.c"
}


void seahorse_deleter_delete (SeahorseDeleter* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	SEAHORSE_DELETER_GET_CLASS (self)->delete (self, cancellable, _callback_, _user_data_);
#line 105 "seahorse-deleter.c"
}


gboolean seahorse_deleter_delete_finish (SeahorseDeleter* self, GAsyncResult* _res_, GError** error) {
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return SEAHORSE_DELETER_GET_CLASS (self)->delete_finish (self, _res_, error);
#line 112 "seahorse-deleter.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 37 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return self ? g_object_ref (self) : NULL;
#line 119 "seahorse-deleter.c"
}


gboolean seahorse_deleter_prompt (SeahorseDeleter* self, GtkWindow* parent) {
	gboolean result = FALSE;
	GtkWindow* _tmp0_;
	GtkDialog* _tmp1_ = NULL;
	GtkDialog* _tmp2_;
	GtkDialog* prompt;
	GtkDialog* _tmp3_;
	gint _tmp4_ = 0;
	gint res;
	GtkDialog* _tmp5_;
	gboolean _tmp6_ = FALSE;
	gint _tmp7_;
	gboolean _tmp9_;
#line 36 "/data/projects/seahorse/common/seahorse-deleter.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 37 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp0_ = parent;
#line 37 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp1_ = seahorse_deleter_create_confirm (self, _tmp0_);
#line 37 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 37 "/data/projects/seahorse/common/seahorse-deleter.vala"
	prompt = _tmp2_;
#line 38 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp3_ = prompt;
#line 38 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp4_ = gtk_dialog_run (_tmp3_);
#line 38 "/data/projects/seahorse/common/seahorse-deleter.vala"
	res = _tmp4_;
#line 39 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp5_ = prompt;
#line 39 "/data/projects/seahorse/common/seahorse-deleter.vala"
	gtk_widget_destroy ((GtkWidget*) _tmp5_);
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp7_ = res;
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
	if (_tmp7_ == ((gint) GTK_RESPONSE_OK)) {
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
		_tmp6_ = TRUE;
#line 162 "seahorse-deleter.c"
	} else {
		gint _tmp8_;
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
		_tmp8_ = res;
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
		_tmp6_ = _tmp8_ == ((gint) GTK_RESPONSE_ACCEPT);
#line 169 "seahorse-deleter.c"
	}
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_tmp9_ = _tmp6_;
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
	result = _tmp9_;
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
	_g_object_unref0 (prompt);
#line 40 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return result;
#line 179 "seahorse-deleter.c"
}


SeahorseDeleter* seahorse_deleter_construct (GType object_type) {
	SeahorseDeleter * self = NULL;
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	self = (SeahorseDeleter*) g_object_new (object_type, NULL);
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	return self;
#line 189 "seahorse-deleter.c"
}


static void seahorse_deleter_class_init (SeahorseDeleterClass * klass) {
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	seahorse_deleter_parent_class = g_type_class_peek_parent (klass);
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	SEAHORSE_DELETER_CLASS (klass)->create_confirm = seahorse_deleter_real_create_confirm;
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	SEAHORSE_DELETER_CLASS (klass)->get_objects = seahorse_deleter_real_get_objects;
#line 27 "/data/projects/seahorse/common/seahorse-deleter.vala"
	SEAHORSE_DELETER_CLASS (klass)->add_object = seahorse_deleter_real_add_object;
#line 202 "seahorse-deleter.c"
}


static void seahorse_deleter_instance_init (SeahorseDeleter * self) {
}


GType seahorse_deleter_get_type (void) {
	static volatile gsize seahorse_deleter_type_id__volatile = 0;
	if (g_once_init_enter (&seahorse_deleter_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SeahorseDeleterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_deleter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorseDeleter), 0, (GInstanceInitFunc) seahorse_deleter_instance_init, NULL };
		GType seahorse_deleter_type_id;
		seahorse_deleter_type_id = g_type_register_static (G_TYPE_OBJECT, "SeahorseDeleter", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&seahorse_deleter_type_id__volatile, seahorse_deleter_type_id);
	}
	return seahorse_deleter_type_id__volatile;
}



