/* web-service-details.c generated by valac 0.13.1.106-1068, the Vala compiler
 * generated from web-service-details.vala, do not modify */

/*
 * Copyright (C) 2011 Collabora Ltd.
 *
 * This library 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.1 of the License, or
 * (at your option) any later version.
 *
 * This library 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 library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Alban Crequy <alban.crequy@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>


#define FOLKS_TYPE_ABSTRACT_FIELD_DETAILS (folks_abstract_field_details_get_type ())
#define FOLKS_ABSTRACT_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, FolksAbstractFieldDetails))
#define FOLKS_ABSTRACT_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, FolksAbstractFieldDetailsClass))
#define FOLKS_IS_ABSTRACT_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS))
#define FOLKS_IS_ABSTRACT_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS))
#define FOLKS_ABSTRACT_FIELD_DETAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, FolksAbstractFieldDetailsClass))

typedef struct _FolksAbstractFieldDetails FolksAbstractFieldDetails;
typedef struct _FolksAbstractFieldDetailsClass FolksAbstractFieldDetailsClass;
typedef struct _FolksAbstractFieldDetailsPrivate FolksAbstractFieldDetailsPrivate;

#define FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS (folks_web_service_field_details_get_type ())
#define FOLKS_WEB_SERVICE_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, FolksWebServiceFieldDetails))
#define FOLKS_WEB_SERVICE_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, FolksWebServiceFieldDetailsClass))
#define FOLKS_IS_WEB_SERVICE_FIELD_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS))
#define FOLKS_IS_WEB_SERVICE_FIELD_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS))
#define FOLKS_WEB_SERVICE_FIELD_DETAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, FolksWebServiceFieldDetailsClass))

typedef struct _FolksWebServiceFieldDetails FolksWebServiceFieldDetails;
typedef struct _FolksWebServiceFieldDetailsClass FolksWebServiceFieldDetailsClass;
typedef struct _FolksWebServiceFieldDetailsPrivate FolksWebServiceFieldDetailsPrivate;

#define FOLKS_TYPE_WEB_SERVICE_DETAILS (folks_web_service_details_get_type ())
#define FOLKS_WEB_SERVICE_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_TYPE_WEB_SERVICE_DETAILS, FolksWebServiceDetails))
#define FOLKS_IS_WEB_SERVICE_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_TYPE_WEB_SERVICE_DETAILS))
#define FOLKS_WEB_SERVICE_DETAILS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FOLKS_TYPE_WEB_SERVICE_DETAILS, FolksWebServiceDetailsIface))

typedef struct _FolksWebServiceDetails FolksWebServiceDetails;
typedef struct _FolksWebServiceDetailsIface FolksWebServiceDetailsIface;

struct _FolksAbstractFieldDetails {
	GObject parent_instance;
	FolksAbstractFieldDetailsPrivate * priv;
};

struct _FolksAbstractFieldDetailsClass {
	GObjectClass parent_class;
	gboolean (*equal) (FolksAbstractFieldDetails* self, FolksAbstractFieldDetails* that);
	guint (*hash) (FolksAbstractFieldDetails* self);
	gconstpointer (*get_value) (FolksAbstractFieldDetails* self);
	void (*set_value) (FolksAbstractFieldDetails* self, gconstpointer value);
	GeeMultiMap* (*get_parameters) (FolksAbstractFieldDetails* self);
	void (*set_parameters) (FolksAbstractFieldDetails* self, GeeMultiMap* value);
};

struct _FolksWebServiceFieldDetails {
	FolksAbstractFieldDetails parent_instance;
	FolksWebServiceFieldDetailsPrivate * priv;
};

struct _FolksWebServiceFieldDetailsClass {
	FolksAbstractFieldDetailsClass parent_class;
};

struct _FolksWebServiceDetailsIface {
	GTypeInterface parent_iface;
	GeeMultiMap* (*get_web_service_addresses) (FolksWebServiceDetails* self);
	void (*set_web_service_addresses) (FolksWebServiceDetails* self, GeeMultiMap* value);
};


static gpointer folks_web_service_field_details_parent_class = NULL;

GType folks_abstract_field_details_get_type (void) G_GNUC_CONST;
GType folks_web_service_field_details_get_type (void) G_GNUC_CONST;
enum  {
	FOLKS_WEB_SERVICE_FIELD_DETAILS_DUMMY_PROPERTY
};
FolksWebServiceFieldDetails* folks_web_service_field_details_new (const gchar* value, GeeMultiMap* parameters);
FolksWebServiceFieldDetails* folks_web_service_field_details_construct (GType object_type, const gchar* value, GeeMultiMap* parameters);
FolksAbstractFieldDetails* folks_abstract_field_details_construct (GType object_type, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func);
void folks_abstract_field_details_set_value (FolksAbstractFieldDetails* self, gconstpointer value);
void folks_abstract_field_details_set_parameters (FolksAbstractFieldDetails* self, GeeMultiMap* value);
static gboolean folks_web_service_field_details_real_equal (FolksAbstractFieldDetails* base, FolksAbstractFieldDetails* that);
gboolean folks_abstract_field_details_equal (FolksAbstractFieldDetails* self, FolksAbstractFieldDetails* that);
static guint folks_web_service_field_details_real_hash (FolksAbstractFieldDetails* base);
guint folks_abstract_field_details_hash (FolksAbstractFieldDetails* self);
GType folks_web_service_details_get_type (void) G_GNUC_CONST;
GeeMultiMap* folks_web_service_details_get_web_service_addresses (FolksWebServiceDetails* self);
void folks_web_service_details_set_web_service_addresses (FolksWebServiceDetails* self, GeeMultiMap* value);


/**
   * Create a new WebServiceFieldDetails.
   *
   * @param value the value of the field
   * @param parameters initial parameters. See
   * {@link AbstractFieldDetails.parameters}. A `null` value is equivalent to an
   * empty map of parameters.
   *
   * @return a new WebServiceFieldDetails
   *
   * @since 0.6.0
   */
