/* mediators_monitor.c generated by valac 0.14.2, the Vala compiler
 * generated from mediators_monitor.vala, do not modify */

/*
 * Copyright (C) 2010-2011 Simon Busch <morphis@gravedo.de>
 *
 * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <fsogsm.h>
#include <gio/gio.h>
#include <freesmartphone.h>


#define TYPE_MSM_MONITOR_GET_SERVING_CELL_INFORMATION (msm_monitor_get_serving_cell_information_get_type ())
#define MSM_MONITOR_GET_SERVING_CELL_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_MONITOR_GET_SERVING_CELL_INFORMATION, MsmMonitorGetServingCellInformation))
#define MSM_MONITOR_GET_SERVING_CELL_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_MONITOR_GET_SERVING_CELL_INFORMATION, MsmMonitorGetServingCellInformationClass))
#define IS_MSM_MONITOR_GET_SERVING_CELL_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_MONITOR_GET_SERVING_CELL_INFORMATION))
#define IS_MSM_MONITOR_GET_SERVING_CELL_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_MONITOR_GET_SERVING_CELL_INFORMATION))
#define MSM_MONITOR_GET_SERVING_CELL_INFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_MONITOR_GET_SERVING_CELL_INFORMATION, MsmMonitorGetServingCellInformationClass))

typedef struct _MsmMonitorGetServingCellInformation MsmMonitorGetServingCellInformation;
typedef struct _MsmMonitorGetServingCellInformationClass MsmMonitorGetServingCellInformationClass;
typedef struct _MsmMonitorGetServingCellInformationPrivate MsmMonitorGetServingCellInformationPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _MsmMonitorGetServingCellInformationRunData MsmMonitorGetServingCellInformationRunData;

#define TYPE_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION (msm_monitor_get_neighbour_cell_information_get_type ())
#define MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION, MsmMonitorGetNeighbourCellInformation))
#define MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION, MsmMonitorGetNeighbourCellInformationClass))
#define IS_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION))
#define IS_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION))
#define MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION, MsmMonitorGetNeighbourCellInformationClass))

typedef struct _MsmMonitorGetNeighbourCellInformation MsmMonitorGetNeighbourCellInformation;
typedef struct _MsmMonitorGetNeighbourCellInformationClass MsmMonitorGetNeighbourCellInformationClass;
typedef struct _MsmMonitorGetNeighbourCellInformationPrivate MsmMonitorGetNeighbourCellInformationPrivate;
typedef struct _MsmMonitorGetNeighbourCellInformationRunData MsmMonitorGetNeighbourCellInformationRunData;

struct _MsmMonitorGetServingCellInformation {
	FsoGsmMonitorGetServingCellInformation parent_instance;
	MsmMonitorGetServingCellInformationPrivate * priv;
};

struct _MsmMonitorGetServingCellInformationClass {
	FsoGsmMonitorGetServingCellInformationClass parent_class;
};

struct _MsmMonitorGetServingCellInformationRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmMonitorGetServingCellInformation* self;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _MsmMonitorGetNeighbourCellInformation {
	FsoGsmMonitorGetNeighbourCellInformation parent_instance;
	MsmMonitorGetNeighbourCellInformationPrivate * priv;
};

struct _MsmMonitorGetNeighbourCellInformationClass {
	FsoGsmMonitorGetNeighbourCellInformationClass parent_class;
};

struct _MsmMonitorGetNeighbourCellInformationRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmMonitorGetNeighbourCellInformation* self;
	GError* _tmp0_;
	GError * _inner_error_;
};


static gpointer msm_monitor_get_serving_cell_information_parent_class = NULL;
static GType msm_monitor_get_serving_cell_information_type_id = 0;
static gpointer msm_monitor_get_neighbour_cell_information_parent_class = NULL;
static GType msm_monitor_get_neighbour_cell_information_type_id = 0;

GType msm_monitor_get_serving_cell_information_get_type (void) G_GNUC_CONST;
GType msm_monitor_get_serving_cell_information_register_type (GTypeModule * module);
enum  {
	MSM_MONITOR_GET_SERVING_CELL_INFORMATION_DUMMY_PROPERTY
};
static void msm_monitor_get_serving_cell_information_real_run_data_free (gpointer _data);
static void msm_monitor_get_serving_cell_information_real_run (FsoGsmMonitorGetServingCellInformation* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_monitor_get_serving_cell_information_real_run_co (MsmMonitorGetServingCellInformationRunData* _data_);
MsmMonitorGetServingCellInformation* msm_monitor_get_serving_cell_information_new (void);
MsmMonitorGetServingCellInformation* msm_monitor_get_serving_cell_information_construct (GType object_type);
GType msm_monitor_get_neighbour_cell_information_get_type (void) G_GNUC_CONST;
GType msm_monitor_get_neighbour_cell_information_register_type (GTypeModule * module);
enum  {
	MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION_DUMMY_PROPERTY
};
static void msm_monitor_get_neighbour_cell_information_real_run_data_free (gpointer _data);
static void msm_monitor_get_neighbour_cell_information_real_run (FsoGsmMonitorGetNeighbourCellInformation* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_monitor_get_neighbour_cell_information_real_run_co (MsmMonitorGetNeighbourCellInformationRunData* _data_);
MsmMonitorGetNeighbourCellInformation* msm_monitor_get_neighbour_cell_information_new (void);
MsmMonitorGetNeighbourCellInformation* msm_monitor_get_neighbour_cell_information_construct (GType object_type);


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


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


static void msm_monitor_get_serving_cell_information_real_run (FsoGsmMonitorGetServingCellInformation* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmMonitorGetServingCellInformation * self;
	MsmMonitorGetServingCellInformationRunData* _data_;
	MsmMonitorGetServingCellInformation* _tmp0_;
	self = (MsmMonitorGetServingCellInformation*) base;
	_data_ = g_slice_new0 (MsmMonitorGetServingCellInformationRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_monitor_get_serving_cell_information_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_monitor_get_serving_cell_information_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_monitor_get_serving_cell_information_real_run_co (_data_);
}


static void msm_monitor_get_serving_cell_information_real_run_finish (FsoGsmMonitorGetServingCellInformation* base, GAsyncResult* _res_, GError** error) {
	MsmMonitorGetServingCellInformationRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_monitor_get_serving_cell_information_real_run_co (MsmMonitorGetServingCellInformationRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_UNSUPPORTED, "Not implemented");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmMonitorGetServingCellInformation* msm_monitor_get_serving_cell_information_construct (GType object_type) {
	MsmMonitorGetServingCellInformation * self = NULL;
	self = (MsmMonitorGetServingCellInformation*) fso_gsm_monitor_get_serving_cell_information_construct (object_type);
	return self;
}


MsmMonitorGetServingCellInformation* msm_monitor_get_serving_cell_information_new (void) {
	return msm_monitor_get_serving_cell_information_construct (TYPE_MSM_MONITOR_GET_SERVING_CELL_INFORMATION);
}


static void msm_monitor_get_serving_cell_information_class_init (MsmMonitorGetServingCellInformationClass * klass) {
	msm_monitor_get_serving_cell_information_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_MONITOR_GET_SERVING_CELL_INFORMATION_CLASS (klass)->run = msm_monitor_get_serving_cell_information_real_run;
	FSO_GSM_MONITOR_GET_SERVING_CELL_INFORMATION_CLASS (klass)->run_finish = msm_monitor_get_serving_cell_information_real_run_finish;
}


static void msm_monitor_get_serving_cell_information_instance_init (MsmMonitorGetServingCellInformation * self) {
}


/**
 * Monitor Mediators
 **/
