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 // Extension function interface
24 #ifndef XMLENGXPATHFUNCTION_H
25 #define XMLENGXPATHFUNCTION_H
27 #include <xml/dom/xmlengxpathresult.h>
29 class MXmlEngXPathEvaluationContext;
32 Provides an interface for an object to participate in the evaluation of XPath
33 expression via a XPath function call.
35 Objects that implement the MXmlEngXPathExtensionFunction interface can be
36 registered in a XmlEngXPathConfiguration object for global action (across
37 all evaluations globally).
39 @see XmlEngXPathConfiguration::AddExtensionFunctionL()
41 When the extension function is no longer required, it must be deregistered
42 by calling XmlEngXPathConfiguration::RemoveExtensionFunction().
44 class MXmlEngXPathExtensionFunction
47 /** Evaluation status */
48 enum TXmlEngEvaluationStatus
50 /** Evaluation was accomplished successfully */
52 /** An exceptional condition occurs */
54 /** Type of argument does not match function specification */
56 /** Number of arguments do not match function specification */
57 EInvalidArgumentNumber
62 Gets the minimum number of arguments the function can take.
63 @return Minimum number of arguments
65 virtual TInt MinArity() {return 0;}
68 Gets the maximum number of arguments the function can take.
70 @return The maximum number of arguments or -1 if unbounded
72 virtual TInt MaxArity() {return MinArity();}
75 Called to evaluate the extension function.
77 This function is called only if simple arity constraints (min/max number of
78 arguments) are satisfied. The implementation of this function may need to
79 check further that the types of arguments and their positions in the
80 function call match function-specific requirements.
82 @param aEvalCtxt Evaluation context, which contains data about arguments
83 and provides a number of methods for setting the result of the extension
86 @return ESucceeded if evaluation success, otherwise one of the errors
87 defined in TXmlEngEvaluationStatus.
89 virtual TXmlEngEvaluationStatus Evaluate(MXmlEngXPathEvaluationContext* aEvalCtxt) = 0;
92 #endif /* XMLENGXPATHFUNCTION_H */