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


#define TYPE_MSM_VOICE_MAILBOX_GET_NUMBER (msm_voice_mailbox_get_number_get_type ())
#define MSM_VOICE_MAILBOX_GET_NUMBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_VOICE_MAILBOX_GET_NUMBER, MsmVoiceMailboxGetNumber))
#define MSM_VOICE_MAILBOX_GET_NUMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_VOICE_MAILBOX_GET_NUMBER, MsmVoiceMailboxGetNumberClass))
#define IS_MSM_VOICE_MAILBOX_GET_NUMBER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_VOICE_MAILBOX_GET_NUMBER))
#define IS_MSM_VOICE_MAILBOX_GET_NUMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_VOICE_MAILBOX_GET_NUMBER))
#define MSM_VOICE_MAILBOX_GET_NUMBER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_VOICE_MAILBOX_GET_NUMBER, MsmVoiceMailboxGetNumberClass))

typedef struct _MsmVoiceMailboxGetNumber MsmVoiceMailboxGetNumber;
typedef struct _MsmVoiceMailboxGetNumberClass MsmVoiceMailboxGetNumberClass;
typedef struct _MsmVoiceMailboxGetNumberPrivate MsmVoiceMailboxGetNumberPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _MsmVoiceMailboxGetNumberRunData MsmVoiceMailboxGetNumberRunData;

#define TYPE_MSM_VOICE_MAILBOX_SET_NUMBER (msm_voice_mailbox_set_number_get_type ())
#define MSM_VOICE_MAILBOX_SET_NUMBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_VOICE_MAILBOX_SET_NUMBER, MsmVoiceMailboxSetNumber))
#define MSM_VOICE_MAILBOX_SET_NUMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_VOICE_MAILBOX_SET_NUMBER, MsmVoiceMailboxSetNumberClass))
#define IS_MSM_VOICE_MAILBOX_SET_NUMBER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_VOICE_MAILBOX_SET_NUMBER))
#define IS_MSM_VOICE_MAILBOX_SET_NUMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_VOICE_MAILBOX_SET_NUMBER))
#define MSM_VOICE_MAILBOX_SET_NUMBER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_VOICE_MAILBOX_SET_NUMBER, MsmVoiceMailboxSetNumberClass))

typedef struct _MsmVoiceMailboxSetNumber MsmVoiceMailboxSetNumber;
typedef struct _MsmVoiceMailboxSetNumberClass MsmVoiceMailboxSetNumberClass;
typedef struct _MsmVoiceMailboxSetNumberPrivate MsmVoiceMailboxSetNumberPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _MsmVoiceMailboxSetNumberRunData MsmVoiceMailboxSetNumberRunData;

struct _MsmVoiceMailboxGetNumber {
	FsoGsmVoiceMailboxGetNumber parent_instance;
	MsmVoiceMailboxGetNumberPrivate * priv;
};

struct _MsmVoiceMailboxGetNumberClass {
	FsoGsmVoiceMailboxGetNumberClass parent_class;
};

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

struct _MsmVoiceMailboxSetNumber {
	FsoGsmVoiceMailboxSetNumber parent_instance;
	MsmVoiceMailboxSetNumberPrivate * priv;
};

struct _MsmVoiceMailboxSetNumberClass {
	FsoGsmVoiceMailboxSetNumberClass parent_class;
};

struct _MsmVoiceMailboxSetNumberRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmVoiceMailboxSetNumber* self;
	gchar* number;
	GError* _tmp0_;
	GError * _inner_error_;
};


static gpointer msm_voice_mailbox_get_number_parent_class = NULL;
static GType msm_voice_mailbox_get_number_type_id = 0;
static gpointer msm_voice_mailbox_set_number_parent_class = NULL;
static GType msm_voice_mailbox_set_number_type_id = 0;

