JSNodeFilterCondition.h 1.55 KB
Newer Older
weinig's avatar
weinig committed
1 2
/*
 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
darin@apple.com's avatar
darin@apple.com committed
3
 *  Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
weinig's avatar
weinig committed
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
ddkilzer's avatar
ddkilzer committed
17
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
weinig's avatar
weinig committed
18 19 20 21 22 23
 */

#ifndef JSNodeFilterCondition_h
#define JSNodeFilterCondition_h

#include "NodeFilterCondition.h"
darin@apple.com's avatar
darin@apple.com committed
24
#include <wtf/PassRefPtr.h>
darin@apple.com's avatar
darin@apple.com committed
25 26 27 28

namespace KJS {
    class JSObject;
}
weinig's avatar
weinig committed
29 30 31 32 33 34 35

namespace WebCore {

    class Node;

    class JSNodeFilterCondition : public NodeFilterCondition {
    public:
darin@apple.com's avatar
darin@apple.com committed
36 37 38 39 40
        static PassRefPtr<JSNodeFilterCondition> create(KJS::JSObject* filter)
        {
            return adoptRef(new JSNodeFilterCondition(filter));
        }

darin@apple.com's avatar
darin@apple.com committed
41
        virtual short acceptNode(Node*, KJS::JSValue*& exception) const;
42
        virtual void mark();
weinig's avatar
weinig committed
43

darin@apple.com's avatar
darin@apple.com committed
44 45
    private:
        JSNodeFilterCondition(KJS::JSObject* filter);
weinig's avatar
weinig committed
46 47 48 49 50 51
        KJS::JSObject* m_filter;
    };

} // namespace WebCore

#endif // JSNodeFilterCondition_h