/* ConfigLocationS3.c generated by valac 0.11.6, the Vala compiler
 * generated from ConfigLocationS3.vala, do not modify */

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
    This file is part of Déjà Dup.
    © 2010 Michael Terry <mike@mterry.name>

    Déjà Dup 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 3 of the License, or
    (at your option) any later version.

    Déjà Dup 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 Déjà Dup.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <common.h>


#define DEJA_DUP_TYPE_CONFIG_LOCATION_TABLE (deja_dup_config_location_table_get_type ())
#define DEJA_DUP_CONFIG_LOCATION_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_LOCATION_TABLE, DejaDupConfigLocationTable))
#define DEJA_DUP_CONFIG_LOCATION_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_LOCATION_TABLE, DejaDupConfigLocationTableClass))
#define DEJA_DUP_IS_CONFIG_LOCATION_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_LOCATION_TABLE))
#define DEJA_DUP_IS_CONFIG_LOCATION_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_LOCATION_TABLE))
#define DEJA_DUP_CONFIG_LOCATION_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_LOCATION_TABLE, DejaDupConfigLocationTableClass))

typedef struct _DejaDupConfigLocationTable DejaDupConfigLocationTable;
typedef struct _DejaDupConfigLocationTableClass DejaDupConfigLocationTableClass;
typedef struct _DejaDupConfigLocationTablePrivate DejaDupConfigLocationTablePrivate;

#define DEJA_DUP_TYPE_CONFIG_LOCATION_S3 (deja_dup_config_location_s3_get_type ())
#define DEJA_DUP_CONFIG_LOCATION_S3(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_LOCATION_S3, DejaDupConfigLocationS3))
#define DEJA_DUP_CONFIG_LOCATION_S3_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_LOCATION_S3, DejaDupConfigLocationS3Class))
#define DEJA_DUP_IS_CONFIG_LOCATION_S3(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_LOCATION_S3))
#define DEJA_DUP_IS_CONFIG_LOCATION_S3_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_LOCATION_S3))
#define DEJA_DUP_CONFIG_LOCATION_S3_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_LOCATION_S3, DejaDupConfigLocationS3Class))

typedef struct _DejaDupConfigLocationS3 DejaDupConfigLocationS3;
typedef struct _DejaDupConfigLocationS3Class DejaDupConfigLocationS3Class;
typedef struct _DejaDupConfigLocationS3Private DejaDupConfigLocationS3Private;

#define DEJA_DUP_TYPE_TOGGLABLE (deja_dup_togglable_get_type ())
#define DEJA_DUP_TOGGLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_TOGGLABLE, DejaDupTogglable))
#define DEJA_DUP_IS_TOGGLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_TOGGLABLE))
#define DEJA_DUP_TOGGLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), DEJA_DUP_TYPE_TOGGLABLE, DejaDupTogglableIface))

typedef struct _DejaDupTogglable DejaDupTogglable;
typedef struct _DejaDupTogglableIface DejaDupTogglableIface;

#define DEJA_DUP_TYPE_CONFIG_WIDGET (deja_dup_config_widget_get_type ())
#define DEJA_DUP_CONFIG_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_WIDGET, DejaDupConfigWidget))
#define DEJA_DUP_CONFIG_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_WIDGET, DejaDupConfigWidgetClass))
#define DEJA_DUP_IS_CONFIG_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_WIDGET))
#define DEJA_DUP_IS_CONFIG_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_WIDGET))
#define DEJA_DUP_CONFIG_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_WIDGET, DejaDupConfigWidgetClass))

typedef struct _DejaDupConfigWidget DejaDupConfigWidget;
typedef struct _DejaDupConfigWidgetClass DejaDupConfigWidgetClass;

#define DEJA_DUP_TYPE_CONFIG_ENTRY (deja_dup_config_entry_get_type ())
#define DEJA_DUP_CONFIG_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_ENTRY, DejaDupConfigEntry))
#define DEJA_DUP_CONFIG_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_ENTRY, DejaDupConfigEntryClass))
#define DEJA_DUP_IS_CONFIG_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_ENTRY))
#define DEJA_DUP_IS_CONFIG_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_ENTRY))
#define DEJA_DUP_CONFIG_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_ENTRY, DejaDupConfigEntryClass))

typedef struct _DejaDupConfigEntry DejaDupConfigEntry;
typedef struct _DejaDupConfigEntryClass DejaDupConfigEntryClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define DEJA_DUP_TYPE_CONFIG_FOLDER (deja_dup_config_folder_get_type ())
#define DEJA_DUP_CONFIG_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_FOLDER, DejaDupConfigFolder))
#define DEJA_DUP_CONFIG_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_FOLDER, DejaDupConfigFolderClass))
#define DEJA_DUP_IS_CONFIG_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_FOLDER))
#define DEJA_DUP_IS_CONFIG_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_FOLDER))
#define DEJA_DUP_CONFIG_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_FOLDER, DejaDupConfigFolderClass))

typedef struct _DejaDupConfigFolder DejaDupConfigFolder;
typedef struct _DejaDupConfigFolderClass DejaDupConfigFolderClass;

struct _DejaDupConfigLocationTable {
	GtkTable parent_instance;
	DejaDupConfigLocationTablePrivate * priv;
	gint row;
};

struct _DejaDupConfigLocationTableClass {
	GtkTableClass parent_class;
};

