/* contacts-settings.c generated by valac 0.56.0, the Vala compiler
 * generated from contacts-settings.vala, do not modify */

/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * 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, see <http://www.gnu.org/licenses/>.
 */

#include <gio/gio.h>
#include <glib-object.h>
#include <adwaita.h>
#include <glib.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 CONTACTS_TYPE_SETTINGS (contacts_settings_get_type ())
#define CONTACTS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_SETTINGS, ContactsSettings))
#define CONTACTS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_SETTINGS, ContactsSettingsClass))
#define CONTACTS_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_SETTINGS))
#define CONTACTS_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_SETTINGS))
#define CONTACTS_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_SETTINGS, ContactsSettingsClass))

typedef struct _ContactsSettings ContactsSettings;
typedef struct _ContactsSettingsClass ContactsSettingsClass;
typedef struct _ContactsSettingsPrivate ContactsSettingsPrivate;
enum  {
	CONTACTS_SETTINGS_0_PROPERTY,
	CONTACTS_SETTINGS_DID_INITIAL_SETUP_PROPERTY,
	CONTACTS_SETTINGS_SORT_ON_SURNAME_PROPERTY,
	CONTACTS_SETTINGS_WINDOW_WIDTH_PROPERTY,
	CONTACTS_SETTINGS_WINDOW_HEIGHT_PROPERTY,
	CONTACTS_SETTINGS_WINDOW_MAXIMIZED_PROPERTY,
	CONTACTS_SETTINGS_WINDOW_FULLSCREEN_PROPERTY,
	CONTACTS_SETTINGS_NUM_PROPERTIES
};
static GParamSpec* contacts_settings_properties[CONTACTS_SETTINGS_NUM_PROPERTIES];

#define CONTACTS_TYPE_APP (contacts_app_get_type ())
#define CONTACTS_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_APP, ContactsApp))
#define CONTACTS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_APP, ContactsAppClass))
#define CONTACTS_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_APP))
#define CONTACTS_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_APP))
#define CONTACTS_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_APP, ContactsAppClass))

typedef struct _ContactsApp ContactsApp;
typedef struct _ContactsAppClass ContactsAppClass;

struct _ContactsSettings {
	GSettings parent_instance;
	ContactsSettingsPrivate * priv;
};

struct _ContactsSettingsClass {
	GSettingsClass parent_class;
};

static gpointer contacts_settings_parent_class = NULL;

VALA_EXTERN GType contacts_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ContactsSettings, g_object_unref)
VALA_EXTERN GType contacts_app_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ContactsApp, g_object_unref)
VALA_EXTERN ContactsSettings* contacts_settings_new (ContactsApp* app);
VALA_EXTERN ContactsSettings* contacts_settings_construct (GType object_type,
                                               ContactsApp* app);
VALA_EXTERN gboolean contacts_settings_get_did_initial_setup (ContactsSettings* self);
VALA_EXTERN void contacts_settings_set_did_initial_setup (ContactsSettings* self,
                                              gboolean value);
VALA_EXTERN gboolean contacts_settings_get_sort_on_surname (ContactsSettings* self);
VALA_EXTERN void contacts_settings_set_sort_on_surname (ContactsSettings* self,
                                            gboolean value);
VALA_EXTERN gint contacts_settings_get_window_width (ContactsSettings* self);
VALA_EXTERN void contacts_settings_set_window_width (ContactsSettings* self,
                                         gint value);
VALA_EXTERN gint contacts_settings_get_window_height (ContactsSettings* self);
VALA_EXTERN void contacts_settings_set_window_height (ContactsSettings* self,
                                          gint value);
VALA_EXTERN gboolean contacts_settings_get_window_maximized (ContactsSettings* self);
VALA_EXTERN void contacts_settings_set_window_maximized (ContactsSettings* self,
                                             gboolean value);
VALA_EXTERN gboolean contacts_settings_get_window_fullscreen (ContactsSettings* self);
VALA_EXTERN void contacts_settings_set_window_fullscreen (ContactsSettings* self,
                                              gboolean value);
static GType contacts_settings_get_type_once (void);
static void _vala_contacts_settings_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static void _vala_contacts_settings_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec);

