bool_object.h

00001 // -*- c-basic-offset: 2 -*-
00002 /*
00003  *  This file is part of the KDE libraries
00004  *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Lesser General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Lesser General Public
00017  *  License along with this library; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  */
00021 
00022 #ifndef _BOOL_OBJECT_H_
00023 #define _BOOL_OBJECT_H_
00024 
00025 #include "internal.h"
00026 #include "function_object.h"
00027 
00028 namespace KJS {
00029 
00030   class BooleanInstanceImp : public ObjectImp {
00031   public:
00032     BooleanInstanceImp(ObjectImp *proto);
00033 
00034     virtual const ClassInfo *classInfo() const { return &info; }
00035     static const ClassInfo info;
00036   };
00037 
00044   class BooleanPrototypeImp : public BooleanInstanceImp {
00045   public:
00046     BooleanPrototypeImp(ExecState *exec,
00047                         ObjectPrototypeImp *objectProto,
00048                         FunctionPrototypeImp *funcProto);
00049   };
00050 
00057   class BooleanProtoFuncImp : public InternalFunctionImp {
00058   public:
00059     BooleanProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
00060                         int i, int len, const Identifier &_ident);
00061 
00062     virtual bool implementsCall() const;
00063     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00064 
00065     enum { ToString, ValueOf };
00066   private:
00067     int id;
00068   };
00069 
00075   class BooleanObjectImp : public InternalFunctionImp {
00076     friend class BooleanProtoFuncImp;
00077   public:
00078     BooleanObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto,
00079                      BooleanPrototypeImp *booleanProto);
00080 
00081     virtual bool implementsConstruct() const;
00082     virtual Object construct(ExecState *exec, const List &args);
00083 
00084     virtual bool implementsCall() const;
00085     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00086   };
00087 
00088 } // namespace
00089 
00090 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys