/* Generated by GOB (v2.0.15)   (do not edit directly) */

/* End world hunger, donate to the World Food Programme, http://www.wfp.org */

#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 15

#define selfp (self->_priv)

#include <string.h> /* memset() */

#include "mn-pop3-mailbox-properties.h"

#include "mn-pop3-mailbox-properties-private.h"

#ifdef G_LIKELY
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
#else /* ! G_LIKELY */
#define ___GOB_LIKELY(expr) (expr)
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */

#line 24 "src/mn-pop3-mailbox-properties.gob"

#include <glib/gi18n.h>
#include "mn-mailbox-properties.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
#include "mn-authenticated-mailbox-properties-private.h"
#include "mn-pi-mailbox-properties-private.h"
#include "mn-properties-dialog.h"
#include "mn-pop3-mailbox.h"

#line 37 "mn-pop3-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_POP3_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_POP3_MAILBOX_PROPERTIES_CONST(x)
#define IS_SELF(x) MN_IS_POP3_MAILBOX_PROPERTIES(x)
#define TYPE_SELF MN_TYPE_POP3_MAILBOX_PROPERTIES
#define SELF_CLASS(x) MN_POP3_MAILBOX_PROPERTIES_CLASS(x)

#define SELF_GET_CLASS(x) MN_POP3_MAILBOX_PROPERTIES_GET_CLASS(x)

/* self typedefs */
typedef MNPOP3MailboxProperties Self;
typedef MNPOP3MailboxPropertiesClass SelfClass;

/* here are local prototypes */
static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
#line 55 "src/mn-pop3-mailbox-properties.gob"
static void mn_pop3_mailbox_properties_class_init (MNPOP3MailboxPropertiesClass * class);
#line 55 "mn-pop3-mailbox-properties.c"
#line 63 "src/mn-pop3-mailbox-properties.gob"
static void mn_pop3_mailbox_properties_init (MNPOP3MailboxProperties * self);
#line 58 "mn-pop3-mailbox-properties.c"

enum {
	PROP_0,
	PROP_DEFAULT_NAME
};

/* pointer to the class of our parent */
static MNPIMailboxPropertiesClass *parent_class = NULL;

GType
mn_pop3_mailbox_properties_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (MNPOP3MailboxPropertiesClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) mn_pop3_mailbox_properties_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (MNPOP3MailboxProperties),
			0 /* n_preallocs */,
			(GInstanceInitFunc) mn_pop3_mailbox_properties_init,
			NULL
		};

		type = g_type_register_static (MN_TYPE_PI_MAILBOX_PROPERTIES, "MNPOP3MailboxProperties", &info, (GTypeFlags)0);
	}

	return type;
}

/* a macro for creating a new object of our type */
#define GET_NEW ((MNPOP3MailboxProperties *)g_object_new(mn_pop3_mailbox_properties_get_type(), NULL))

/* a function for creating a new object of our type */
#include <stdarg.h>
static MNPOP3MailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
static MNPOP3MailboxProperties *
GET_NEW_VARG (const char *first, ...)
{
	MNPOP3MailboxProperties *ret;
	va_list ap;
	va_start (ap, first);
	ret = (MNPOP3MailboxProperties *)g_object_new_valist (mn_pop3_mailbox_properties_get_type (), first, ap);
	va_end (ap);
	return ret;
}

#line 55 "src/mn-pop3-mailbox-properties.gob"
static void 
mn_pop3_mailbox_properties_class_init (MNPOP3MailboxPropertiesClass * class G_GNUC_UNUSED)
{
#line 114 "mn-pop3-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::class_init"
	GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;

	parent_class = g_type_class_ref (MN_TYPE_PI_MAILBOX_PROPERTIES);

	g_object_class->get_property = ___object_get_property;
    {
	g_object_class_override_property (g_object_class,
		PROP_DEFAULT_NAME,
		"default_name");
    }
 {
#line 56 "src/mn-pop3-mailbox-properties.gob"

    MNMailboxPropertiesClass *p_class = MN_MAILBOX_PROPERTIES_CLASS(class);

    p_class->type = "pop3";
    p_class->combo_label = "POP3";
  
#line 134 "mn-pop3-mailbox-properties.c"
 }
}
#undef __GOB_FUNCTION__
#line 63 "src/mn-pop3-mailbox-properties.gob"
static void 
mn_pop3_mailbox_properties_init (MNPOP3MailboxProperties * self G_GNUC_UNUSED)
{
#line 142 "mn-pop3-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::init"
 {
#line 64 "src/mn-pop3-mailbox-properties.gob"

    MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
    int i;

    mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+APOP", "APOP");
    mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+USERPASS", "USER/PASS");

    for (i = 0; i < MN_PI_MAILBOX_N_CONNECTION_TYPES; i++)
      gtk_spin_button_set_value(GTK_SPIN_BUTTON(pi->port_spin[i]), mn_pop3_mailbox_default_ports[i]);
  
#line 156 "mn-pop3-mailbox-properties.c"
 }
}
#undef __GOB_FUNCTION__

static void
___object_get_property (GObject *object,
	guint property_id,
	GValue *VAL G_GNUC_UNUSED,
	GParamSpec *pspec G_GNUC_UNUSED)
#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::get_property"
{
	MNPOP3MailboxProperties *self G_GNUC_UNUSED;

	self = MN_POP3_MAILBOX_PROPERTIES (object);

	switch (property_id) {
	case PROP_DEFAULT_NAME:
		{
#line 39 "src/mn-pop3-mailbox-properties.gob"

      const char *username;
      const char *server;

      mn_authenticated_mailbox_properties_get_contents(MN_AUTHENTICATED_MAILBOX_PROPERTIES(self),
						       &username,
						       NULL);
      mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(self),
					    NULL,
					    NULL,
					    &server,
					    NULL);

      g_value_take_string(VAL, mn_pop3_mailbox_build_name(username, server));
    
#line 191 "mn-pop3-mailbox-properties.c"
		}
		break;
	default:
/* Apparently in g++ this is needed, glib is b0rk */
#ifndef __PRETTY_FUNCTION__
#  undef G_STRLOC
#  define G_STRLOC	__FILE__ ":" G_STRINGIFY (__LINE__)
#endif
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
#undef __GOB_FUNCTION__