ContactsSettings*
contacts_settings_construct (GType object_type,
                             ContactsApp* app)
{
	ContactsSettings * self = NULL;
	g_return_val_if_fail (app != NULL, NULL);
	self = (ContactsSettings*) g_object_new (object_type, "schema-id", "org.gnome.Contacts", NULL);
	return self;
}

ContactsSettings*
contacts_settings_new (ContactsApp* app)
{
	return contacts_settings_construct (CONTACTS_TYPE_SETTINGS, app);
}

gboolean
contacts_settings_get_did_initial_setup (ContactsSettings* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = g_settings_get_boolean ((GSettings*) self, "did-initial-setup");
	return result;
}

void
contacts_settings_set_did_initial_setup (ContactsSettings* self,
                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	g_settings_set_boolean ((GSettings*) self, "did-initial-setup", value);
	g_object_notify_by_pspec ((GObject *) self, contacts_settings_properties[CONTACTS_SETTINGS_DID_INITIAL_SETUP_PROPERTY]);
}

gboolean
contacts_settings_get_sort_on_surname (ContactsSettings* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = g_settings_get_boolean ((GSettings*) self, "sort-on-surname");
	return result;
}

void
contacts_settings_set_sort_on_surname (ContactsSettings* self,
                                       gboolean value)
{
	g_return_if_fail (self != NULL);
	g_settings_set_boolean ((GSettings*) self, "sort-on-surname", value);
	g_object_notify_by_pspec ((GObject *) self, contacts_settings_properties[CONTACTS_SETTINGS_SORT_ON_SURNAME_PROPERTY]);
}

gint
contacts_settings_get_window_width (ContactsSettings* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = g_settings_get_int ((GSettings*) self, "window-width");
	return result;
}

void
contacts_settings_set_window_width (ContactsSettings* self,
                                    gint value)
{
	g_return_if_fail (self != NULL);
	g_settings_set_int ((GSettings*) self, "window-width", value);
	g_object_notify_by_pspec ((GObject *) self, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_WIDTH_PROPERTY]);
}

gint
contacts_settings_get_window_height (ContactsSettings* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = g_settings_get_int ((GSettings*) self, "window-height");
	return result;
}

void
contacts_settings_set_window_height (ContactsSettings* self,
                                     gint value)
{
	g_return_if_fail (self != NULL);
	g_settings_set_int ((GSettings*) self, "window-height", value);
	g_object_notify_by_pspec ((GObject *) self, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_HEIGHT_PROPERTY]);
}

gboolean
contacts_settings_get_window_maximized (ContactsSettings* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = g_settings_get_boolean ((GSettings*) self, "window-maximized");
	return result;
}

void
contacts_settings_set_window_maximized (ContactsSettings* self,
                                        gboolean value)
{
	g_return_if_fail (self != NULL);
	g_settings_set_boolean ((GSettings*) self, "window-maximized", value);
	g_object_notify_by_pspec ((GObject *) self, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_MAXIMIZED_PROPERTY]);
}

gboolean
contacts_settings_get_window_fullscreen (ContactsSettings* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = g_settings_get_boolean ((GSettings*) self, "window-fullscreen");
	return result;
}

void
contacts_settings_set_window_fullscreen (ContactsSettings* self,
                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	g_settings_set_boolean ((GSettings*) self, "window-fullscreen", value);
	g_object_notify_by_pspec ((GObject *) self, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_FULLSCREEN_PROPERTY]);
}

