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

/* link.vala
 *
 * Copyright (C) 2008-2009 Didier Villevalois
 * Copyright (C) 2008-2014 Florian Brosch
 *
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
 */

#include <glib.h>
#include <glib-object.h>
#include "valadoc.h"
#include <stdlib.h>
#include <string.h>
#include <valagee.h>

enum  {
	VALADOC_CONTENT_LINK_0_PROPERTY,
	VALADOC_CONTENT_LINK_URL_PROPERTY,
	VALADOC_CONTENT_LINK_ID_REGISTRAR_PROPERTY,
	VALADOC_CONTENT_LINK_NUM_PROPERTIES
};
static GParamSpec* valadoc_content_link_properties[VALADOC_CONTENT_LINK_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _valadoc_importer_internal_id_registrar_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_importer_internal_id_registrar_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _ValadocContentLinkPrivate {
	gchar* _url;
	ValadocImporterInternalIdRegistrar* _id_registrar;
};


static gpointer valadoc_content_link_parent_class = NULL;
static ValadocContentInlineIface * valadoc_content_link_valadoc_content_inline_parent_iface = NULL;

#define VALADOC_CONTENT_LINK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_CONTENT_TYPE_LINK, ValadocContentLinkPrivate))
G_GNUC_INTERNAL ValadocContentLink* valadoc_content_link_new (void);
G_GNUC_INTERNAL ValadocContentLink* valadoc_content_link_construct (GType object_type);
G_GNUC_INTERNAL ValadocContentInlineContent* valadoc_content_inline_content_construct (GType object_type);
static void valadoc_content_link_real_configure (ValadocContentContentElement* base, ValadocSettings* settings, ValadocResourceLocator* locator);
static void valadoc_content_link_real_check (ValadocContentContentElement* base, ValadocApiTree* api_root, ValadocApiNode* container, const gchar* file_path, ValadocErrorReporter* reporter, ValadocSettings* settings);
G_GNUC_INTERNAL ValadocContentSymbolLink* valadoc_content_symbol_link_new (ValadocApiNode* symbol, const gchar* given_symbol_name);
G_GNUC_INTERNAL ValadocContentSymbolLink* valadoc_content_symbol_link_construct (GType object_type, ValadocApiNode* symbol, const gchar* given_symbol_name);
G_GNUC_INTERNAL void valadoc_content_inline_content_replace_node (ValadocContentInlineContent* self, ValadocContentInline* old, ValadocContentInline* replacement);
G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_new (ValadocContentRunStyle style);
G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_construct (GType object_type, ValadocContentRunStyle style);
static void valadoc_content_link_real_accept (ValadocContentContentElement* base, ValadocContentContentVisitor* visitor);
static gboolean valadoc_content_link_real_is_empty (ValadocContentContentElement* base);
static ValadocContentContentElement* valadoc_content_link_real_copy (ValadocContentContentElement* base, ValadocContentContentElement* new_parent);
G_GNUC_INTERNAL void valadoc_content_link_set_id_registrar (ValadocContentLink* self, ValadocImporterInternalIdRegistrar* value);
G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self, ValadocContentContentElement* value);
static void valadoc_content_link_finalize (GObject * obj);
static void _vala_valadoc_content_link_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_valadoc_content_link_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


G_GNUC_INTERNAL ValadocContentLink* valadoc_content_link_construct (GType object_type) {
	ValadocContentLink * self = NULL;
	self = (ValadocContentLink*) valadoc_content_inline_content_construct (object_type);
	return self;
}


G_GNUC_INTERNAL ValadocContentLink* valadoc_content_link_new (void) {
	return valadoc_content_link_construct (VALADOC_CONTENT_TYPE_LINK);
}


