1 | // -*- c-basic-offset: 2 -*-
|
---|
2 | /*
|
---|
3 | * This file is part of the KDE libraries
|
---|
4 | * Copyright (C) 1999-2000 Harri Porten ([email protected])
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
19 | *
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef NumberObject_h
|
---|
23 | #define NumberObject_h
|
---|
24 |
|
---|
25 | #include "FunctionPrototype.h"
|
---|
26 | #include "JSWrapperObject.h"
|
---|
27 |
|
---|
28 | namespace KJS {
|
---|
29 |
|
---|
30 | class NumberObject : public JSWrapperObject {
|
---|
31 | public:
|
---|
32 | NumberObject(JSObject* prototype);
|
---|
33 |
|
---|
34 | virtual const ClassInfo* classInfo() const { return &info; }
|
---|
35 | static const ClassInfo info;
|
---|
36 | };
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * @internal
|
---|
40 | *
|
---|
41 | * The initial value of Number.prototype (and thus all objects created
|
---|
42 | * with the Number constructor
|
---|
43 | */
|
---|
44 | class NumberPrototype : public NumberObject {
|
---|
45 | public:
|
---|
46 | NumberPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
|
---|
47 | };
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * @internal
|
---|
51 | *
|
---|
52 | * The initial value of the the global variable's "Number" property
|
---|
53 | */
|
---|
54 | class NumberConstructor : public InternalFunction {
|
---|
55 | public:
|
---|
56 | NumberConstructor(ExecState*, FunctionPrototype*, NumberPrototype*);
|
---|
57 |
|
---|
58 | virtual ConstructType getConstructData(ConstructData&);
|
---|
59 | virtual JSObject* construct(ExecState*, const List&);
|
---|
60 |
|
---|
61 | virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
|
---|
62 |
|
---|
63 | bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
|
---|
64 | JSValue* getValueProperty(ExecState*, int token) const;
|
---|
65 |
|
---|
66 | virtual const ClassInfo* classInfo() const { return &info; }
|
---|
67 | static const ClassInfo info;
|
---|
68 |
|
---|
69 | enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
|
---|
70 |
|
---|
71 | JSObject* construct(const List&);
|
---|
72 | };
|
---|
73 |
|
---|
74 | } // namespace KJS
|
---|
75 |
|
---|
76 | #endif // NumberObject_h
|
---|