Blame include/libxml/xlink.h

Packit 423ecb
/*
Packit 423ecb
 * Summary: unfinished XLink detection module
Packit 423ecb
 * Description: unfinished XLink detection module
Packit 423ecb
 *
Packit 423ecb
 * Copy: See Copyright for the status of this software.
Packit 423ecb
 *
Packit 423ecb
 * Author: Daniel Veillard
Packit 423ecb
 */
Packit 423ecb
Packit 423ecb
#ifndef __XML_XLINK_H__
Packit 423ecb
#define __XML_XLINK_H__
Packit 423ecb
Packit 423ecb
#include <libxml/xmlversion.h>
Packit 423ecb
#include <libxml/tree.h>
Packit 423ecb
Packit 423ecb
#ifdef LIBXML_XPTR_ENABLED
Packit 423ecb
Packit 423ecb
#ifdef __cplusplus
Packit 423ecb
extern "C" {
Packit 423ecb
#endif
Packit 423ecb
Packit 423ecb
/**
Packit 423ecb
 * Various defines for the various Link properties.
Packit 423ecb
 *
Packit 423ecb
 * NOTE: the link detection layer will try to resolve QName expansion
Packit 423ecb
 *       of namespaces. If "foo" is the prefix for "http://foo.com/"
Packit 423ecb
 *       then the link detection layer will expand role="foo:myrole"
Packit 423ecb
 *       to "http://foo.com/:myrole".
Packit 423ecb
 * NOTE: the link detection layer will expand URI-Refences found on
Packit 423ecb
 *       href attributes by using the base mechanism if found.
Packit 423ecb
 */
Packit 423ecb
typedef xmlChar *xlinkHRef;
Packit 423ecb
typedef xmlChar *xlinkRole;
Packit 423ecb
typedef xmlChar *xlinkTitle;
Packit 423ecb
Packit 423ecb
typedef enum {
Packit 423ecb
    XLINK_TYPE_NONE = 0,
Packit 423ecb
    XLINK_TYPE_SIMPLE,
Packit 423ecb
    XLINK_TYPE_EXTENDED,
Packit 423ecb
    XLINK_TYPE_EXTENDED_SET
Packit 423ecb
} xlinkType;
Packit 423ecb
Packit 423ecb
typedef enum {
Packit 423ecb
    XLINK_SHOW_NONE = 0,
Packit 423ecb
    XLINK_SHOW_NEW,
Packit 423ecb
    XLINK_SHOW_EMBED,
Packit 423ecb
    XLINK_SHOW_REPLACE
Packit 423ecb
} xlinkShow;
Packit 423ecb
Packit 423ecb
typedef enum {
Packit 423ecb
    XLINK_ACTUATE_NONE = 0,
Packit 423ecb
    XLINK_ACTUATE_AUTO,
Packit 423ecb
    XLINK_ACTUATE_ONREQUEST
Packit 423ecb
} xlinkActuate;
Packit 423ecb
Packit 423ecb
/**
Packit 423ecb
 * xlinkNodeDetectFunc:
Packit 423ecb
 * @ctx:  user data pointer
Packit 423ecb
 * @node:  the node to check
Packit 423ecb
 *
Packit 423ecb
 * This is the prototype for the link detection routine.
Packit 423ecb
 * It calls the default link detection callbacks upon link detection.
Packit 423ecb
 */
Packit 423ecb
typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
Packit 423ecb
Packit 423ecb
/*
Packit 423ecb
 * The link detection module interact with the upper layers using
Packit 423ecb
 * a set of callback registered at parsing time.
Packit 423ecb
 */
Packit 423ecb
Packit 423ecb
/**
Packit 423ecb
 * xlinkSimpleLinkFunk:
Packit 423ecb
 * @ctx:  user data pointer
Packit 423ecb
 * @node:  the node carrying the link
Packit 423ecb
 * @href:  the target of the link
Packit 423ecb
 * @role:  the role string
Packit 423ecb
 * @title:  the link title
Packit 423ecb
 *
Packit 423ecb
 * This is the prototype for a simple link detection callback.
Packit 423ecb
 */
Packit 423ecb
typedef void
Packit 423ecb
(*xlinkSimpleLinkFunk)	(void *ctx,
Packit 423ecb
			 xmlNodePtr node,
Packit 423ecb
			 const xlinkHRef href,
Packit 423ecb
			 const xlinkRole role,
Packit 423ecb
			 const xlinkTitle title);
Packit 423ecb
Packit 423ecb
/**
Packit 423ecb
 * xlinkExtendedLinkFunk:
Packit 423ecb
 * @ctx:  user data pointer
Packit 423ecb
 * @node:  the node carrying the link
Packit 423ecb
 * @nbLocators: the number of locators detected on the link
Packit 423ecb
 * @hrefs:  pointer to the array of locator hrefs
Packit 423ecb
 * @roles:  pointer to the array of locator roles
Packit 423ecb
 * @nbArcs: the number of arcs detected on the link
Packit 423ecb
 * @from:  pointer to the array of source roles found on the arcs
Packit 423ecb
 * @to:  pointer to the array of target roles found on the arcs
Packit 423ecb
 * @show:  array of values for the show attributes found on the arcs
Packit 423ecb
 * @actuate:  array of values for the actuate attributes found on the arcs
Packit 423ecb
 * @nbTitles: the number of titles detected on the link
Packit 423ecb
 * @title:  array of titles detected on the link
Packit 423ecb
 * @langs:  array of xml:lang values for the titles
Packit 423ecb
 *
Packit 423ecb
 * This is the prototype for a extended link detection callback.
Packit 423ecb
 */
Packit 423ecb
typedef void
Packit 423ecb
(*xlinkExtendedLinkFunk)(void *ctx,
Packit 423ecb
			 xmlNodePtr node,
Packit 423ecb
			 int nbLocators,
Packit 423ecb
			 const xlinkHRef *hrefs,
Packit 423ecb
			 const xlinkRole *roles,
Packit 423ecb
			 int nbArcs,
Packit 423ecb
			 const xlinkRole *from,
Packit 423ecb
			 const xlinkRole *to,
Packit 423ecb
			 xlinkShow *show,
Packit 423ecb
			 xlinkActuate *actuate,
Packit 423ecb
			 int nbTitles,
Packit 423ecb
			 const xlinkTitle *titles,
Packit 423ecb
			 const xmlChar **langs);
Packit 423ecb
Packit 423ecb
/**
Packit 423ecb
 * xlinkExtendedLinkSetFunk:
Packit 423ecb
 * @ctx:  user data pointer
Packit 423ecb
 * @node:  the node carrying the link
Packit 423ecb
 * @nbLocators: the number of locators detected on the link
Packit 423ecb
 * @hrefs:  pointer to the array of locator hrefs
Packit 423ecb
 * @roles:  pointer to the array of locator roles
Packit 423ecb
 * @nbTitles: the number of titles detected on the link
Packit 423ecb
 * @title:  array of titles detected on the link
Packit 423ecb
 * @langs:  array of xml:lang values for the titles
Packit 423ecb
 *
Packit 423ecb
 * This is the prototype for a extended link set detection callback.
Packit 423ecb
 */
Packit 423ecb
typedef void
Packit 423ecb
(*xlinkExtendedLinkSetFunk)	(void *ctx,
Packit 423ecb
				 xmlNodePtr node,
Packit 423ecb
				 int nbLocators,
Packit 423ecb
				 const xlinkHRef *hrefs,
Packit 423ecb
				 const xlinkRole *roles,
Packit 423ecb
				 int nbTitles,
Packit 423ecb
				 const xlinkTitle *titles,
Packit 423ecb
				 const xmlChar **langs);
Packit 423ecb
Packit 423ecb
/**
Packit 423ecb
 * This is the structure containing a set of Links detection callbacks.
Packit 423ecb
 *
Packit 423ecb
 * There is no default xlink callbacks, if one want to get link
Packit 423ecb
 * recognition activated, those call backs must be provided before parsing.
Packit 423ecb
 */
Packit 423ecb
typedef struct _xlinkHandler xlinkHandler;
Packit 423ecb
typedef xlinkHandler *xlinkHandlerPtr;
Packit 423ecb
struct _xlinkHandler {
Packit 423ecb
    xlinkSimpleLinkFunk simple;
Packit 423ecb
    xlinkExtendedLinkFunk extended;
Packit 423ecb
    xlinkExtendedLinkSetFunk set;
Packit 423ecb
};
Packit 423ecb
Packit 423ecb
/*
Packit 423ecb
 * The default detection routine, can be overridden, they call the default
Packit 423ecb
 * detection callbacks.
Packit 423ecb
 */
Packit 423ecb
Packit 423ecb
XMLPUBFUN xlinkNodeDetectFunc XMLCALL
Packit 423ecb
		xlinkGetDefaultDetect	(void);
Packit 423ecb
XMLPUBFUN void XMLCALL
Packit 423ecb
		xlinkSetDefaultDetect	(xlinkNodeDetectFunc func);
Packit 423ecb
Packit 423ecb
/*
Packit 423ecb
 * Routines to set/get the default handlers.
Packit 423ecb
 */
Packit 423ecb
XMLPUBFUN xlinkHandlerPtr XMLCALL
Packit 423ecb
		xlinkGetDefaultHandler	(void);
Packit 423ecb
XMLPUBFUN void XMLCALL
Packit 423ecb
		xlinkSetDefaultHandler	(xlinkHandlerPtr handler);
Packit 423ecb
Packit 423ecb
/*
Packit 423ecb
 * Link detection module itself.
Packit 423ecb
 */
Packit 423ecb
XMLPUBFUN xlinkType XMLCALL
Packit 423ecb
		xlinkIsLink		(xmlDocPtr doc,
Packit 423ecb
					 xmlNodePtr node);
Packit 423ecb
Packit 423ecb
#ifdef __cplusplus
Packit 423ecb
}
Packit 423ecb
#endif
Packit 423ecb
Packit 423ecb
#endif /* LIBXML_XPTR_ENABLED */
Packit 423ecb
Packit 423ecb
#endif /* __XML_XLINK_H__ */