static void
contacts_settings_class_init (ContactsSettingsClass * klass,
                              gpointer klass_data)
{
	contacts_settings_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_contacts_settings_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_contacts_settings_set_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_SETTINGS_DID_INITIAL_SETUP_PROPERTY, contacts_settings_properties[CONTACTS_SETTINGS_DID_INITIAL_SETUP_PROPERTY] = g_param_spec_boolean ("did-initial-setup", "did-initial-setup", "did-initial-setup", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_SETTINGS_SORT_ON_SURNAME_PROPERTY, contacts_settings_properties[CONTACTS_SETTINGS_SORT_ON_SURNAME_PROPERTY] = g_param_spec_boolean ("sort-on-surname", "sort-on-surname", "sort-on-surname", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_SETTINGS_WINDOW_WIDTH_PROPERTY, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_WIDTH_PROPERTY] = g_param_spec_int ("window-width", "window-width", "window-width", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_SETTINGS_WINDOW_HEIGHT_PROPERTY, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_HEIGHT_PROPERTY] = g_param_spec_int ("window-height", "window-height", "window-height", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_SETTINGS_WINDOW_MAXIMIZED_PROPERTY, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_MAXIMIZED_PROPERTY] = g_param_spec_boolean ("window-maximized", "window-maximized", "window-maximized", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_SETTINGS_WINDOW_FULLSCREEN_PROPERTY, contacts_settings_properties[CONTACTS_SETTINGS_WINDOW_FULLSCREEN_PROPERTY] = g_param_spec_boolean ("window-fullscreen", "window-fullscreen", "window-fullscreen", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
contacts_settings_instance_init (ContactsSettings * self,
                                 gpointer klass)
{
}

/**
 * Provides a convenient interface to deal with Contacts' settings.
 *
 * When editing this, make sure you keep it in sync with the schema file!
 */
 G_GNUC_NO_INLINE static GType
contacts_settings_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ContactsSettingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_settings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsSettings), 0, (GInstanceInitFunc) contacts_settings_instance_init, NULL };
	GType contacts_settings_type_id;
	contacts_settings_type_id = g_type_register_static (g_settings_get_type (), "ContactsSettings", &g_define_type_info, 0);
	return contacts_settings_type_id;
}

GType
contacts_settings_get_type (void)
{
	static volatile gsize contacts_settings_type_id__once = 0;
	if (g_once_init_enter (&contacts_settings_type_id__once)) {
		GType contacts_settings_type_id;
		contacts_settings_type_id = contacts_settings_get_type_once ();
		g_once_init_leave (&contacts_settings_type_id__once, contacts_settings_type_id);
	}
	return contacts_settings_type_id__once;
}

static void
_vala_contacts_settings_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	ContactsSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_SETTINGS, ContactsSettings);
	switch (property_id) {
		case CONTACTS_SETTINGS_DID_INITIAL_SETUP_PROPERTY:
		g_value_set_boolean (value, contacts_settings_get_did_initial_setup (self));
		break;
		case CONTACTS_SETTINGS_SORT_ON_SURNAME_PROPERTY:
		g_value_set_boolean (value, contacts_settings_get_sort_on_surname (self));
		break;
		case CONTACTS_SETTINGS_WINDOW_WIDTH_PROPERTY:
		g_value_set_int (value, contacts_settings_get_window_width (self));
		break;
		case CONTACTS_SETTINGS_WINDOW_HEIGHT_PROPERTY:
		g_value_set_int (value, contacts_settings_get_window_height (self));
		break;
		case CONTACTS_SETTINGS_WINDOW_MAXIMIZED_PROPERTY:
		g_value_set_boolean (value, contacts_settings_get_window_maximized (self));
		break;
		case CONTACTS_SETTINGS_WINDOW_FULLSCREEN_PROPERTY:
		g_value_set_boolean (value, contacts_settings_get_window_fullscreen (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_contacts_settings_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec)
{
	ContactsSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_SETTINGS, ContactsSettings);
	switch (property_id) {
		case CONTACTS_SETTINGS_DID_INITIAL_SETUP_PROPERTY:
		contacts_settings_set_did_initial_setup (self, g_value_get_boolean (value));
		break;
		case CONTACTS_SETTINGS_SORT_ON_SURNAME_PROPERTY:
		contacts_settings_set_sort_on_surname (self, g_value_get_boolean (value));
		break;
		case CONTACTS_SETTINGS_WINDOW_WIDTH_PROPERTY:
		contacts_settings_set_window_width (self, g_value_get_int (value));
		break;
		case CONTACTS_SETTINGS_WINDOW_HEIGHT_PROPERTY:
		contacts_settings_set_window_height (self, g_value_get_int (value));
		break;
		case CONTACTS_SETTINGS_WINDOW_MAXIMIZED_PROPERTY:
		contacts_settings_set_window_maximized (self, g_value_get_boolean (value));
		break;
		case CONTACTS_SETTINGS_WINDOW_FULLSCREEN_PROPERTY:
		contacts_settings_set_window_fullscreen (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

