-fix remaining regressions in background images painting.
[kdelibs.git] / kjs / bool_object.h
blobf9e16abe713c223533823e4b613df6c546b1730b
1 // -*- c-basic-offset: 2 -*-
2 /*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
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.
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.
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
22 #ifndef BOOL_OBJECT_H_
23 #define BOOL_OBJECT_H_
25 #include "internal.h"
26 #include "function_object.h"
27 #include "JSWrapperObject.h"
29 namespace KJS {
31 class BooleanInstance : public JSWrapperObject {
32 public:
33 BooleanInstance(JSObject *proto);
35 virtual const ClassInfo *classInfo() const { return &info; }
36 static const ClassInfo info;
39 /**
40 * @internal
42 * The initial value of Boolean.prototype (and thus all objects created
43 * with the Boolean constructor
45 class BooleanPrototype : public BooleanInstance {
46 public:
47 BooleanPrototype(ExecState *exec,
48 ObjectPrototype *objectProto,
49 FunctionPrototype *funcProto);
52 /**
53 * @internal
55 * Class to implement all methods that are properties of the
56 * Boolean.prototype object
58 class BooleanProtoFunc : public InternalFunctionImp {
59 public:
60 BooleanProtoFunc(ExecState*, FunctionPrototype*, int i, int len, const Identifier&);
62 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
64 enum { ToString, ValueOf };
65 private:
66 int id;
69 /**
70 * @internal
72 * The initial value of the the global variable's "Boolean" property
74 class BooleanObjectImp : public InternalFunctionImp {
75 friend class BooleanProtoFunc;
76 public:
77 BooleanObjectImp(ExecState *exec, FunctionPrototype *funcProto,
78 BooleanPrototype *booleanProto);
80 virtual bool implementsConstruct() const;
81 virtual JSObject *construct(ExecState *exec, const List &args);
83 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
86 } // namespace
88 #endif