author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@4 | 1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@4 | 2 |
// All rights reserved. |
williamr@4 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@4 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@4 | 7 |
// |
williamr@4 | 8 |
// Initial Contributors: |
williamr@4 | 9 |
// Nokia Corporation - initial contribution. |
williamr@4 | 10 |
// |
williamr@4 | 11 |
// Contributors: |
williamr@4 | 12 |
// |
williamr@4 | 13 |
// Description: |
williamr@4 | 14 |
// Extension function interface |
williamr@4 | 15 |
// |
williamr@4 | 16 |
|
williamr@4 | 17 |
|
williamr@4 | 18 |
|
williamr@4 | 19 |
/** |
williamr@4 | 20 |
@file |
williamr@4 | 21 |
@publishedAll |
williamr@4 | 22 |
@released |
williamr@4 | 23 |
*/ |
williamr@4 | 24 |
#ifndef XMLENGXPATHFUNCTION_H |
williamr@4 | 25 |
#define XMLENGXPATHFUNCTION_H |
williamr@4 | 26 |
|
williamr@4 | 27 |
#include <xml/dom/xmlengxpathresult.h> |
williamr@4 | 28 |
|
williamr@4 | 29 |
class MXmlEngXPathEvaluationContext; |
williamr@4 | 30 |
|
williamr@4 | 31 |
/** |
williamr@4 | 32 |
Provides an interface for an object to participate in the evaluation of XPath |
williamr@4 | 33 |
expression via a XPath function call. |
williamr@4 | 34 |
|
williamr@4 | 35 |
Objects that implement the MXmlEngXPathExtensionFunction interface can be |
williamr@4 | 36 |
registered in a XmlEngXPathConfiguration object for global action (across |
williamr@4 | 37 |
all evaluations globally). |
williamr@4 | 38 |
|
williamr@4 | 39 |
@see XmlEngXPathConfiguration::AddExtensionFunctionL() |
williamr@4 | 40 |
|
williamr@4 | 41 |
When the extension function is no longer required, it must be deregistered |
williamr@4 | 42 |
by calling XmlEngXPathConfiguration::RemoveExtensionFunction(). |
williamr@4 | 43 |
*/ |
williamr@4 | 44 |
class MXmlEngXPathExtensionFunction |
williamr@4 | 45 |
{ |
williamr@4 | 46 |
public: |
williamr@4 | 47 |
/** Evaluation status */ |
williamr@4 | 48 |
enum TXmlEngEvaluationStatus |
williamr@4 | 49 |
{ |
williamr@4 | 50 |
/** Evaluation was accomplished successfully */ |
williamr@4 | 51 |
ESucceeded, |
williamr@4 | 52 |
/** An exceptional condition occurs */ |
williamr@4 | 53 |
EError, |
williamr@4 | 54 |
/** Type of argument does not match function specification */ |
williamr@4 | 55 |
EInvalidArgumentType, |
williamr@4 | 56 |
/** Number of arguments do not match function specification */ |
williamr@4 | 57 |
EInvalidArgumentNumber |
williamr@4 | 58 |
}; |
williamr@4 | 59 |
|
williamr@4 | 60 |
public: |
williamr@4 | 61 |
/** |
williamr@4 | 62 |
Gets the minimum number of arguments the function can take. |
williamr@4 | 63 |
@return Minimum number of arguments |
williamr@4 | 64 |
*/ |
williamr@4 | 65 |
virtual TInt MinArity() {return 0;} |
williamr@4 | 66 |
|
williamr@4 | 67 |
/** |
williamr@4 | 68 |
Gets the maximum number of arguments the function can take. |
williamr@4 | 69 |
|
williamr@4 | 70 |
@return The maximum number of arguments or -1 if unbounded |
williamr@4 | 71 |
*/ |
williamr@4 | 72 |
virtual TInt MaxArity() {return MinArity();} |
williamr@4 | 73 |
|
williamr@4 | 74 |
/** |
williamr@4 | 75 |
Called to evaluate the extension function. |
williamr@4 | 76 |
|
williamr@4 | 77 |
This function is called only if simple arity constraints (min/max number of |
williamr@4 | 78 |
arguments) are satisfied. The implementation of this function may need to |
williamr@4 | 79 |
check further that the types of arguments and their positions in the |
williamr@4 | 80 |
function call match function-specific requirements. |
williamr@4 | 81 |
|
williamr@4 | 82 |
@param aEvalCtxt Evaluation context, which contains data about arguments |
williamr@4 | 83 |
and provides a number of methods for setting the result of the extension |
williamr@4 | 84 |
function. |
williamr@4 | 85 |
|
williamr@4 | 86 |
@return ESucceeded if evaluation success, otherwise one of the errors |
williamr@4 | 87 |
defined in TXmlEngEvaluationStatus. |
williamr@4 | 88 |
*/ |
williamr@4 | 89 |
virtual TXmlEngEvaluationStatus Evaluate(MXmlEngXPathEvaluationContext* aEvalCtxt) = 0; |
williamr@4 | 90 |
}; |
williamr@4 | 91 |
|
williamr@4 | 92 |
#endif /* XMLENGXPATHFUNCTION_H */ |
williamr@4 | 93 |