2 * Summary: unfinished XLink detection module
3 * Description: unfinished XLink detection module
5 * Copy: See Copyright for the status of this software.
7 * Author: Daniel Veillard
10 #ifndef __XML_XLINK_H__
11 #define __XML_XLINK_H__
13 #include <libxml/xmlversion.h>
14 #include <libxml/tree.h>
16 #ifdef LIBXML_XPTR_ENABLED
23 * Various defines for the various Link properties.
25 * NOTE: the link detection layer will try to resolve QName expansion
26 * of namespaces. If "foo" is the prefix for "http://foo.com/"
27 * then the link detection layer will expand role="foo:myrole"
28 * to "http://foo.com/:myrole".
29 * NOTE: the link detection layer will expand URI-Refences found on
30 * href attributes by using the base mechanism if found.
32 typedef xmlChar *xlinkHRef;
33 typedef xmlChar *xlinkRole;
34 typedef xmlChar *xlinkTitle;
40 XLINK_TYPE_EXTENDED_SET
51 XLINK_ACTUATE_NONE = 0,
53 XLINK_ACTUATE_ONREQUEST
57 * xlinkNodeDetectFunc:
58 * @ctx: user data pointer
59 * @node: the node to check
61 * This is the prototype for the link detection routine.
62 * It calls the default link detection callbacks upon link detection.
64 typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
67 * The link detection module interact with the upper layers using
68 * a set of callback registered at parsing time.
72 * xlinkSimpleLinkFunk:
73 * @ctx: user data pointer
74 * @node: the node carrying the link
75 * @href: the target of the link
76 * @role: the role string
77 * @title: the link title
79 * This is the prototype for a simple link detection callback.
82 (*xlinkSimpleLinkFunk) (void *ctx,
86 const xlinkTitle title);
89 * xlinkExtendedLinkFunk:
90 * @ctx: user data pointer
91 * @node: the node carrying the link
92 * @nbLocators: the number of locators detected on the link
93 * @hrefs: pointer to the array of locator hrefs
94 * @roles: pointer to the array of locator roles
95 * @nbArcs: the number of arcs detected on the link
96 * @from: pointer to the array of source roles found on the arcs
97 * @to: pointer to the array of target roles found on the arcs
98 * @show: array of values for the show attributes found on the arcs
99 * @actuate: array of values for the actuate attributes found on the arcs
100 * @nbTitles: the number of titles detected on the link
101 * @title: array of titles detected on the link
102 * @langs: array of xml:lang values for the titles
104 * This is the prototype for a extended link detection callback.
107 (*xlinkExtendedLinkFunk)(void *ctx,
110 const xlinkHRef *hrefs,
111 const xlinkRole *roles,
113 const xlinkRole *from,
116 xlinkActuate *actuate,
118 const xlinkTitle *titles,
119 const xmlChar **langs);
122 * xlinkExtendedLinkSetFunk:
123 * @ctx: user data pointer
124 * @node: the node carrying the link
125 * @nbLocators: the number of locators detected on the link
126 * @hrefs: pointer to the array of locator hrefs
127 * @roles: pointer to the array of locator roles
128 * @nbTitles: the number of titles detected on the link
129 * @title: array of titles detected on the link
130 * @langs: array of xml:lang values for the titles
132 * This is the prototype for a extended link set detection callback.
135 (*xlinkExtendedLinkSetFunk) (void *ctx,
138 const xlinkHRef *hrefs,
139 const xlinkRole *roles,
141 const xlinkTitle *titles,
142 const xmlChar **langs);
145 * This is the structure containing a set of Links detection callbacks.
147 * There is no default xlink callbacks, if one want to get link
148 * recognition activated, those call backs must be provided before parsing.
150 typedef struct _xlinkHandler xlinkHandler;
151 typedef xlinkHandler *xlinkHandlerPtr;
152 struct _xlinkHandler {
153 xlinkSimpleLinkFunk simple;
154 xlinkExtendedLinkFunk extended;
155 xlinkExtendedLinkSetFunk set;
159 * The default detection routine, can be overridden, they call the default
160 * detection callbacks.
163 XMLPUBFUN xlinkNodeDetectFunc XMLCALL
164 xlinkGetDefaultDetect (void);
165 XMLPUBFUN void XMLCALL
166 xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
169 * Routines to set/get the default handlers.
171 XMLPUBFUN xlinkHandlerPtr XMLCALL
172 xlinkGetDefaultHandler (void);
173 XMLPUBFUN void XMLCALL
174 xlinkSetDefaultHandler (xlinkHandlerPtr handler);
177 * Link detection module itself.
179 XMLPUBFUN xlinkType XMLCALL
180 xlinkIsLink (xmlDocPtr doc,
187 #endif /* LIBXML_XPTR_ENABLED */
189 #endif /* __XML_XLINK_H__ */