/* deleter.c generated by valac 0.56.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 "seahorse-common.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>

enum  {
	SEAHORSE_DELETER_0_PROPERTY,
	SEAHORSE_DELETER_NUM_PROPERTIES
};
static GParamSpec* seahorse_deleter_properties[SEAHORSE_DELETER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer seahorse_deleter_parent_class = NULL;

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 GType seahorse_deleter_get_type_once (void);

static GtkDialog*
seahorse_deleter_real_create_confirm (SeahorseDeleter* self,
                                      GtkWindow* parent)
{
	g_critical ("Type `%s' does not implement abstract method `seahorse_deleter_create_confirm'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

GtkDialog*
seahorse_deleter_create_confirm (SeahorseDeleter* self,
                                 GtkWindow* parent)
{
	SeahorseDeleterClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = SEAHORSE_DELETER_GET_CLASS (self);
	if (_klass_->create_confirm) {
		return _klass_->create_confirm (self, parent);
	}
	return NULL;
}

static GList*
seahorse_deleter_real_get_objects (SeahorseDeleter* self)
{
	g_critical ("Type `%s' does not implement abstract method `seahorse_deleter_get_objects'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

GList*
seahorse_deleter_get_objects (SeahorseDeleter* self)
{
	SeahorseDeleterClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = SEAHORSE_DELETER_GET_CLASS (self);
	if (_klass_->get_objects) {
		return _klass_->get_objects (self);
	}
	return NULL;
}

static gboolean
seahorse_deleter_real_add_object (SeahorseDeleter* self,
                                  GObject* obj)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `seahorse_deleter_add_object'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
seahorse_deleter_add_object (SeahorseDeleter* self,
                             GObject* obj)
{
	SeahorseDeleterClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = SEAHORSE_DELETER_GET_CLASS (self);
	if (_klass_->add_object) {
		return _klass_->add_object (self, obj);
	}
	return FALSE;
}

void
seahorse_deleter_delete (SeahorseDeleter* self,
                         GCancellable* cancellable,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	SeahorseDeleterClass* _klass_;
	_klass_ = SEAHORSE_DELETER_GET_CLASS (self);
	if (_klass_->delete) {
		_klass_->delete (self, cancellable, _callback_, _user_data_);
	}
}

gboolean
seahorse_deleter_delete_finish (SeahorseDeleter* self,
                                GAsyncResult* _res_,
                                GError** error)
{
	SeahorseDeleterClass* _klass_;
	_klass_ = SEAHORSE_DELETER_GET_CLASS (self);
	if (_klass_->delete_finish) {
		return _klass_->delete_finish (self, _res_, error);
	}
	return FALSE;
}

gboolean
seahorse_deleter_prompt (SeahorseDeleter* self,
                         GtkWindow* parent)
{
	GtkDialog* prompt = NULL;
	GtkDialog* _tmp0_;
	gint res = 0;
	GtkDialog* _tmp1_;
	GtkDialog* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = seahorse_deleter_create_confirm (self, parent);
	prompt = _tmp0_;
	_tmp1_ = prompt;
	res = gtk_dialog_run (_tmp1_);
	_tmp2_ = prompt;
	gtk_widget_destroy ((GtkWidget*) _tmp2_);
	if (res == ((gint) GTK_RESPONSE_OK)) {
		_tmp3_ = TRUE;
	} else {
		_tmp3_ = res == ((gint) GTK_RESPONSE_ACCEPT);
	}
	result = _tmp3_;
	_g_object_unref0 (prompt);
	return result;
}

SeahorseDeleter*
seahorse_deleter_construct (GType object_type)
{
	SeahorseDeleter * self = NULL;
	self = (SeahorseDeleter*) g_object_new (object_type, NULL);
	return self;
}

static void
seahorse_deleter_class_init (SeahorseDeleterClass * klass,
                             gpointer klass_data)
{
	seahorse_deleter_parent_class = g_type_class_peek_parent (klass);
	((SeahorseDeleterClass *) klass)->create_confirm = (GtkDialog* (*) (SeahorseDeleter*, GtkWindow*)) seahorse_deleter_real_create_confirm;
	((SeahorseDeleterClass *) klass)->get_objects = (GList* (*) (SeahorseDeleter*)) seahorse_deleter_real_get_objects;
	((SeahorseDeleterClass *) klass)->add_object = (gboolean (*) (SeahorseDeleter*, GObject*)) seahorse_deleter_real_add_object;
}

static void
seahorse_deleter_instance_init (SeahorseDeleter * self,
                                gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
seahorse_deleter_get_type_once (void)
{
	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);
	return seahorse_deleter_type_id;
}

GType
seahorse_deleter_get_type (void)
{
	static volatile gsize seahorse_deleter_type_id__once = 0;
	if (g_once_init_enter (&seahorse_deleter_type_id__once)) {
		GType seahorse_deleter_type_id;
		seahorse_deleter_type_id = seahorse_deleter_get_type_once ();
		g_once_init_leave (&seahorse_deleter_type_id__once, seahorse_deleter_type_id);
	}
	return seahorse_deleter_type_id__once;
}

