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

#include "protonplus_core.h"
#include <glib.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <string.h>

#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

enum  {
	PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_0_PROPERTY,
	PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_installation_workflow_properties[PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_NUM_PROPERTIES];

static gpointer proton_plus_services_installation_workflow_parent_class = NULL;

static ProtonPlusReturnCode proton_plus_services_installation_workflow_real_validate_install (ProtonPlusServicesInstallationWorkflow* self,
                                                                                       ProtonPlusServicesInstallJob* job,
                                                                                       gboolean replace_existing);
static void proton_plus_services_installation_workflow_real_refresh_state (ProtonPlusServicesInstallationWorkflow* self,
                                                                    ProtonPlusServicesInstallJob* job);
static void proton_plus_services_installation_workflow_real_finalize_install_success (ProtonPlusServicesInstallationWorkflow* self,
                                                                               ProtonPlusServicesInstallJob* job);
static void proton_plus_services_installation_workflow_real_finalize_removal_success (ProtonPlusServicesInstallationWorkflow* self,
                                                                               ProtonPlusServicesInstallJob* job);
static GType proton_plus_services_installation_workflow_get_type_once (void);
static GType proton_plus_services_installation_operation_coordinator_get_type_once (void);
static GType proton_plus_services_installation_lifecycle_recorder_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static ProtonPlusReturnCode
proton_plus_services_installation_workflow_real_validate_install (ProtonPlusServicesInstallationWorkflow* self,
                                                                  ProtonPlusServicesInstallJob* job,
                                                                  gboolean replace_existing)
{
	g_critical ("Type `%s' does not implement abstract method `proton_plus_services_installation_workflow_validate_install'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return 0;
}

ProtonPlusReturnCode
proton_plus_services_installation_workflow_validate_install (ProtonPlusServicesInstallationWorkflow* self,
                                                             ProtonPlusServicesInstallJob* job,
                                                             gboolean replace_existing)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	g_return_val_if_fail (self != NULL, 0);
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->validate_install) {
		return _klass_->validate_install (self, job, replace_existing);
	}
	return 0;
}

void
proton_plus_services_installation_workflow_install (ProtonPlusServicesInstallationWorkflow* self,
                                                    ProtonPlusServicesInstallJob* job,
                                                    gboolean replace_existing,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->install) {
		_klass_->install (self, job, replace_existing, _callback_, _user_data_);
	}
}

ProtonPlusReturnCode
proton_plus_services_installation_workflow_install_finish (ProtonPlusServicesInstallationWorkflow* self,
                                                           GAsyncResult* _res_)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->install_finish) {
		return _klass_->install_finish (self, _res_);
	}
	return 0;
}

void
proton_plus_services_installation_workflow_update (ProtonPlusServicesInstallationWorkflow* self,
                                                   ProtonPlusServicesInstallJob* job,
                                                   ProtonPlusServicesInstallationOperationCoordinator* coordinator,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->update) {
		_klass_->update (self, job, coordinator, _callback_, _user_data_);
	}
}

ProtonPlusReturnCode
proton_plus_services_installation_workflow_update_finish (ProtonPlusServicesInstallationWorkflow* self,
                                                          GAsyncResult* _res_)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->update_finish) {
		return _klass_->update_finish (self, _res_);
	}
	return 0;
}

void
proton_plus_services_installation_workflow_remove (ProtonPlusServicesInstallationWorkflow* self,
                                                   ProtonPlusServicesInstallJob* job,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->remove) {
		_klass_->remove (self, job, _callback_, _user_data_);
	}
}

ProtonPlusReturnCode
proton_plus_services_installation_workflow_remove_finish (ProtonPlusServicesInstallationWorkflow* self,
                                                          GAsyncResult* _res_)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->remove_finish) {
		return _klass_->remove_finish (self, _res_);
	}
	return 0;
}

static void
proton_plus_services_installation_workflow_real_refresh_state (ProtonPlusServicesInstallationWorkflow* self,
                                                               ProtonPlusServicesInstallJob* job)
{
	g_critical ("Type `%s' does not implement abstract method `proton_plus_services_installation_workflow_refresh_state'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
proton_plus_services_installation_workflow_refresh_state (ProtonPlusServicesInstallationWorkflow* self,
                                                          ProtonPlusServicesInstallJob* job)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->refresh_state) {
		_klass_->refresh_state (self, job);
	}
}

