/* 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>
 * Copyright (C) 2013 Jeremy Bicha <jbicha@ubuntu.com>
 * 
 * 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_SECURITY_WIDGET (alm_security_widget_get_type ())
#define ALM_SECURITY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_SECURITY_WIDGET, AlmSecurityWidget))
#define ALM_SECURITY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_SECURITY_WIDGET, AlmSecurityWidgetClass))
#define ALM_IS_SECURITY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_SECURITY_WIDGET))
#define ALM_IS_SECURITY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_SECURITY_WIDGET))
#define ALM_SECURITY_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_SECURITY_WIDGET, AlmSecurityWidgetClass))

typedef struct _AlmSecurityWidget AlmSecurityWidget;
typedef struct _AlmSecurityWidgetClass AlmSecurityWidgetClass;

#define ALM_TYPE_SEARCH_RESULTS_WIDGET (alm_search_results_widget_get_type ())
#define ALM_SEARCH_RESULTS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_SEARCH_RESULTS_WIDGET, AlmSearchResultsWidget))
#define ALM_SEARCH_RESULTS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_SEARCH_RESULTS_WIDGET, AlmSearchResultsWidgetClass))
#define ALM_IS_SEARCH_RESULTS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_SEARCH_RESULTS_WIDGET))
#define ALM_IS_SEARCH_RESULTS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_SEARCH_RESULTS_WIDGET))
#define ALM_SEARCH_RESULTS_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_SEARCH_RESULTS_WIDGET, AlmSearchResultsWidgetClass))

typedef struct _AlmSearchResultsWidget AlmSearchResultsWidget;
typedef struct _AlmSearchResultsWidgetClass AlmSearchResultsWidgetClass;

#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;
	AlmSecurityWidget* security_widget;
	AlmSearchResultsWidget* searchresults_widget;
	AlmPrivacyWidget* privacy_widget;
	GtkWidget* whoopsie;
	AlmBlacklist* blacklist;
};


static gpointer alm_activity_log_manager_parent_class = NULL;

GtkWidget* whoopsie_daisy_preferences_new (void);
GType alm_activity_log_manager_get_type (void) G_GNUC_CONST;
GType alm_security_widget_get_type (void) G_GNUC_CONST;
GType alm_search_results_widget_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);
AlmSecurityWidget* alm_security_widget_new (void);
AlmSecurityWidget* alm_security_widget_construct (GType object_type);
AlmSearchResultsWidget* alm_search_results_widget_new (void);
AlmSearchResultsWidget* alm_search_results_widget_construct (GType object_type);
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_;
	GtkLabel* _tmp9_;
	const gchar* _tmp10_ = NULL;
	GtkWidget* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	GtkLabel* _tmp25_;
	GtkLabel* whoopsie_label;
	GtkNotebook* _tmp26_;
	GtkWidget* _tmp27_;
	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;
	_tmp9_ = privacy_label;
	gtk_notebook_append_page (_tmp7_, (GtkWidget*) _tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = g_getenv ("XDG_CURRENT_DESKTOP");
	if (g_strcmp0 (_tmp10_, "Unity") == 0) {
		AlmSecurityWidget* _tmp11_;
		const gchar* _tmp12_ = NULL;
		GtkLabel* _tmp13_;
		GtkLabel* security_label;
		GtkNotebook* _tmp14_;
		AlmSecurityWidget* _tmp15_;
		GtkLabel* _tmp16_;
		AlmSearchResultsWidget* _tmp17_;
		const gchar* _tmp18_ = NULL;
		GtkLabel* _tmp19_;
		GtkLabel* searchresults_label;
		GtkNotebook* _tmp20_;
		AlmSearchResultsWidget* _tmp21_;
		GtkLabel* _tmp22_;
		_tmp11_ = alm_security_widget_new ();
		g_object_ref_sink (_tmp11_);
		_g_object_unref0 (self->priv->security_widget);
		self->priv->security_widget = _tmp11_;
		_tmp12_ = _ ("Security");
		_tmp13_ = (GtkLabel*) gtk_label_new (_tmp12_);
		g_object_ref_sink (_tmp13_);
		security_label = _tmp13_;
		_tmp14_ = self->priv->notebook;
		_tmp15_ = self->priv->security_widget;
		_tmp16_ = security_label;
		gtk_notebook_prepend_page (_tmp14_, (GtkWidget*) _tmp15_, (GtkWidget*) _tmp16_);
		_tmp17_ = alm_search_results_widget_new ();
		g_object_ref_sink (_tmp17_);
		_g_object_unref0 (self->priv->searchresults_widget);
		self->priv->searchresults_widget = _tmp17_;
		_tmp18_ = _ ("Search");
		_tmp19_ = (GtkLabel*) gtk_label_new (_tmp18_);
		g_object_ref_sink (_tmp19_);
		searchresults_label = _tmp19_;
		_tmp20_ = self->priv->notebook;
		_tmp21_ = self->priv->searchresults_widget;
		_tmp22_ = searchresults_label;
		gtk_notebook_append_page (_tmp20_, (GtkWidget*) _tmp21_, (GtkWidget*) _tmp22_);
		_g_object_unref0 (searchresults_label);
		_g_object_unref0 (security_label);
	}
	_tmp23_ = whoopsie_daisy_preferences_new ();
	_g_object_unref0 (self->priv->whoopsie);
	self->priv->whoopsie = _tmp23_;
	_tmp24_ = _ ("Diagnostics");
	_tmp25_ = (GtkLabel*) gtk_label_new (_tmp24_);
	g_object_ref_sink (_tmp25_);
	whoopsie_label = _tmp25_;
	_tmp26_ = self->priv->notebook;
	_tmp27_ = self->priv->whoopsie;
	gtk_notebook_append_page (_tmp26_, _tmp27_, (GtkWidget*) whoopsie_label);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (whoopsie_label);
	_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->security_widget);
	_g_object_unref0 (self->priv->searchresults_widget);
	_g_object_unref0 (self->priv->privacy_widget);
	_g_object_unref0 (self->priv->whoopsie);
	_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;
}



