/* rygel-preferences-section.c generated by valac 0.30.0.35-2c9e8, the Vala compiler
 * generated from rygel-preferences-section.vala, do not modify */

/*
 * Copyright (C) 2009 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.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 <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define RYGEL_TYPE_PREFERENCES_SECTION (rygel_preferences_section_get_type ())
#define RYGEL_PREFERENCES_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_PREFERENCES_SECTION, RygelPreferencesSection))
#define RYGEL_PREFERENCES_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_PREFERENCES_SECTION, RygelPreferencesSectionClass))
#define RYGEL_IS_PREFERENCES_SECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_PREFERENCES_SECTION))
#define RYGEL_IS_PREFERENCES_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_PREFERENCES_SECTION))
#define RYGEL_PREFERENCES_SECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_PREFERENCES_SECTION, RygelPreferencesSectionClass))

typedef struct _RygelPreferencesSection RygelPreferencesSection;
typedef struct _RygelPreferencesSectionClass RygelPreferencesSectionClass;
typedef struct _RygelPreferencesSectionPrivate RygelPreferencesSectionPrivate;

#define RYGEL_TYPE_USER_CONFIG (rygel_user_config_get_type ())
#define RYGEL_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_USER_CONFIG, RygelUserConfig))
#define RYGEL_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_USER_CONFIG, RygelUserConfigClass))
#define RYGEL_IS_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_USER_CONFIG))
#define RYGEL_IS_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_USER_CONFIG))
#define RYGEL_USER_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_USER_CONFIG, RygelUserConfigClass))

typedef struct _RygelUserConfig RygelUserConfig;
typedef struct _RygelUserConfigClass RygelUserConfigClass;

#define RYGEL_TYPE_WRITABLE_USER_CONFIG (rygel_writable_user_config_get_type ())
#define RYGEL_WRITABLE_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_WRITABLE_USER_CONFIG, RygelWritableUserConfig))
#define RYGEL_WRITABLE_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_WRITABLE_USER_CONFIG, RygelWritableUserConfigClass))
#define RYGEL_IS_WRITABLE_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_WRITABLE_USER_CONFIG))
#define RYGEL_IS_WRITABLE_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_WRITABLE_USER_CONFIG))
#define RYGEL_WRITABLE_USER_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_WRITABLE_USER_CONFIG, RygelWritableUserConfigClass))

typedef struct _RygelWritableUserConfig RygelWritableUserConfig;
typedef struct _RygelWritableUserConfigClass RygelWritableUserConfigClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _RygelPreferencesSection {
	GObject parent_instance;
	RygelPreferencesSectionPrivate * priv;
	RygelWritableUserConfig* config;
	gchar* name;
};

struct _RygelPreferencesSectionClass {
	GObjectClass parent_class;
	void (*save) (RygelPreferencesSection* self);
	void (*set_sensitivity) (RygelPreferencesSection* self, gboolean sensitivity);
};


static gpointer rygel_preferences_section_parent_class = NULL;

GType rygel_preferences_section_get_type (void) G_GNUC_CONST;
GType rygel_user_config_get_type (void) G_GNUC_CONST;
GType rygel_writable_user_config_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_PREFERENCES_SECTION_DUMMY_PROPERTY
};
RygelPreferencesSection* rygel_preferences_section_construct (GType object_type, RygelWritableUserConfig* config, const gchar* name);
void rygel_preferences_section_save (RygelPreferencesSection* self);
static void rygel_preferences_section_real_save (RygelPreferencesSection* self);
void rygel_preferences_section_set_sensitivity (RygelPreferencesSection* self, gboolean sensitivity);
static void rygel_preferences_section_real_set_sensitivity (RygelPreferencesSection* self, gboolean sensitivity);
static void rygel_preferences_section_finalize (GObject* obj);


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


RygelPreferencesSection* rygel_preferences_section_construct (GType object_type, RygelWritableUserConfig* config, const gchar* name) {
	RygelPreferencesSection * self = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	RygelWritableUserConfig* _tmp2_ = NULL;
	RygelWritableUserConfig* _tmp3_ = NULL;
	g_return_val_if_fail (config != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	self = (RygelPreferencesSection*) g_object_new (object_type, NULL);
	_tmp0_ = name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->name);
	self->name = _tmp1_;
	_tmp2_ = config;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->config);
	self->config = _tmp3_;
	return self;
}


static void rygel_preferences_section_real_save (RygelPreferencesSection* self) {
	g_critical ("Type `%s' does not implement abstract method `rygel_preferences_section_save'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void rygel_preferences_section_save (RygelPreferencesSection* self) {
	g_return_if_fail (self != NULL);
	RYGEL_PREFERENCES_SECTION_GET_CLASS (self)->save (self);
}


static void rygel_preferences_section_real_set_sensitivity (RygelPreferencesSection* self, gboolean sensitivity) {
	g_critical ("Type `%s' does not implement abstract method `rygel_preferences_section_set_sensitivity'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void rygel_preferences_section_set_sensitivity (RygelPreferencesSection* self, gboolean sensitivity) {
	g_return_if_fail (self != NULL);
	RYGEL_PREFERENCES_SECTION_GET_CLASS (self)->set_sensitivity (self, sensitivity);
}


static void rygel_preferences_section_class_init (RygelPreferencesSectionClass * klass) {
	rygel_preferences_section_parent_class = g_type_class_peek_parent (klass);
	((RygelPreferencesSectionClass *) klass)->save = rygel_preferences_section_real_save;
	((RygelPreferencesSectionClass *) klass)->set_sensitivity = rygel_preferences_section_real_set_sensitivity;
	G_OBJECT_CLASS (klass)->finalize = rygel_preferences_section_finalize;
}


static void rygel_preferences_section_instance_init (RygelPreferencesSection * self) {
}


static void rygel_preferences_section_finalize (GObject* obj) {
	RygelPreferencesSection * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_PREFERENCES_SECTION, RygelPreferencesSection);
	_g_object_unref0 (self->config);
	_g_free0 (self->name);
	G_OBJECT_CLASS (rygel_preferences_section_parent_class)->finalize (obj);
}


GType rygel_preferences_section_get_type (void) {
	static volatile gsize rygel_preferences_section_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_preferences_section_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelPreferencesSectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_preferences_section_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelPreferencesSection), 0, (GInstanceInitFunc) rygel_preferences_section_instance_init, NULL };
		GType rygel_preferences_section_type_id;
		rygel_preferences_section_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelPreferencesSection", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&rygel_preferences_section_type_id__volatile, rygel_preferences_section_type_id);
	}
	return rygel_preferences_section_type_id__volatile;
}



