/* activity-log-manager.c generated by valac 0.20.1, the Vala compiler
 * generated from activity-log-manager.vala, do not modify */

/*
 * activity-log-manager.vala
 * Copyright (C) 2012 Seif Lotfy <seif@lotfy.com>
 * Copyright (C) 2012 Stefano Candori <stefano.candori@gmail.com>
 * Copyright (C) 2012 Manish Sinha <manishsinha@ubuntu.com>
 * Copyright (C) 2012 Intel Corp.
 *               Authored by: Seif Lotfy <seif.lotfy@collabora.co.uk>
 * 
 * alm 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 of the License, or
 * (at your option) any later version.
 * 
 * alm 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 program.  If not, see <http://www.gnu.org/licenses/>.";
 */

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


#define ALM_TYPE_ACTIVITY_LOG_MANAGER (alm_activity_log_manager_get_type ())
#define ALM_ACTIVITY_LOG_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_ACTIVITY_LOG_MANAGER, AlmActivityLogManager))
#define ALM_ACTIVITY_LOG_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_ACTIVITY_LOG_MANAGER, AlmActivityLogManagerClass))
#define ALM_IS_ACTIVITY_LOG_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_ACTIVITY_LOG_MANAGER))
#define ALM_IS_ACTIVITY_LOG_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_ACTIVITY_LOG_MANAGER))
#define ALM_ACTIVITY_LOG_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_ACTIVITY_LOG_MANAGER, AlmActivityLogManagerClass))

typedef struct _AlmActivityLogManager AlmActivityLogManager;
typedef struct _AlmActivityLogManagerClass AlmActivityLogManagerClass;
typedef struct _AlmActivityLogManagerPrivate AlmActivityLogManagerPrivate;

#define ALM_TYPE_PRIVACY_WIDGET (alm_privacy_widget_get_type ())
#define ALM_PRIVACY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_PRIVACY_WIDGET, AlmPrivacyWidget))
#define ALM_PRIVACY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_PRIVACY_WIDGET, AlmPrivacyWidgetClass))
#define ALM_IS_PRIVACY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_PRIVACY_WIDGET))
#define ALM_IS_PRIVACY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_PRIVACY_WIDGET))
#define ALM_PRIVACY_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_PRIVACY_WIDGET, AlmPrivacyWidgetClass))

typedef struct _AlmPrivacyWidget AlmPrivacyWidget;
typedef struct _AlmPrivacyWidgetClass AlmPrivacyWidgetClass;

#define ALM_TYPE_BLACKLIST (alm_blacklist_get_type ())
#define ALM_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_BLACKLIST, AlmBlacklist))
#define ALM_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_BLACKLIST, AlmBlacklistClass))
#define ALM_IS_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_BLACKLIST))
#define ALM_IS_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_BLACKLIST))
#define ALM_BLACKLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_BLACKLIST, AlmBlacklistClass))

typedef struct _AlmBlacklist AlmBlacklist;
typedef struct _AlmBlacklistClass AlmBlacklistClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _alm_blacklist_unref0(var) ((var == NULL) ? NULL : (var = (alm_blacklist_unref (var), NULL)))

struct _AlmActivityLogManager {
	GtkBox parent_instance;
	AlmActivityLogManagerPrivate * priv;
};

struct _AlmActivityLogManagerClass {
	GtkBoxClass parent_class;
};

struct _AlmActivityLogManagerPrivate {
	GtkNotebook* notebook;
	AlmPrivacyWidget* privacy_widget;
	AlmBlacklist* blacklist;
};


static gpointer alm_activity_log_manager_parent_class = NULL;

