Debian Codegraph @

include/libxml/xlink.h

raw
1 /**
2 * @file
3 *
4 * @brief unfinished XLink detection module
5 *
6 * This module is deprecated, don't use.
7 *
8 * @copyright See Copyright for the status of this software.
9 *
10 * @author Daniel Veillard
11 */
12
13 #ifndef __XML_XLINK_H__
14 #define __XML_XLINK_H__
15
16 #include <libxml/xmlversion.h>
17 #include <libxml/tree.h>
18
19 #ifdef LIBXML_XPTR_ENABLED
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 /** @cond ignore */
26
27 /**
28 * Various defines for the various Link properties.
29 *
30 * NOTE: the link detection layer will try to resolve QName expansion
31 * of namespaces. If "foo" is the prefix for "http://foo.com/"
32 * then the link detection layer will expand role="foo:myrole"
33 * to "http://foo.com/:myrole".
34 * NOTE: the link detection layer will expand URI-References found on
35 * href attributes by using the base mechanism if found.
36 */
37 typedef xmlChar *xlinkHRef;
38 typedef xmlChar *xlinkRole;
39 typedef xmlChar *xlinkTitle;
40
41 typedef enum {
42 XLINK_TYPE_NONE = 0,
43 XLINK_TYPE_SIMPLE,
44 XLINK_TYPE_EXTENDED,
45 XLINK_TYPE_EXTENDED_SET
46 } xlinkType;
47
48 typedef enum {
49 XLINK_SHOW_NONE = 0,
50 XLINK_SHOW_NEW,
51 XLINK_SHOW_EMBED,
52 XLINK_SHOW_REPLACE
53 } xlinkShow;
54
55 typedef enum {
56 XLINK_ACTUATE_NONE = 0,
57 XLINK_ACTUATE_AUTO,
58 XLINK_ACTUATE_ONREQUEST
59 } xlinkActuate;
60
61 /** @endcond */
62
63 /**
64 * This is the prototype for the link detection routine.
65 * It calls the default link detection callbacks upon link detection.
66 *
67 * @param ctx user data pointer
68 * @param node the node to check
69 */
70 typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNode *node);
71
72 /*
73 * The link detection module interact with the upper layers using
74 * a set of callback registered at parsing time.
75 */
76
77 /**
78 * This is the prototype for a simple link detection callback.
79 *
80 * @param ctx user data pointer
81 * @param node the node carrying the link
82 * @param href the target of the link
83 * @param role the role string
84 * @param title the link title
85 */
86 typedef void
87 (*xlinkSimpleLinkFunk) (void *ctx,
88 xmlNode *node,
89 const xlinkHRef href,
90 const xlinkRole role,
91 const xlinkTitle title);
92
93 /**
94 * This is the prototype for a extended link detection callback.
95 *
96 * @param ctx user data pointer
97 * @param node the node carrying the link
98 * @param nbLocators the number of locators detected on the link
99 * @param hrefs pointer to the array of locator hrefs
100 * @param roles pointer to the array of locator roles
101 * @param nbArcs the number of arcs detected on the link
102 * @param from pointer to the array of source roles found on the arcs
103 * @param to pointer to the array of target roles found on the arcs
104 * @param show array of values for the show attributes found on the arcs
105 * @param actuate array of values for the actuate attributes found on the arcs
106 * @param nbTitles the number of titles detected on the link
107 * @param titles array of titles detected on the link
108 * @param langs array of xml:lang values for the titles
109 */
110 typedef void
111 (*xlinkExtendedLinkFunk)(void *ctx,
112 xmlNode *node,
113 int nbLocators,
114 const xlinkHRef *hrefs,
115 const xlinkRole *roles,
116 int nbArcs,
117 const xlinkRole *from,
118 const xlinkRole *to,
119 xlinkShow *show,
120 xlinkActuate *actuate,
121 int nbTitles,
122 const xlinkTitle *titles,
123 const xmlChar **langs);
124
125 /**
126 * This is the prototype for a extended link set detection callback.
127 *
128 * @param ctx user data pointer
129 * @param node the node carrying the link
130 * @param nbLocators the number of locators detected on the link
131 * @param hrefs pointer to the array of locator hrefs
132 * @param roles pointer to the array of locator roles
133 * @param nbTitles the number of titles detected on the link
134 * @param titles array of titles detected on the link
135 * @param langs array of xml:lang values for the titles
136 */
137 typedef void
138 (*xlinkExtendedLinkSetFunk) (void *ctx,
139 xmlNode *node,
140 int nbLocators,
141 const xlinkHRef *hrefs,
142 const xlinkRole *roles,
143 int nbTitles,
144 const xlinkTitle *titles,
145 const xmlChar **langs);
146
147 typedef struct _xlinkHandler xlinkHandler;
148 typedef xlinkHandler *xlinkHandlerPtr;
149 /**
150 * This is the structure containing a set of Links detection callbacks.
151 *
152 * There is no default xlink callbacks, if one want to get link
153 * recognition activated, those call backs must be provided before parsing.
154 */
155 struct _xlinkHandler {
156 xlinkSimpleLinkFunk simple;
157 xlinkExtendedLinkFunk extended;
158 xlinkExtendedLinkSetFunk set;
159 };
160
161 /*
162 * The default detection routine, can be overridden, they call the default
163 * detection callbacks.
164 */
165
166 XML_DEPRECATED
167 XMLPUBFUN xlinkNodeDetectFunc
168 xlinkGetDefaultDetect (void);
169 XML_DEPRECATED
170 XMLPUBFUN void
171 xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
172
173 /*
174 * Routines to set/get the default handlers.
175 */
176 XML_DEPRECATED
177 XMLPUBFUN xlinkHandler *
178 xlinkGetDefaultHandler (void);
179 XML_DEPRECATED
180 XMLPUBFUN void
181 xlinkSetDefaultHandler (xlinkHandler *handler);
182
183 /*
184 * Link detection module itself.
185 */
186 XML_DEPRECATED
187 XMLPUBFUN xlinkType
188 xlinkIsLink (xmlDoc *doc,
189 xmlNode *node);
190
191 #ifdef __cplusplus
192 }
193 #endif
194
195 #endif /* LIBXML_XPTR_ENABLED */
196
197 #endif /* __XML_XLINK_H__ */