KJS

object_object.h
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (C) 1999-2000 Harri Porten ([email protected])
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser 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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  */
20 
21 #ifndef _OBJECT_OBJECT_H_
22 #define _OBJECT_OBJECT_H_
23 
24 #include "function.h"
25 
26 namespace KJS
27 {
28 
29 class FunctionPrototype;
30 
37 class KJS_EXPORT ObjectPrototype : public JSObject
38 {
39 public:
40  ObjectPrototype(ExecState *exec, FunctionPrototype *funcProto);
41 
42  // Returns the lexical default object prototype for the given interpreter.
43  // This is just an alias for exec->lexicalInterpreter()->builtinObjectPrototype()
44  // for uniformity with custom prototypes.
45  static JSObject *self(ExecState *exec);
46 };
47 
54 class ObjectProtoFunc : public InternalFunctionImp
55 {
56 public:
57  ObjectProtoFunc(ExecState *exec, FunctionPrototype *funcProto, int i, int len, const Identifier &);
58 
59  virtual JSValue *callAsFunction(ExecState *, JSObject *, const List &args);
60 
61  enum { ToString, ToLocaleString, ValueOf, HasOwnProperty, IsPrototypeOf, PropertyIsEnumerable,
62  DefineGetter, DefineSetter, LookupGetter, LookupSetter
63  };
64 private:
65  int id;
66 };
67 
73 class ObjectObjectImp : public InternalFunctionImp
74 {
75 public:
76 
78  ObjectPrototype *objProto,
79  FunctionPrototype *funcProto);
80 
81  virtual bool implementsConstruct() const;
82  using KJS::JSObject::construct;
83  virtual JSObject *construct(ExecState *, const List &args);
84  virtual JSValue *callAsFunction(ExecState *, JSObject *, const List &args);
85 };
86 
87 } // namespace
88 
89 #endif
JSValue is the base type for all primitives (Undefined, Null, Boolean, String, Number) and objects in...
Definition: value.h:58
Native list type.
Definition: list.h:52
Represents the current state of script execution.
Definition: ExecState.h:53
Represents an Identifier for a Javascript object.
Definition: identifier.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jan 14 2021 23:02:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.