static void valadoc_content_link_real_configure (ValadocContentContentElement* base, ValadocSettings* settings, ValadocResourceLocator* locator) {
	ValadocContentLink * self;
	self = (ValadocContentLink*) base;
	g_return_if_fail (settings != NULL);
	g_return_if_fail (locator != NULL);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void valadoc_content_link_real_check (ValadocContentContentElement* base, ValadocApiTree* api_root, ValadocApiNode* container, const gchar* file_path, ValadocErrorReporter* reporter, ValadocSettings* settings) {
	ValadocContentLink * self;
	ValadocImporterInternalIdRegistrar* _tmp0_;
	ValadocApiTree* _tmp61_;
	ValadocApiNode* _tmp62_;
	const gchar* _tmp63_;
	ValadocErrorReporter* _tmp64_;
	ValadocSettings* _tmp65_;
	self = (ValadocContentLink*) base;
	g_return_if_fail (api_root != NULL);
	g_return_if_fail (container != NULL);
	g_return_if_fail (file_path != NULL);
	g_return_if_fail (reporter != NULL);
	g_return_if_fail (settings != NULL);
	_tmp0_ = self->priv->_id_registrar;
	if (_tmp0_ != NULL) {
		ValadocApiNode* node = NULL;
		ValadocImporterInternalIdRegistrar* _tmp1_;
		const gchar* _tmp2_;
		ValadocApiNode* _tmp3_;
		ValadocApiNode* _tmp4_;
		gchar* _url = NULL;
		ValadocImporterInternalIdRegistrar* _tmp24_;
		const gchar* _tmp25_;
		gchar* _tmp26_;
		const gchar* _tmp27_;
		const gchar* _tmp60_;
		_tmp1_ = self->priv->_id_registrar;
		_tmp2_ = self->priv->_url;
		_tmp3_ = valadoc_importer_internal_id_registrar_map_symbol_id (_tmp1_, _tmp2_);
		node = _tmp3_;
		_tmp4_ = node;
		if (_tmp4_ != NULL) {
			ValadocContentInlineContent* _parent = NULL;
			ValadocContentContentElement* _tmp5_;
			ValadocContentContentElement* _tmp6_;
			ValadocContentInlineContent* _tmp7_;
			ValadocContentInlineContent* _tmp8_;
			ValadocContentSymbolLink* replacement = NULL;
			ValadocApiNode* _tmp9_;
			ValadocContentSymbolLink* _tmp10_;
			ValadocContentSymbolLink* _tmp11_;
			ValaList* _tmp12_;
			ValaList* _tmp13_;
			ValaList* _tmp14_;
			ValaList* _tmp15_;
			ValadocContentSymbolLink* _tmp16_;
			ValadocApiTree* _tmp17_;
			ValadocApiNode* _tmp18_;
			const gchar* _tmp19_;
			ValadocErrorReporter* _tmp20_;
			ValadocSettings* _tmp21_;
			ValadocContentInlineContent* _tmp22_;
			ValadocContentSymbolLink* _tmp23_;
			_tmp5_ = valadoc_content_content_element_get_parent ((ValadocContentContentElement*) self);
			_tmp6_ = _tmp5_;
			_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, VALADOC_CONTENT_TYPE_INLINE_CONTENT) ? ((ValadocContentInlineContent*) _tmp6_) : NULL);
			_parent = _tmp7_;
			_tmp8_ = _parent;
			_vala_assert (_tmp8_ != NULL, "_parent != null");
			_tmp9_ = node;
			_tmp10_ = valadoc_content_symbol_link_new (_tmp9_, NULL);
			replacement = _tmp10_;
			_tmp11_ = replacement;
			_tmp12_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) self);
			_tmp15_ = _tmp14_;
			vala_collection_add_all ((ValaCollection*) _tmp13_, (ValaCollection*) _tmp15_);
			_tmp16_ = replacement;
			_tmp17_ = api_root;
			_tmp18_ = container;
			_tmp19_ = file_path;
			_tmp20_ = reporter;
			_tmp21_ = settings;
			valadoc_content_content_element_check ((ValadocContentContentElement*) _tmp16_, _tmp17_, _tmp18_, _tmp19_, _tmp20_, _tmp21_);
			_tmp22_ = _parent;
			_tmp23_ = replacement;
			valadoc_content_inline_content_replace_node (_tmp22_, (ValadocContentInline*) self, (ValadocContentInline*) _tmp23_);
			_g_object_unref0 (replacement);
			_g_object_unref0 (_parent);
			_g_object_unref0 (node);
			return;
		}
		_tmp24_ = self->priv->_id_registrar;
		_tmp25_ = self->priv->_url;
		_tmp26_ = valadoc_importer_internal_id_registrar_map_url_id (_tmp24_, _tmp25_);
		_url = _tmp26_;
		_tmp27_ = _url;
		if (_tmp27_ == NULL) {
			gchar* _tmp28_ = NULL;
			ValadocApiNode* _tmp29_;
			gchar* node_segment = NULL;
			gchar* _tmp35_;
			ValadocErrorReporter* _tmp36_;
			const gchar* _tmp37_;
			const gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			const gchar* _tmp41_;
			ValadocContentInlineContent* _parent = NULL;
			ValadocContentContentElement* _tmp42_;
			ValadocContentContentElement* _tmp43_;
			ValadocContentInlineContent* _tmp44_;
			ValadocContentInlineContent* _tmp45_;
			ValadocContentRun* replacement = NULL;
			ValadocContentRun* _tmp46_;
			ValadocContentRun* _tmp47_;
			ValaList* _tmp48_;
			ValaList* _tmp49_;
			ValaList* _tmp50_;
			ValaList* _tmp51_;
			ValadocContentRun* _tmp52_;
			ValadocApiTree* _tmp53_;
			ValadocApiNode* _tmp54_;
			const gchar* _tmp55_;
			ValadocErrorReporter* _tmp56_;
			ValadocSettings* _tmp57_;
			ValadocContentInlineContent* _tmp58_;
			ValadocContentRun* _tmp59_;
			_tmp29_ = container;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, VALADOC_API_TYPE_PACKAGE)) {
				gchar* _tmp30_;
				_tmp30_ = g_strdup ("");
				_g_free0 (_tmp28_);
				_tmp28_ = _tmp30_;
			} else {
				ValadocApiNode* _tmp31_;
				gchar* _tmp32_;
				gchar* _tmp33_;
				gchar* _tmp34_;
				_tmp31_ = container;
				_tmp32_ = valadoc_api_node_get_full_name (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = g_strconcat (_tmp33_, ": ", NULL);
				_g_free0 (_tmp28_);
				_tmp28_ = _tmp34_;
				_g_free0 (_tmp33_);
			}
			_tmp35_ = g_strdup (_tmp28_);
			node_segment = _tmp35_;
			_tmp36_ = reporter;
			_tmp37_ = file_path;
			_tmp38_ = node_segment;
			_tmp39_ = g_strdup_printf ("%s: %s[[", _tmp37_, _tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = self->priv->_url;
			valadoc_error_reporter_simple_warning (_tmp36_, _tmp40_, "unknown imported internal id '%s'", _tmp41_);
			_g_free0 (_tmp40_);
			_tmp42_ = valadoc_content_content_element_get_parent ((ValadocContentContentElement*) self);
			_tmp43_ = _tmp42_;
			_tmp44_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp43_, VALADOC_CONTENT_TYPE_INLINE_CONTENT) ? ((ValadocContentInlineContent*) _tmp43_) : NULL);
			_parent = _tmp44_;
			_tmp45_ = _parent;
			_vala_assert (_tmp45_ != NULL, "_parent != null");
			_tmp46_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_ITALIC);
			replacement = _tmp46_;
			_tmp47_ = replacement;
			_tmp48_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) self);
			_tmp51_ = _tmp50_;
			vala_collection_add_all ((ValaCollection*) _tmp49_, (ValaCollection*) _tmp51_);
			_tmp52_ = replacement;
			_tmp53_ = api_root;
			_tmp54_ = container;
			_tmp55_ = file_path;
			_tmp56_ = reporter;
			_tmp57_ = settings;
			valadoc_content_content_element_check ((ValadocContentContentElement*) _tmp52_, _tmp53_, _tmp54_, _tmp55_, _tmp56_, _tmp57_);
			_tmp58_ = _parent;
			_tmp59_ = replacement;
			valadoc_content_inline_content_replace_node (_tmp58_, (ValadocContentInline*) self, (ValadocContentInline*) _tmp59_);
			_g_object_unref0 (replacement);
			_g_object_unref0 (_parent);
			_g_free0 (node_segment);
			_g_free0 (_tmp28_);
			_g_free0 (_url);
			_g_object_unref0 (node);
			return;
		}
		_tmp60_ = _url;
		valadoc_content_link_set_url (self, _tmp60_);
		_g_free0 (_url);
		_g_object_unref0 (node);
	}
	_tmp61_ = api_root;
	_tmp62_ = container;
	_tmp63_ = file_path;
	_tmp64_ = reporter;
	_tmp65_ = settings;
	VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_content_link_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_INLINE_CONTENT, ValadocContentInlineContent), _tmp61_, _tmp62_, _tmp63_, _tmp64_, _tmp65_);
}


