/* mediators_cb.c generated by valac 0.14.2, the Vala compiler
 * generated from mediators_cb.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 <stdlib.h>
#include <string.h>
#include <freesmartphone.h>


#define TYPE_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS (msm_cb_set_cell_broadcast_subscriptions_get_type ())
#define MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS, MsmCbSetCellBroadcastSubscriptions))
#define MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS, MsmCbSetCellBroadcastSubscriptionsClass))
#define IS_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS))
#define IS_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS))
#define MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS, MsmCbSetCellBroadcastSubscriptionsClass))

typedef struct _MsmCbSetCellBroadcastSubscriptions MsmCbSetCellBroadcastSubscriptions;
typedef struct _MsmCbSetCellBroadcastSubscriptionsClass MsmCbSetCellBroadcastSubscriptionsClass;
typedef struct _MsmCbSetCellBroadcastSubscriptionsPrivate MsmCbSetCellBroadcastSubscriptionsPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _MsmCbSetCellBroadcastSubscriptionsRunData MsmCbSetCellBroadcastSubscriptionsRunData;

#define TYPE_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS (msm_cb_get_cell_broadcast_subscriptions_get_type ())
#define MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS, MsmCbGetCellBroadcastSubscriptions))
#define MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS, MsmCbGetCellBroadcastSubscriptionsClass))
#define IS_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS))
#define IS_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS))
#define MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS, MsmCbGetCellBroadcastSubscriptionsClass))

typedef struct _MsmCbGetCellBroadcastSubscriptions MsmCbGetCellBroadcastSubscriptions;
typedef struct _MsmCbGetCellBroadcastSubscriptionsClass MsmCbGetCellBroadcastSubscriptionsClass;
typedef struct _MsmCbGetCellBroadcastSubscriptionsPrivate MsmCbGetCellBroadcastSubscriptionsPrivate;
typedef struct _MsmCbGetCellBroadcastSubscriptionsRunData MsmCbGetCellBroadcastSubscriptionsRunData;

struct _MsmCbSetCellBroadcastSubscriptions {
	FsoGsmCbSetCellBroadcastSubscriptions parent_instance;
	MsmCbSetCellBroadcastSubscriptionsPrivate * priv;
};

struct _MsmCbSetCellBroadcastSubscriptionsClass {
	FsoGsmCbSetCellBroadcastSubscriptionsClass parent_class;
};

struct _MsmCbSetCellBroadcastSubscriptionsRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmCbSetCellBroadcastSubscriptions* self;
	gchar* subscriptions;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _MsmCbGetCellBroadcastSubscriptions {
	FsoGsmCbGetCellBroadcastSubscriptions parent_instance;
	MsmCbGetCellBroadcastSubscriptionsPrivate * priv;
};

struct _MsmCbGetCellBroadcastSubscriptionsClass {
	FsoGsmCbGetCellBroadcastSubscriptionsClass parent_class;
};

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


static gpointer msm_cb_set_cell_broadcast_subscriptions_parent_class = NULL;
static GType msm_cb_set_cell_broadcast_subscriptions_type_id = 0;
static gpointer msm_cb_get_cell_broadcast_subscriptions_parent_class = NULL;
static GType msm_cb_get_cell_broadcast_subscriptions_type_id = 0;

GType msm_cb_set_cell_broadcast_subscriptions_get_type (void) G_GNUC_CONST;
GType msm_cb_set_cell_broadcast_subscriptions_register_type (GTypeModule * module);
enum  {
	MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS_DUMMY_PROPERTY
};
static void msm_cb_set_cell_broadcast_subscriptions_real_run_data_free (gpointer _data);
static void msm_cb_set_cell_broadcast_subscriptions_real_run (FsoGsmCbSetCellBroadcastSubscriptions* base, const gchar* subscriptions, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_cb_set_cell_broadcast_subscriptions_real_run_co (MsmCbSetCellBroadcastSubscriptionsRunData* _data_);
MsmCbSetCellBroadcastSubscriptions* msm_cb_set_cell_broadcast_subscriptions_new (void);
MsmCbSetCellBroadcastSubscriptions* msm_cb_set_cell_broadcast_subscriptions_construct (GType object_type);
GType msm_cb_get_cell_broadcast_subscriptions_get_type (void) G_GNUC_CONST;
GType msm_cb_get_cell_broadcast_subscriptions_register_type (GTypeModule * module);
enum  {
	MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS_DUMMY_PROPERTY
};
static void msm_cb_get_cell_broadcast_subscriptions_real_run_data_free (gpointer _data);
static void msm_cb_get_cell_broadcast_subscriptions_real_run (FsoGsmCbGetCellBroadcastSubscriptions* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_cb_get_cell_broadcast_subscriptions_real_run_co (MsmCbGetCellBroadcastSubscriptionsRunData* _data_);
MsmCbGetCellBroadcastSubscriptions* msm_cb_get_cell_broadcast_subscriptions_new (void);
MsmCbGetCellBroadcastSubscriptions* msm_cb_get_cell_broadcast_subscriptions_construct (GType object_type);


static void msm_cb_set_cell_broadcast_subscriptions_real_run_data_free (gpointer _data) {
	MsmCbSetCellBroadcastSubscriptionsRunData* _data_;
	_data_ = _data;
	_g_free0 (_data_->subscriptions);
	_g_object_unref0 (_data_->self);
	g_slice_free (MsmCbSetCellBroadcastSubscriptionsRunData, _data_);
}


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


static void msm_cb_set_cell_broadcast_subscriptions_real_run (FsoGsmCbSetCellBroadcastSubscriptions* base, const gchar* subscriptions, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmCbSetCellBroadcastSubscriptions * self;
	MsmCbSetCellBroadcastSubscriptionsRunData* _data_;
	MsmCbSetCellBroadcastSubscriptions* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = (MsmCbSetCellBroadcastSubscriptions*) base;
	_data_ = g_slice_new0 (MsmCbSetCellBroadcastSubscriptionsRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_cb_set_cell_broadcast_subscriptions_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_cb_set_cell_broadcast_subscriptions_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = subscriptions;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->subscriptions = _tmp2_;
	msm_cb_set_cell_broadcast_subscriptions_real_run_co (_data_);
}


static void msm_cb_set_cell_broadcast_subscriptions_real_run_finish (FsoGsmCbSetCellBroadcastSubscriptions* base, GAsyncResult* _res_, GError** error) {
	MsmCbSetCellBroadcastSubscriptionsRunData* _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_cb_set_cell_broadcast_subscriptions_real_run_co (MsmCbSetCellBroadcastSubscriptionsRunData* _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 yet 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;
}


MsmCbSetCellBroadcastSubscriptions* msm_cb_set_cell_broadcast_subscriptions_construct (GType object_type) {
	MsmCbSetCellBroadcastSubscriptions * self = NULL;
	self = (MsmCbSetCellBroadcastSubscriptions*) fso_gsm_cb_set_cell_broadcast_subscriptions_construct (object_type);
	return self;
}


MsmCbSetCellBroadcastSubscriptions* msm_cb_set_cell_broadcast_subscriptions_new (void) {
	return msm_cb_set_cell_broadcast_subscriptions_construct (TYPE_MSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS);
}


static void msm_cb_set_cell_broadcast_subscriptions_class_init (MsmCbSetCellBroadcastSubscriptionsClass * klass) {
	msm_cb_set_cell_broadcast_subscriptions_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS (klass)->run = msm_cb_set_cell_broadcast_subscriptions_real_run;
	FSO_GSM_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS (klass)->run_finish = msm_cb_set_cell_broadcast_subscriptions_real_run_finish;
}


static void msm_cb_set_cell_broadcast_subscriptions_instance_init (MsmCbSetCellBroadcastSubscriptions * self) {
}


/**
 * CB Mediators
 **/
