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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include <adwaita.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "deja.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#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 TYPE_CONFIG_COMBO_ROW (config_combo_row_get_type ())
#define CONFIG_COMBO_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIG_COMBO_ROW, ConfigComboRow))
#define CONFIG_COMBO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIG_COMBO_ROW, ConfigComboRowClass))
#define IS_CONFIG_COMBO_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIG_COMBO_ROW))
#define IS_CONFIG_COMBO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIG_COMBO_ROW))
#define CONFIG_COMBO_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIG_COMBO_ROW, ConfigComboRowClass))

typedef struct _ConfigComboRow ConfigComboRow;
typedef struct _ConfigComboRowClass ConfigComboRowClass;
typedef struct _ConfigComboRowPrivate ConfigComboRowPrivate;

#define TYPE_CONFIG_DELETE (config_delete_get_type ())
#define CONFIG_DELETE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIG_DELETE, ConfigDelete))
#define CONFIG_DELETE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIG_DELETE, ConfigDeleteClass))
#define IS_CONFIG_DELETE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIG_DELETE))
#define IS_CONFIG_DELETE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIG_DELETE))
#define CONFIG_DELETE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIG_DELETE, ConfigDeleteClass))

typedef struct _ConfigDelete ConfigDelete;
typedef struct _ConfigDeleteClass ConfigDeleteClass;
typedef struct _ConfigDeletePrivate ConfigDeletePrivate;
enum  {
	CONFIG_DELETE_0_PROPERTY,
	CONFIG_DELETE_NUM_PROPERTIES
};
static GParamSpec* config_delete_properties[CONFIG_DELETE_NUM_PROPERTIES];

struct _ConfigComboRow {
	AdwComboRow parent_instance;
	ConfigComboRowPrivate * priv;
};

struct _ConfigComboRowClass {
	AdwComboRowClass parent_class;
	void (*fill_store) (ConfigComboRow* self);
	gchar* (*setting_name) (ConfigComboRow* self);
	gchar* (*label_for_value) (ConfigComboRow* self, gint val);
	gint (*clamp_value) (ConfigComboRow* self, gint val);
	gint (*compare_value) (ConfigComboRow* self, gint val);
};

struct _ConfigDelete {
	ConfigComboRow parent_instance;
	ConfigDeletePrivate * priv;
};

struct _ConfigDeleteClass {
	ConfigComboRowClass parent_class;
};

static gpointer config_delete_parent_class = NULL;

VALA_EXTERN GType config_combo_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigComboRow, g_object_unref)
VALA_EXTERN GType config_delete_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigDelete, g_object_unref)
VALA_EXTERN void config_combo_row_fill_store (ConfigComboRow* self);
VALA_EXTERN gchar* config_combo_row_setting_name (ConfigComboRow* self);
VALA_EXTERN gchar* config_combo_row_label_for_value (ConfigComboRow* self,
                                         gint val);
VALA_EXTERN gint config_combo_row_clamp_value (ConfigComboRow* self,
                                   gint val);
VALA_EXTERN gint config_combo_row_compare_value (ConfigComboRow* self,
                                     gint val);
static void config_delete_real_fill_store (ConfigComboRow* base);
VALA_EXTERN guint config_combo_row_add_item (ConfigComboRow* self,
                                 gint val,
                                 const gchar* label);
static gchar* config_delete_real_setting_name (ConfigComboRow* base);
static gchar* config_delete_real_label_for_value (ConfigComboRow* base,
                                           gint val);
static gint config_delete_real_clamp_value (ConfigComboRow* base,
                                     gint val);
static gint config_delete_real_compare_value (ConfigComboRow* base,
                                       gint val);
VALA_EXTERN ConfigDelete* config_delete_new (void);
VALA_EXTERN ConfigDelete* config_delete_construct (GType object_type);
VALA_EXTERN ConfigComboRow* config_combo_row_construct (GType object_type);
static GType config_delete_get_type_once (void);