GType msm_voice_mailbox_get_number_get_type (void) G_GNUC_CONST;
GType msm_voice_mailbox_get_number_register_type (GTypeModule * module);
enum  {
	MSM_VOICE_MAILBOX_GET_NUMBER_DUMMY_PROPERTY
};
static void msm_voice_mailbox_get_number_real_run_data_free (gpointer _data);
static void msm_voice_mailbox_get_number_real_run (FsoGsmVoiceMailboxGetNumber* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_voice_mailbox_get_number_real_run_co (MsmVoiceMailboxGetNumberRunData* _data_);
MsmVoiceMailboxGetNumber* msm_voice_mailbox_get_number_new (void);
MsmVoiceMailboxGetNumber* msm_voice_mailbox_get_number_construct (GType object_type);
GType msm_voice_mailbox_set_number_get_type (void) G_GNUC_CONST;
GType msm_voice_mailbox_set_number_register_type (GTypeModule * module);
enum  {
	MSM_VOICE_MAILBOX_SET_NUMBER_DUMMY_PROPERTY
};
static void msm_voice_mailbox_set_number_real_run_data_free (gpointer _data);
static void msm_voice_mailbox_set_number_real_run (FsoGsmVoiceMailboxSetNumber* base, const gchar* number, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_voice_mailbox_set_number_real_run_co (MsmVoiceMailboxSetNumberRunData* _data_);
MsmVoiceMailboxSetNumber* msm_voice_mailbox_set_number_new (void);
MsmVoiceMailboxSetNumber* msm_voice_mailbox_set_number_construct (GType object_type);


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


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


static void msm_voice_mailbox_get_number_real_run (FsoGsmVoiceMailboxGetNumber* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmVoiceMailboxGetNumber * self;
	MsmVoiceMailboxGetNumberRunData* _data_;
	MsmVoiceMailboxGetNumber* _tmp0_;
	self = (MsmVoiceMailboxGetNumber*) base;
	_data_ = g_slice_new0 (MsmVoiceMailboxGetNumberRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_voice_mailbox_get_number_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_voice_mailbox_get_number_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_voice_mailbox_get_number_real_run_co (_data_);
}


static void msm_voice_mailbox_get_number_real_run_finish (FsoGsmVoiceMailboxGetNumber* base, GAsyncResult* _res_, GError** error) {
	MsmVoiceMailboxGetNumberRunData* _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_voice_mailbox_get_number_real_run_co (MsmVoiceMailboxGetNumberRunData* _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;
}


MsmVoiceMailboxGetNumber* msm_voice_mailbox_get_number_construct (GType object_type) {
	MsmVoiceMailboxGetNumber * self = NULL;
	self = (MsmVoiceMailboxGetNumber*) fso_gsm_voice_mailbox_get_number_construct (object_type);
	return self;
}


MsmVoiceMailboxGetNumber* msm_voice_mailbox_get_number_new (void) {
	return msm_voice_mailbox_get_number_construct (TYPE_MSM_VOICE_MAILBOX_GET_NUMBER);
}


static void msm_voice_mailbox_get_number_class_init (MsmVoiceMailboxGetNumberClass * klass) {
	msm_voice_mailbox_get_number_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_VOICE_MAILBOX_GET_NUMBER_CLASS (klass)->run = msm_voice_mailbox_get_number_real_run;
	FSO_GSM_VOICE_MAILBOX_GET_NUMBER_CLASS (klass)->run_finish = msm_voice_mailbox_get_number_real_run_finish;
}


static void msm_voice_mailbox_get_number_instance_init (MsmVoiceMailboxGetNumber * self) {
}


/**
 * Voice Mailbox Mediators
 **/
GType msm_voice_mailbox_get_number_get_type (void) {
	return msm_voice_mailbox_get_number_type_id;
}


GType msm_voice_mailbox_get_number_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmVoiceMailboxGetNumberClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_voice_mailbox_get_number_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmVoiceMailboxGetNumber), 0, (GInstanceInitFunc) msm_voice_mailbox_get_number_instance_init, NULL };
	msm_voice_mailbox_get_number_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_VOICE_MAILBOX_GET_NUMBER, "MsmVoiceMailboxGetNumber", &g_define_type_info, 0);
	return msm_voice_mailbox_get_number_type_id;
}


static void msm_voice_mailbox_set_number_real_run_data_free (gpointer _data) {
	MsmVoiceMailboxSetNumberRunData* _data_;
	_data_ = _data;
	_g_free0 (_data_->number);
	_g_object_unref0 (_data_->self);
	g_slice_free (MsmVoiceMailboxSetNumberRunData, _data_);
}


static void msm_voice_mailbox_set_number_real_run (FsoGsmVoiceMailboxSetNumber* base, const gchar* number, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmVoiceMailboxSetNumber * self;
	MsmVoiceMailboxSetNumberRunData* _data_;
	MsmVoiceMailboxSetNumber* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = (MsmVoiceMailboxSetNumber*) base;
	_data_ = g_slice_new0 (MsmVoiceMailboxSetNumberRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_voice_mailbox_set_number_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_voice_mailbox_set_number_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = number;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->number = _tmp2_;
	msm_voice_mailbox_set_number_real_run_co (_data_);
}


static void msm_voice_mailbox_set_number_real_run_finish (FsoGsmVoiceMailboxSetNumber* base, GAsyncResult* _res_, GError** error) {
	MsmVoiceMailboxSetNumberRunData* _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_voice_mailbox_set_number_real_run_co (MsmVoiceMailboxSetNumberRunData* _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;
}


MsmVoiceMailboxSetNumber* msm_voice_mailbox_set_number_construct (GType object_type) {
	MsmVoiceMailboxSetNumber * self = NULL;
	self = (MsmVoiceMailboxSetNumber*) fso_gsm_voice_mailbox_set_number_construct (object_type);
	return self;
}


MsmVoiceMailboxSetNumber* msm_voice_mailbox_set_number_new (void) {
	return msm_voice_mailbox_set_number_construct (TYPE_MSM_VOICE_MAILBOX_SET_NUMBER);
}


static void msm_voice_mailbox_set_number_class_init (MsmVoiceMailboxSetNumberClass * klass) {
	msm_voice_mailbox_set_number_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_VOICE_MAILBOX_SET_NUMBER_CLASS (klass)->run = msm_voice_mailbox_set_number_real_run;
	FSO_GSM_VOICE_MAILBOX_SET_NUMBER_CLASS (klass)->run_finish = msm_voice_mailbox_set_number_real_run_finish;
}


static void msm_voice_mailbox_set_number_instance_init (MsmVoiceMailboxSetNumber * self) {
}


GType msm_voice_mailbox_set_number_get_type (void) {
	return msm_voice_mailbox_set_number_type_id;
}


GType msm_voice_mailbox_set_number_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmVoiceMailboxSetNumberClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_voice_mailbox_set_number_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmVoiceMailboxSetNumber), 0, (GInstanceInitFunc) msm_voice_mailbox_set_number_instance_init, NULL };
	msm_voice_mailbox_set_number_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_VOICE_MAILBOX_SET_NUMBER, "MsmVoiceMailboxSetNumber", &g_define_type_info, 0);
	return msm_voice_mailbox_set_number_type_id;
}



