#ifndef XPathResult_H
#define XPathResult_H
#if XPATH_SUPPORT
#include "Shared.h"
#include "XPathValue.h"
namespace WebCore {
typedef int ExceptionCode;
class EventListener;
class EventTargetNode;
class Node;
class String;
class XPathResult : public Shared<XPathResult> {
public:
enum XPathResultType {
ANY_TYPE = 0,
NUMBER_TYPE = 1,
STRING_TYPE = 2,
BOOLEAN_TYPE = 3,
UNORDERED_NODE_ITERATOR_TYPE = 4,
ORDERED_NODE_ITERATOR_TYPE = 5,
UNORDERED_NODE_SNAPSHOT_TYPE = 6,
ORDERED_NODE_SNAPSHOT_TYPE = 7,
ANY_UNORDERED_NODE_TYPE = 8,
FIRST_ORDERED_NODE_TYPE = 9
};
XPathResult(EventTargetNode*, const XPath::Value&);
~XPathResult();
void convertTo(unsigned short type, ExceptionCode&);
unsigned short resultType() const;
double numberValue(ExceptionCode&) const;
String stringValue(ExceptionCode&) const;
bool booleanValue(ExceptionCode&) const;
Node* singleNodeValue(ExceptionCode&) const;
bool invalidIteratorState() const;
unsigned long snapshotLength(ExceptionCode&) const;
Node* iterateNext(ExceptionCode&);
Node* snapshotItem(unsigned long index, ExceptionCode&);
void invalidateIteratorState();
private:
XPath::Value m_value;
unsigned m_nodeSetPosition;
XPath::NodeVector m_nodeSet;
unsigned short m_resultType;
bool m_invalidIteratorState;
RefPtr<EventTargetNode> m_eventTarget;
RefPtr<EventListener> m_eventListener;
};
}
#endif // XPATH_SUPPORT
#endif // XPathResult_H