static void
config_delete_real_fill_store (ConfigComboRow* base)
{
	ConfigDelete * self;
	self = (ConfigDelete*) base;
	config_combo_row_add_item ((ConfigComboRow*) self, 90, _ ("At least three months"));
	config_combo_row_add_item ((ConfigComboRow*) self, 182, _ ("At least six months"));
	config_combo_row_add_item ((ConfigComboRow*) self, 365, _ ("At least a year"));
	config_combo_row_add_item ((ConfigComboRow*) self, 0, _ ("Forever"));
}

static gchar*
config_delete_real_setting_name (ConfigComboRow* base)
{
	ConfigDelete * self;
	gchar* _tmp0_;
	gchar* result;
	self = (ConfigDelete*) base;
	_tmp0_ = g_strdup (DEJA_DUP_DELETE_AFTER_KEY);
	result = _tmp0_;
	return result;
}

static gchar*
config_delete_real_label_for_value (ConfigComboRow* base,
                                    gint val)
{
	ConfigDelete * self;
	gchar* _tmp0_;
	gchar* result;
	self = (ConfigDelete*) base;
	_tmp0_ = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "At least %d day", "At least %d days", (gulong) val), val);
	result = _tmp0_;
	return result;
}

static gint
config_delete_real_clamp_value (ConfigComboRow* base,
                                gint val)
{
	ConfigDelete * self;
	gint result;
	self = (ConfigDelete*) base;
	result = MAX (0, val);
	return result;
}

static gint
config_delete_real_compare_value (ConfigComboRow* base,
                                  gint val)
{
	ConfigDelete * self;
	gint _tmp0_ = 0;
	gint result;
	self = (ConfigDelete*) base;
	if (val == 0) {
		_tmp0_ = G_MAXINT;
	} else {
		_tmp0_ = val;
	}
	result = _tmp0_;
	return result;
}

ConfigDelete*
config_delete_construct (GType object_type)
{
	ConfigDelete * self = NULL;
	self = (ConfigDelete*) config_combo_row_construct (object_type);
	return self;
}

ConfigDelete*
config_delete_new (void)
{
	return config_delete_construct (TYPE_CONFIG_DELETE);
}

static void
config_delete_class_init (ConfigDeleteClass * klass,
                          gpointer klass_data)
{
	config_delete_parent_class = g_type_class_peek_parent (klass);
	((ConfigComboRowClass *) klass)->fill_store = (void (*) (ConfigComboRow*)) config_delete_real_fill_store;
	((ConfigComboRowClass *) klass)->setting_name = (gchar* (*) (ConfigComboRow*)) config_delete_real_setting_name;
	((ConfigComboRowClass *) klass)->label_for_value = (gchar* (*) (ConfigComboRow*, gint)) config_delete_real_label_for_value;
	((ConfigComboRowClass *) klass)->clamp_value = (gint (*) (ConfigComboRow*, gint)) config_delete_real_clamp_value;
	((ConfigComboRowClass *) klass)->compare_value = (gint (*) (ConfigComboRow*, gint)) config_delete_real_compare_value;
}

static void
config_delete_instance_init (ConfigDelete * self,
                             gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
config_delete_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConfigDeleteClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) config_delete_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConfigDelete), 0, (GInstanceInitFunc) config_delete_instance_init, NULL };
	GType config_delete_type_id;
	config_delete_type_id = g_type_register_static (TYPE_CONFIG_COMBO_ROW, "ConfigDelete", &g_define_type_info, G_TYPE_FLAG_NONE);
	return config_delete_type_id;
}

GType
config_delete_get_type (void)
{
	static GType config_delete_type_id__once = 0;
	if (g_once_init_enter_pointer (&config_delete_type_id__once)) {
		GType config_delete_type_id;
		config_delete_type_id = config_delete_get_type_once ();
		g_once_init_leave_pointer (&config_delete_type_id__once, config_delete_type_id);
	}
	return config_delete_type_id__once;
}

