kjs Library API Documentation

number_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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  *  $Id: number_object.h,v 1.15.2.1 2003/05/17 11:19:25 mueller Exp $
00021  */
00022 
00023 #ifndef _NUMBER_OBJECT_H_
00024 #define _NUMBER_OBJECT_H_
00025 
00026 #include "internal.h"
00027 #include "function_object.h"
00028 
00029 namespace KJS {
00030 
00031   class NumberInstanceImp : public ObjectImp {
00032   public:
00033     NumberInstanceImp(const Object &proto);
00034 
00035     virtual const ClassInfo *classInfo() const { return &info; }
00036     static const ClassInfo info;
00037   };
00038 
00045   class NumberPrototypeImp : public NumberInstanceImp {
00046   public:
00047     NumberPrototypeImp(ExecState *exec,
00048                        ObjectPrototypeImp *objProto,
00049                        FunctionPrototypeImp *funcProto);
00050   };
00051 
00058   class NumberProtoFuncImp : public InternalFunctionImp {
00059   public:
00060     NumberProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
00061                        int i, int len);
00062 
00063     virtual bool implementsCall() const;
00064     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00065 
00066     enum { ToString, ToLocaleString, ValueOf };
00067   private:
00068     int id;
00069   };
00070 
00076   class NumberObjectImp : public InternalFunctionImp {
00077   public:
00078     NumberObjectImp(ExecState *exec,
00079                     FunctionPrototypeImp *funcProto,
00080                     NumberPrototypeImp *numberProto);
00081 
00082     virtual bool implementsConstruct() const;
00083     virtual Object construct(ExecState *exec, const List &args);
00084 
00085     virtual bool implementsCall() const;
00086     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00087 
00088     Value get(ExecState *exec, const UString &p) const;
00089     Value getValueProperty(ExecState *exec, int token) const;
00090     virtual const ClassInfo *classInfo() const { return &info; }
00091     static const ClassInfo info;
00092     enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
00093 
00094     Completion execute(const List &);
00095     Object construct(const List &);
00096   };
00097 
00098 } // namespace
00099 
00100 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:15:18 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001