GType msm_monitor_get_serving_cell_information_get_type (void) {
	return msm_monitor_get_serving_cell_information_type_id;
}


GType msm_monitor_get_serving_cell_information_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmMonitorGetServingCellInformationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_monitor_get_serving_cell_information_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmMonitorGetServingCellInformation), 0, (GInstanceInitFunc) msm_monitor_get_serving_cell_information_instance_init, NULL };
	msm_monitor_get_serving_cell_information_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_MONITOR_GET_SERVING_CELL_INFORMATION, "MsmMonitorGetServingCellInformation", &g_define_type_info, 0);
	return msm_monitor_get_serving_cell_information_type_id;
}


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


static void msm_monitor_get_neighbour_cell_information_real_run (FsoGsmMonitorGetNeighbourCellInformation* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmMonitorGetNeighbourCellInformation * self;
	MsmMonitorGetNeighbourCellInformationRunData* _data_;
	MsmMonitorGetNeighbourCellInformation* _tmp0_;
	self = (MsmMonitorGetNeighbourCellInformation*) base;
	_data_ = g_slice_new0 (MsmMonitorGetNeighbourCellInformationRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_monitor_get_neighbour_cell_information_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_monitor_get_neighbour_cell_information_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_monitor_get_neighbour_cell_information_real_run_co (_data_);
}


static void msm_monitor_get_neighbour_cell_information_real_run_finish (FsoGsmMonitorGetNeighbourCellInformation* base, GAsyncResult* _res_, GError** error) {
	MsmMonitorGetNeighbourCellInformationRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_monitor_get_neighbour_cell_information_real_run_co (MsmMonitorGetNeighbourCellInformationRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_UNSUPPORTED, "Not implemented");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmMonitorGetNeighbourCellInformation* msm_monitor_get_neighbour_cell_information_construct (GType object_type) {
	MsmMonitorGetNeighbourCellInformation * self = NULL;
	self = (MsmMonitorGetNeighbourCellInformation*) fso_gsm_monitor_get_neighbour_cell_information_construct (object_type);
	return self;
}


MsmMonitorGetNeighbourCellInformation* msm_monitor_get_neighbour_cell_information_new (void) {
	return msm_monitor_get_neighbour_cell_information_construct (TYPE_MSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION);
}


static void msm_monitor_get_neighbour_cell_information_class_init (MsmMonitorGetNeighbourCellInformationClass * klass) {
	msm_monitor_get_neighbour_cell_information_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION_CLASS (klass)->run = msm_monitor_get_neighbour_cell_information_real_run;
	FSO_GSM_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION_CLASS (klass)->run_finish = msm_monitor_get_neighbour_cell_information_real_run_finish;
}


static void msm_monitor_get_neighbour_cell_information_instance_init (MsmMonitorGetNeighbourCellInformation * self) {
}


GType msm_monitor_get_neighbour_cell_information_get_type (void) {
	return msm_monitor_get_neighbour_cell_information_type_id;
}


GType msm_monitor_get_neighbour_cell_information_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmMonitorGetNeighbourCellInformationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_monitor_get_neighbour_cell_information_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmMonitorGetNeighbourCellInformation), 0, (GInstanceInitFunc) msm_monitor_get_neighbour_cell_information_instance_init, NULL };
	msm_monitor_get_neighbour_cell_information_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_MONITOR_GET_NEIGHBOUR_CELL_INFORMATION, "MsmMonitorGetNeighbourCellInformation", &g_define_type_info, 0);
	return msm_monitor_get_neighbour_cell_information_type_id;
}