struct _DejaDupConfigLocationS3 {
	DejaDupConfigLocationTable parent_instance;
	DejaDupConfigLocationS3Private * priv;
};

struct _DejaDupConfigLocationS3Class {
	DejaDupConfigLocationTableClass parent_class;
};

struct _DejaDupTogglableIface {
	GTypeInterface parent_iface;
	gboolean (*get_active) (DejaDupTogglable* self);
};


static gpointer deja_dup_config_location_s3_parent_class = NULL;

GType deja_dup_config_location_table_get_type (void) G_GNUC_CONST;
GType deja_dup_config_location_s3_get_type (void) G_GNUC_CONST;
enum  {
	DEJA_DUP_CONFIG_LOCATION_S3_DUMMY_PROPERTY
};
DejaDupConfigLocationS3* deja_dup_config_location_s3_new (GtkSizeGroup* sg);
DejaDupConfigLocationS3* deja_dup_config_location_s3_construct (GType object_type, GtkSizeGroup* sg);
static GObject * deja_dup_config_location_s3_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
void deja_dup_config_location_table_add_optional_label (DejaDupConfigLocationTable* self);
GType deja_dup_togglable_get_type (void) G_GNUC_CONST;
void deja_dup_config_location_table_add_widget (DejaDupConfigLocationTable* self, const gchar* msg, GtkWidget* w, DejaDupTogglable* check);
DejaDupConfigEntry* deja_dup_config_entry_new (const gchar* key, const gchar* ns);
DejaDupConfigEntry* deja_dup_config_entry_construct (GType object_type, const gchar* key, const gchar* ns);
GType deja_dup_config_widget_get_type (void) G_GNUC_CONST;
GType deja_dup_config_entry_get_type (void) G_GNUC_CONST;
DejaDupConfigFolder* deja_dup_config_folder_new (const gchar* key, const gchar* ns);
DejaDupConfigFolder* deja_dup_config_folder_construct (GType object_type, const gchar* key, const gchar* ns);
GType deja_dup_config_folder_get_type (void) G_GNUC_CONST;


DejaDupConfigLocationS3* deja_dup_config_location_s3_construct (GType object_type, GtkSizeGroup* sg) {
	DejaDupConfigLocationS3 * self = NULL;
	g_return_val_if_fail (sg != NULL, NULL);
	self = (DejaDupConfigLocationS3*) g_object_new (object_type, "label-sizes", sg, NULL);
	return self;
}


DejaDupConfigLocationS3* deja_dup_config_location_s3_new (GtkSizeGroup* sg) {
	return deja_dup_config_location_s3_construct (DEJA_DUP_TYPE_CONFIG_LOCATION_S3, sg);
}


static GObject * deja_dup_config_location_s3_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	DejaDupConfigLocationS3 * self;
	const gchar* _tmp0_ = NULL;
	DejaDupConfigEntry* _tmp1_ = NULL;
	DejaDupConfigEntry* _tmp2_;
	const gchar* _tmp3_ = NULL;
	DejaDupConfigFolder* _tmp4_ = NULL;
	DejaDupConfigFolder* _tmp5_;
	parent_class = G_OBJECT_CLASS (deja_dup_config_location_s3_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = DEJA_DUP_CONFIG_LOCATION_S3 (obj);
	deja_dup_config_location_table_add_optional_label ((DejaDupConfigLocationTable*) self);
	_tmp0_ = _ ("S3 Access Key I_D:");
	_tmp1_ = deja_dup_config_entry_new (DEJA_DUP_S3_ID_KEY, DEJA_DUP_S3_ROOT);
	_tmp2_ = g_object_ref_sink (_tmp1_);
	deja_dup_config_location_table_add_widget ((DejaDupConfigLocationTable*) self, _tmp0_, (GtkWidget*) _tmp2_, NULL);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = _ ("_Folder:");
	_tmp4_ = deja_dup_config_folder_new (DEJA_DUP_S3_FOLDER_KEY, DEJA_DUP_S3_ROOT);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	deja_dup_config_location_table_add_widget ((DejaDupConfigLocationTable*) self, _tmp3_, (GtkWidget*) _tmp5_, NULL);
	_g_object_unref0 (_tmp5_);
	return obj;
}


static void deja_dup_config_location_s3_class_init (DejaDupConfigLocationS3Class * klass) {
	deja_dup_config_location_s3_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = deja_dup_config_location_s3_constructor;
}


static void deja_dup_config_location_s3_instance_init (DejaDupConfigLocationS3 * self) {
}


GType deja_dup_config_location_s3_get_type (void) {
	static volatile gsize deja_dup_config_location_s3_type_id__volatile = 0;
	if (g_once_init_enter (&deja_dup_config_location_s3_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DejaDupConfigLocationS3Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_config_location_s3_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupConfigLocationS3), 0, (GInstanceInitFunc) deja_dup_config_location_s3_instance_init, NULL };
		GType deja_dup_config_location_s3_type_id;
		deja_dup_config_location_s3_type_id = g_type_register_static (DEJA_DUP_TYPE_CONFIG_LOCATION_TABLE, "DejaDupConfigLocationS3", &g_define_type_info, 0);
		g_once_init_leave (&deja_dup_config_location_s3_type_id__volatile, deja_dup_config_location_s3_type_id);
	}
	return deja_dup_config_location_s3_type_id__volatile;
}



