xmlhttprequest.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "xmlhttprequest.h"
00022 #include "xmlhttprequest.lut.h"
00023
00024 #include <kdebug.h>
00025
00026 using namespace KJS;
00027
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 DEFINE_PROTOTYPE("XMLHttpRequest",XMLHttpRequestProto)
00041 IMPLEMENT_PROTOFUNC_DOM(XMLHttpRequestProtoFunc)
00042 IMPLEMENT_PROTOTYPE(XMLHttpRequestProto,XMLHttpRequestProtoFunc)
00043
00044 namespace KJS {
00045
00046 XMLHttpRequestConstructorImp::XMLHttpRequestConstructorImp(ExecState *, const DOM::Document &d)
00047 : ObjectImp(), doc(d)
00048 {
00049 }
00050
00051 bool XMLHttpRequestConstructorImp::implementsConstruct() const
00052 {
00053 return true;
00054 }
00055
00056 Object XMLHttpRequestConstructorImp::construct(ExecState *exec, const List &)
00057 {
00058 return Object(new XMLHttpRequest(exec, doc));
00059 }
00060
00061 const ClassInfo XMLHttpRequest::info = { "XMLHttpRequest", 0, &XMLHttpRequestTable, 0 };
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 Value XMLHttpRequest::tryGet(ExecState *exec, const Identifier &propertyName) const
00075 {
00076 return DOMObjectLookupGetValue<XMLHttpRequest,DOMObject>(exec, propertyName, &XMLHttpRequestTable, this);
00077 }
00078
00079 Value XMLHttpRequest::getValueProperty(ExecState *, int token) const
00080 {
00081 switch (token) {
00082 case ReadyState:
00083 return Undefined();
00084 case ResponseText:
00085 return Undefined();
00086 case ResponseXML:
00087 return Undefined();
00088 case Status:
00089 return Undefined();
00090 case StatusText:
00091 return Undefined();
00092 case Onreadystatechange:
00093 return Null();
00094 default:
00095 kdWarning() << "XMLHttpRequest::getValueProperty unhandled token " << token << endl;
00096 return Value();
00097 }
00098 }
00099
00100 void XMLHttpRequest::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
00101 {
00102 DOMObjectLookupPut<XMLHttpRequest,DOMObject>(exec, propertyName, value, attr, &XMLHttpRequestTable, this );
00103 }
00104
00105 void XMLHttpRequest::putValueProperty(ExecState *exec, int token, const Value& value, int )
00106 {
00107 switch(token) {
00108 case Onreadystatechange:
00109 break;
00110 default:
00111 kdWarning() << "HTMLDocument::putValue unhandled token " << token << endl;
00112 }
00113 }
00114
00115 void XMLHttpRequest::notifyFinished(khtml::CachedObject *)
00116 {
00117 }
00118
00119 XMLHttpRequest::XMLHttpRequest(ExecState *exec, const DOM::Document &d)
00120 : DOMObject(XMLHttpRequestProto::self(exec))
00121 {
00122 }
00123
00124 XMLHttpRequest::~XMLHttpRequest()
00125 {
00126 }
00127
00128 Value XMLHttpRequestProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
00129 {
00130 if (!thisObj.inherits(&XMLHttpRequest::info)) {
00131 Object err = Error::create(exec,TypeError);
00132 exec->setException(err);
00133 return err;
00134 }
00135 switch (id) {
00136 case XMLHttpRequest::Abort:
00137 return Undefined();
00138 case XMLHttpRequest::GetAllResponseHeaders:
00139 return Undefined();
00140 case XMLHttpRequest::GetResponseHeader:
00141 return Undefined();
00142 case XMLHttpRequest::Open:
00143 return Undefined();
00144 case XMLHttpRequest::Send:
00145 return Undefined();
00146 case XMLHttpRequest::SetRequestHeader:
00147 return Undefined();
00148 }
00149
00150 return Undefined();
00151 }
00152
00153 }
This file is part of the documentation for khtml Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 21 18:45:06 2004 by
doxygen 1.3.6-20040222 written by
Dimitri van Heesch, © 1997-2003