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
8 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
19 #include <libxml2_xmlversion.h>
20 #include <libxml2_tree.h>
26 * Various defines for the various Link properties.
28 * NOTE: the link detection layer will try to resolve QName expansion
29 * of namespaces. If "foo" is the prefix for "http://foo.com/"
30 * then the link detection layer will expand role="foo:myrole"
31 * to "http://foo.com/:myrole".
32 * NOTE: the link detection layer will expand URI-Refences found on
33 * href attributes by using the base mechanism if found.
35 typedef xmlChar *xlinkHRef;
36 typedef xmlChar *xlinkRole;
37 typedef xmlChar *xlinkTitle;
43 XLINK_TYPE_EXTENDED_SET
54 XLINK_ACTUATE_NONE = 0,
56 XLINK_ACTUATE_ONREQUEST
60 * xlinkNodeDetectFunc:
61 * @param ctx user data pointer
62 * @param node the node to check
64 * This is the prototype for the link detection routine.
65 * It calls the default link detection callbacks upon link detection.
67 typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
70 * The link detection module interact with the upper layers using
71 * a set of callback registered at parsing time.
75 * xlinkSimpleLinkFunk:
76 * @param ctx user data pointer
77 * @param node the node carrying the link
78 * @param href the target of the link
79 * @param role the role string
80 * @param title the link title
82 * This is the prototype for a simple link detection callback.
85 (*xlinkSimpleLinkFunk) (void *ctx,
89 const xlinkTitle title);
92 * xlinkExtendedLinkFunk:
93 * @param ctx user data pointer
94 * @param node the node carrying the link
95 * @param nbLocators the number of locators detected on the link
96 * @param hrefs pointer to the array of locator hrefs
97 * @param roles pointer to the array of locator roles
98 * @param nbArcs the number of arcs detected on the link
99 * @param from pointer to the array of source roles found on the arcs
100 * @param to pointer to the array of target roles found on the arcs
101 * @param show array of values for the show attributes found on the arcs
102 * @param actuate array of values for the actuate attributes found on the arcs
103 * @param nbTitles the number of titles detected on the link
104 * @param title array of titles detected on the link
105 * @param langs array of xml:lang values for the titles
107 * This is the prototype for a extended link detection callback.
110 (*xlinkExtendedLinkFunk)(void *ctx,
113 const xlinkHRef *hrefs,
114 const xlinkRole *roles,
116 const xlinkRole *from,
119 xlinkActuate *actuate,
121 const xlinkTitle *titles,
122 const xmlChar **langs);
125 * xlinkExtendedLinkSetFunk:
126 * @param ctx user data pointer
127 * @param node the node carrying the link
128 * @param nbLocators the number of locators detected on the link
129 * @param hrefs pointer to the array of locator hrefs
130 * @param roles pointer to the array of locator roles
131 * @param nbTitles the number of titles detected on the link
132 * @param title array of titles detected on the link
133 * @param langs array of xml:lang values for the titles
135 * This is the prototype for a extended link set detection callback.
138 (*xlinkExtendedLinkSetFunk) (void *ctx,
141 const xlinkHRef *hrefs,
142 const xlinkRole *roles,
144 const xlinkTitle *titles,
145 const xmlChar **langs);
148 * This is the structure containing a set of Links detection callbacks.
150 * There is no default xlink callbacks, if one want to get link
151 * recognition activated, those call backs must be provided before parsing.
153 typedef struct _xlinkHandler xlinkHandler;
154 typedef xlinkHandler *xlinkHandlerPtr;
155 struct _xlinkHandler {
156 xlinkSimpleLinkFunk simple;
157 xlinkExtendedLinkFunk extended;
158 xlinkExtendedLinkSetFunk set;
162 * The default detection routine, can be overridden, they call the default
163 * detection callbacks.
166 XMLPUBFUN xlinkNodeDetectFunc XMLCALL
167 xlinkGetDefaultDetect (void);
168 XMLPUBFUN void XMLCALL
169 xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
172 * Routines to set/get the default handlers.
174 XMLPUBFUN xlinkHandlerPtr XMLCALL
175 xlinkGetDefaultHandler (void);
176 XMLPUBFUN void XMLCALL
177 xlinkSetDefaultHandler (xlinkHandlerPtr handler);
180 * Link detection module itself.
182 XMLPUBFUN xlinkType XMLCALL
183 xlinkIsLink (xmlDocPtr doc,
189 #endif /* XML_XLINK_H */