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

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 0; tab-width: 2 -*- */
/* ObjectModel.vala
 *
 * Copyright (C) 2013, 2014  Daniel Espinosa <esodan@gmail.com>
 *
 * 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:
 *      Daniel Espinosa <esodan@gmail.com>
 */

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


#define GXML_TYPE_NAMESPACE (gxml_namespace_get_type ())
#define GXML_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE, GXmlNamespace))
#define GXML_IS_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE))
#define GXML_NAMESPACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NAMESPACE, GXmlNamespaceIface))

typedef struct _GXmlNamespace GXmlNamespace;
typedef struct _GXmlNamespaceIface GXmlNamespaceIface;

struct _GXmlNamespaceIface {
	GTypeInterface parent_iface;
	gchar* (*get_uri) (GXmlNamespace* self);
	gchar* (*get_prefix) (GXmlNamespace* self);
};



GType gxml_namespace_get_type (void) G_GNUC_CONST;
gchar* gxml_namespace_get_uri (GXmlNamespace* self);
gchar* gxml_namespace_get_prefix (GXmlNamespace* self);


gchar* gxml_namespace_get_uri (GXmlNamespace* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return GXML_NAMESPACE_GET_INTERFACE (self)->get_uri (self);
}


gchar* gxml_namespace_get_prefix (GXmlNamespace* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return GXML_NAMESPACE_GET_INTERFACE (self)->get_prefix (self);
}


static void gxml_namespace_base_init (GXmlNamespaceIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		/**
		   * Read-only property to get namespace's URI.
		   */
		g_object_interface_install_property (iface, g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
		/**
		   * Read-only property to get namespace's prefix.
		   *
		   * Prefix should be added to {@link GXml.Element} or {@link GXml.Attribute}
		   * name in order to apply a given namespace, unless it is the default.
		   */
		g_object_interface_install_property (iface, g_param_spec_string ("prefix", "prefix", "prefix", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	}
}


/**
 * Interface to handle XML Namespaces.
 *
 * Basic information for a XML document's namespaces and applied to a given
 * {@link GXml.Node}.
 *
 * Namespace management is a matter of this or other libraries, implementing
 * this interfaces.
 */
GType gxml_namespace_get_type (void) {
	static volatile gsize gxml_namespace_type_id__volatile = 0;
	if (g_once_init_enter (&gxml_namespace_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GXmlNamespaceIface), (GBaseInitFunc) gxml_namespace_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType gxml_namespace_type_id;
		gxml_namespace_type_id = g_type_register_static (G_TYPE_INTERFACE, "GXmlNamespace", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (gxml_namespace_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&gxml_namespace_type_id__volatile, gxml_namespace_type_id);
	}
	return gxml_namespace_type_id__volatile;
}