GType msm_cb_set_cell_broadcast_subscriptions_get_type (void) {
	return msm_cb_set_cell_broadcast_subscriptions_type_id;
}


GType msm_cb_set_cell_broadcast_subscriptions_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmCbSetCellBroadcastSubscriptionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_cb_set_cell_broadcast_subscriptions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmCbSetCellBroadcastSubscriptions), 0, (GInstanceInitFunc) msm_cb_set_cell_broadcast_subscriptions_instance_init, NULL };
	msm_cb_set_cell_broadcast_subscriptions_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_CB_SET_CELL_BROADCAST_SUBSCRIPTIONS, "MsmCbSetCellBroadcastSubscriptions", &g_define_type_info, 0);
	return msm_cb_set_cell_broadcast_subscriptions_type_id;
}


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


static void msm_cb_get_cell_broadcast_subscriptions_real_run (FsoGsmCbGetCellBroadcastSubscriptions* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmCbGetCellBroadcastSubscriptions * self;
	MsmCbGetCellBroadcastSubscriptionsRunData* _data_;
	MsmCbGetCellBroadcastSubscriptions* _tmp0_;
	self = (MsmCbGetCellBroadcastSubscriptions*) base;
	_data_ = g_slice_new0 (MsmCbGetCellBroadcastSubscriptionsRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_cb_get_cell_broadcast_subscriptions_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_cb_get_cell_broadcast_subscriptions_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_cb_get_cell_broadcast_subscriptions_real_run_co (_data_);
}


static void msm_cb_get_cell_broadcast_subscriptions_real_run_finish (FsoGsmCbGetCellBroadcastSubscriptions* base, GAsyncResult* _res_, GError** error) {
	MsmCbGetCellBroadcastSubscriptionsRunData* _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_cb_get_cell_broadcast_subscriptions_real_run_co (MsmCbGetCellBroadcastSubscriptionsRunData* _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 yet 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;
}


MsmCbGetCellBroadcastSubscriptions* msm_cb_get_cell_broadcast_subscriptions_construct (GType object_type) {
	MsmCbGetCellBroadcastSubscriptions * self = NULL;
	self = (MsmCbGetCellBroadcastSubscriptions*) fso_gsm_cb_get_cell_broadcast_subscriptions_construct (object_type);
	return self;
}


MsmCbGetCellBroadcastSubscriptions* msm_cb_get_cell_broadcast_subscriptions_new (void) {
	return msm_cb_get_cell_broadcast_subscriptions_construct (TYPE_MSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS);
}


static void msm_cb_get_cell_broadcast_subscriptions_class_init (MsmCbGetCellBroadcastSubscriptionsClass * klass) {
	msm_cb_get_cell_broadcast_subscriptions_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS (klass)->run = msm_cb_get_cell_broadcast_subscriptions_real_run;
	FSO_GSM_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS_CLASS (klass)->run_finish = msm_cb_get_cell_broadcast_subscriptions_real_run_finish;
}


static void msm_cb_get_cell_broadcast_subscriptions_instance_init (MsmCbGetCellBroadcastSubscriptions * self) {
}


GType msm_cb_get_cell_broadcast_subscriptions_get_type (void) {
	return msm_cb_get_cell_broadcast_subscriptions_type_id;
}


GType msm_cb_get_cell_broadcast_subscriptions_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmCbGetCellBroadcastSubscriptionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_cb_get_cell_broadcast_subscriptions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmCbGetCellBroadcastSubscriptions), 0, (GInstanceInitFunc) msm_cb_get_cell_broadcast_subscriptions_instance_init, NULL };
	msm_cb_get_cell_broadcast_subscriptions_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_CB_GET_CELL_BROADCAST_SUBSCRIPTIONS, "MsmCbGetCellBroadcastSubscriptions", &g_define_type_info, 0);
	return msm_cb_get_cell_broadcast_subscriptions_type_id;
}



