1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/libxml2/libxml2_xlink.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,189 @@
1.4 +/*
1.5 + * Summary: unfinished XLink detection module
1.6 + * Description: unfinished XLink detection module
1.7 + *
1.8 + * Copy: See Copyright for the status of this software.
1.9 + *
1.10 + * Author: Daniel Veillard
1.11 + * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.12 + */
1.13 +
1.14 +/** @file
1.15 +@publishedAll
1.16 +@released
1.17 +*/
1.18 +
1.19 +#ifndef XML_XLINK_H
1.20 +#define XML_XLINK_H
1.21 +
1.22 +#include <libxml2_xmlversion.h>
1.23 +#include <libxml2_tree.h>
1.24 +
1.25 +#ifdef __cplusplus
1.26 +extern "C" {
1.27 +#endif
1.28 +/**
1.29 + * Various defines for the various Link properties.
1.30 + *
1.31 + * NOTE: the link detection layer will try to resolve QName expansion
1.32 + * of namespaces. If "foo" is the prefix for "http://foo.com/"
1.33 + * then the link detection layer will expand role="foo:myrole"
1.34 + * to "http://foo.com/:myrole".
1.35 + * NOTE: the link detection layer will expand URI-Refences found on
1.36 + * href attributes by using the base mechanism if found.
1.37 + */
1.38 +typedef xmlChar *xlinkHRef;
1.39 +typedef xmlChar *xlinkRole;
1.40 +typedef xmlChar *xlinkTitle;
1.41 +
1.42 +typedef enum {
1.43 + XLINK_TYPE_NONE = 0,
1.44 + XLINK_TYPE_SIMPLE,
1.45 + XLINK_TYPE_EXTENDED,
1.46 + XLINK_TYPE_EXTENDED_SET
1.47 +} xlinkType;
1.48 +
1.49 +typedef enum {
1.50 + XLINK_SHOW_NONE = 0,
1.51 + XLINK_SHOW_NEW,
1.52 + XLINK_SHOW_EMBED,
1.53 + XLINK_SHOW_REPLACE
1.54 +} xlinkShow;
1.55 +
1.56 +typedef enum {
1.57 + XLINK_ACTUATE_NONE = 0,
1.58 + XLINK_ACTUATE_AUTO,
1.59 + XLINK_ACTUATE_ONREQUEST
1.60 +} xlinkActuate;
1.61 +
1.62 +/**
1.63 + * xlinkNodeDetectFunc:
1.64 + * @param ctx user data pointer
1.65 + * @param node the node to check
1.66 + *
1.67 + * This is the prototype for the link detection routine.
1.68 + * It calls the default link detection callbacks upon link detection.
1.69 + */
1.70 +typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
1.71 +
1.72 +/*
1.73 + * The link detection module interact with the upper layers using
1.74 + * a set of callback registered at parsing time.
1.75 + */
1.76 +
1.77 +/**
1.78 + * xlinkSimpleLinkFunk:
1.79 + * @param ctx user data pointer
1.80 + * @param node the node carrying the link
1.81 + * @param href the target of the link
1.82 + * @param role the role string
1.83 + * @param title the link title
1.84 + *
1.85 + * This is the prototype for a simple link detection callback.
1.86 + */
1.87 +typedef void
1.88 +(*xlinkSimpleLinkFunk) (void *ctx,
1.89 + xmlNodePtr node,
1.90 + const xlinkHRef href,
1.91 + const xlinkRole role,
1.92 + const xlinkTitle title);
1.93 +
1.94 +/**
1.95 + * xlinkExtendedLinkFunk:
1.96 + * @param ctx user data pointer
1.97 + * @param node the node carrying the link
1.98 + * @param nbLocators the number of locators detected on the link
1.99 + * @param hrefs pointer to the array of locator hrefs
1.100 + * @param roles pointer to the array of locator roles
1.101 + * @param nbArcs the number of arcs detected on the link
1.102 + * @param from pointer to the array of source roles found on the arcs
1.103 + * @param to pointer to the array of target roles found on the arcs
1.104 + * @param show array of values for the show attributes found on the arcs
1.105 + * @param actuate array of values for the actuate attributes found on the arcs
1.106 + * @param nbTitles the number of titles detected on the link
1.107 + * @param title array of titles detected on the link
1.108 + * @param langs array of xml:lang values for the titles
1.109 + *
1.110 + * This is the prototype for a extended link detection callback.
1.111 + */
1.112 +typedef void
1.113 +(*xlinkExtendedLinkFunk)(void *ctx,
1.114 + xmlNodePtr node,
1.115 + int nbLocators,
1.116 + const xlinkHRef *hrefs,
1.117 + const xlinkRole *roles,
1.118 + int nbArcs,
1.119 + const xlinkRole *from,
1.120 + const xlinkRole *to,
1.121 + xlinkShow *show,
1.122 + xlinkActuate *actuate,
1.123 + int nbTitles,
1.124 + const xlinkTitle *titles,
1.125 + const xmlChar **langs);
1.126 +
1.127 +/**
1.128 + * xlinkExtendedLinkSetFunk:
1.129 + * @param ctx user data pointer
1.130 + * @param node the node carrying the link
1.131 + * @param nbLocators the number of locators detected on the link
1.132 + * @param hrefs pointer to the array of locator hrefs
1.133 + * @param roles pointer to the array of locator roles
1.134 + * @param nbTitles the number of titles detected on the link
1.135 + * @param title array of titles detected on the link
1.136 + * @param langs array of xml:lang values for the titles
1.137 + *
1.138 + * This is the prototype for a extended link set detection callback.
1.139 + */
1.140 +typedef void
1.141 +(*xlinkExtendedLinkSetFunk) (void *ctx,
1.142 + xmlNodePtr node,
1.143 + int nbLocators,
1.144 + const xlinkHRef *hrefs,
1.145 + const xlinkRole *roles,
1.146 + int nbTitles,
1.147 + const xlinkTitle *titles,
1.148 + const xmlChar **langs);
1.149 +
1.150 +/**
1.151 + * This is the structure containing a set of Links detection callbacks.
1.152 + *
1.153 + * There is no default xlink callbacks, if one want to get link
1.154 + * recognition activated, those call backs must be provided before parsing.
1.155 + */
1.156 +typedef struct _xlinkHandler xlinkHandler;
1.157 +typedef xlinkHandler *xlinkHandlerPtr;
1.158 +struct _xlinkHandler {
1.159 + xlinkSimpleLinkFunk simple;
1.160 + xlinkExtendedLinkFunk extended;
1.161 + xlinkExtendedLinkSetFunk set;
1.162 +};
1.163 +
1.164 +/*
1.165 + * The default detection routine, can be overridden, they call the default
1.166 + * detection callbacks.
1.167 + */
1.168 +
1.169 +XMLPUBFUN xlinkNodeDetectFunc XMLCALL
1.170 + xlinkGetDefaultDetect (void);
1.171 +XMLPUBFUN void XMLCALL
1.172 + xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
1.173 +
1.174 +/*
1.175 + * Routines to set/get the default handlers.
1.176 + */
1.177 +XMLPUBFUN xlinkHandlerPtr XMLCALL
1.178 + xlinkGetDefaultHandler (void);
1.179 +XMLPUBFUN void XMLCALL
1.180 + xlinkSetDefaultHandler (xlinkHandlerPtr handler);
1.181 +
1.182 +/*
1.183 + * Link detection module itself.
1.184 + */
1.185 +XMLPUBFUN xlinkType XMLCALL
1.186 + xlinkIsLink (xmlDocPtr doc,
1.187 + xmlNodePtr node);
1.188 +
1.189 +#ifdef __cplusplus
1.190 +}
1.191 +#endif
1.192 +#endif /* XML_XLINK_H */