GType alm_activity_log_manager_get_type (void) G_GNUC_CONST;
GType alm_privacy_widget_get_type (void) G_GNUC_CONST;
gpointer alm_blacklist_ref (gpointer instance);
void alm_blacklist_unref (gpointer instance);
GParamSpec* alm_param_spec_blacklist (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void alm_value_set_blacklist (GValue* value, gpointer v_object);
void alm_value_take_blacklist (GValue* value, gpointer v_object);
gpointer alm_value_get_blacklist (const GValue* value);
GType alm_blacklist_get_type (void) G_GNUC_CONST;
#define ALM_ACTIVITY_LOG_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ALM_TYPE_ACTIVITY_LOG_MANAGER, AlmActivityLogManagerPrivate))
enum  {
	ALM_ACTIVITY_LOG_MANAGER_DUMMY_PROPERTY
};
AlmActivityLogManager* alm_activity_log_manager_new (void);
AlmActivityLogManager* alm_activity_log_manager_construct (GType object_type);
AlmBlacklist* alm_blacklist_new (void);
AlmBlacklist* alm_blacklist_construct (GType object_type);
AlmPrivacyWidget* alm_privacy_widget_new (AlmBlacklist* blacklist_interface);
AlmPrivacyWidget* alm_privacy_widget_construct (GType object_type, AlmBlacklist* blacklist_interface);
void alm_activity_log_manager_append_page (AlmActivityLogManager* self, GtkWidget* widget, const gchar* label);
static void alm_activity_log_manager_finalize (GObject* obj);


AlmActivityLogManager* alm_activity_log_manager_construct (GType object_type) {
	AlmActivityLogManager * self = NULL;
	AlmBlacklist* _tmp0_;
	AlmBlacklist* _tmp1_;
	AlmPrivacyWidget* _tmp2_;
	GtkNotebook* _tmp3_;
	GtkNotebook* _tmp4_;
	const gchar* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GtkLabel* privacy_label;
	GtkNotebook* _tmp7_;
	AlmPrivacyWidget* _tmp8_;
	self = (AlmActivityLogManager*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
	gtk_widget_set_size_request ((GtkWidget*) self, 600, 450);
	gtk_box_set_spacing ((GtkBox*) self, 6);
	g_object_set ((GtkWidget*) self, "margin", 12, NULL);
	_tmp0_ = alm_blacklist_new ();
	_alm_blacklist_unref0 (self->priv->blacklist);
	self->priv->blacklist = _tmp0_;
	_tmp1_ = self->priv->blacklist;
	_tmp2_ = alm_privacy_widget_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->privacy_widget);
	self->priv->privacy_widget = _tmp2_;
	_tmp3_ = (GtkNotebook*) gtk_notebook_new ();
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->notebook);
	self->priv->notebook = _tmp3_;
	_tmp4_ = self->priv->notebook;
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp4_, TRUE, TRUE, (guint) 0);
	_tmp5_ = _ ("Files & Applications");
	_tmp6_ = (GtkLabel*) gtk_label_new (_tmp5_);
	g_object_ref_sink (_tmp6_);
	privacy_label = _tmp6_;
	_tmp7_ = self->priv->notebook;
	_tmp8_ = self->priv->privacy_widget;
	gtk_notebook_append_page (_tmp7_, (GtkWidget*) _tmp8_, (GtkWidget*) privacy_label);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (privacy_label);
	return self;
}


AlmActivityLogManager* alm_activity_log_manager_new (void) {
	return alm_activity_log_manager_construct (ALM_TYPE_ACTIVITY_LOG_MANAGER);
}


void alm_activity_log_manager_append_page (AlmActivityLogManager* self, GtkWidget* widget, const gchar* label) {
	const gchar* _tmp0_;
	const gchar* _tmp1_ = NULL;
	GtkLabel* _tmp2_;
	GtkLabel* app_label;
	GtkNotebook* _tmp3_;
	GtkWidget* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (label != NULL);
	_tmp0_ = label;
	_tmp1_ = _ (_tmp0_);
	_tmp2_ = (GtkLabel*) gtk_label_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	app_label = _tmp2_;
	_tmp3_ = self->priv->notebook;
	_tmp4_ = widget;
	gtk_notebook_append_page (_tmp3_, _tmp4_, (GtkWidget*) app_label);
	_g_object_unref0 (app_label);
}


static void alm_activity_log_manager_class_init (AlmActivityLogManagerClass * klass) {
	alm_activity_log_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (AlmActivityLogManagerPrivate));
	G_OBJECT_CLASS (klass)->finalize = alm_activity_log_manager_finalize;
}


static void alm_activity_log_manager_instance_init (AlmActivityLogManager * self) {
	self->priv = ALM_ACTIVITY_LOG_MANAGER_GET_PRIVATE (self);
}


static void alm_activity_log_manager_finalize (GObject* obj) {
	AlmActivityLogManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_ACTIVITY_LOG_MANAGER, AlmActivityLogManager);
	_g_object_unref0 (self->priv->notebook);
	_g_object_unref0 (self->priv->privacy_widget);
	_alm_blacklist_unref0 (self->priv->blacklist);
	G_OBJECT_CLASS (alm_activity_log_manager_parent_class)->finalize (obj);
}


GType alm_activity_log_manager_get_type (void) {
	static volatile gsize alm_activity_log_manager_type_id__volatile = 0;
	if (g_once_init_enter (&alm_activity_log_manager_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AlmActivityLogManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_activity_log_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmActivityLogManager), 0, (GInstanceInitFunc) alm_activity_log_manager_instance_init, NULL };
		GType alm_activity_log_manager_type_id;
		alm_activity_log_manager_type_id = g_type_register_static (GTK_TYPE_BOX, "AlmActivityLogManager", &g_define_type_info, 0);
		g_once_init_leave (&alm_activity_log_manager_type_id__volatile, alm_activity_log_manager_type_id);
	}
	return alm_activity_log_manager_type_id__volatile;
}