FolksWebServiceFieldDetails* folks_web_service_field_details_construct (GType object_type, const gchar* value, GeeMultiMap* parameters) {
	FolksWebServiceFieldDetails * self = NULL;
	const gchar* _tmp0_;
	GeeMultiMap* _tmp1_;
	g_return_val_if_fail (value != NULL, NULL);
	self = (FolksWebServiceFieldDetails*) folks_abstract_field_details_construct (object_type, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free);
	_tmp0_ = value;
	folks_abstract_field_details_set_value ((FolksAbstractFieldDetails*) self, _tmp0_);
	_tmp1_ = parameters;
	if (_tmp1_ != NULL) {
		GeeMultiMap* _tmp2_;
		_tmp2_ = parameters;
		folks_abstract_field_details_set_parameters ((FolksAbstractFieldDetails*) self, _tmp2_);
	}
	return self;
}


FolksWebServiceFieldDetails* folks_web_service_field_details_new (const gchar* value, GeeMultiMap* parameters) {
	return folks_web_service_field_details_construct (FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, value, parameters);
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.0
   */
static gboolean folks_web_service_field_details_real_equal (FolksAbstractFieldDetails* base, FolksAbstractFieldDetails* that) {
	FolksWebServiceFieldDetails * self;
	gboolean result = FALSE;
	FolksAbstractFieldDetails* _tmp0_;
	gboolean _tmp1_ = FALSE;
	self = (FolksWebServiceFieldDetails*) base;
	g_return_val_if_fail (that != NULL, FALSE);
	_tmp0_ = that;
	_tmp1_ = FOLKS_ABSTRACT_FIELD_DETAILS_CLASS (folks_web_service_field_details_parent_class)->equal (FOLKS_ABSTRACT_FIELD_DETAILS (self), _tmp0_);
	result = _tmp1_;
	return result;
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.0
   */
static guint folks_web_service_field_details_real_hash (FolksAbstractFieldDetails* base) {
	FolksWebServiceFieldDetails * self;
	guint result = 0U;
	guint _tmp0_ = 0U;
	self = (FolksWebServiceFieldDetails*) base;
	_tmp0_ = FOLKS_ABSTRACT_FIELD_DETAILS_CLASS (folks_web_service_field_details_parent_class)->hash (FOLKS_ABSTRACT_FIELD_DETAILS (self));
	result = _tmp0_;
	return result;
}


static void folks_web_service_field_details_class_init (FolksWebServiceFieldDetailsClass * klass) {
	folks_web_service_field_details_parent_class = g_type_class_peek_parent (klass);
	FOLKS_ABSTRACT_FIELD_DETAILS_CLASS (klass)->equal = folks_web_service_field_details_real_equal;
	FOLKS_ABSTRACT_FIELD_DETAILS_CLASS (klass)->hash = folks_web_service_field_details_real_hash;
}


static void folks_web_service_field_details_instance_init (FolksWebServiceFieldDetails * self) {
}


/**
 * Object representing a web service contact that can have some parameters
 * associated with it.
 *
 * See {@link Folks.AbstractFieldDetails}.
 *
 * @since 0.6.0
 */
GType folks_web_service_field_details_get_type (void) {
	static volatile gsize folks_web_service_field_details_type_id__volatile = 0;
	if (g_once_init_enter (&folks_web_service_field_details_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksWebServiceFieldDetailsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_web_service_field_details_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksWebServiceFieldDetails), 0, (GInstanceInitFunc) folks_web_service_field_details_instance_init, NULL };
		GType folks_web_service_field_details_type_id;
		folks_web_service_field_details_type_id = g_type_register_static (FOLKS_TYPE_ABSTRACT_FIELD_DETAILS, "FolksWebServiceFieldDetails", &g_define_type_info, 0);
		g_once_init_leave (&folks_web_service_field_details_type_id__volatile, folks_web_service_field_details_type_id);
	}
	return folks_web_service_field_details_type_id__volatile;
}


GeeMultiMap* folks_web_service_details_get_web_service_addresses (FolksWebServiceDetails* self) {
	return FOLKS_WEB_SERVICE_DETAILS_GET_INTERFACE (self)->get_web_service_addresses (self);
}


void folks_web_service_details_set_web_service_addresses (FolksWebServiceDetails* self, GeeMultiMap* value) {
	FOLKS_WEB_SERVICE_DETAILS_GET_INTERFACE (self)->set_web_service_addresses (self, value);
}


static void folks_web_service_details_base_init (FolksWebServiceDetailsIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		/**
		   * A mapping of web service to an (unordered) set of web service addresses.
		   *
		   * Each mapping is from an arbitrary web service identifier to a set of web
		   * service addresses for the contact, listed in no particular order.
		   *
		   * Web service addresses are guaranteed to be unique per web service, but
		   * not necessarily unique amongst all web services.
		   *
		   * @since 0.6.0
		   */
		g_object_interface_install_property (iface, g_param_spec_object ("web-service-addresses", "web-service-addresses", "web-service-addresses", GEE_TYPE_MULTI_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	}
}


/**
 * Web service contact details.
 *
 * @since 0.5.0
 */
GType folks_web_service_details_get_type (void) {
	static volatile gsize folks_web_service_details_type_id__volatile = 0;
	if (g_once_init_enter (&folks_web_service_details_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksWebServiceDetailsIface), (GBaseInitFunc) folks_web_service_details_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType folks_web_service_details_type_id;
		folks_web_service_details_type_id = g_type_register_static (G_TYPE_INTERFACE, "FolksWebServiceDetails", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (folks_web_service_details_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&folks_web_service_details_type_id__volatile, folks_web_service_details_type_id);
	}
	return folks_web_service_details_type_id__volatile;
}



