1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // XPath configuraion functions
24 #ifndef XMLENGXPATHCONFIGURATION_H
25 #define XMLENGXPATHCONFIGURATION_H
27 #include <xml/dom/xmlengxpathextensionfunction.h>
30 This class holds a name, a namespace URI and a pointer to a XPath extension
31 function (either native or defined via MXmlEngXPathExtensionFunction interface).
33 @see XmlEngXPathConfiguration
34 @see MXmlEngXPathExtensionFunction
36 class TXmlEngExtensionFunctionDescriptor
39 /** Default constructor */
40 IMPORT_C TXmlEngExtensionFunctionDescriptor();
43 /** Extension function (Pointer to MXmlEngXPathExtensionFunction) */
48 const char* iNamespaceUri;
54 This object is used to support extension functions used within the XPath library.
55 Extension functions may be added or removed. This object can also determine whether
56 an extension function is supported.
58 Extension functions are stored in a TXmlEngExtensionFunctionDescriptor object which
59 holds the extension function (a MXmlEngXPathExtensionFunction instance), the
60 function name and the function namespace. An extension function can be added
61 to the library using XmlEngXPathConfiguration::AddExtensionFunctionL().
63 When an extension function is to be evaluated,
64 MXmlEngXPathExtensionFunction::Evaluate() is called with a
65 MXmlEngXPathEvaluationContext instance which holds the function arguments and
68 @see MXmlEngXPathExtensionFunction
69 @see MXmlEngXPathEvaluationContext
70 @see TXmlEngExtensionFunctionDescriptor
72 class XmlEngXPathConfiguration
79 IMPORT_C static void Unused_Func1(TBool aEnable);
82 Disables support of any previously registered extension functions
83 and switches to support only the XPath Function Library.
84 @leave KErrNoMemory Memory allocation failure
86 IMPORT_C static void ResetExtensionFunctionsL();
89 Check if XPath extension function is supported.
91 @param aFunc Function name
92 @param aNsUri Function namespace URI
93 @return ETrue if supported, EFalse otherwise
94 @leave - One of the system-wide error codes
96 IMPORT_C static TBool IsFunctionSupportedL(const TDesC8& aFunc, const TDesC8& aNsUri);
99 Registers an extension function at the global scope.
101 @param aFuncDes Function descriptor.
102 @leave KXmlEngErrWrongUseOfAPI Error initializing XPath context
103 @leave KXmlEngErrXPathResult Error adding function
104 @leave - One of the system-wide error codes
106 IMPORT_C static void AddExtensionFunctionL(const TXmlEngExtensionFunctionDescriptor& aFuncDes);
109 Registers a set of extension functions at the global scope.
111 @param aFuncVector Vector with function descriptors. Ownership is not transferred.
112 @param aSize The size of the vector
113 @leave KXmlEngErrWrongUseOfAPI Error initializing XPath context
114 @leave KXmlEngErrXPathResult Error adding function
115 @leave - One of the system-wide error codes
117 IMPORT_C static void AddExtensionFunctionVectorL (const RArray<TXmlEngExtensionFunctionDescriptor>& aFuncVector, TUint aSize);
120 Registers a native extension function at the global scope.
122 @param aNativeFuncDes Function descriptor.
123 @leave KXmlEngErrWrongUseOfAPI Error initializing XPath context
124 @leave KXmlEngErrXPathResult Error adding function
125 @leave - One of the system-wide error codes
127 IMPORT_C static void AddNativeExtensionFunctionL(const TXmlEngExtensionFunctionDescriptor& aNativeFuncDes);
130 Registers a set of native extension functions at the global scope.
132 @param aNativeFuncVector Function descriptor.
133 @param aSize The size of the vector
134 @leave KXmlEngErrWrongUseOfAPI Error initializing XPath context
135 @leave KXmlEngErrXPathResult Error adding function
136 @leave - One of the system-wide error codes
138 IMPORT_C static void AddNativeExtensionFunctionVectorL(const RArray<TXmlEngExtensionFunctionDescriptor>& aNativeFuncVector, TUint aSize);
141 Deregisters an extension function. No error is generated if the extension
142 function is not found.
144 @param aFuncDes Function descriptor.
146 IMPORT_C static void RemoveExtensionFunction(const TXmlEngExtensionFunctionDescriptor& aFuncDes);
149 Deregisters a set of extension functions. No error is generated if an
150 extension function in the vector is not found.
152 @param aFuncVector Vector with function descriptors.
153 @param aSize The size of the vector
155 IMPORT_C static void RemoveExtensionFunctionVector(const RArray<TXmlEngExtensionFunctionDescriptor>& aFuncVector, TUint aSize);
158 #endif /* XMLENGXPATHCONFIGURATION_H */