static void
proton_plus_services_installation_workflow_real_finalize_install_success (ProtonPlusServicesInstallationWorkflow* self,
                                                                          ProtonPlusServicesInstallJob* job)
{
	g_return_if_fail (job != NULL);
}

void
proton_plus_services_installation_workflow_finalize_install_success (ProtonPlusServicesInstallationWorkflow* self,
                                                                     ProtonPlusServicesInstallJob* job)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->finalize_install_success) {
		_klass_->finalize_install_success (self, job);
	}
}

static void
proton_plus_services_installation_workflow_real_finalize_removal_success (ProtonPlusServicesInstallationWorkflow* self,
                                                                          ProtonPlusServicesInstallJob* job)
{
	g_return_if_fail (job != NULL);
}

void
proton_plus_services_installation_workflow_finalize_removal_success (ProtonPlusServicesInstallationWorkflow* self,
                                                                     ProtonPlusServicesInstallJob* job)
{
	ProtonPlusServicesInstallationWorkflowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PROTON_PLUS_SERVICES_INSTALLATION_WORKFLOW_GET_CLASS (self);
	if (_klass_->finalize_removal_success) {
		_klass_->finalize_removal_success (self, job);
	}
}

ProtonPlusServicesInstallationWorkflow*
proton_plus_services_installation_workflow_construct (GType object_type)
{
	ProtonPlusServicesInstallationWorkflow * self = NULL;
	self = (ProtonPlusServicesInstallationWorkflow*) g_object_new (object_type, NULL);
	return self;
}

static void
proton_plus_services_installation_workflow_class_init (ProtonPlusServicesInstallationWorkflowClass * klass,
                                                       gpointer klass_data)
{
	proton_plus_services_installation_workflow_parent_class = g_type_class_peek_parent (klass);
	((ProtonPlusServicesInstallationWorkflowClass *) klass)->validate_install = (ProtonPlusReturnCode (*) (ProtonPlusServicesInstallationWorkflow*, ProtonPlusServicesInstallJob*, gboolean)) proton_plus_services_installation_workflow_real_validate_install;
	((ProtonPlusServicesInstallationWorkflowClass *) klass)->refresh_state = (void (*) (ProtonPlusServicesInstallationWorkflow*, ProtonPlusServicesInstallJob*)) proton_plus_services_installation_workflow_real_refresh_state;
	((ProtonPlusServicesInstallationWorkflowClass *) klass)->finalize_install_success = (void (*) (ProtonPlusServicesInstallationWorkflow*, ProtonPlusServicesInstallJob*)) proton_plus_services_installation_workflow_real_finalize_install_success;
	((ProtonPlusServicesInstallationWorkflowClass *) klass)->finalize_removal_success = (void (*) (ProtonPlusServicesInstallationWorkflow*, ProtonPlusServicesInstallJob*)) proton_plus_services_installation_workflow_real_finalize_removal_success;
}

static void
proton_plus_services_installation_workflow_instance_init (ProtonPlusServicesInstallationWorkflow * self,
                                                          gpointer klass)
{
}

static GType
proton_plus_services_installation_workflow_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesInstallationWorkflowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_installation_workflow_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesInstallationWorkflow), 0, (GInstanceInitFunc) proton_plus_services_installation_workflow_instance_init, NULL };
	GType proton_plus_services_installation_workflow_type_id;
	proton_plus_services_installation_workflow_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesInstallationWorkflow", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return proton_plus_services_installation_workflow_type_id;
}

GType
proton_plus_services_installation_workflow_get_type (void)
{
	static volatile gsize proton_plus_services_installation_workflow_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_installation_workflow_type_id__once)) {
		GType proton_plus_services_installation_workflow_type_id;
		proton_plus_services_installation_workflow_type_id = proton_plus_services_installation_workflow_get_type_once ();
		g_once_init_leave (&proton_plus_services_installation_workflow_type_id__once, proton_plus_services_installation_workflow_type_id);
	}
	return proton_plus_services_installation_workflow_type_id__once;
}