static void valadoc_content_link_real_accept (ValadocContentContentElement* base, ValadocContentContentVisitor* visitor) {
	ValadocContentLink * self;
	ValadocContentContentVisitor* _tmp0_;
	self = (ValadocContentLink*) base;
	g_return_if_fail (visitor != NULL);
	_tmp0_ = visitor;
	valadoc_content_content_visitor_visit_link (_tmp0_, self);
}


static gboolean valadoc_content_link_real_is_empty (ValadocContentContentElement* base) {
	ValadocContentLink * self;
	gboolean result = FALSE;
	self = (ValadocContentLink*) base;
	result = FALSE;
	return result;
}


static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


static ValadocContentContentElement* valadoc_content_link_real_copy (ValadocContentContentElement* base, ValadocContentContentElement* new_parent) {
	ValadocContentLink * self;
	ValadocContentContentElement* result = NULL;
	ValadocContentLink* link = NULL;
	ValadocContentLink* _tmp0_;
	ValadocContentLink* _tmp1_;
	ValadocImporterInternalIdRegistrar* _tmp2_;
	ValadocContentLink* _tmp3_;
	ValadocContentContentElement* _tmp4_;
	ValadocContentLink* _tmp5_;
	const gchar* _tmp6_;
	self = (ValadocContentLink*) base;
	_tmp0_ = valadoc_content_link_new ();
	link = _tmp0_;
	_tmp1_ = link;
	_tmp2_ = self->priv->_id_registrar;
	valadoc_content_link_set_id_registrar (_tmp1_, _tmp2_);
	_tmp3_ = link;
	_tmp4_ = new_parent;
	valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp3_, _tmp4_);
	_tmp5_ = link;
	_tmp6_ = self->priv->_url;
	valadoc_content_link_set_url (_tmp5_, _tmp6_);
	{
		ValaList* _element_list = NULL;
		ValaList* _tmp7_;
		ValaList* _tmp8_;
		ValaList* _tmp9_;
		gint _element_size = 0;
		ValaList* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		gint _element_index = 0;
		_tmp7_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = _vala_iterable_ref0 (_tmp8_);
		_element_list = _tmp9_;
		_tmp10_ = _element_list;
		_tmp11_ = vala_collection_get_size ((ValaCollection*) _tmp10_);
		_tmp12_ = _tmp11_;
		_element_size = _tmp12_;
		_element_index = -1;
		while (TRUE) {
			gint _tmp13_;
			gint _tmp14_;
			gint _tmp15_;
			ValadocContentInline* element = NULL;
			ValaList* _tmp16_;
			gint _tmp17_;
			gpointer _tmp18_;
			ValadocContentInline* copy = NULL;
			ValadocContentInline* _tmp19_;
			ValadocContentLink* _tmp20_;
			ValadocContentContentElement* _tmp21_;
			ValadocContentInline* _tmp22_;
			ValadocContentLink* _tmp23_;
			ValaList* _tmp24_;
			ValaList* _tmp25_;
			ValadocContentInline* _tmp26_;
			_tmp13_ = _element_index;
			_element_index = _tmp13_ + 1;
			_tmp14_ = _element_index;
			_tmp15_ = _element_size;
			if (!(_tmp14_ < _tmp15_)) {
				break;
			}
			_tmp16_ = _element_list;
			_tmp17_ = _element_index;
			_tmp18_ = vala_list_get (_tmp16_, _tmp17_);
			element = (ValadocContentInline*) _tmp18_;
			_tmp19_ = element;
			_tmp20_ = link;
			_tmp21_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp19_, (ValadocContentContentElement*) _tmp20_);
			_tmp22_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, VALADOC_CONTENT_TYPE_INLINE) ? ((ValadocContentInline*) _tmp21_) : NULL;
			if (_tmp22_ == NULL) {
				_g_object_unref0 (_tmp21_);
			}
			copy = _tmp22_;
			_tmp23_ = link;
			_tmp24_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = copy;
			vala_collection_add ((ValaCollection*) _tmp25_, _tmp26_);
			_g_object_unref0 (copy);
			_g_object_unref0 (element);
		}
		_vala_iterable_unref0 (_element_list);
	}
	result = (ValadocContentContentElement*) link;
	return result;
}


