/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#include "config.h"
#include "JSXMLHttpRequestProgressEvent.h"

#include "XMLHttpRequestProgressEvent.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSXMLHttpRequestProgressEventTableValues[] =
{
    { "position", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestProgressEventPosition), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { "totalSize", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestProgressEventTotalSize), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestProgressEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSXMLHttpRequestProgressEventTable = { 9, 7, true, JSXMLHttpRequestProgressEventTableValues, 0 };
/* Hash table for constructor */

static const HashTableValue JSXMLHttpRequestProgressEventConstructorTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSXMLHttpRequestProgressEventConstructorTable = { 1, 0, false, JSXMLHttpRequestProgressEventConstructorTableValues, 0 };
static const HashTable& getJSXMLHttpRequestProgressEventConstructorTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSXMLHttpRequestProgressEventConstructorTable);
}

const ClassInfo JSXMLHttpRequestProgressEventConstructor::s_info = { "XMLHttpRequestProgressEventConstructor", &Base::s_info, 0, getJSXMLHttpRequestProgressEventConstructorTable, CREATE_METHOD_TABLE(JSXMLHttpRequestProgressEventConstructor) };

JSXMLHttpRequestProgressEventConstructor::JSXMLHttpRequestProgressEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
}

void JSXMLHttpRequestProgressEventConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    putDirect(vm, vm.propertyNames->prototype, JSXMLHttpRequestProgressEventPrototype::self(vm, globalObject), DontDelete | ReadOnly);
    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
}

bool JSXMLHttpRequestProgressEventConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSXMLHttpRequestProgressEventConstructor, JSDOMWrapper>(exec, getJSXMLHttpRequestProgressEventConstructorTable(exec->vm()), jsCast<JSXMLHttpRequestProgressEventConstructor*>(object), propertyName, slot);
}

/* Hash table for prototype */

static const HashTableValue JSXMLHttpRequestProgressEventPrototypeTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSXMLHttpRequestProgressEventPrototypeTable = { 1, 0, false, JSXMLHttpRequestProgressEventPrototypeTableValues, 0 };
static const HashTable& getJSXMLHttpRequestProgressEventPrototypeTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSXMLHttpRequestProgressEventPrototypeTable);
}

const ClassInfo JSXMLHttpRequestProgressEventPrototype::s_info = { "XMLHttpRequestProgressEventPrototype", &Base::s_info, 0, getJSXMLHttpRequestProgressEventPrototypeTable, CREATE_METHOD_TABLE(JSXMLHttpRequestProgressEventPrototype) };

JSObject* JSXMLHttpRequestProgressEventPrototype::self(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSXMLHttpRequestProgressEvent>(vm, globalObject);
}

static const HashTable& getJSXMLHttpRequestProgressEventTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSXMLHttpRequestProgressEventTable);
}

const ClassInfo JSXMLHttpRequestProgressEvent::s_info = { "XMLHttpRequestProgressEvent", &Base::s_info, 0, getJSXMLHttpRequestProgressEventTable , CREATE_METHOD_TABLE(JSXMLHttpRequestProgressEvent) };

JSXMLHttpRequestProgressEvent::JSXMLHttpRequestProgressEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<XMLHttpRequestProgressEvent> impl)
    : JSProgressEvent(structure, globalObject, impl)
{
}

void JSXMLHttpRequestProgressEvent::finishCreation(VM& vm)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
}

JSObject* JSXMLHttpRequestProgressEvent::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSXMLHttpRequestProgressEventPrototype::create(vm, globalObject, JSXMLHttpRequestProgressEventPrototype::createStructure(vm, globalObject, JSProgressEventPrototype::self(vm, globalObject)));
}

bool JSXMLHttpRequestProgressEvent::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSXMLHttpRequestProgressEvent* thisObject = jsCast<JSXMLHttpRequestProgressEvent*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    return getStaticValueSlot<JSXMLHttpRequestProgressEvent, Base>(exec, getJSXMLHttpRequestProgressEventTable(exec->vm()), thisObject, propertyName, slot);
}

EncodedJSValue jsXMLHttpRequestProgressEventPosition(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestProgressEvent* castedThis = jsDynamicCast<JSXMLHttpRequestProgressEvent*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestProgressEvent& impl = castedThis->impl();
    JSValue result = jsNumber(impl.position());
    return JSValue::encode(result);
}


EncodedJSValue jsXMLHttpRequestProgressEventTotalSize(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestProgressEvent* castedThis = jsDynamicCast<JSXMLHttpRequestProgressEvent*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestProgressEvent& impl = castedThis->impl();
    JSValue result = jsNumber(impl.totalSize());
    return JSValue::encode(result);
}


EncodedJSValue jsXMLHttpRequestProgressEventConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSXMLHttpRequestProgressEvent* domObject = jsDynamicCast<JSXMLHttpRequestProgressEvent*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSXMLHttpRequestProgressEvent::getConstructor(exec->vm(), domObject->globalObject()));
}

JSValue JSXMLHttpRequestProgressEvent::getConstructor(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSXMLHttpRequestProgressEventConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
}


}