void
proton_plus_services_installation_operation_coordinator_install_for_update (ProtonPlusServicesInstallationOperationCoordinator* self,
                                                                            ProtonPlusServicesInstallJob* job,
                                                                            GAsyncReadyCallback _callback_,
                                                                            gpointer _user_data_)
{
	ProtonPlusServicesInstallationOperationCoordinatorIface* _iface_;
	_iface_ = PROTON_PLUS_SERVICES_INSTALLATION_OPERATION_COORDINATOR_GET_INTERFACE (self);
	if (_iface_->install_for_update) {
		_iface_->install_for_update (self, job, _callback_, _user_data_);
	}
}

ProtonPlusReturnCode
proton_plus_services_installation_operation_coordinator_install_for_update_finish (ProtonPlusServicesInstallationOperationCoordinator* self,
                                                                                   GAsyncResult* _res_)
{
	ProtonPlusServicesInstallationOperationCoordinatorIface* _iface_;
	_iface_ = PROTON_PLUS_SERVICES_INSTALLATION_OPERATION_COORDINATOR_GET_INTERFACE (self);
	if (_iface_->install_for_update_finish) {
		return _iface_->install_for_update_finish (self, _res_);
	}
	return 0;
}

static void
proton_plus_services_installation_operation_coordinator_default_init (ProtonPlusServicesInstallationOperationCoordinatorIface * iface,
                                                                      gpointer iface_data)
{
}

static GType
proton_plus_services_installation_operation_coordinator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesInstallationOperationCoordinatorIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_installation_operation_coordinator_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_services_installation_operation_coordinator_type_id;
	proton_plus_services_installation_operation_coordinator_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusServicesInstallationOperationCoordinator", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_services_installation_operation_coordinator_type_id, G_TYPE_OBJECT);
	return proton_plus_services_installation_operation_coordinator_type_id;
}

GType
proton_plus_services_installation_operation_coordinator_get_type (void)
{
	static volatile gsize proton_plus_services_installation_operation_coordinator_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_installation_operation_coordinator_type_id__once)) {
		GType proton_plus_services_installation_operation_coordinator_type_id;
		proton_plus_services_installation_operation_coordinator_type_id = proton_plus_services_installation_operation_coordinator_get_type_once ();
		g_once_init_leave (&proton_plus_services_installation_operation_coordinator_type_id__once, proton_plus_services_installation_operation_coordinator_type_id);
	}
	return proton_plus_services_installation_operation_coordinator_type_id__once;
}

void
proton_plus_services_installation_lifecycle_recorder_record_completed_update (ProtonPlusServicesInstallationLifecycleRecorder* self,
                                                                              ProtonPlusServicesInstallJob* job)
{
	ProtonPlusServicesInstallationLifecycleRecorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PROTON_PLUS_SERVICES_INSTALLATION_LIFECYCLE_RECORDER_GET_INTERFACE (self);
	if (_iface_->record_completed_update) {
		_iface_->record_completed_update (self, job);
	}
}

static void
proton_plus_services_installation_lifecycle_recorder_default_init (ProtonPlusServicesInstallationLifecycleRecorderIface * iface,
                                                                   gpointer iface_data)
{
}

static GType
proton_plus_services_installation_lifecycle_recorder_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesInstallationLifecycleRecorderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_installation_lifecycle_recorder_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_services_installation_lifecycle_recorder_type_id;
	proton_plus_services_installation_lifecycle_recorder_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusServicesInstallationLifecycleRecorder", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_services_installation_lifecycle_recorder_type_id, G_TYPE_OBJECT);
	return proton_plus_services_installation_lifecycle_recorder_type_id;
}

GType
proton_plus_services_installation_lifecycle_recorder_get_type (void)
{
	static volatile gsize proton_plus_services_installation_lifecycle_recorder_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_installation_lifecycle_recorder_type_id__once)) {
		GType proton_plus_services_installation_lifecycle_recorder_type_id;
		proton_plus_services_installation_lifecycle_recorder_type_id = proton_plus_services_installation_lifecycle_recorder_get_type_once ();
		g_once_init_leave (&proton_plus_services_installation_lifecycle_recorder_type_id__once, proton_plus_services_installation_lifecycle_recorder_type_id);
	}
	return proton_plus_services_installation_lifecycle_recorder_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