const gchar* valadoc_content_link_get_url (ValadocContentLink* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	result = _tmp0_;
	return result;
}


void valadoc_content_link_set_url (ValadocContentLink* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, valadoc_content_link_get_url (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_url);
		self->priv->_url = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_content_link_properties[VALADOC_CONTENT_LINK_URL_PROPERTY]);
	}
}


ValadocImporterInternalIdRegistrar* valadoc_content_link_get_id_registrar (ValadocContentLink* self) {
	ValadocImporterInternalIdRegistrar* result;
	ValadocImporterInternalIdRegistrar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id_registrar;
	result = _tmp0_;
	return result;
}


static gpointer _valadoc_importer_internal_id_registrar_ref0 (gpointer self) {
	return self ? valadoc_importer_internal_id_registrar_ref (self) : NULL;
}


G_GNUC_INTERNAL void valadoc_content_link_set_id_registrar (ValadocContentLink* self, ValadocImporterInternalIdRegistrar* value) {
	g_return_if_fail (self != NULL);
	if (valadoc_content_link_get_id_registrar (self) != value) {
		ValadocImporterInternalIdRegistrar* _tmp0_;
		ValadocImporterInternalIdRegistrar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _valadoc_importer_internal_id_registrar_ref0 (_tmp0_);
		_valadoc_importer_internal_id_registrar_unref0 (self->priv->_id_registrar);
		self->priv->_id_registrar = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_content_link_properties[VALADOC_CONTENT_LINK_ID_REGISTRAR_PROPERTY]);
	}
}


