kjs Library API Documentation

string_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 */ 00021 00022 #ifndef _STRING_OBJECT_H_ 00023 #define _STRING_OBJECT_H_ 00024 00025 #include "internal.h" 00026 #include "function_object.h" 00027 00028 namespace KJS { 00029 00030 class StringInstanceImp : public ObjectImp { 00031 public: 00032 StringInstanceImp(ObjectImp *proto); 00033 StringInstanceImp(ObjectImp *proto, const UString &string); 00034 00035 virtual Value get(ExecState *exec, const Identifier &propertyName) const; 00036 virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None); 00037 virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const; 00038 virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName); 00039 virtual ReferenceList propList(ExecState *exec, bool recursive); 00040 00041 virtual const ClassInfo *classInfo() const { return &info; } 00042 static const ClassInfo info; 00043 }; 00044 00051 class StringPrototypeImp : public StringInstanceImp { 00052 public: 00053 StringPrototypeImp(ExecState *exec, 00054 ObjectPrototypeImp *objProto); 00055 Value get(ExecState *exec, const Identifier &p) const; 00056 virtual const ClassInfo *classInfo() const { return &info; } 00057 static const ClassInfo info; 00058 }; 00059 00066 class StringProtoFuncImp : public InternalFunctionImp { 00067 public: 00068 StringProtoFuncImp(ExecState *exec, int i, int len); 00069 00070 virtual bool implementsCall() const; 00071 virtual Value call(ExecState *exec, Object &thisObj, const List &args); 00072 00073 enum { ToString, ValueOf, CharAt, CharCodeAt, Concat, IndexOf, LastIndexOf, 00074 Match, Replace, Search, Slice, Split, 00075 Substr, Substring, FromCharCode, ToLowerCase, ToUpperCase 00076 #ifndef KJS_PURE_ECMA 00077 , Big, Small, Blink, Bold, Fixed, Italics, Strike, Sub, Sup, 00078 Fontcolor, Fontsize, Anchor, Link 00079 #endif 00080 }; 00081 private: 00082 int id; 00083 }; 00084 00090 class StringObjectImp : public InternalFunctionImp { 00091 public: 00092 StringObjectImp(ExecState *exec, 00093 FunctionPrototypeImp *funcProto, 00094 StringPrototypeImp *stringProto); 00095 00096 virtual bool implementsConstruct() const; 00097 virtual Object construct(ExecState *exec, const List &args); 00098 virtual bool implementsCall() const; 00099 virtual Value call(ExecState *exec, Object &thisObj, const List &args); 00100 }; 00101 00108 class StringObjectFuncImp : public InternalFunctionImp { 00109 public: 00110 StringObjectFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto); 00111 virtual bool implementsCall() const; 00112 virtual Value call(ExecState *exec, Object &thisObj, const List &args); 00113 }; 00114 00115 } // namespace 00116 00117 #endif 00118
KDE Logo
This file is part of the documentation for kjs Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 17 11:28:51 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003