/* rygel-configuration.c generated by valac 0.56.1, the Vala compiler
 * generated from rygel-configuration.vala, do not modify */

/*
 * Copyright (C) 2008,2009 Nokia Corporation.
 * Copyright (C) 2008,2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
 * Copyright (C) 2012 Intel Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *         Krzesimir Nowak <krnowak@openismus.com>
 *         Jens Georg <jensg@openismus.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * Rygel 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "rygel-core.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>

enum  {
	RYGEL_CONFIGURATION_CONFIGURATION_CHANGED_SIGNAL,
	RYGEL_CONFIGURATION_SECTION_CHANGED_SIGNAL,
	RYGEL_CONFIGURATION_SETTING_CHANGED_SIGNAL,
	RYGEL_CONFIGURATION_NUM_SIGNALS
};
static guint rygel_configuration_signals[RYGEL_CONFIGURATION_NUM_SIGNALS] = {0};

static void g_cclosure_user_marshal_VOID__STRING_ENUM (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__STRING_STRING (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static GType rygel_configuration_get_type_once (void);

GQuark
rygel_configuration_error_quark (void)
{
	return g_quark_from_static_string ("rygel-configuration-error-quark");
}

static GType
rygel_configuration_error_get_type_once (void)
{
	static const GEnumValue values[] = {{RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, "RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET", "no-value-set"}, {RYGEL_CONFIGURATION_ERROR_VALUE_OUT_OF_RANGE, "RYGEL_CONFIGURATION_ERROR_VALUE_OUT_OF_RANGE", "value-out-of-range"}, {0, NULL, NULL}};
	GType rygel_configuration_error_type_id;
	rygel_configuration_error_type_id = g_enum_register_static ("RygelConfigurationError", values);
	return rygel_configuration_error_type_id;
}

GType
rygel_configuration_error_get_type (void)
{
	static volatile gsize rygel_configuration_error_type_id__once = 0;
	if (g_once_init_enter (&rygel_configuration_error_type_id__once)) {
		GType rygel_configuration_error_type_id;
		rygel_configuration_error_type_id = rygel_configuration_error_get_type_once ();
		g_once_init_leave (&rygel_configuration_error_type_id__once, rygel_configuration_error_type_id);
	}
	return rygel_configuration_error_type_id__once;
}

static GType
rygel_configuration_entry_get_type_once (void)
{
	static const GEnumValue values[] = {{RYGEL_CONFIGURATION_ENTRY_INTERFACE, "RYGEL_CONFIGURATION_ENTRY_INTERFACE", "interface"}, {RYGEL_CONFIGURATION_ENTRY_PORT, "RYGEL_CONFIGURATION_ENTRY_PORT", "port"}, {RYGEL_CONFIGURATION_ENTRY_TRANSCODING, "RYGEL_CONFIGURATION_ENTRY_TRANSCODING", "transcoding"}, {RYGEL_CONFIGURATION_ENTRY_ALLOW_UPLOAD, "RYGEL_CONFIGURATION_ENTRY_ALLOW_UPLOAD", "allow-upload"}, {RYGEL_CONFIGURATION_ENTRY_ALLOW_DELETION, "RYGEL_CONFIGURATION_ENTRY_ALLOW_DELETION", "allow-deletion"}, {RYGEL_CONFIGURATION_ENTRY_LOG_LEVELS, "RYGEL_CONFIGURATION_ENTRY_LOG_LEVELS", "log-levels"}, {RYGEL_CONFIGURATION_ENTRY_PLUGIN_PATH, "RYGEL_CONFIGURATION_ENTRY_PLUGIN_PATH", "plugin-path"}, {RYGEL_CONFIGURATION_ENTRY_VIDEO_UPLOAD_FOLDER, "RYGEL_CONFIGURATION_ENTRY_VIDEO_UPLOAD_FOLDER", "video-upload-folder"}, {RYGEL_CONFIGURATION_ENTRY_MUSIC_UPLOAD_FOLDER, "RYGEL_CONFIGURATION_ENTRY_MUSIC_UPLOAD_FOLDER", "music-upload-folder"}, {RYGEL_CONFIGURATION_ENTRY_PICTURE_UPLOAD_FOLDER, "RYGEL_CONFIGURATION_ENTRY_PICTURE_UPLOAD_FOLDER", "picture-upload-folder"}, {0, NULL, NULL}};
	GType rygel_configuration_entry_type_id;
	rygel_configuration_entry_type_id = g_enum_register_static ("RygelConfigurationEntry", values);
	return rygel_configuration_entry_type_id;
}

GType
rygel_configuration_entry_get_type (void)
{
	static volatile gsize rygel_configuration_entry_type_id__once = 0;
	if (g_once_init_enter (&rygel_configuration_entry_type_id__once)) {
		GType rygel_configuration_entry_type_id;
		rygel_configuration_entry_type_id = rygel_configuration_entry_get_type_once ();
		g_once_init_leave (&rygel_configuration_entry_type_id__once, rygel_configuration_entry_type_id);
	}
	return rygel_configuration_entry_type_id__once;
}

static GType
rygel_section_entry_get_type_once (void)
{
	static const GEnumValue values[] = {{RYGEL_SECTION_ENTRY_TITLE, "RYGEL_SECTION_ENTRY_TITLE", "title"}, {RYGEL_SECTION_ENTRY_ENABLED, "RYGEL_SECTION_ENTRY_ENABLED", "enabled"}, {0, NULL, NULL}};
	GType rygel_section_entry_type_id;
	rygel_section_entry_type_id = g_enum_register_static ("RygelSectionEntry", values);
	return rygel_section_entry_type_id;
}

GType
rygel_section_entry_get_type (void)
{
	static volatile gsize rygel_section_entry_type_id__once = 0;
	if (g_once_init_enter (&rygel_section_entry_type_id__once)) {
		GType rygel_section_entry_type_id;
		rygel_section_entry_type_id = rygel_section_entry_get_type_once ();
		g_once_init_leave (&rygel_section_entry_type_id__once, rygel_section_entry_type_id);
	}
	return rygel_section_entry_type_id__once;
}

gchar*
rygel_configuration_get_interface (RygelConfiguration* self,
                                   GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_interface) {
		return _iface_->get_interface (self, error);
	}
	return NULL;
}

gchar**
rygel_configuration_get_interfaces (RygelConfiguration* self,
                                    GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_interfaces) {
		return _iface_->get_interfaces (self, error);
	}
	return NULL;
}

gint
rygel_configuration_get_port (RygelConfiguration* self,
                              GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_port) {
		return _iface_->get_port (self, error);
	}
	return -1;
}

gboolean
rygel_configuration_get_transcoding (RygelConfiguration* self,
                                     GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_transcoding) {
		return _iface_->get_transcoding (self, error);
	}
	return FALSE;
}

gboolean
rygel_configuration_get_allow_upload (RygelConfiguration* self,
                                      GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_allow_upload) {
		return _iface_->get_allow_upload (self, error);
	}
	return FALSE;
}

gboolean
rygel_configuration_get_allow_deletion (RygelConfiguration* self,
                                        GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_allow_deletion) {
		return _iface_->get_allow_deletion (self, error);
	}
	return FALSE;
}

gchar*
rygel_configuration_get_log_levels (RygelConfiguration* self,
                                    GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_log_levels) {
		return _iface_->get_log_levels (self, error);
	}
	return NULL;
}

gchar*
rygel_configuration_get_plugin_path (RygelConfiguration* self,
                                     GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_plugin_path) {
		return _iface_->get_plugin_path (self, error);
	}
	return NULL;
}

gchar*
rygel_configuration_get_engine_path (RygelConfiguration* self,
                                     GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_engine_path) {
		return _iface_->get_engine_path (self, error);
	}
	return NULL;
}

gchar*
rygel_configuration_get_media_engine (RygelConfiguration* self,
                                      GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_media_engine) {
		return _iface_->get_media_engine (self, error);
	}
	return NULL;
}

gchar*
rygel_configuration_get_video_upload_folder (RygelConfiguration* self,
                                             GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_video_upload_folder) {
		return _iface_->get_video_upload_folder (self, error);
	}
	return NULL;
}

gchar*
rygel_configuration_get_music_upload_folder (RygelConfiguration* self,
                                             GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_music_upload_folder) {
		return _iface_->get_music_upload_folder (self, error);
	}
	return NULL;
}

gchar*
rygel_configuration_get_picture_upload_folder (RygelConfiguration* self,
                                               GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_picture_upload_folder) {
		return _iface_->get_picture_upload_folder (self, error);
	}
	return NULL;
}

gboolean
rygel_configuration_get_enabled (RygelConfiguration* self,
                                 const gchar* section,
                                 GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_enabled) {
		return _iface_->get_enabled (self, section, error);
	}
	return FALSE;
}

gchar*
rygel_configuration_get_title (RygelConfiguration* self,
                               const gchar* section,
                               GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_title) {
		return _iface_->get_title (self, section, error);
	}
	return NULL;
}

gchar*
rygel_configuration_get_string (RygelConfiguration* self,
                                const gchar* section,
                                const gchar* key,
                                GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_string) {
		return _iface_->get_string (self, section, key, error);
	}
	return NULL;
}

GeeArrayList*
rygel_configuration_get_string_list (RygelConfiguration* self,
                                     const gchar* section,
                                     const gchar* key,
                                     GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_string_list) {
		return _iface_->get_string_list (self, section, key, error);
	}
	return NULL;
}

gint
rygel_configuration_get_int (RygelConfiguration* self,
                             const gchar* section,
                             const gchar* key,
                             gint min,
                             gint max,
                             GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_int) {
		return _iface_->get_int (self, section, key, min, max, error);
	}
	return -1;
}

GeeArrayList*
rygel_configuration_get_int_list (RygelConfiguration* self,
                                  const gchar* section,
                                  const gchar* key,
                                  GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_int_list) {
		return _iface_->get_int_list (self, section, key, error);
	}
	return NULL;
}

gboolean
rygel_configuration_get_bool (RygelConfiguration* self,
                              const gchar* section,
                              const gchar* key,
                              GError** error)
{
	RygelConfigurationIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = RYGEL_CONFIGURATION_GET_INTERFACE (self);
	if (_iface_->get_bool) {
		return _iface_->get_bool (self, section, key, error);
	}
	return FALSE;
}

static void
g_cclosure_user_marshal_VOID__STRING_ENUM (GClosure * closure,
                                           GValue * return_value,
                                           guint n_param_values,
                                           const GValue * param_values,
                                           gpointer invocation_hint,
                                           gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_ENUM) (gpointer data1, const char* arg_1, gint arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_ENUM callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_ENUM) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_enum (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, const char* arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), data2);
}

static void
rygel_configuration_default_init (RygelConfigurationIface * iface,
                                  gpointer iface_data)
{
	/**
	     * Emitted when any of known configuration settings has
	     * changed. RygelConfigurationEntry lists known configuration
	     * settings.
	     */
	rygel_configuration_signals[RYGEL_CONFIGURATION_CONFIGURATION_CHANGED_SIGNAL] = g_signal_new ("configuration-changed", RYGEL_TYPE_CONFIGURATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, RYGEL_TYPE_CONFIGURATION_ENTRY);
	/**
	     * Emitted when any of section settings has
	     * changed. RygelSectionEntry lists known section settings.
	     */
	rygel_configuration_signals[RYGEL_CONFIGURATION_SECTION_CHANGED_SIGNAL] = g_signal_new ("section-changed", RYGEL_TYPE_CONFIGURATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_ENUM, G_TYPE_NONE, 2, G_TYPE_STRING, RYGEL_TYPE_SECTION_ENTRY);
	/**
	     * Emitted when some custom setting has changed. That happens when
	     * changed setting does fit into neither configuration_changed nor
	     * section_changed signal.
	     */
	rygel_configuration_signals[RYGEL_CONFIGURATION_SETTING_CHANGED_SIGNAL] = g_signal_new ("setting-changed", RYGEL_TYPE_CONFIGURATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
}

/**
 * Interface for dealing with Rygel configuration.
 */
static GType
rygel_configuration_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RygelConfigurationIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_configuration_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType rygel_configuration_type_id;
	rygel_configuration_type_id = g_type_register_static (G_TYPE_INTERFACE, "RygelConfiguration", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (rygel_configuration_type_id, G_TYPE_OBJECT);
	return rygel_configuration_type_id;
}

GType
rygel_configuration_get_type (void)
{
	static volatile gsize rygel_configuration_type_id__once = 0;
	if (g_once_init_enter (&rygel_configuration_type_id__once)) {
		GType rygel_configuration_type_id;
		rygel_configuration_type_id = rygel_configuration_get_type_once ();
		g_once_init_leave (&rygel_configuration_type_id__once, rygel_configuration_type_id);
	}
	return rygel_configuration_type_id__once;
}

