15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/*
25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright 2005 Frerich Raabe <raabe@kde.org>
35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2006 Apple Computer, Inc.
45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * are met:
802772c6a72f1ee0b226341a4f4439970c29fc861Ben Murdoch *
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 1. Redistributions of source code must retain the above copyright
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    notice, this list of conditions and the following disclaimer.
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 2. Redistributions in binary form must reproduce the above copyright
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    notice, this list of conditions and the following disclaimer in the
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    documentation and/or other materials provided with the distribution.
1402772c6a72f1ee0b226341a4f4439970c29fc861Ben Murdoch *
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */
265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef XPathEvaluator_h
285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define XPathEvaluator_h
295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "bindings/v8/ScriptWrappable.h"
3193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "wtf/Forward.h"
3293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "wtf/PassRefPtr.h"
3393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "wtf/RefCounted.h"
345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)namespace WebCore {
365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
37df95704c49daea886ddad70775bda23618d6274dBen Murdochclass ExceptionState;
3893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class Node;
3993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class XPathExpression;
4093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class XPathNSResolver;
4193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class XPathResult;
4293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class XPathEvaluator : public RefCounted<XPathEvaluator>, public ScriptWrappable {
4493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)public:
4593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    static PassRefPtr<XPathEvaluator> create() { return adoptRef(new XPathEvaluator); }
4693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    PassRefPtr<XPathExpression> createExpression(const String& expression, PassRefPtr<XPathNSResolver>, ExceptionState&);
4893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    PassRefPtr<XPathNSResolver> createNSResolver(Node* nodeResolver);
4993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    PassRefPtr<XPathResult> evaluate(const String& expression, Node* contextNode,
5051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)        PassRefPtr<XPathNSResolver>, unsigned short type, XPathResult*, ExceptionState&);
5193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
5293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)private:
5393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    XPathEvaluator()
5493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    {
5593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        ScriptWrappable::init(this);
5693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    }
5793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)};
585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}
605c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
615c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#endif // XPathEvaluator_h
62