OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 3 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
4 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 4 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef NodeFilter_h | 25 #ifndef NodeFilter_h |
26 #define NodeFilter_h | 26 #define NodeFilter_h |
27 | 27 |
28 #if USE(JSC) | |
29 #include "JSDOMBinding.h" | |
30 #endif | |
31 #include "NodeFilterCondition.h" | 28 #include "NodeFilterCondition.h" |
32 #include <wtf/PassRefPtr.h> | 29 #include <wtf/PassRefPtr.h> |
33 #include <wtf/RefPtr.h> | 30 #include <wtf/RefPtr.h> |
34 | 31 |
35 namespace WebCore { | 32 namespace WebCore { |
36 | 33 |
| 34 class ExceptionContext; |
| 35 |
37 class NodeFilter : public RefCounted<NodeFilter> { | 36 class NodeFilter : public RefCounted<NodeFilter> { |
38 public: | 37 public: |
39 /** | 38 /** |
40 * The following constants are returned by the acceptNode() | 39 * The following constants are returned by the acceptNode() |
41 * method: | 40 * method: |
42 */ | 41 */ |
43 enum { | 42 enum { |
44 FILTER_ACCEPT = 1, | 43 FILTER_ACCEPT = 1, |
45 FILTER_REJECT = 2, | 44 FILTER_REJECT = 2, |
46 FILTER_SKIP = 3 | 45 FILTER_SKIP = 3 |
(...skipping 19 matching lines...) Expand all Loading... |
66 SHOW_DOCUMENT_TYPE = 0x00000200, | 65 SHOW_DOCUMENT_TYPE = 0x00000200, |
67 SHOW_DOCUMENT_FRAGMENT = 0x00000400, | 66 SHOW_DOCUMENT_FRAGMENT = 0x00000400, |
68 SHOW_NOTATION = 0x00000800 | 67 SHOW_NOTATION = 0x00000800 |
69 }; | 68 }; |
70 | 69 |
71 static PassRefPtr<NodeFilter> create(PassRefPtr<NodeFilterCondition> con
dition) | 70 static PassRefPtr<NodeFilter> create(PassRefPtr<NodeFilterCondition> con
dition) |
72 { | 71 { |
73 return adoptRef(new NodeFilter(condition)); | 72 return adoptRef(new NodeFilter(condition)); |
74 } | 73 } |
75 | 74 |
76 #if USE(JSC) | 75 short acceptNode(ExceptionContext*, Node*) const; |
77 short acceptNode(KJS::ExecState*, Node*) const; | |
78 void mark() { m_condition->mark(); }; | 76 void mark() { m_condition->mark(); }; |
79 | 77 |
80 // For non-JS bindings. Silently ignores the JavaScript exception if any
. | 78 // For non-JS bindings. Silently ignores the JavaScript exception if any
. |
81 short acceptNode(Node* node) const { return acceptNode(execStateFromNode
(node), node); } | 79 short acceptNode(Node* node) const; |
82 #endif | |
83 | 80 |
84 private: | 81 private: |
85 NodeFilter(PassRefPtr<NodeFilterCondition> condition) : m_condition(cond
ition) { } | 82 NodeFilter(PassRefPtr<NodeFilterCondition> condition) : m_condition(cond
ition) { } |
86 | 83 |
87 RefPtr<NodeFilterCondition> m_condition; | 84 RefPtr<NodeFilterCondition> m_condition; |
88 }; | 85 }; |
89 | 86 |
90 } // namespace WebCore | 87 } // namespace WebCore |
91 | 88 |
92 #endif // NodeFilter_h | 89 #endif // NodeFilter_h |
OLD | NEW |