/* rygel-preferences-section.c generated by valac 0.56.1, 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-object.h>
#include <glib.h>
#include "rygel-core.h"
#include <stdlib.h>
#include <string.h>

#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#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_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;
enum  {
	RYGEL_PREFERENCES_SECTION_0_PROPERTY,
	RYGEL_PREFERENCES_SECTION_NUM_PROPERTIES
};
static GParamSpec* rygel_preferences_section_properties[RYGEL_PREFERENCES_SECTION_NUM_PROPERTIES];
#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;

VALA_EXTERN GType rygel_preferences_section_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RygelPreferencesSection, g_object_unref)
VALA_EXTERN GType rygel_writable_user_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RygelWritableUserConfig, g_object_unref)
VALA_EXTERN void rygel_preferences_section_save (RygelPreferencesSection* self);
VALA_EXTERN void rygel_preferences_section_set_sensitivity (RygelPreferencesSection* self,
                                                gboolean sensitivity);
VALA_EXTERN RygelPreferencesSection* rygel_preferences_section_construct (GType object_type,
                                                              RygelWritableUserConfig* config,
                                                              const gchar* name);
static void rygel_preferences_section_real_save (RygelPreferencesSection* self);
static void rygel_preferences_section_real_set_sensitivity (RygelPreferencesSection* self,
                                                     gboolean sensitivity);
static void rygel_preferences_section_finalize (GObject * obj);
static GType rygel_preferences_section_get_type_once (void);

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;
	gchar* _tmp0_;
	RygelWritableUserConfig* _tmp1_;
	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_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	_tmp1_ = _g_object_ref0 (config);
	_g_object_unref0 (self->config);
	self->config = _tmp1_;
	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)
{
	RygelPreferencesSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = RYGEL_PREFERENCES_SECTION_GET_CLASS (self);
	if (_klass_->save) {
		_klass_->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)
{
	RygelPreferencesSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = RYGEL_PREFERENCES_SECTION_GET_CLASS (self);
	if (_klass_->set_sensitivity) {
		_klass_->set_sensitivity (self, sensitivity);
	}
}

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

static void
rygel_preferences_section_instance_init (RygelPreferencesSection * self,
                                         gpointer klass)
{
}

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);
}

static GType
rygel_preferences_section_get_type_once (void)
{
	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);
	return rygel_preferences_section_type_id;
}

GType
rygel_preferences_section_get_type (void)
{
	static volatile gsize rygel_preferences_section_type_id__once = 0;
	if (g_once_init_enter (&rygel_preferences_section_type_id__once)) {
		GType rygel_preferences_section_type_id;
		rygel_preferences_section_type_id = rygel_preferences_section_get_type_once ();
		g_once_init_leave (&rygel_preferences_section_type_id__once, rygel_preferences_section_type_id);
	}
	return rygel_preferences_section_type_id__once;
}

