|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #ifndef JSHTMLCollection_H |
|
22 #define JSHTMLCollection_H |
|
23 |
|
24 #include "kjs_binding.h" |
|
25 |
|
26 namespace WebCore { |
|
27 |
|
28 class HTMLCollection; |
|
29 |
|
30 class JSHTMLCollection : public KJS::DOMObject { |
|
31 public: |
|
32 JSHTMLCollection(KJS::ExecState*, HTMLCollection*); |
|
33 virtual ~JSHTMLCollection(); |
|
34 virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&); |
|
35 KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const; |
|
36 virtual const KJS::ClassInfo* classInfo() const { return &info; } |
|
37 static const KJS::ClassInfo info; |
|
38 |
|
39 virtual KJS::JSValue* callAsFunction(KJS::ExecState*, KJS::JSObject*, const KJS::List&); |
|
40 virtual bool implementsCall() const; |
|
41 |
|
42 static KJS::JSValue* getConstructor(KJS::ExecState*); |
|
43 enum { |
|
44 // Attributes |
|
45 LengthAttrNum, |
|
46 |
|
47 // The Constructor Attribute |
|
48 ConstructorAttrNum, |
|
49 |
|
50 // Functions |
|
51 ItemFuncNum, NamedItemFuncNum, TagsFuncNum |
|
52 }; |
|
53 |
|
54 // Custom functions |
|
55 KJS::JSValue* item(KJS::ExecState*, const KJS::List&); |
|
56 KJS::JSValue* namedItem(KJS::ExecState*, const KJS::List&); |
|
57 HTMLCollection* impl() const { return m_impl.get(); } |
|
58 private: |
|
59 RefPtr<HTMLCollection> m_impl; |
|
60 private: |
|
61 static KJS::JSValue* indexGetter(KJS::ExecState*, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot&); |
|
62 private: |
|
63 static bool canGetItemsForName(KJS::ExecState*, HTMLCollection*, const KJS::Identifier&); |
|
64 static KJS::JSValue* nameGetter(KJS::ExecState*, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot&); |
|
65 }; |
|
66 |
|
67 KJS::JSValue* toJS(KJS::ExecState*, HTMLCollection*); |
|
68 HTMLCollection* toHTMLCollection(KJS::JSValue*); |
|
69 |
|
70 class JSHTMLCollectionPrototype : public KJS::JSObject { |
|
71 public: |
|
72 static KJS::JSObject* self(KJS::ExecState* exec); |
|
73 virtual const KJS::ClassInfo* classInfo() const { return &info; } |
|
74 static const KJS::ClassInfo info; |
|
75 bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&); |
|
76 JSHTMLCollectionPrototype(KJS::ExecState* exec) |
|
77 : KJS::JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { } |
|
78 }; |
|
79 |
|
80 class JSHTMLCollectionPrototypeFunction : public KJS::InternalFunctionImp { |
|
81 public: |
|
82 JSHTMLCollectionPrototypeFunction(KJS::ExecState* exec, int i, int len, const KJS::Identifier& name) |
|
83 : KJS::InternalFunctionImp(static_cast<KJS::FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name) |
|
84 , id(i) |
|
85 { |
|
86 put(exec, exec->propertyNames().length, KJS::jsNumber(len), KJS::DontDelete|KJS::ReadOnly|KJS::DontEnum); |
|
87 } |
|
88 virtual KJS::JSValue* callAsFunction(KJS::ExecState*, KJS::JSObject*, const KJS::List&); |
|
89 |
|
90 private: |
|
91 int id; |
|
92 }; |
|
93 |
|
94 } // namespace WebCore |
|
95 |
|
96 #endif |