static void valadoc_content_link_class_init (ValadocContentLinkClass * klass) {
	valadoc_content_link_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocContentLinkPrivate));
	((ValadocContentContentElementClass *) klass)->configure = (void (*) (ValadocContentContentElement *, ValadocSettings*, ValadocResourceLocator*)) valadoc_content_link_real_configure;
	((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement *, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_content_link_real_check;
	((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement *, ValadocContentContentVisitor*)) valadoc_content_link_real_accept;
	((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement *)) valadoc_content_link_real_is_empty;
	((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement *, ValadocContentContentElement*)) valadoc_content_link_real_copy;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_content_link_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_content_link_set_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_content_link_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_LINK_URL_PROPERTY, valadoc_content_link_properties[VALADOC_CONTENT_LINK_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Used by importers to transform internal URLs
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_LINK_ID_REGISTRAR_PROPERTY, valadoc_content_link_properties[VALADOC_CONTENT_LINK_ID_REGISTRAR_PROPERTY] = valadoc_importer_param_spec_internal_id_registrar ("id-registrar", "id-registrar", "id-registrar", VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void valadoc_content_link_valadoc_content_inline_interface_init (ValadocContentInlineIface * iface) {
	valadoc_content_link_valadoc_content_inline_parent_iface = g_type_interface_peek_parent (iface);
}


static void valadoc_content_link_instance_init (ValadocContentLink * self) {
	self->priv = VALADOC_CONTENT_LINK_GET_PRIVATE (self);
}


static void valadoc_content_link_finalize (GObject * obj) {
	ValadocContentLink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_CONTENT_TYPE_LINK, ValadocContentLink);
	_g_free0 (self->priv->_url);
	_valadoc_importer_internal_id_registrar_unref0 (self->priv->_id_registrar);
	G_OBJECT_CLASS (valadoc_content_link_parent_class)->finalize (obj);
}


GType valadoc_content_link_get_type (void) {
	static volatile gsize valadoc_content_link_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_content_link_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValadocContentLinkClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_content_link_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocContentLink), 0, (GInstanceInitFunc) valadoc_content_link_instance_init, NULL };
		static const GInterfaceInfo valadoc_content_inline_info = { (GInterfaceInitFunc) valadoc_content_link_valadoc_content_inline_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType valadoc_content_link_type_id;
		valadoc_content_link_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_INLINE_CONTENT, "ValadocContentLink", &g_define_type_info, 0);
		g_type_add_interface_static (valadoc_content_link_type_id, VALADOC_CONTENT_TYPE_INLINE, &valadoc_content_inline_info);
		g_once_init_leave (&valadoc_content_link_type_id__volatile, valadoc_content_link_type_id);
	}
	return valadoc_content_link_type_id__volatile;
}


static void _vala_valadoc_content_link_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ValadocContentLink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_LINK, ValadocContentLink);
	switch (property_id) {
		case VALADOC_CONTENT_LINK_URL_PROPERTY:
		g_value_set_string (value, valadoc_content_link_get_url (self));
		break;
		case VALADOC_CONTENT_LINK_ID_REGISTRAR_PROPERTY:
		valadoc_importer_value_set_internal_id_registrar (value, valadoc_content_link_get_id_registrar (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_valadoc_content_link_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ValadocContentLink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_LINK, ValadocContentLink);
	switch (property_id) {
		case VALADOC_CONTENT_LINK_URL_PROPERTY:
		valadoc_content_link_set_url (self, g_value_get_string (value));
		break;
		case VALADOC_CONTENT_LINK_ID_REGISTRAR_PROPERTY:
		valadoc_content_link_set_id_registrar (self, valadoc_importer_value_get_internal_id_registrar (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



