/* deleter.c generated by valac 0.22.1, the Vala compiler
 * generated from 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, see <http://www.gnu.org/licenses/>.
 *
 * 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 25 "/data/src/seahorse/common/deleter.vala"
	g_critical ("Type `%s' does not implement abstract method `seahorse_deleter_create_confirm'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 25 "/data/src/seahorse/common/deleter.vala"
	return NULL;
#line 50 "deleter.c"
}


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


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


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


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


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


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


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


gboolean seahorse_deleter_prompt (SeahorseDeleter* self, GtkWindow* parent) {
	gboolean result = FALSE;
	GtkDialog* prompt = NULL;
	GtkWindow* _tmp0_ = NULL;
	GtkDialog* _tmp1_ = NULL;
	gint res = 0;
	GtkDialog* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GtkDialog* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gint _tmp6_ = 0;
	gboolean _tmp8_ = FALSE;
#line 33 "/data/src/seahorse/common/deleter.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 34 "/data/src/seahorse/common/deleter.vala"
	_tmp0_ = parent;
#line 34 "/data/src/seahorse/common/deleter.vala"
	_tmp1_ = seahorse_deleter_create_confirm (self, _tmp0_);
#line 34 "/data/src/seahorse/common/deleter.vala"
	prompt = _tmp1_;
#line 35 "/data/src/seahorse/common/deleter.vala"
	_tmp2_ = prompt;
#line 35 "/data/src/seahorse/common/deleter.vala"
	_tmp3_ = gtk_dialog_run (_tmp2_);
#line 35 "/data/src/seahorse/common/deleter.vala"
	res = _tmp3_;
#line 36 "/data/src/seahorse/common/deleter.vala"
	_tmp4_ = prompt;
#line 36 "/data/src/seahorse/common/deleter.vala"
	gtk_widget_destroy ((GtkWidget*) _tmp4_);
#line 37 "/data/src/seahorse/common/deleter.vala"
	_tmp6_ = res;
#line 37 "/data/src/seahorse/common/deleter.vala"
	if (_tmp6_ == ((gint) GTK_RESPONSE_OK)) {
#line 37 "/data/src/seahorse/common/deleter.vala"
		_tmp5_ = TRUE;
#line 149 "deleter.c"
	} else {
		gint _tmp7_ = 0;
#line 37 "/data/src/seahorse/common/deleter.vala"
		_tmp7_ = res;
#line 37 "/data/src/seahorse/common/deleter.vala"
		_tmp5_ = _tmp7_ == ((gint) GTK_RESPONSE_ACCEPT);
#line 156 "deleter.c"
	}
#line 37 "/data/src/seahorse/common/deleter.vala"
	_tmp8_ = _tmp5_;
#line 37 "/data/src/seahorse/common/deleter.vala"
	result = _tmp8_;
#line 37 "/data/src/seahorse/common/deleter.vala"
	_g_object_unref0 (prompt);
#line 37 "/data/src/seahorse/common/deleter.vala"
	return result;
#line 166 "deleter.c"
}


SeahorseDeleter* seahorse_deleter_construct (GType object_type) {
	SeahorseDeleter * self = NULL;
#line 24 "/data/src/seahorse/common/deleter.vala"
	self = (SeahorseDeleter*) g_object_new (object_type, NULL);
#line 24 "/data/src/seahorse/common/deleter.vala"
	return self;
#line 176 "deleter.c"
}


static void seahorse_deleter_class_init (SeahorseDeleterClass * klass) {
#line 24 "/data/src/seahorse/common/deleter.vala"
	seahorse_deleter_parent_class = g_type_class_peek_parent (klass);
#line 24 "/data/src/seahorse/common/deleter.vala"
	SEAHORSE_DELETER_CLASS (klass)->create_confirm = seahorse_deleter_real_create_confirm;
#line 24 "/data/src/seahorse/common/deleter.vala"
	SEAHORSE_DELETER_CLASS (klass)->get_objects = seahorse_deleter_real_get_objects;
#line 24 "/data/src/seahorse/common/deleter.vala"
	SEAHORSE_DELETER_CLASS (klass)->add_object = seahorse_deleter_real_add_object;
#line 189 "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;
}



